故障现象:
data guard归档出现gap,悲剧的是丢失的归档在主库上被rman备份时删除了,丢失的归档大约有20几个,数据库大小约2T,如果重建DG将非常耗时间,因此决定利用增量备份的方式恢复DG,主要步骤如下:
1.备份备库spfile文件
SQL> create pfile='/home/ora/pfileRdg.ora' from spfile;

2、查看当前备库scn
SQL> select to_char(current_scn) from v$database;

TO_CHAR(CURRENT_SCN)
----------------------------------------
19652214434
3、查看缺失的archivelog
SQL> select * from v$archive_gap;

THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#
---------- ------------- --------------
         1        160163         160170
         2        151303         151309
、在主库执增量备份

[ora@jzhRAC1 ~]$ rman target /

Recovery Manager: Release 10.2.0.4.0 - Production on Sat May 23 18:10:52 2015

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: JZH (DBID=2072634265)
RMAN> run
2> {
3> allocate channel d1 type disk;
4> allocate channel d2 type disk;
5> allocate channel d3 type disk;
6> backup as compressed backupset incremental from SCN 19652214434 database format '/home/ora/full_db_%d_%T_%s.bak' include current controlfile for standby

filesperset=5 tag 'FOR STANDBY';
7> release channel d1;
8> release channel d2;
9> release channel d3;
10> }
channel d1: backup set complete, elapsed time: 00:00:35
channel d1: starting compressed full datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00124 name=/oradata/JZH/TP_CTEST15.ORA
input datafile fno=00186 name=/oradata/JZH/TP_LEARNING01.ORA
input datafile fno=00187 name=/oradata/JZH/TP_LEARNING02.ORA
input datafile fno=00188 name=/oradata/JZH/TP_LEARNING03.ORA
input datafile fno=00191 name=/oradata/JZH/TP_LEARNING06.ORA
channel d1: starting piece 1 at 23-MAY-15
channel d3: finished piece 1 at 23-MAY-15
piece handle=/home/ora/full_db_JZH_20150523_232604.bak tag=FOR STANDBY comment=NONE
channel d3: backup set complete, elapsed time: 00:00:36
channel d3: starting compressed full datafile backupset
channel d3: specifying datafile(s) in backupset
input datafile fno=00192 name=/oradata/JZH/TP_LEARNING07.ORA
input datafile fno=00239 name=/oradata/JZH/TP_LEARNING08.ORA
input datafile fno=00250 name=/oradata/JZH/TP_LEARNING09.ORA
input datafile fno=00261 name=/oradata/JZH/TP_CTEST16.ORA
input datafile fno=00267 name=/oradata/JZH/TP_LEARNING10.ORA
channel d3: starting piece 1 at 23-MAY-15
channel d2: finished piece 1 at 23-MAY-15
piece handle=/home/ora/full_db_JZH_20150523_232602.bak tag=FOR STANDBY comment=NONE
channel d2: backup set complete, elapsed time: 00:01:08
channel d2: starting compressed full datafile backupset
channel d2: specifying datafile(s) in backupset
input datafile fno=00272 name=/oradata/JZH/TP_CTEST17.ORA
input datafile fno=00284 name=/oradata/JZH/TP_CTEST18.ORA
input datafile fno=00288 name=/oradata/JZH/TP_LEARNING11.ORA
input datafile fno=00296 name=/oradata/JZH/TP_CTEST19.ORA
input datafile fno=00313 name=/oradata/JZH/TP_LEARNING12.ORA
channel d2: starting piece 1 at 23-MAY-15
channel d1: finished piece 1 at 23-MAY-15
piece handle=/home/ora/full_db_JZH_20150523_232606.bak tag=FOR STANDBY comment=NONE
channel d1: backup set complete, elapsed time: 00:00:32
channel d1: starting compressed full datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00338 name=/oradata/JZH/TP_LEARNING15.ORA
input datafile fno=00342 name=/oradata/JZH/TP_CTEST22.ORA
channel d1: starting piece 1 at 23-MAY-15
channel d3: finished piece 1 at 23-MAY-15
piece handle=/home/ora/full_db_JZH_20150523_232607.bak tag=FOR STANDBY comment=NONE
channel d3: backup set complete, elapsed time: 00:00:32
channel d3: starting compressed full datafile backupset
channel d3: specifying datafile(s) in backupset
including standby control file in backupset
channel d3: starting piece 1 at 23-MAY-15
channel d1: finished piece 1 at 23-MAY-15
piece handle=/home/ora/full_db_JZH_20150523_232609.bak tag=FOR STANDBY comment=NONE
channel d1: backup set complete, elapsed time: 00:00:06
channel d1: starting compressed full datafile backupset
channel d1: specifying datafile(s) in backupset
including current SPFILE in backupset
channel d1: starting piece 1 at 23-MAY-15
channel d3: finished piece 1 at 23-MAY-15
piece handle=/home/ora/full_db_JZH_20150523_232610.bak tag=FOR STANDBY comment=NONE
channel d3: backup set complete, elapsed time: 00:00:08
channel d1: finished piece 1 at 23-MAY-15
piece handle=/home/ora/full_db_JZH_20150523_232611.bak tag=FOR STANDBY comment=NONE
channel d1: backup set complete, elapsed time: 00:00:02
channel d2: finished piece 1 at 23-MAY-15
piece handle=/home/ora/full_db_JZH_20150523_232608.bak tag=FOR STANDBY comment=NONE
channel d2: backup set complete, elapsed time: 00:00:32
Finished backup at 23-MAY-15

released channel: d1

released channel: d2

released channel: d3

5、将备份传至备库
scp full_db_JZH_20150523_*.bak 192.168.110.115:~/20150523_recover/ 
6、恢复备库
[ora@jzhDG ~]$ rman target /

Recovery Manager: Release 10.2.0.4.0 - Production on Sat May 23 20:17:59 2015

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: JZH (DBID=2072634265, not open)

RMAN> catalog start with '/home/ora/20150523_recover';

[ora@jzhDG ~]$ rman target /

Recovery Manager: Release 10.2.0.4.0 - Production on Sat May 23 20:25:44 2015

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: JZH (DBID=2072634265, not open)

RMAN> run
2> {
3> allocate channel d1 type disk;
4> allocate channel d2 type disk;
5> allocate channel d3 type disk;
6> restore standby controlfile to '/home/ora/control01.ctl';
7> recover database noredo;
8> release channel d1;
9> release channel d2;
10> release channel d3;
11> }
7、关闭备库,将恢复出来的control01.ctl覆盖备库控制文件
[ora@jzhDG ~]$ cp control01.ctl /oradata/JZH/standby.ctl
8、启动备库至mount状态
SQL> startup mount
ORACLE instance started.
Total System Global Area 1795162112 bytes
Fixed Size                  2084648 bytes
Variable Size             301990104 bytes
Database Buffers         1476395008 bytes
Redo Buffers               14692352 bytes
Database mounted.
9、查看gap
SQL> select * from v$archive_gap;
no rows selected
10、开启备库recover模式
SQL> recover managed standby database disconnect from session;
Media recovery complete.
11、查看日志,正在恢复
Sat May 23 21:17:53 2015
Media Recovery Log /oradata/standby_arch/1_161210_706979804.log
Sat May 23 21:18:15 2015
Media Recovery Log /oradata/standby_arch/1_161211_706979804.log
Media Recovery Log /oradata/standby_arch/2_152328_706979804.log
Sat May 23 21:19:14 2015
Media Recovery Log /oradata/standby_arch/1_161212_706979804.log
Sat May 23 21:20:06 2015
Media Recovery Log /oradata/standby_arch/2_152329_706979804.log
Sat May 23 21:20:29 2015
Media Recovery Log /oradata/standby_arch/1_161213_706979804.log
Media Recovery Log /oradata/standby_arch/2_152330_706979804.log
Sat May 23 21:20:50 2015
Media Recovery Log /oradata/standby_arch/2_152331_706979804.log
Media Recovery Log /oradata/standby_arch/1_161214_706979804.log
Sat May 23 21:21:10 2015
Media Recovery Log /oradata/standby_arch/1_161215_706979804.log
Sat May 23 21:21:20 2015
Media Recovery Log /oradata/standby_arch/2_152332_706979804.log
Sat May 23 21:21:31 2015
Media Recovery Log /oradata/standby_arch/1_161216_706979804.log
Sat May 23 21:21:41 2015
Media Recovery Log /oradata/standby_arch/2_152333_706979804.log
Sat May 23 21:21:53 2015
Media Recovery Waiting for thread 1 sequence 161217

利用增量备份恢复因归档丢失造成的DG gap的更多相关文章

  1. 如何通过rman的增量备份恢复dataguard中standby端的数据

    很多正在使用dataguard的客户,都会遇到一个棘手的问题: 在备份端与主库同步的过程中由于网络原因或磁盘问题导致一个或多个归档日志丢失,进而dataguard同步无法继续.很多客户都选择了重新全库 ...

  2. ORACLE异机增量备份恢复

    PROD异机增量备份恢复验证实施文档 准备工作:source 源库:PROD数据库备份策略:周日0级RMAN备份,周一至周六1级差异增量备份0 4 * * 0 /data/rmanlev0.sh &g ...

  3. ORACLE 11G 利用泠备份恢复standby库

    利用泠备份恢复standby数据库 開始使用泠备份进行db恢复 2.1,停止掉standby库 SQL> shutdown immediate; Database closed. Databas ...

  4. 怎样使用 RMAN 增量备份恢复 data guard log gap(日志断档)

    主库查询最小scn 信息: SQL> col current_scn for 999999999999999 SQL>  SELECT CURRENT_SCN FROM V$DATABAS ...

  5. Oracle DB备份恢复篇之丢失控制文件

    实验目的 本篇主要模拟控制文件丢失后,如何根据实际情况恢复数据库,才能使数据库尽可能不丢失数据. 实验环境 1)Linux系统环境 [oracle@DG1 ~]$ lsb_release -a LSB ...

  6. oracle 增量备份恢复策略(基础知识)

    EXP和IMP是Oracle提供的一种逻辑备份工具.逻辑备份创建数据库对 象的逻辑拷贝并存入一个二进制转储文件.这种逻辑备份需要在数据库启动的情况下使用, 其导出实质就是读取一个数据库记录集(甚至可以 ...

  7. MySQL5.7增量备份恢复全实战

    一. 简介 1. 增量备份 增量备份是指在一次全备份或上一次增量备份后,以后每次的备份只需备份与前一次相比增加或者被修改的文件.这就意味着,第一次增量 备份的对象是进行全备后所产生的增加和修改的文件; ...

  8. 【转】mysql增量备份恢复实战企业案例

    来源地址:http://seanlook.com/2014/12/05/mysql_incremental_backup_example/ 小量的数据库可以每天进行完整备份,因为这也用不了多少时间,但 ...

  9. 通过增量备份恢复来处理Oracle DG 复制GAP

    1.确定增备scn范围,通过alert日志获取gap日志序列GAP - thread 1 sequence 109631-117170 2.根据序列获取增备起点SCN提示最小gap序列为109631, ...

随机推荐

  1. lodash常用方法1--查询

    1.find var _ = require('lodash'); var user1 = { name: 'zhangsan', height: 180, weight: 120 }; var us ...

  2. 网上图书商城3--Book模块

    小技巧一:分页 ①PageBean<Book> findByCriteria(List<Expression> exprList, int pc)  --- 通用的查询方法(p ...

  3. HTML+AngularJS+Groovy如何实现登录功能

    AngularJS是一款优秀的前端JS框架,已经被用于Google的多款产品当中.AngularJS核心特性有:MVVM.模块化.自动化双向数据绑定.语义化标签.依赖注入等.AngularJS认为声明 ...

  4. javascript数据类型理解整理

    起因:关于数据类型这块,自己看了很多遍相关的资料,每次查看和实践都有一些体会和理解:但又感到没有理解透,总是差一点,最近又在看这块的内容,加上最近的积累,做个相关笔记 ECMAScript数据类型:1 ...

  5. js引入php 用来加载静态页面 输出到页面中

    HTML页面中加入代码 <script type="text/javascript" src="http://www.域名.com/js.php?id=tjyd&q ...

  6. 网页引用本地电脑的字体 css设置浏览器会不显示的解决办法

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  7. 【Bootstrap】入门例子创建

    本文简单介绍下如何来使用 Bootstrap,通过引入 Bootstrap,来实现一个最基本的入门例子. 在前一篇博文[Bootstrap]1.初识Bootstrap 基础之上,我们完全可以更加方便快 ...

  8. RecyclerView局部刷新那点事

    1.局部刷新的引入 提到RecyclerView,我们首先想到的是ListView,对于ListView的局部刷新,我们之前已经有解决方案,[android:ListView的局部刷新]当时的解决方案 ...

  9. WPF 使用Caliburn.Micro 多线程打开窗口

    我们都知道在WPF里面用多线程打开一个窗口很简单.如下 public void ClickMe(object sender) { Thread newWindowThread = new Thread ...

  10. location.href参数丢失

    今天用location.href跳转页面的时候遇到了一个问题. 给一个按钮添加点击事件,在js里实现跳转页面,并传递一个参数. <a class="btn btn-primary&qu ...