Thursday, May 21, 2026

Oracle Standby FIX using RMAN Incremental Backup from Primary DB

 

When you don’t have an option other than doing incremental backup from Primary DB (when ARCH logs are gone from all places) below is the high-level DB steps to fix the Standby GAP

On Standby:

Get the current DB SCN number

SYS@myoradb> select to_char (current_scn) from v$database;
TO_CHAR(CURRENT_SCN)
---------------------------------
11411445224862      à  SCN to take Backup from
  
  1. [Standby] Stop the managed standby apply process:
  2. Shut down standby
  3. start RMAN incremental backup from source (primary OR standby)
    RMAN> Backup as compressed backupset incremental from scn 11411445224862 database format '/u01/app/oracle/RMAN_INC/ForStandby_%U' tag 'FORSTANDBY';
  4. backup control file from source
    backup current controlfile for standby format '/u01/app/oracle/RMAN_INC/TRGDB_ForStandbyCTRL.bck';
  5. SCP backup pieces to Standby Server
    oracle@SRCHOST testdb > nohup scp TRGHOST:/u01/app/oracle/RMAN_INC/ForStandby_6091 . > Nohup_6091.log &
  6. [on standby] shut down DB and copy standby control file to location specified in standby
    • Backup existing control file and replace with primary control file
  7. mount standby DB from only 1 NODE
    RMAN> alter database mount;

       8 . Catalog all backup files with RMAN and start recover
             RMAN> catalog start with '/u01/app/oracle/TESTDB_standby_';
             RMAN> recover database;

             SYS@myoradb> select thread#, low_sequence#, high_sequence# from v$archive_gap;

 


0 comments:

Post a Comment

Auto Scroll Stop Scroll