利用增量备份恢复因归档丢失造成的DG gap
故障现象:
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的更多相关文章
- 如何通过rman的增量备份恢复dataguard中standby端的数据
很多正在使用dataguard的客户,都会遇到一个棘手的问题: 在备份端与主库同步的过程中由于网络原因或磁盘问题导致一个或多个归档日志丢失,进而dataguard同步无法继续.很多客户都选择了重新全库 ...
- ORACLE异机增量备份恢复
PROD异机增量备份恢复验证实施文档 准备工作:source 源库:PROD数据库备份策略:周日0级RMAN备份,周一至周六1级差异增量备份0 4 * * 0 /data/rmanlev0.sh &g ...
- ORACLE 11G 利用泠备份恢复standby库
利用泠备份恢复standby数据库 開始使用泠备份进行db恢复 2.1,停止掉standby库 SQL> shutdown immediate; Database closed. Databas ...
- 怎样使用 RMAN 增量备份恢复 data guard log gap(日志断档)
主库查询最小scn 信息: SQL> col current_scn for 999999999999999 SQL> SELECT CURRENT_SCN FROM V$DATABAS ...
- Oracle DB备份恢复篇之丢失控制文件
实验目的 本篇主要模拟控制文件丢失后,如何根据实际情况恢复数据库,才能使数据库尽可能不丢失数据. 实验环境 1)Linux系统环境 [oracle@DG1 ~]$ lsb_release -a LSB ...
- oracle 增量备份恢复策略(基础知识)
EXP和IMP是Oracle提供的一种逻辑备份工具.逻辑备份创建数据库对 象的逻辑拷贝并存入一个二进制转储文件.这种逻辑备份需要在数据库启动的情况下使用, 其导出实质就是读取一个数据库记录集(甚至可以 ...
- MySQL5.7增量备份恢复全实战
一. 简介 1. 增量备份 增量备份是指在一次全备份或上一次增量备份后,以后每次的备份只需备份与前一次相比增加或者被修改的文件.这就意味着,第一次增量 备份的对象是进行全备后所产生的增加和修改的文件; ...
- 【转】mysql增量备份恢复实战企业案例
来源地址:http://seanlook.com/2014/12/05/mysql_incremental_backup_example/ 小量的数据库可以每天进行完整备份,因为这也用不了多少时间,但 ...
- 通过增量备份恢复来处理Oracle DG 复制GAP
1.确定增备scn范围,通过alert日志获取gap日志序列GAP - thread 1 sequence 109631-117170 2.根据序列获取增备起点SCN提示最小gap序列为109631, ...
随机推荐
- TreeSet集合深入了解--------攻击原理
Set接口Set不允许包含相同的元素,如果试图把两个相同元素加入同一个集合中,add方法返回false.(无序,不可重复 )Set判断两个对象相同不是使用==运算符,而是根据equals方法.也就是说 ...
- 原博客地址http://blog.chinaunix.net/uid/20656672.html弃用
原博客地址http://blog.chinaunix.net/uid/20656672.html弃用
- 代理模式的java实现
1. 简介 代理模式(Proxy Pattern)是常用设计模式之一.代理模式的定义:Provide a surrogate or placeholder for another object to ...
- Xamarin安装和跳坑指南
安装Checklist 注意:本文只描述安装过程,由于组件的版本更新很快,为保证文章时效性,不提供下载链接,也尽可能不指明具体版本. 安装Visual Studio 2015进行默认安装,除非已经FQ ...
- WAF指纹识别和XSS过滤器绕过技巧
[译文] -- “Modern Web Application Firewalls Fingerprinting and Bypassing XSS Filters” 0x1 前言 之前在乌云drop ...
- Autodesk 2013开发者日(DevDays)又要来了 -- 北京(2013年11月7日)和上海(2013年11月11日)
各位, 一年一度的Autodesk 开发者日(Devdays)开始注册了,抓紧时间前排占座! 注册地址: www.autodesk.com.cn/adndevday2013 今年开发者日的主题:革命性 ...
- 关于内存泄露分析插件 MAT 的用法
关于内存泄露分析插件 MAT 的用法,建议大家有时间看一下,下面的文章 http://www.blogjava.net/rosen/archive/2010/05/21/321575.html htt ...
- sqlite API模型
 每一个数据库连接可以包括多个数据库文件,一个主数据库文件和attached的几个数据库文件. 每一个数据库文件都有自己的B-tree和pager. 数据库连接(connection)和事务(tra ...
- 【转】JavaScript 异步进化史
前言 JS 中最基础的异步调用方式是 callback,它将回调函数 callback 传给异步 API,由浏览器或 Node 在异步完成后,通知 JS 引擎调用 callback.对于简单的异步操作 ...
- 安装SqlServer的时候性能计数器注册表配置单元一致性失败的解决办法
http://www.2cto.com/database/201204/126772.html