采用RMAN 备份恢复搭建Oracle 11g的Data Guard,恢复结束之后,DG 同步一直异常,主库提示如下信息:
SQL> select DEST_NAME,STATUS,PROCESS,ERROR,TRANSMIT_MODE from v$archive_dest WHERE TARGET='STANDBY';
DEST_NAME
--------------------------------------------------------------------------------
STATUS PROCESS
--------- ----------
ERROR TRANSMIT_MOD
----------------------------------------------------------------- ------------
LOG_ARCHIVE_DEST_2
ERROR LGWR
ORA-16058: standby database instance is not mounted PARALLELSYNC
备库在open 时又提示GAP:
Sun Dec 20 10:40:42 2020
Standby crash recovery need archive log for thread 1 sequence 4 to continue.
Please verify that primary database is transporting redo logs to the standby database.
Wait timeout: thread 1 sequence 4
Standby crash recovery aborted due to error 16016.
Errors in file /u01/app/oracle/diag/rdbms/cd/cd/trace/cd_ora_26198.trc:
ORA-16016: archived log for thread 1 sequence# 4 unavailable
Recovery interrupted!
Completed standby crash recovery.
Errors in file /u01/app/oracle/diag/rdbms/cd/cd/trace/cd_ora_26198.trc:
ORA-10458: standby database requires recovery
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/u01/app/oracle/oradata/CD_PD/datafile/o1_mf_system_hxs5rcpc_.dbf'
ORA-10458 signalled during: alter database open...
Sun Dec 20 10:44:01 2020
alter database open
Beginning standby crash recovery.
Serial Media Recovery started
Managed Standby Recovery starting Real Time Apply
Media Recovery Waiting for thread 1 sequence 4
Fetching gap sequence in thread 1, gap sequence 4-4
Sun Dec 20 10:45:03 2020
Standby crash recovery need archive log for thread 1 sequence 4 to continue.
Please verify that primary database is transporting redo logs to the standby database.
Wait timeout: thread 1 sequence 4
Standby crash recovery aborted due to error 16016.
Errors in file /u01/app/oracle/diag/rdbms/cd/cd/trace/cd_ora_26198.trc:
ORA-16016: archived log for thread 1 sequence# 4 unavailable
Recovery interrupted!
Completed standby crash recovery.
Errors in file /u01/app/oracle/diag/rdbms/cd/cd/trace/cd_ora_26198.trc:
ORA-10458: standby database requires recovery
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/u01/app/oracle/oradata/CD_PD/datafile/o1_mf_system_hxs5rcpc_.dbf'
ORA-10458 signalled during: alter database open...
Sun Dec 20 10:45:43 2020
alter database open
实际上测试备库已经是mount的状态,应该是指备库信息的不一致导致的,所有先关闭备库,重新通过sqlplus 直接启动到mount 状态:
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 5344731136 bytes
Fixed Size 2237776 bytes
Variable Size 1895828144 bytes
Database Buffers 3388997632 bytes
Redo Buffers 57667584 bytes
Database mounted.
SQL> a
将缺失的归档scp 传到备库并注册:
[oracle@cd2 archivelog]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Sun Dec 20 11:05:08 2020
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: CD (DBID=1880941554, not open)
RMAN> catalog start with '/u01/archivelog';
using target database control file instead of recovery catalog
searching for all files that match the pattern /u01/archivelog
List of Files Unknown to the Database
=====================================
File Name: /u01/archivelog/1_6_1059608430.arc
File Name: /u01/archivelog/1_8_1059608430.arc
File Name: /u01/archivelog/1_10_1059608430.arc
File Name: /u01/archivelog/1_7_1059608430.arc
File Name: /u01/archivelog/1_9_1059608430.arc
File Name: /u01/archivelog/1_5_1059608430.arc
Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/archivelog/1_6_1059608430.arc
File Name: /u01/archivelog/1_8_1059608430.arc
File Name: /u01/archivelog/1_10_1059608430.arc
File Name: /u01/archivelog/1_7_1059608430.arc
File Name: /u01/archivelog/1_9_1059608430.arc
File Name: /u01/archivelog/1_5_1059608430.arc
RMAN>
备库启动MRP,同步正常:
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> select sequence#,applied from v$archived_log ;
SEQUENCE# APPLIED
---------- ---------
4 YES
12 YES
11 YES
6 YES
8 YES
10 YES
7 YES
9 YES
5 YES
13 IN-MEMORY
14 NO
11 rows selected.
SQL> select sequence#,applied from v$archived_log order by 1;
SEQUENCE# APPLIED
---------- ---------
4 YES
5 YES
6 YES
7 YES
8 YES
9 YES
10 YES
11 YES
12 YES
13 YES
14 YES
11 rows selected.
同步正常。
版权声明:本文为博主原创文章,未经博主允许不得转载。