Oracle数据库的状态查询
Posted ✧*꧁一品堂.技术学习笔记꧂*✧.
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle数据库的状态查询相关的知识,希望对你有一定的参考价值。
本文来源:huang_xw 的《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 实验过程
1 SQL> startup nomount; 2 ORACLE instance started. 3 4 Total System Global Area 125829120 bytes 5 Fixed Size 1247684 bytes 6 Variable Size 92276284 bytes 7 Database Buffers 25165824 bytes 8 Redo Buffers 7139328 bytes 9 10 SQL> select status from v$instance; 11 12 STATUS 13 ------------ 14 STARTED 15 16 SQL> select open_mode from v$database; 17 select open_mode from v$database 18 * 19 ERROR at line 1: 20 ORA-01507: database not mounted 21 22 SQL> alter database mount; 23 24 Database altered. 25 26 SQL> select status from v$instance; 27 28 STATUS 29 ------------ 30 MOUNTED 31 32 SQL> select open_mode from v$database; 33 34 OPEN_MODE 35 ---------- 36 MOUNTED 37 38 SQL> alter database open; 39 40 Database altered. 41 42 SQL> select status from v$instance; 43 44 STATUS 45 ------------ 46 OPEN 47 48 SQL> select open_mode from v$database; 49 50 OPEN_MODE 51 ---------- 52 READ WRITE
以上是关于Oracle数据库的状态查询的主要内容,如果未能解决你的问题,请参考以下文章