Oracle 11gR2默认valid_for引起ora-16009

alter日志路径:/u01/app/oracle/diag/rdbms/orcl1234_dg/orcl1234/trace/


配置完成dataguard后通过命令在主库和备库上查询:

SQL> select max(sequence#) from v$archived_log;

是一致没有错误的

通过命令

SQL> select dest_name,error,status,process from v$archive_dest where rownum<3;

在主库查询也是没有错误的

但是在备库查询:

SQL> select dest_name,error,status,process from v$archive_dest where rownum<3;

DEST_NAME
--------------------------------------------------------------------------------
ERROR
-----------------------------------------------------------------
STATUS           PROCESS
------------------ --------------------
LOG_ARCHIVE_DEST_1

VALID           ARCH

LOG_ARCHIVE_DEST_2
ORA-16009: invalid redo transport destination
ERROR           LGWR

DEST_NAME
--------------------------------------------------------------------------------
ERROR
-----------------------------------------------------------------
STATUS           PROCESS
------------------ --------------------
可以看出出现错误。


通过查看alter日志出现:

Errors in file /u01/app/oracle/diag/rdbms/orcl1234_dg/orcl1234/trace/orcl1234_arc1_3065.trc:
ORA-16009: invalid redo transport destination
PING[ARC1]: Heartbeat failed to connect to standby 'orcl1234_pre'. Error is 1600

通过查询是因为我的log_archive_dest_2参数设置默认参数引起的,我设置值为:

*.LOG_ARCHIVE_DEST_2='service=orcl1234_dg DB_UNIQUE_NAME=orcl1234_dg'

需要这里说明的是11g这个ora-16009 invalid redo transport destination并没有影响dg体系结构的运行,而这个错误也是反映在备库的v$archive_dest下,这个因为log_archive_dest_2参数不规范引起的,默认不设置valid_for属性oracle认为是 :

LGWR VALID_FOR=(ALL_LOGFILES, ALL_ROLES)。

修改参数将其补全,在主库上执行:

SQL> alter system set log_archive_dest_2='service=orcl1234_dg arch valid_for=(online_logfiles,primary_role) db_unique_name=orcl1234_dg';

System altered.

备库上执行:

SQL> alter system set log_archive_dest_2='service=orcl1234_pre arch valid_for=(online_logfiles,primary_role) db_unique_name=orcl1234_pre';

最后再在备库上通过命令查看
SQL> select dest_name,error,status,process from v$archive_dest where rownum<3;

DEST_NAME
--------------------------------------------------------------------------------
ERROR
-----------------------------------------------------------------
STATUS           PROCESS
------------------ --------------------
LOG_ARCHIVE_DEST_1

VALID           ARCH

LOG_ARCHIVE_DEST_2

VALID           ARCH

DEST_NAME
--------------------------------------------------------------------------------
ERROR
-----------------------------------------------------------------
STATUS           PROCESS
------------------ --------------------
恢复正常。alter日志也正常。


参考:http://www.dbaxiaoyu.com/archives/812

你可能感兴趣的:(Oracle)