oracle只读打开数据库

客户经常有这样的需求,数据库已迁移,但还是希望原库可以打开,就只能只读模式打开了

方法一

SYS@orcl> STARTUP OPEN READ ONLY;
ORACLE instance started.

Total System Global Area 4.0086E+10 bytes
Fixed Size                  2254976 bytes
Variable Size            1.5301E+10 bytes
Database Buffers         2.4696E+10 bytes
Redo Buffers               86413312 bytes
Database mounted.
Database opened.
SYS@orcl> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
ORCL     READ ONLY

SYS@orcl>

方法二、

SYS@orcl> startup mount;
ORACLE instance started.

Total System Global Area 4.0086E+10 bytes
Fixed Size                  2254976 bytes
Variable Size            6442452864 bytes
Database Buffers         3.3554E+10 bytes
Redo Buffers               86413312 bytes
Database mounted.
SYS@orcl> alter database open read only;

Database altered.

SYS@orcl> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
ORCL     READ ONLY


1、只读模式下不可以锁定用户
2、集群环境下,只要有个实例处在只读模式,另外一个实例无法锁定用户
3、集群环境下,某个实例处在restrict模式下,另外一个实例无法进入到只读模式
4、只读模式下,无法执行expdp导出操作

SYS@orcl2> STARTUP OPEN READ ONLY;
ORACLE instance started.

Total System Global Area 4.0086E+10 bytes
Fixed Size                  2254976 bytes
Variable Size            6845106048 bytes
Database Buffers         3.3152E+10 bytes
Redo Buffers               86413312 bytes
Database mounted.
ORA-16002: database already open for read/write access by another instance

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
ORA-31626: job does not exist
ORA-31633: unable to create master table "SYS.SYS_EXPORT_SCHEMA_05"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPV$FT", line 1038
ORA-16000: database open for read-only access

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值