Hi,
I will explain How to Resolve Gaps in Data Guard Apply Using Incremental RMAN Backup in this article.
If you don’t know what is the Dataguard and how to install Oracle dataguard, then read the following article.
Oracle DataGuard Physical Standby Installation Step by Step Using RMAN -2
Sometimes There are unresolvable archive gap or corrupted Archive log in the Dataguard ( Standby ), you may need to roll forward your Standby using RMAN Incremental backup.
Step-1: Check the SCN of Standby ( Dataguard ) database and Find the lowest SCN from the following Queries.
SQL> SELECT CURRENT_SCN FROM V$DATABASE; CURRENT_SCN -------------- 1165261 SQL> select min(fhscn) from x$kcvfh; MIN(FHSCN) ---------------- 1162291 SQL> select min(kc.fhscn) from x$kcvfh f, v$datafile d where kc.hxfil =dd.file# and dd.enabled != 'READ ONLY'; MIN(kc.FHSCN) ---------------- 1161196
Step-2: Stop the Dataguard MRP ( Apply ) Process and shutdown Standby database.
SQL> alter database recover managed standby database cancel; SQL> shutdown immediate;
Step-3: Take an Incremental Backup from Production database using the lowest SCN as follows.
RMAN > backup incremental from scn 1161196 database format '/oracle/incrementallast.rman' DEVICE TYPE DISK;
Step-4: Transfer the Incremental backup to the Standby database from Production server.
[oracle@msddbadm01 ~]$ scp incremental.rman 192.168.63.35:/oracle/backup/incremental.rman
Step-5: Create a new Standby Controlfile on Production database and transfer it to Standby database.
SQL> alter database create standby controlfile as '/oracle/standby0405.ctl';
[oracle@msddbadm01 ~]$ scp standby.ctl 192.168.63.35:/oracle/backup/
Step-6: Startup Standby database in nomount mode.
SQL> startup nomount
Step-7: Restore new standby controlfile on Standby database.
RMAN> restore standby controlfile from '/oracle/backup/standby0405.ctl';
Step-8: mount the standby database.
SQL> alter database mount standby database; Database altered.
Step-9: Catalog the new Incremental backups on Standby Server as follows.
RMAN> catalog start with '/oracle/backup/'; List of Cataloged Files ======================= File Name: /oracle/backup/incremental.rman
Step-10: start Recover database on Standby database.
RMAN> recover database;
Step-11: Now you can start the MRP Process to apply new logs.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
You can read the following article to get the dataguard monitoring scripts.
https://ittutorial.org/oracle-dba-scripts-all-in-one-2-dataguard-monitoring-scripts/
Do you want to learn Oracle Database for Beginners, then read the following articles.
https://ittutorial.org/oracle-database-19c-tutorials-for-beginners/