Incremental backup resolves Dataguard library log gap

Source: Internet
Author: User
Tags tmp folder

Sometimes the repository lags behind the main library for a long time, and the archive log of the main library is no longer there, at this time how to eliminate the log interval, many people choose to rebuild the repository, this is very troublesome, especially when the main library data is very large, at this time we have another option, that is, using incremental database backup to roll back the library Eliminate log intervals, as follows:
1. Standby to view the SCN number at the time of the Lost archive

Idle> select Current_scn from V$database;

Current_scn

-----------

96458277

2. The main library creates an incremental backup based on the Lost archive SCN number (The/tmp folder is used to determine the destination directory for the main and standby repositories)

Rman>
run{
BACKUP DEVICE TYPE DISK INCREMENTAL from SCN 96458277 DATABASE FORMAT '/tmp/stb_bk/%u_for_stb.bk ' include current Controlf Ile for standby;
}

3. After the backup is done, the directory from the main library to the backup repository can be different from the directory above.

Rman> CATALOG START with '/tmp/stb_bk/';

4. Take a look at the location of the Controlfile because the backup control file will be used next.

Idle> Show Parameter control

Look at the location of the Standby_log file again, as it may need to be rebuilt next.

idle> Select *from v$logfile;

5. Use the following command to recover from Rman

Rman>
run{
Restore standby controlfile to '/tmp/stb_controlfile01.ctl ';
Recover database Noredo;
}

If the following error is reported, it is possible that the recover managed standby command is executing:

Ora-19870:errorwhile Restoring Backup PIECE/TMP/STB_BK/05N5A31S_1_1_FOR_STB.BK

Ora-19573:cannotobtain Exclusive enqueue for DataFile 1

Execute the following command, or restart the database to mount state:

Idle>alter database recover managed standby database cancel;

Then execute again in Rman:

Rman>

run{

Restore standby controlfile to '/tmp/stb_controlfile01.ctl ';

Recover database Noredo;

}

6. Close the database and overwrite the original control file with the recovered backup control file.

Incremental backup resolves Dataguard library log gap

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.