Oracle 11.2.0.3.0 Active Data Guard 遇 ORA-10458、ORA-01152、ORA-01110 错误

今天第一次配 Oracle 11g R2 Active Data Guard,在用 RMAN 创建好 physical standby database 后,
尝试将 standby 以 read only 方式打开时遇如下错误:

SQL> alter database open read only;
alter database open read only
*
ERROR at line 1:
ORA-10458: standby database requires recovery
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1:
‘/u01/app/oracle/oradata/STANDBY/datafile/o1_mf_system_8v8y9m2x_.dbf’

metalink 文章[ID 1312376.1]上描述是 primary database 的 compatible 参数设置错误

Primary:
SQL> col host_name for a20
SQL> select instance_name,host_name,version,archiver,log_switch_wait from v$instance;

INSTANCE_NAME    HOST_NAME            VERSION           ARCHIVE LOG_SWITCH_WAIT
—————- ——————– —————– ——- —————
prod             prod.oracle.com      11.2.0.3.0        STARTED

Standby:
SQL> select instance_name,host_name,version,archiver,log_switch_wait from v$instance;

INSTANCE_NAME    HOST_NAME            VERSION           ARCHIVE LOG_SWITCH_WAIT
—————- ——————– —————– ——- —————
standby          standby.oracle.com   11.2.0.3.0        STARTED

Primary:
SQL> show parameter compatible
NAME                                 TYPE        VALUE
———————————— ———– ——————————
compatible                           string      11.2.0.0.0

Standby:
SQL> show parameter compatible
NAME                                 TYPE        VALUE
———————————— ———– ——————————
compatible                           string      11.2.0.0.0

将 Primary 和 Standby 的 compatible 参数全部修改为 11.2.0.2.0 后重启便可将 standby 以 read only 方式打开
primary:
SQL> alter system set compatible=’11.2.0.2.0′ scope=spfile;
SQL> shutdown immediate;
SQL> startup;

standby:
SQL> startup open read only;
SQL> select OPEN_MODE from v$database;
OPEN_MODE
——————–

READ ONLY

标签