摘录于:oracle dg 最大可用,Oracle DG 最大保护模式的实现_赵龙峰的博客-CSDN博客
八、切换standby的保护模式
切换保护模式的操作必须在primay执行,且primay必须处于mount状态
如果在open状态执行,则报错:
ORA-01126: database must be mounted EXCLUSIVE and not open for this operation
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database set standby database to maximize protection;
Database altered.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
注意,这时需要先修改日志传送方式为lgwr同步方式,否则,数据库是无法open,可以在初始化参数文件中定义。
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 134814580 bytes
Fixed Size 453492 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 143360 bytes
Database mounted.
SQL> alter system set log_archive_dest_2='service=standby lgwr sync affirm';
System altered.
SQL> alter database open;
Database altered.
再来看看当前保护模式
SQL> select DATABASE_ROLE,PROTECTION_MODE,PROTECTION_LEVEL from
v$database;
DATABASE_ROLE PROTECTION_MODE PROTECTION_LEVEL
---------------- -------------------- --------------------
PHYSICAL standby maximize protection maximize protection