Dataguard master database archive is lost or deleted by mistake, and has not been uploaded to the slave database. The Incremental backup function of RMAN is used to solve the gap and no reconstruction of DG is required.
Using RMAN incremental backups to refresh a standby Database
You can create an incremental backup of the target database containing changes to the database since the creation of the duplicate or the previous syncrhonization. You can apply the Incremental backup to the standby database.
Note:
This technique cannot be used to update a duplicate database.
RMAN enables you to synchronize a standby database with a primary database by creating an incremental backup at the source database that contains all changed blocks since the duplicate was created or last refreshed. you then apply the Incremental backup to the standby database, which updates it with all changes.
This capability facilitates the temporary conversion of a physical standby database into a reporting database, as described in Oracle Data guard concepts and administration. in particle, this capability makes it possible to reverse the effects of converting the standby into a reporting database. after the standby database has been used for reporting or testing, flashback database can reverse any changes resulting from that work, returning the database to its contents when it was still a standby. an incremental backup created with backup incremental... from SCN can be used to refresh the standby with changes at the primary since the conversion and then managed recovery can resume. the effect is to return the reporting database to its role as standby.
For more details on this scenario, see Oracle Data guard concepts and administration.
Using backup incremental... from SCN
The Incremental backup is created at the source database by means of the backup incremental from SCN = N form of the Backup command. For example:
Backup Device Type SBT incremental from SCN 750923 database;
Backup incremental from SCN 750923 database;
Backup Device Type disk incremental from SCN 750983 Database
Format '/tmp/incr_standby _ % U ';
RMAN uses the selected SCN as the basis for this Incremental backup. for all files being backed up, RMAN should des all data blocks that were changed at scns greater than or equal to the from SCN In the Incremental backup.
Note:
- RMAN does not consider the Incremental backup as part of a backup strategy at the source database. The backup is not suitable for use in a normal recover database operation at the source database.
- The backup sets produced by this command are written? /DBS by default, even if the flash recovery area or some other backup destination is defined as the default for disk backups.
- You must create this Incremental backup on disk for it to be useful. when you move the Incremental backup to the standby, you must catalog it at the standby as described in "Step 3: catalog the Incremental backup files at the standby Database ". backups on tape cannot be cataloged.
See also:
Oracle database backup and recovery reference for more details on Backup command syntax
Refreshing a standby database with incremental from SCN backups: Example
This example shows the steps required to update a standby database using incremental backups. the assumption is that you have already activated the standby, stored med your tests or other operations at the standby, and then used flashback database to undo the effects of those changes. the task here is to refresh the standby with the latest changes to the primary, so that it can resume its role as a standby database.
Step 1: Create the Incremental Backup
Create the needed Incremental backup at the source database, using backup with the incremental from SCN clause.
Assume that the Incremental backup to be used in updating the duplicate database is to be created on disk, with the filenames for backup pieces determined by the format/tmp/incr_for_standby/bkup _ % u.
RMAN> Backup Device Type disk incremental from SCN 750983 Database
Format '/tmp/incr_for_standby/bkup _ % U ';
Step 2: Make the Incremental Backup accessible at the standby Database
Make the backup pieces containing the Incremental backup available in some directory accessible on the system containing the standby database. for this example, assume that the destination directory is called/standbydisk1/incrback/and ensure that it contains nothing besides the incremental backups from step 1.
Step 3: catalog the Incremental backup files at the standby Database
Use the RMAN catalog command to register the backup sets in the RMAN repository at the duplicate. with an RMAN Client Connected to the standby database and the recovery catalog (if you use one at the standby), mount the standby and run the following command:
RMAN> catalog start with '/standbydisk1/incrback /';
The backups are now available for use in recovery of the standby.
Step 4: Apply the Incremental backup to the standby Database
Use the RMAN recover command with the noredo option to apply the Incremental backup to the standby database. all changed blocks captured in the Incremental Backup are updated at the standby database, bringing it up to date with the primary database. with an RMAN Client Connected to the standby database, run the following command:
RMAN> recover database noredo;
You can now resume managed recovery at the standby. Any redo logs required at the standby with changes since those contained in the incremental are automatically requested from the primary and applied
In the physical standby database environment of Data guard
After the master database is deleted by mistake or some archived logs are lost, the master and slave databases are synchronized without re-deploying the standby environment.
The entire process is also described in the Oracle official documentation.
Oracle? Database backup and recovery Advanced User's Guide
--> Using RMAN incremental backups to refresh a standby Database
First
Query the missing archive number on the slave database:
SQL> select first_time, first_change #, next_change #, sequence # from V $ log_history;
Query the gap on the slave Database
SQL> select thread #, low_sequence #, high_sequence # from V $ archive_gap;
Check whether the missing archive exists on the master database
SQL> select name from V $ archived_log where thread # = 1 and dest_id = 1 and sequence # Between 31149 and 31157;
If you confirm that the master database does not have a Lost Archive, you need to find the SCN corresponding to the Lost Archive.
10 Gb can be viewed in this way
SQL> select current_scn from V $ database;
Urrent_scn
----------
3470773
SQL> select dbms_flashback.get_system_change_number from dual;
Et_system_change_number
-----------------------
3470743
Step 1: Create an SCN-Based Incremental Backup
First, you must know the SCN from which the archive logs are deleted or lost by mistake.
In the first_change # column of V $ archived_log, you can find the starting SCN (750983 for example) corresponding to the archive log. Then you can perform the following operations.
Use Backup... incremental from SCN on the master database to perform an incremental backup for the master database. This operation backs up blocks larger than 750983 of the SCN in the entire database. (The database block contains SCN, which is explicitly stated in concept)
RMAN> Backup Device Type disk incremental from SCN 750983 Database
Format '/tmp/incr_for_standby/bkup_incre.bk ';
Step 2: copy the backup file to the standby end
For example:/standbydisk1/incrback/. Note that if it is an empty directory, there cannot be anything other than Incremental backup.
/Standbydisk1/incrback/bkup_incre.bk
Step 3: register the backup data to RMAN repository on the standby end. RMAN is required to connect the standby database and the Catalog Database (if any, skip this step). If the standby database is in the Mount status
RMAN> catalog start with '/standbydisk1/incrback /';
The preceding command imports the backup files in the/standbydisk1/incrback/directory in the controlfile and catalog of standby.
Step 4:
Execute recover in the standby database. Note that the standby database will not be restored to the consistent State, because the primary database is online during Backup. However, after the recover is complete, the status can be used for standby's managed recovery, and the standby database is in the Mount status.
RMAN> recover database noredo;
Now
Alter database recover managed standby database disconnect from session;