oracle增量恢复dg备库,rman增量恢复DG备库出现GAP的情况
主库归档被意外删除,备库复制出现问题,alter日志如下:
Wed Apr 01 10:16:15 2015
Media Recovery Log /tol/archivelog/1_587399_798641496.arc
Error opening /tol/archivelog/1_587399_798641496.arc
Attempting refetch
Media Recovery Waiting for thread 1 sequence 587399
Fetching gap sequence in thread 1, gap sequence 587399-587399
Wed Apr 01 10:16:25 2015
FAL[client]: Failed to request gap sequence
GAP - thread 1 sequence 587399-587399
DBID 484391126 branch 798641496
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.
-------------------------------------------------------------
Wed Apr 01 10:19:16 2015
Standby crash recovery need archive log for thread 1 sequence 587399 to continue.
Please verify that primary database is transporting redo logs to the standby database.
Wait timeout: thread 1 sequence 587399
Standby crash recovery aborted due to error 16016.
Errors in file /opt/app/oracle/diag/rdbms/dg_136/db26/trace/db26_ora_9667.trc:
ORA-16016: archived log for thread 1 sequence# 587399 unavailable
Recovery interrupted!
Some recovered datafiles maybe left media fuzzy
Media recovery may continue but open resetlogs may fail
Completed standby crash recovery.
Errors in file /opt/app/oracle/diag/rdbms/dg_136/db26/trace/db26_ora_9667.trc:
ORA-10458: standby database requires recovery
ORA-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: '/tol/oradata/db26/system01.dbf'
ORA-10458 signalled during: ALTER DATABASE OPEN...
解决:
一、备库
查看当前的SCN号:
SQL> select status from v$instance;
STATUS
------------
MOUNTED
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
1.1217E+10
SQL> set numw 15
SQL> select current_scn from v$database;
CURRENT_SCN
---------------
11217220915
二、主库
进行RMAN增量备库:
[oracle@dg_135 ~]$ ls /tol/rmanbak/db26/
[oracle@dg_135 ~]$
[oracle@dg_135 ~]$
[oracle@dg_135 ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Apr 1 10:33:03 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: DB26 (DBID=484391126)
RMAN> backup as compressed backupset incremental from SCN 11217220915 database format '/tol/rmanbak/db26/standby_%d_%T_%U.bak'incRMAN>
RMAN> backup as compressed backupset incremental from SCN 11217220915 database format '/tol/rmanbak/db26/standby_%d_%T_%U.bak'include current controlfile for standby filesperset=5tag 'FOR STANDBY';
Starting backup at 2015-04-01 10:33:07
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=767 device type=DISK
backup will be obsolete on date 2015-04-08 10:33:12
archived logs will not be kept or backed up
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/tol/oradata/db26/sysaux01.dbf
input datafile file number=00516 name=/tol/oradata/db26/monitor01.dbf
input datafile file number=00525 name=/tol/oradata/db26/dbmonitor01.dbf
channel ORA_DISK_1: starting piece 1 at 2015-04-01 10:33:12
channel ORA_DISK_1: finished piece 1 at 2015-04-01 10:45:18
piece handle=/tol/rmanbak/db26/standby_DB26_20150401_3hq39if8_1_1.bak tag=FOR STANDBY comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:12:06
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00515 name=/tol/oradata/db26/undotbs01.dbf
input datafile file number=00498 name=/tol/oradata/db26/pkunewlib_index02.dbf
input datafile file number=00508 name=/tol/oradata/db26/voicedemo_index01.dbf
input datafile file number=00513 name=/tol/oradata/db26/ent2_index01.dbf
input datafile file number=00514 name=/tol/oradata/db26/ent2_index02.dbf
channel ORA_DISK_1: starting piece 1 at 2015-04-01 10:45:18
channel ORA_DISK_1: finished piece 1 at 2015-04-01 11:03:44
.....
.....
.....
using channel ORA_DISK_1
backup will be obsolete on date 2015-04-08 14:29:31
archived logs will not be kept or backed up
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 2015-04-01 14:29:32
channel ORA_DISK_1: finished piece 1 at 2015-04-01 14:29:35
piece handle=/tol/rmanbak/db26/standby_DB26_20150401_71q3a0ab_1_1.bak tag=FOR STANDBY comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 2015-04-01 14:29:35
RMAN> exit
Recovery Manager complete.
三、备库
进行恢复数据,恢复控制文件:
1、把增量备份SCP到备库上
[oracle@dg_135 ~]$ cd /tol/rmanbak/db26/
[oracle@dg_135 db26]$ scp * 192.168.100.136:/tol/rmanbak/db26/
standby_DB26_20150401_3hq39if8_1_1.bak 100% 1350MB 32.9MB/s 00:41
standby_DB26_20150401_3iq39j5u_1_1.bak 100% 5160MB 35.3MB/s 02:26
standby_DB26_20150401_3jq39k8g_1_1.bak 100% 296KB 296.0KB/s 00:00
standby_DB26_20150401_3kq39kah_1_1.bak 100% 72KB 72.0KB/s 00:00
standby_DB26_20150401_3lq39kcj_1_1.bak 100% 72KB 72.0KB/s 00:00
standby_DB26_20150401_3mq39kf9_1_1.bak 100% 72KB 72.0KB/s 00:00
standby_DB26_20150401_3nq39kh0_1_1.bak 100% 72KB 72.0KB/s 00:00
standby_DB26_20150401_3oq39kj2_1_1.bak 100% 128MB 25.6MB/s 00:05
standby_DB26_20150401_3pq39kle_1_1.bak 100% 98MB 32.6MB/s 00:03
standby_DB26_20150401_3qq39kng_1_1.bak 100% 92MB 30.8MB/s 00:03
standby_DB26_20150401_3rq39kp8_1_1.bak 100% 102MB 50.8MB/s 00:02
standby_DB26_20150401_3sq39kr9_1_1.bak 100% 113MB 28.3MB/s 00:04
standby_DB26_20150401_3tq39ktb_1_1.bak 100% 96MB 48.0MB/s 00:02
standby_DB26_20150401_3uq39kvd_1_1.bak 100% 94MB 31.3MB/s 00:03
standby_DB26_20150401_3vq39l1f_1_1.bak 100% 109MB 27.2MB/s 00:04
standby_DB26_20150401_40q39l3g_1_1.bak 100% 94MB 31.5MB/s 00:03
standby_DB26_20150401_41q39l5i_1_1.bak 100% 102MB 51.2MB/s 00:02
....
....
....
CATALOG注册。
[oracle@dg_136 ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Apr 1 14:55:42 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: DB26 (DBID=484391126, not open)
RMAN> CATALOG START WITH '/tol/rmanbak/db26';
using target database control file instead of recovery catalog
searching for all files that match the pattern /tol/rmanbak/db26
List of Files Unknown to the Database
=====================================
File Name: /tol/rmanbak/db26/standby_DB26_20150401_6vq3a07p_1_1.bak
File Name: /tol/rmanbak/db26/standby_DB26_20150401_4qq39oj7_1_1.bak
File Name: /tol/rmanbak/db26/standby_DB26_20150401_49q39me1_1_1.bak
File Name: /tol/rmanbak/db26/standby_DB26_20150401_6nq39vg7_1_1.bak
File Name: /tol/rmanbak/db26/standby_DB26_20150401_5vq39sv4_1_1.bak
File Name: /tol/rmanbak/db26/standby_DB26_20150401_66q39tms_1_1.bak
File Name: /tol/rmanbak/db26/standby_DB26_20150401_5uq39sse_1_1.bak
File Name: /tol/rmanbak/db26/standby_DB26_20150401_69q39u1n_1_1.bak
File Name: /tol/rmanbak/db26/standby_DB26_20150401_3oq39kj2_1_1.bak
.....
.....
.....
2、然后进行恢复。
SQL> Alter database recover managed standby database disconnect from session;
Database altered.
SQL> Alter database recover managed standby database cancel;
Database altered.
SQL> shut immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.
Total System Global Area 1.6034E+10 bytes
Fixed Size 2219552 bytes
Variable Size 1409286624 bytes
Database Buffers 1.4563E+10 bytes
Redo Buffers 60084224 bytes
Database mounted.
[oracle@dg_136 ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Apr 1 14:59:18 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: DB26 (DBID=484391126, not open)
RMAN> run {
2> allocate channel dsk0 type disk;
3> allocate channel dsk1 type disk;
4> allocate channel dsk2 type disk;
5> restore standby controlfile to '/tol/rmanbak/db26/control01.ctl';
6> recover database noredo;}
using target database control file instead of recovery catalog
allocated channel: dsk0
channel dsk0: SID=512 device type=DISK
allocated channel: dsk1
channel dsk1: SID=638 device type=DISK
allocated channel: dsk2
channel dsk2: SID=764 device type=DISK
Starting restore at 2015-04-01 14:59:23
channel dsk0: starting datafile backup set restore
channel dsk0: restoring control file
output file name=/tol/rmanbak/db26/control01.ctl
channel dsk0: reading from backup piece /tol/rmanbak/db26/standby_DB26_20150401_71q3a0ab_1_1.bak
channel dsk0: piece handle=/tol/rmanbak/db26/standby_DB26_20150401_71q3a0ab_1_1.bak tag=FOR STANDBY
channel dsk0: restored backup piece 1
channel dsk0: restore complete, elapsed time: 00:00:03
Finished restore at 2015-04-01 14:59:26
Starting recover at 2015-04-01 14:59:27
。。。
。。。
。。。
channel dsk1: restore complete, elapsed time: 00:42:14
channel dsk1: starting incremental datafile backup set restore
channel dsk1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00178: /tol/oradata/db26/lenovo04.dbf
destination for restore of datafile 00386: /tol/oradata/db26/newlib208.dbf
destination for restore of datafile 00404: /tol/oradata/db26/faq208.dbf
destination for restore of datafile 00499: /tol/oradata/db26/t_lib01.dbf
destination for restore of datafile 00547: /tol/oradata/db26/sso11.dbf
channel dsk1: reading from backup piece /tol/rmanbak/db26/standby_DB26_20150401_5bq39qht_1_1.bak
channel dsk0: piece handle=/tol/rmanbak/db26/standby_DB26_20150401_51q39pjd_1_1.bak tag=FOR STANDBY
channel dsk0: restored backup piece 1
channel dsk0: restore complete, elapsed time: 00:02:52
channel dsk1: piece handle=/tol/rmanbak/db26/standby_DB26_20150401_5bq39qht_1_1.bak tag=FOR STANDBY
channel dsk1: restored backup piece 1
channel dsk1: restore complete, elapsed time: 00:00:15
channel dsk2: piece handle=/tol/rmanbak/db26/standby_DB26_20150401_4oq39o5n_1_1.bak tag=FOR STANDBY
channel dsk2: restored backup piece 1
channel dsk2: restore complete, elapsed time: 00:17:16
Finished recover at 2015-04-01 17:42:08
released channel: dsk0
released channel: dsk1
released channel: dsk2
然后shut immediate把控制文件覆盖原控制文件
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/tol/oradata/db26/control01.ctl
/tol/oradata/db26/control02.ctl
/tol/oradata/db26/control03.ctl
SQL> shut immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg_136 trace]$ cp /tol/rmanbak/db26/control01.ctl /tol/oradata/db26/control01.ctl
[oracle@dg_136 trace]$ cp /tol/rmanbak/db26/control01.ctl /tol/oradata/db26/control02.ctl
[oracle@dg_136 trace]$ cp /tol/rmanbak/db26/control01.ctl /tol/oradata/db26/control03.ctl
然后startup mount
SQL> startup mount;
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.
Total System Global Area 1.6034E+10 bytes
Fixed Size 2219552 bytes
Variable Size 1409286624 bytes
Database Buffers 1.4563E+10 bytes
Redo Buffers 60084224 bytes
Database mounted.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Database altered.
四、主库
切换即可,然后查看备库的归档应用状态。
SQL> alter system switch logfile;
System altered.
SQL> Select sequence#,applied from v$archived_log;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23249684/viewspace-1482012/,如需转载,请注明出处,否则将追究法律责任。
oracle增量恢复dg备库,rman增量恢复DG备库出现GAP的情况相关推荐
- oracle rman备份整库,RMAN备份恢复整个库
RMAN备份恢复整个库 1 查看历史备份集 $ rman target / RMAN> list backup; 说明与资料档案库中的任何备份都不匹配 上述结果说明之前没有备份过 2 备份整个库 ...
- cmd oracle 连接实例_基于winserver的Oracle数据库跨版本下的rman备份恢复
概述 继续上一篇rman跨版本恢复的内容,今天主要分享在目的端恢复的过程,下面一起来看看吧! 因为目标数据库已经有实例,但不需要的,所以这里需要先删除一下. 1.删除安装oracle数据库时的实例 c ...
- RMAN备份数据库_制作和更新RMAN增量备份(Incremental Backup)
增量备份只拷贝从指定的之前的备份以后更改过的数据文件块.使用BACKUP命令来创建增量备份. 增量备份要么是累积增量备份,要么是差异增量备份. 虽然备份的内容相同,BACKUP DATABASE和BA ...
- oracle rman catalogo,ORACLE 11g RMAN备份恢复--catalog
rman catalog是为数据备份恢复时,使用恢复目录catalog,与nocatalog的不同是,nocatalog将备份相关的信息记录在了控制文件中,而catalog将备份信息记录在了恢复目录中 ...
- oracle standby同步,ORACLE 利用rman增量备份同步standby库
standby库归档日志断档,故standby库不能利用恢复归档日志和生产库保持同步,因生产库有1T多,重拉数据将非常耗时,遂利用RMAN对生产库进行增量备份,将增量备份集合成到standby库,利用 ...
- oracle进行rman增量恢复时报错RMAN-06094
rman恢复增量备份最后一步recover database noredo的时候报错RMAN-0057.RAMN00569.RMAN-00571.RMAN-03002.RMAN06094 解决办法: ...
- oracle增量备份如何恢复,【Oracle】增量备份和全库备份怎么恢复数据库
在线QQ客服:1922638 专业的SQL Server.MySQL数据库同步软件 ? 为了演示增量备份的效果,我们在执行0级备份后对数据库进行了一些更改. ? 执行另一级1差异增量备份: < ...
- bct对oracle影响,Oracle 优化篇+Rman增量备份优化之BCT(块变更追踪)
说明:本文为面向Oracle BCT(BLOCK CHANGE TRACKING)初学者的指导手册 标签:BCT.BLOCK CHANGE TRACKING.增量备份.备份优化.RMAN 注意:文中删 ...
- oracle增量备份level0,ORACLE RMAN增量备份经典理解
中,增量时分等级的,级别从0开始,一级一级递增,不过实际上用的最多的也就是0级和1级了,0级增量是后面级别的增量备份的 基础,0级备份实际上就是一个完全备份,与普通的完全备份唯一的不同点是0级备份可以 ...
最新文章
- 机洗内裤容易得暗病?这个锅我们袜子不背!
- 管人、管团队、管项目,如何让团队管理者成为技术团队中的发动机?
- 从JDK9的Flow接口说起
- Socket系列3 Socket服务端开发 数据的接收和发送
- 【移植Linux 3.4.2内核第三步】从0制作支持新内核的文件系统
- 做过leader,会数仓,项目经验丰富,能值多少钱?
- iOS 13发布日期确定 苹果WWDC2019定档!
- 从入门到入土:[SEED-Lab]MD5碰撞试验|MD5collgen实验|linux|Ubuntu|MD5 Collision Attack Lab|详细讲解
- 小黑小波比.Ubuntu14.04安装ffmpeg以及使用ffmpeg
- 建立项目接口文档_一个 SpringBoot 项目该包含哪些?
- 中国省份、城市-身份证编码
- 92套AE抖音快闪模板(精品)
- 聚合搜索V3.0泛解析泛目录站群源码 MIP自动推送 SEO功能SEO源码
- Python应用练习题(第一期)——基本语句练习
- TO B的百度云新品问世/价格腰斩 智能化DNA能撑起百度野心?
- PS初学者实例教程——图层样式的学习[斜面和浮雕]
- 利用计算机 算法写文章,计算机算法论文
- Unity 打包发布UWP 超详细
- pstools使用教程
- SpringCloud项目如何成功打包以及其中的一些坑
热门文章
- 联通“格物”,做好设备管理这篇大文章
- WiFi 4/5/6的差别(3)
- Win10中Pro/E鼠标滚轮不能缩放该怎么办?
- node-sass安装报错及其解决方案
- IJCAI2019 FinNLP(金融+NLP论文)
- MSDM5051 Notes 1
- autocad锐龙英特尔_入门级CPU怎么选?请不要再纠结于酷睿和锐龙啦!
- SMBIOS读取本机的MEMORY信息
- 服务器网卡网速慢怎么维护,网速慢怎么办我通过某单位内部的局域网上互联网,最近一段时间网速巨 爱问知识人...
- [项目] 网易云音乐项目总结