案例3:将数据库打开到只读模式

1.直接打开数据库到只读模式

SQL> startup open read only;
ORACLE instance started.

Total System Global Area  608174080 bytes
Fixed Size            1268920 bytes
Variable Size          230687560 bytes
Database Buffers      373293056 bytes
Redo Buffers            2924544 bytes
Database mounted.
Database opened.

查询当前数据库的读写模式
SQL> select open_mode from v$database;

OPEN_MODE
----------
READ ONLY

2.在mount状态下怎样将数据库打开到只读模式

SQL> alter database open read only;

Database altered.

SQL> select open_mode from v$database;

OPEN_MODE
----------
READ ONLY

3.正常状态下数据库的读写模式为
SQL> select open_mode from v$database;

OPEN_MODE
----------
READ WRITE