在只读模式下,数据文件及联机日志文件都禁止写操作。不过允许执行数据库恢复及其他不会产生回滚的操作。
数据库关闭的情况下
[oracle@prod1 ~]$ sqlplus / as sysdbasql*plus: release 11.2.0.1.0 production on sun feb 22 19:07:12 2015copyright (c) 1982, 2009, oracle. all rights reserved.connected to an idle instance.idle> startup open read only;oracle instance started.total system global area 891383808 bytesfixed size 1340104 bytesvariable size 658509112 bytesdatabase buffers 226492416 bytesredo buffers 5042176 bytesdatabase mounted.database opened.idle> select open_mode from v$database;open_mode--------------------read only
mount状态下
idle> alter database open read only;database altered.
重新恢复到读写状态
idle> shutdown immediate;database closed.database dismounted.oracle instance shut down.idle> startup mount;oracle instance started.total system global area 891383808 bytesfixed size 1340104 bytesvariable size 658509112 bytesdatabase buffers 226492416 bytesredo buffers 5042176 bytesdatabase mounted.idle> alter database open read write;database altered.
在只读模式下,数据文件及联机日志文件都禁止写操作。不过允许执行数据库恢复及其他不会产生回滚的操作。
数据库关闭的情况下
[oracle@prod1 ~]$ sqlplus / as sysdbasql*plus: release 11.2.0.1.0 production on sun feb 22 19:07:12 2015copyright (c) 1982, 2009, oracle. all rights reserved.connected to an idle instance.idle> startup open read only;oracle instance started.total system global area 891383808 bytesfixed size 1340104 bytesvariable size 658509112 bytesdatabase buffers 226492416 bytesredo buffers 5042176 bytesdatabase mounted.database opened.idle> select open_mode from v$database;open_mode--------------------read only
mount状态下
idle> alter database open read only;database altered.
重新恢复到读写状态
idle> shutdown immediate;database closed.database dismounted.oracle instance shut down.idle> startup mount;oracle instance started.total system global area 891383808 bytesfixed size 1340104 bytesvariable size 658509112 bytesdatabase buffers 226492416 bytesredo buffers 5042176 bytesdatabase mounted.idle> alter database open read write;database altered.