数据库各个阶段的INSTANCE DATABASE状态
A.数据库为nomount状态select status from v$instance;
STATUS
------------
STARTED 实例状态代表只启动了实例
SYS@PROD> select open_mode from v$database;
select open_mode from v$database
*
ERROR at line 1:
ORA-01507: database not mounted 这时数据库还没有加载至内存中,所以看不到状态信息
B.数据库为mount状态
SYS@PROD> select status from v$instance;
STATUS
------------
MOUNTED 实例状态代表数据库MOUNT
SYS@PROD> select open_mode from v$database;
OPEN_MODE
----------
MOUNTED 这时数据库已经加载到内存中
C.数据库为open状态
SYS@PROD> select status from v$instance;
STATUS
------------
OPEN 实例状态代表数据库OPEN
SYS@PROD> select open_mode from v$database;
OPEN_MODE
----------
READ WRITE 这时数据库为可读写状态
D.数据库为close状态,即alter database close 只关闭数据库(文件集合)但没有关闭实例
SYS@PROD> select status from v$instance;
STATUS
------------
MOUNTED 实例也在内存中加载->MOUNTED
SYS@PROD> select open_mode from v$database;
OPEN_MODE
----------
MOUNTED 数据库还在内存中加载->MOUNTED
E. 数据库再OPEN 此时数据库就不能启动了,因为一个实例生命周期里只能开启一次数据库
SYS@PROD> alter database open;
alter database open
*
ERROR at line 1:
ORA-16196: database has been previously opened and closed 数据库先前被开启和关闭过
2012.03.16
leonarding
tianjin
作者 leonarding