oracle

关注公众号 jb51net

关闭
首页 > 数据库 > oracle > Oracle 数据库启动

Oracle 数据库启动过程的三阶段、停库四种模式详解

作者:梦想家DBA

这篇文章主要介绍了Oracle 数据库启动三阶段、停库四种模式,停库模式主要有正常停库、事务级停库、立即停库和强制停库,本文给大家介绍的非常详细需要的朋友可以参考下

数据库的启动过程(3个台阶)

1.nomount

shutdown --> nomount

startup nomount

select status from v$instance;
SQL> 
SQL> conn / as sysdba
Connected to an idle instance.
SQL> 
SQL> startup nomount
ORACLE instance started.
 
Total System Global Area  629145392 bytes
Fixed Size                  9137968 bytes
Variable Size             197132288 bytes
Database Buffers          415236096 bytes
Redo Buffers                7639040 bytes
SQL> 
SQL> 
SQL> 
SQL> 
SQL> select status from v$instance;
 
STATUS
------------
STARTED
 
SQL> 

数据库启动到nomount做了什么?

数据库启动到nomount需要什么?

nomount状态可以做什么?

SQL> 
SQL> select * from v$sgainfo;
 
NAME                                  BYTES RES     CON_ID
-------------------------------- ---------- --- ----------
Fixed SGA Size                      9137968 No           0
Redo Buffers                        7639040 No           0
Buffer Cache Size                 411041792 Yes          0
In-Memory Area Size                       0 No           0
Shared Pool Size                  197132288 Yes          0
Large Pool Size                     4194304 Yes          0
Java Pool Size                            0 Yes          0
Streams Pool Size                         0 Yes          0
Shared IO Pool Size                       0 Yes          0
Data Transfer Cache Size                  0 Yes          0
Granule Size                        4194304 No           0
 
NAME                                  BYTES RES     CON_ID
-------------------------------- ---------- --- ----------
Maximum SGA Size                  629145392 No           0
Startup overhead in Shared Pool   193465328 No           0
Free SGA Memory Available                 0              0
 
14 rows selected.
 
SQL> select name from v$bgprocess where paddr<>'00';
 
NAME
-----
PMON
CLMN
PSP0
VKTM
GEN0
MMAN
M000
GEN1
SCMN
DIAG
OFSD
 
NAME
-----
SCMN
DBRM
VKRM
SVCB
PMAN
DIA0
DBW0
LGWR
CKPT
LG00
SMON
 
NAME
-----
LG01
SMCO
RECO
W000
LREG
W001
PXMN
FENC
D000
MMON
MMNL
 
NAME
-----
S000
TMON
 
35 rows selected.
 
SQL> 

2.mount

shutdown --> mount

nomount --> mount

SQL> 
SQL> select status from v$instance;
 
STATUS
------------
STARTED
 
SQL> alter database mount;
 
Database altered.
 
SQL> select status from v$instance;
 
STATUS
------------
MOUNTED
 
SQL> 

数据库启动到mount做了什么?

数据库启动到mount状态需要做什么?

mount状态可以做什么?

SQL> 
SQL> select name from v$datafile;
 
NAME
--------------------------------------------------------------------------------
/u02/oradata/CDB1/system01.dbf
/u02/oradata/CDB1/sysaux01.dbf
/u02/oradata/CDB1/undotbs01.dbf
/u02/oradata/CDB1/pdbseed/system01.dbf
/u02/oradata/CDB1/pdbseed/sysaux01.dbf
/u02/oradata/CDB1/users01.dbf
/u02/oradata/CDB1/pdbseed/undotbs01.dbf
/u02/oradata/CDB1/pdb1/system01.dbf
/u02/oradata/CDB1/pdb1/sysaux01.dbf
/u02/oradata/CDB1/pdb1/undotbs01.dbf
/u02/oradata/CDB1/pdb1/users01.dbf
 
11 rows selected.
 
SQL> select name from v$tempfile;
 
NAME
--------------------------------------------------------------------------------
/u02/oradata/CDB1/temp01.dbf
/u02/oradata/CDB1/pdbseed/temp012022-11-02_15-16-24-663-PM.dbf
/u02/oradata/CDB1/pdb1/temp01.dbf
 
SQL> 
SQL> select member from v$logfile;
 
MEMBER
--------------------------------------------------------------------------------
/u02/oradata/CDB1/redo03.log
/u02/oradata/CDB1/redo02.log
/u02/oradata/CDB1/redo01.log
 
SQL>

3.open

shutdown --> open

nomount ---->  open

只读方式去打开数据库

SQL> 
SQL> startup mount
ORACLE instance started.
 
Total System Global Area  629145392 bytes
Fixed Size                  9137968 bytes
Variable Size             197132288 bytes
Database Buffers          415236096 bytes
Redo Buffers                7639040 bytes
Database mounted.
SQL> 
SQL> 
SQL> select status from v$instance;
 
STATUS
------------
MOUNTED
 
SQL> 
SQL> alter database open read only;
 
Database altered.
 
SQL> 
SQL> select status from v$instance;
 
STATUS
------------
OPEN
 
SQL> 
SQL> 
SQL> 
SQL> select open_mode from v$database;
 
OPEN_MODE
--------------------
READ ONLY
 
SQL> 
SQL> 
SQL> startup
ORACLE instance started.
 
Total System Global Area  629145392 bytes
Fixed Size                  9137968 bytes
Variable Size             197132288 bytes
Database Buffers          415236096 bytes
Redo Buffers                7639040 bytes
Database mounted.
Database opened.
SQL>

数据库启动到open做了什么?

数据库启动到open需要什么?

open状态可以做什么?

数据库的停止(四种模式)

1.正常停库: shutdown normal = shutdown

2.事务级停库: shutdown transactional

3.立即停库 : shutdown immediate (生产库最常用的停库方式)

4.强制停库 : shutdown abort

相当于拔电源

(停止之后的数据库是脏库)
注意:这些命令需要慎用

startup force = shutdown abort + startup
startup force nomount = shutdown abort + startup nomount
startup force mount = shutdown abort + startup mount

到此这篇关于Oracle 数据库启动三阶段、停库四种模式的文章就介绍到这了,更多相关Oracle 数据库启动内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

您可能感兴趣的文章:
阅读全文