"Oracle" SCN-based incremental backup fixes Dataguard GAP

Source: Internet
Author: User

1. first to simulate the generation of Gap1.1. Repository shutdown:

[Email Protected]_s>shutdown Immediate;

1.2. Main Library Switch log

[Email protected]>select sequence#,archived,status from V$log;

sequence# ARC STATUS

---------- --- ----------------

+ YES ACTIVE

+ YES ACTIVE

NO Current

[Email protected]>alter system archive log current;

System altered.

[Email protected]>select sequence#,archived,status from V$log;

sequence# ARC STATUS

---------- --- ----------------

NO Current

+ YES ACTIVE

+ YES ACTIVE

Just now The current log has been filed.

1.3. Delete archive, generate unresolvable GAP

Now delete the number archive

[Email protected] arch]$ MV 1_63_909786801.DBF 1_63_909786801.dbf.bak

2. View error2.1. starting a standby library

[Email Protected]_s>startup

2.2. Check the alert of the standby library

Media Recovery log/u01/app/oracle/arch/1_62_909786801.dbf

Media Recovery waiting for thread 1 sequence 63

Fetching gap sequence in thread 1, Gap sequence 63-63

Fri May 06 05:28:09 2016

Fal[client]: Failed to request gap sequence

Gap-thread 1 Sequence 63-63

DBID 3866310445 Branch 909786801

Fal[client]: All defined FAL servers has been attempted.

------------------------------------------------------------

Check that the Control_file_record_keep_time initialization

parameter is defined to a value of that ' s sufficiently large

Enough to maintain adequate log switch information to resolve

Archivelog gaps.

------------------------------------------------------------

2.3. Main Library Query switchover_status

[Email protected]>select switchover_status from V$database;

Switchover_status

--------------------

Unresolvable GAP

For Unresolvable Gap, that the gap at this time need our own repair, unable to automatically repair, can automatically repair the gap Display as resolvable GAP

3. SCM -based incremental backup for GAP Repair3.1. querying the current SCN number on the standby library

[Email protected]_s>select current_scn from V$database;

Current_scn

-----------

2567388

3.2. go to the main repository for incremental backups based on this SCN

Rman> BACKUP INCREMENTAL from SCN 2567388 DATABASE FORMAT '/u01/app/oracle/oradata/tmp/ora11_scn_%u ' tag ' for Standby G AP ';

3.3. transfer to the standby library:

[Email protected] tmp]$ SCP * standby:/u01/app/oracle/oradata/tmp

[email protected] ' s password:

ora11_scn_0kr54hvk_1_1                                                                                                                     100%  125MB 125.2MB/s    00:01    

Ora11_scn_0lr54l99_1_1 100% 9664KB 9.4mb/s 00:00

3.4. the repository restarts to Mountandcancels the log app

[Email Protected]_s>shutdown Immediate;

[Email Protected]_s>startup Mount;

[Email protected]_s>alter database Recover managed standby database cancel;

3.5. register the backup set that you just transferred.

Rman> CATALOG START with '/u01/app/oracle/oradata/tmp ';

3.6. Recover Standby library

rman> Recover Database Noredo;

When the recovery is complete, we can observe the alert log of the repository:

Incremental restore complete of datafile 4/u01/app/oracle/oradata/dgtest_s/users01.dbf

Checkpoint is 2893208

Last deallocation SCN is 3

Incremental restore complete of datafile 3/u01/app/oracle/oradata/dgtest_s/undotbs01.dbf

Checkpoint is 2893208

Last deallocation SCN is 973300

Incremental restore complete of datafile 5/u01/app/oracle/oradata/dgtest_s/example01.dbf

Checkpoint is 2893208

Last deallocation SCN is 942056

Mon May 09 05:20:25 2016

Incremental restore complete of datafile 2/u01/app/oracle/oradata/dgtest_s/sysaux01.dbf

Checkpoint is 2893208

Last deallocation SCN is 956093

Incremental restore complete of datafile 1/u01/app/oracle/oradata/dgtest_s/system01.dbf

Checkpoint is 2893208

Last deallocation SCN is 955346

The SCN number of the found data file has been refreshed, but it is not possible to restart the library at this time and need to re-libraries from the main to a standby controlfile.

3.7. Master Repository backup control file

Rman> BACKUP current controlfile for STANDBY FORMAT '/u01/app/oracle/oradata/tmp/ctl.bak ';

3.8. transfer standby control files to the standby library

[email protected] ' s password:

Ctl.bak 100% 9664KB 9.4mb/s 00:00

3.9. Standby Recovery standby control file

Standby library to the nomount Stage:

[Email Protected]_s>shutdown Immediate

[Email Protected]_s>startup nomount;

Rman Recovery Control file

Rman> RESTORE STANDBY controlfile from '/u01/app/oracle/oradata/tmp/ctl.bak ';

3.10. Mount repository and cancel the log app

[Email protected]_s> ALTER DATABASE mount;

[Email protected]_s>alter database Recover managed standby database cancel;

3.11. emptying the repository log group

[Email protected]_s>alter DATABASE CLEAR LOGFILE GROUP 1;

Database altered.

Note: If the standby log mode is used, it does not need to be emptied and will appear if emptied

sql> ALTER DATABASE CLEAR LOGFILE GROUP 1;

ALTER DATABASE CLEAR LOGFILE GROUP 1

*

ERROR at line 1:

Ora-19527:physical Standby Redo log must be renamed

Ora-00312:online Log 1 Thread 1: '/u01/oradata/badly9/redo01.log '

Note: If standby log mode is not used , there are several groups that need to be emptied

3.12. Standby Reset Flashback

[Email protected]_s>alter DATABASE FLASHBACK OFF;

[Email Protected]_s>alter DATABASE FLASHBACK on;

3.13. Prepare library to start Application log

[Email protected]_s>alter database RECOVER MANAGED STANDBY database USING current LOGFILE DISCONNECT from SESSION;

4. confirm that the repair was successful

Executing in the main library

[Email protected]>alter system switch logfile;

select Max (sequence#) from V$archived_log is executed in the master and standby libraries respectively; if the consistent mark is successfully repaired

[Email protected]>select max (sequence#) from V$archived_log;

MAX (sequence#)

--------------

81

[Email protected]_s>select max (sequence#) from V$archived_log;

MAX (sequence#)

--------------

81

GAP Repair is complete.

"Oracle" SCN-based incremental backup fixes Dataguard GAP

Related Article

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.