设为首页 加入收藏

TOP

使用RMAN增量备份处理Dataguard因归档丢失造成的gap(一)
2018-04-08 08:51:33 】 浏览:135
Tags:使用 RMAN 增量 备份 处理 Dataguard 归档 丢失 造成 gap

场景:


备库执行日志应用出现如下报错:


Thu Mar 29 11:21:45 2018
FAL[client]: Failed to request gap sequence
 GAP - thread 1 sequence 184-185
 DBID 1484954774 branch 960494131
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's sufficiently large
enough to maintain adequate log switch information to resolve
archivelog gaps.


查询缺失的归档日志:


SQL> select * from v$archive_gap;


THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#
---------- ------------- --------------
  1              183          185


去主库查看归档,发现归档已丢失


SQL> archive log list;


Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/archivelog
Oldest online log sequence 186
Next log sequence to archive 188
Current log sequence 188


下面开始使用RMAN进行基于SCN增量备份恢复的方式进行恢复,参考文档 ID 836986.1


1.取消备库日志应用


SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE cancel;


2.在备库上确定需要开始增量备份的SCN


SQL> SELECT CURRENT_SCN FROM V$DATABASE;


CURRENT_SCN
-----------
 3505254


SQL> select min(checkpoint_change#) from v$datafile_header
 where file# not in (select file# from v$datafile where enabled = 'READ ONLY');


MIN(CHECKPOINT_CHANGE#)
-----------------------


(如果结果为空,重启备库到mount状态)
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.


Total System Global Area 1002127360 bytes
Fixed Size 2259440 bytes
Variable Size 285214224 bytes
Database Buffers 708837376 bytes
Redo Buffers 5816320 bytes
Database mounted.
SQL> select min(checkpoint_change#) from v$datafile_header
where file# not in (select file# from v$datafile where enabled = 'READ ONLY');


MIN(CHECKPOINT_CHANGE#)
-----------------------
 3505255


选择以上结果中最小SCN作为增量备份的起点(此处是350524)。


3.在主库上进行基于SCN的增量备份


RMAN> BACKUP INCREMENTAL FROM SCN 3505254 DATABASE FORMAT '/tmp/ForStandby_%U' tag 'FORSTANDBY';


4.拷贝刚才的备份到备库


scp /tmp/ForStandby_* 192.168.211.162:/tmp


5.将拷贝过来的备份注册到备库的控制文件中


[oracle@stand ~]$ rman target /


Recovery Manager: Release 11.2.0.4.0 - Production on Thu Mar 29 11:37:52 2018


Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.


connected to target database: ORCL (DBID=1484954774, not open)


RMAN> CATALOG START WITH '/tmp/ForStandby';


using target database control file instead of recovery catalog
searching for all files that match the pattern /tmp/ForStandby


List of Files Unknown to the Database
=====================================
File Name: /tmp/ForStandby_08sv0bdj_1_1
File Name: /tmp/ForStandby_07sv0bcg_1_1


Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done


List of Cataloged Files
=======================
File Name: /tmp/ForStandby_08sv0bdj_1_1
File Name: /tmp/ForStandby_07sv0bcg_1_1


6.使用增量备份恢复备库


RMAN> RECOVER DATABASE NOREDO;


Starting recover at 29-MAR-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=16 device type=DISK
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: /u01/app/oracle/oradata/rzorcl/system01.dbf
destination for restore of datafile 00002: /u01/app/oracle/oradata/rzorc

首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Oracle 11gR2 RAC 11.2.0.4 全自.. 下一篇CentOS 7.4下MySQL+Amoeba实现主..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目