部署 11G 物理DataGuard时 ALTER DATABASE OPEN 报错

采用的配置方法 是通过DUPLICATE命令实时从主库同步到备库。

duplicate target database for standby nofilenamecheck from active database;

当主库传输完所有数据文件到备库上后,想将备库启动到OPEN状态报错

SQL> ALTER DATABASE OPEN;
ALTER DATABASE OPEN
*
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:
'/ORADATA/data/GTFDBDG/datafile/o1_mf_system_8oqlcnin_.dbf

备库启动日志应用

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;


检查归档日志的同步情况,发现一条归档都没有传输到备库

SELECT SEQUENCE#,THREAD#,APPLIED FROM GV$ARCHIVED_LOG ORDER BY SEQUENCE#;

no rows selected

可以判断是主库无法同步归档日志到备库

主库是两节点的 RAC ,查看主库两节点的 alert 日志,没有明显的报错信息

检查主库的配置参数,没有错误。重新配置主库下面参数后, alert 日志报错

ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH;
Wed Nov 04 05:37:34 2015
PING[ARC2]: Heartbeat failed to connect to standby 'gtfdbdg'. Error is 16057. 
Wed Nov 04 05:37:36 2015
Thread 1 advanced to log sequence 13837 (LGWR switch)
  Current log# 1 seq# 13837 mem# 0: +REDO1/gtfdb/onlinelog/group_1.256.833906321
  Current log# 1 seq# 13837 mem# 1: +REDO2/gtfdb/onlinelog/group_1.256.833906323
Wed Nov 04 05:37:36 2015
ARC3: Archivelog destination LOG_ARCHIVE_DEST_2 disabled: destination Data Guard configuration error

检查备库的 LOG_ARCHIVE_CONFIG 参数,发现配置有错

SQL> show parameter log_archive_config


NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_config     string DG_CONFIG=( gftdb,gtfdbdg)

更改备库的 LOG_ARCHIVE_CONFIG 参数

SQL> alter system set log_archive_config='DG_CONFIG=( gtfdb,gtfdbdg)' scope=both sid='*';

备库启动日志应用

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;


检查归档日志的同步情况,等待主库传输过来的归档日志全部被备库应用之后,再次将备库置为 OPEN READ 状态

SELECT SEQUENCE#,THREAD#,APPLIED FROM GV$ARCHIVED_LOG ORDER BY SEQUENCE#;

 SEQUENCE#    THREAD# APPLIED
---------- ---------- ---------
      5019    2 YES
      5020    2 YES
      5021    2 YES
      5022    2 YES
      5023    2 YES
      5024    2 YES
      5025    2 YES
      5026    2 YES
      5027    2 YES
      5028    2 YES
      5029    2 YES


 SEQUENCE#    THREAD# APPLIED
---------- ---------- ---------
      5030    2 YES
      5031    2 YES
      5032    2 YES
      5033    2 YES
      5034    2 IN-MEMORY

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
 
ALTER DATABASE OPEN;

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

备库状态正常,实现日志实时应用

SQL> select database_role,switchover_status,open_mode from v$database;

DATABASE_ROLE SWITCHOVER_STATUS    OPEN_MODE
---------------- -------------------- --------------------
PHYSICAL STANDBY NOT ALLOWED      READ ONLY WITH APPLY


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26506993/viewspace-1822519/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26506993/viewspace-1822519/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值