Oracle数据库的状态查询

Posted 规格严格-功夫到家-哈工大威海人

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle数据库的状态查询相关的知识,希望对你有一定的参考价值。

 

1 状态查询

启动状态

SQL语句

结果

nomount

select status from v$instance;

STARTED

select open_mode from v$database;

ERROR at line 1:

ORA-01507: database not mounted

mount

select status from v$instance;

MOUNTED

select open_mode from v$database;

MOUNTED

open

select status from v$instance;

OPEN

select open_mode from v$database;

READ WRITE 或者 READ ONLY

2 实验过程

SQL> startup nomount;

ORACLE instance started.

 

Total System Global Area  125829120 bytes

Fixed Size                  1247684 bytes

Variable Size              92276284 bytes

Database Buffers           25165824 bytes

Redo Buffers                7139328 bytes

 

SQL> select status from v$instance;

 

STATUS

------------

STARTED

 

SQL> select open_mode from v$database;

select open_mode from v$database

*

ERROR at line 1:

ORA-01507: database not mounted

 

SQL> alter database mount;

 

Database altered.

 

SQL> select status from v$instance;

 

STATUS

------------

MOUNTED

 

SQL> select open_mode from v$database;

 

OPEN_MODE

----------

MOUNTED

 

SQL> alter database open;

 

Database altered.

 

SQL> select status from v$instance;

 

STATUS

------------

OPEN

 

SQL> select open_mode from v$database;

 

OPEN_MODE

----------

READ WRITE

以上是关于Oracle数据库的状态查询的主要内容,如果未能解决你的问题,请参考以下文章

Oracle数据库的状态查询

Oracle数据库的状态查询

如何在windows 和linux 下 对oracle数据库各参数的查询?

Oracle 8i 从具有相同 ID 但不同状态的多行数据集中选择查询

Oracle数据库几种启动方式及查询当前状态

如何查询oracle某个时间的连接数