Dataguard-solution for gap generation on the standby machine

Source: Internet
Author: User

 

Dataguard-solution for gap generation on the standby machine

Sometimes, due to network or backup failure, the archived logs generated by the host cannot be uploaded to the backup machine. In this case, the backup machine generates a gap. How can this problem be solved?

Note that once the gap is generated, even if the archive log after the gap can be uploaded to the standby database normally, the Standby database will not apply the subsequent log files. Only by applying standby recover to the first file that generates the gap to the latest archive log file can the two databases be consistent.

1. Recreate standby controlfile in the primary database. And copy it to the standby database. The location is the same as before.Alter database create standby controlfile as '[path] [ctl_file_name]. CTL ';

2. log on to the slave database and select * from V $ archive_gap. What are the files that generate the gap?

2. Shutdown standby Library (shutdown immediate)

3. Copy the archive files that generate the gap to the standby database. (If the master database is restored, the Hot Standby files and all newly generated archive logs of the master database after resetlog are reversed to the original location .)

4. Start the standby database to the Mount state and perform manual synchronization:
$ Startup nomount
$ Alter database Mount standby database;
$ Recover standby database; -- (this is also true if archive logs generate gaps: reverse the missing archive log to the standby database type and execute it .)

5. After the Primary and Secondary databases are consistent, set the standby database back to the Management Status:
Alter database recover managed standby database disconnect from session;

Check:

Select * from V $ archive_gap -- check whether there is a gap in standby. If there is a gap, check whether these sequence # logs are missing on the standby machine. To perform monitoring, you can use the following SQL statement:

Select decode (select count (*) from (select low_sequence # from V $ archive_gap Union select 9999 from dual), 2, 'found gaps, contact DBA as soon as possible! ', 'No gaps, take it easy') "gap status" from dual;

Select * from V $ archived_log where applied = 'no' indicates no applied

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.