Rolling Forward a Physical Standby Database using RMAN Incremental Backup - nchillal/Oracle GitHub Wiki
sqlplus -s / as sysdba <<!
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
!
!!! Note: For the remaining steps, the standby database must be in a MOUNT state. !!!
sqlplus -s / as sysdba <<!
SELECT current_scn FROM v\$database;
SELECT MIN(checkpoint_change#)
FROM v\$datafile_header
WHERE file# NOT IN (SELECT file# FROM v\$datafile WHERE enabled = 'READ ONLY');
!
!!! Note: You need to use the 'lowest SCN' from the queries above. !!!
rman target / <<!
BACKUP INCREMENTAL FROM SCN 2590404855 DATABASE FORMAT '/tmp/ForStandby_%U' tag 'FORSTANDBY';
!
scp /tmp/ForStandby_* <STANDBY_SERVER>:/tmp
rman target / <<!
CATALOG START WITH '/tmp/ForStandby';
!
rman target / <<!
RECOVER DATABASE NOREDO;
!
rman target / <<!
BACKUP CURRENT CONTROLFILE FOR STANDBY FORMAT '/tmp/ForStandbyCTRL.bck';
!
scp /tmp/ForStandbyCTRL.bck <STANDBY_SERVER>:/tmp
sqlplus -s / as sysdba <<!
spool datafile_names.txt
set linesize 200 heading off
COLUMN name FORMAT a60
SELECT file#, name FROM v$datafile ORDER BY file# ;
spool off
!
rman target /
SHUTDOWN IMMEDIATE ;
STARTUP NOMOUNT;
RESTORE STANDBY CONTROLFILE FROM '/tmp/ForStandbyCTRL.bck';
sqlplus -s / as sysdba <<!
SHUTDOWN;
STARTUP MOUNT;
!
sqlplus -s / as sysdba <<!
SELECT flashback_on FROM v$database;
ALTER DATABASE FLASHBACK ON;
!
sqlplus -s / as sysdba <<!
SET HEADING OFF FEEDBACK OFF
spool /tmp/clear_srl.sql
SELECT 'ALTER DATABASE CLEAR LOGFILE GROUP '||group#||';' FROM v\$logfile WHERE type='STANDBY';
spool off
!
sqlplus -s / as sysdba <<!
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
!
Steps to perform for Rolling Forward a Physical Standby Database using RMAN Incremental Backup. (Doc ID 836986.1)
Steps to perform for Rolling forward a standby database using RMAN incremental backup when datafile is added to primary (Doc ID 1531031.1)