模拟物理standby产生gap

长平狐 发布于 2013/09/17 15:10
阅读 98
收藏 0

1.停掉备库dg2的网络

2.在主库进行切换日志的操作

SYS@dg1>select protection_mode,database_role,protection_level from v$database;
PROTECTION_MODE      DATABASE_ROLE    PROTECTION_LEVEL
-------------------- ---------------- --------------------
MAXIMUM PERFORMANCE  PRIMARY          MAXIMUM PERFORMANCE
SYS@dg1>alter system switch logfile;
System altered.
SYS@dg1>alter system switch logfile;
System altered.
SYS@dg1>col name for a40
SYS@dg1>select * from (select name,recid from v$archived_log  order by recid desc) where rownum<5;
NAME                                          RECID
---------------------------------------- ----------
dg2                                             285
/u01/archivelog/arc_1_147_821829622.arc         284
/u01/archivelog/arc_1_146_821829622.arc         283
/u01/archivelog/arc_1_145_821829622.arc         282

3.去操作系统中把刚才切换日志产生的归档文件移动(这里是改了个名)

[oracle@dg1 ~]$ cd /u01/archivelog/
[oracle@dg1 archivelog]$ mv arc_1_146_821829622.arc arc_1_146_821829622.arcbak

4.恢复备库dg2的网络并查看主备库的日志,出现了GAP

此时主库dg1的日志:
FAL[server, ARC0]: Error 12543 creating remote archivelog file 'dg2'
FAL[server, ARC0]: FAL archive failed, see trace file.
Errors in file /u01/diag/rdbms/dg1/dg/trace/dg_arc0_14838.trc:
ORA-16055: FAL request rejected
ARCH: FAL archive failed. Archiver continuing
ORACLE Instance dg - Archival Error. Archiver continuing.
FAL[server, ARC3]: Error 12543 creating remote archivelog file 'dg2'
FAL[server, ARC3]: FAL archive failed, see trace file.
Errors in file /u01/diag/rdbms/dg1/dg/trace/dg_arc3_14850.trc:
ORA-16055: FAL request rejected
ARCH: FAL archive failed
. Archiver continuing
ORACLE Instance dg - Archival Error. Archiver continuing.
此时备库dg2的日志:
[oracle@dg2 ~]$ cat alert_dg.log
Mon Aug 05 11:34:20 2013
RFS[2]: Assigned to RFS process 7930
RFS[2]: Identified database type as 'physical standby': Client is ARCH pid 14846
Mon Aug 05 11:34:20 2013
RFS[3]: Assigned to RFS process 7934
RFS[3]: Identified database type as 'physical standby': Client is ARCH pid 14850
RFS[3]: Opened log for thread 1 sequence 147 dbid 1735160627 branch 821829622
Archived Log entry 153 added for thread 1 sequence 147 rlc 821829622 ID 0x6776473b dest 2:
Mon Aug 05 11:34:23 2013
Fetching gap sequence in thread 1, gap sequence 146-146
Mon Aug 05 11:34:34 2013
FAL[client]: Failed to request gap sequence
GAP - thread 1 sequence 146-146
DBID 1735160627 branch 821829622
FAL[client]: All defined FAL servers have been attempted.

-------------------------------------------------------------
Check that the CONTROL_FILE_RECORD_KEEP_TIME initialization
parameter is defined to a value that is sufficiently large
enough to maintain adequate log switch information to resolve
archivelog gaps.
-------------------------------------------------------------

5.此时在主库上把归档名字改回去。系统自动修复GAP。

[oracle@dg1 ~]$ cat alert_dg.log
[oracle@dg1 ~]$ cd /u01/archivelog/
[oracle@dg1 archivelog]$ mv arc_1_146_821829622.arcbak arc_1_146_821829622.arc
[oracle@dg1 archivelog]$ cd
稍等片刻:
[oracle@dg1 ~]$ sqlplus / as sysdba
SYS@dg1>select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
--------------
           147
[oracle@dg2 ~]$ cat alert_dg.log
Mon Aug 05 11:43:21 2013
RFS[3]: Opened log for thread 1 sequence 146 dbid 1735160627 branch 821829622
Archived Log entry 154 added for thread 1 sequence 146 rlc 821829622 ID 0x6776473b dest 2:
Mon Aug 05 11:43:25 2013
Media Recovery Log /u01/archivelog/arc_1_146_821829622.arc
Media Recovery Log /u01/archivelog/arc_1_147_821829622.arc
Media Recovery Waiting for thread 1 sequence 148


oracle@dg2 ~]$ sqlplus / as sysdba
SYS@dg2>select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
--------------
           147
原文链接:http://blog.csdn.net/q947817003/article/details/11525887
加载中
返回顶部
顶部