Recover DG Gap due to archive loss with incremental backup

Source: Internet
Author: User

Failure phenomena:
Data Guard archive Gap, the tragedy is that the lost archive on the Main library was deleted by Rman Backup, the lost archive about 20, the database size of about 2T, if the Rebuild DG will be very time-consuming, so decided to use incremental backup to recover the DG, the main steps are as follows:
1. Backup Repository spfile file
sql> create pfile= '/home/ora/pfilerdg.ora ' from SPFile;

2. View current standby SCN
Sql> Select To_char (CURRENT_SCN) from V$database;

To_char (CURRENT_SCN)
----------------------------------------
19652214434
3. View Missing Archivelog
Sql> select * from V$archive_gap;

thread# low_sequence# high_sequence#
---------- ------------- --------------
1 160163 160170
2 151303 151309
, incremental backup in the main library

[[email protected] ~]$ Rman target/

Recovery manager:release 10.2.0.4.0-production on Sat 23 18:10:52 2015

Copyright (c) 1982, 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 ' Inc Lude 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. Transfer the backup to the standby library
SCP Full_db_jzh_20150523_*.bak 192.168.110.115:~/20150523_recover/
6. Restore the Standby library
[[email protected] ~]$ Rman target/

Recovery manager:release 10.2.0.4.0-production on Sat 23 20:17:59 2015

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

Connected to target Database:jzh (dbid=2072634265, not open)

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

[[email protected] ~]$ Rman target/

Recovery manager:release 10.2.0.4.0-production on Sat 23 20:25:44 2015

Copyright (c) 1982, 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, close the standby library, the recovered Control01.ctl cover the repository control file
[email protected] ~]$ CP Control01.ctl/oradata/jzh/standby.ctl
8. Start the standby library to Mount state
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. View Gap
Sql> select * from V$archive_gap;
No rows selected
10. Open Standby Recover Mode
sql> Recover managed Standby database disconnect from session;
Media recovery complete.
11, check the log, is recovering
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

Recover DG Gap due to archive loss with incremental backup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.