How to Resolve Gaps in Data Guard Apply Using Incremental RMAN Backup

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/

 747 views last month,  2 views today

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience. I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource. I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks. I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients. If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress mehmetsalih.deveci@outlook.com. -                                                                                                                                                                                                                                                 - Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  mehmetsalih.deveci@outlook.com a mail atabilirsiniz.

Leave a Reply