Вы находитесь на странице: 1из 3

RMAN Incremental Backup to Roll Forward a

Physical Standby Database

Below statements are the quick and efficient alternatives to rebuilding a physical standby database in
using RMAN incremental backups to roll forward and resynchronize a physical standby database with the
primary database
1. On the physical standby database, stop the managed recovery process (MRP):
SQL> alter database recover managed standby database cancel;
2. On the physical standby database, find the SCN which will be used for the incremental backup at
the primary database, as the backup must be created from this SCN forward.
Sql > select current_scn from v$database;
eg. 3890015
3. Using RMAN, connect to the primary database and create an incremental backup from the SCN
derived in the previous steps
oracle@host1 ~]$ rman target sys/MySysPassword@modesto
RMAN> backup incremental from scn 3890015 database format
'/u04/oracle/dg /DG_%U' tag 'FORSTANDBY';
Note:

modesto is the primary Database

4. Using an OS remote copy utility, transfer all backup sets created on the
primary system to the physical standby machine
[oracle@host1 ~]$ scp /u04/oracle/dg /DG_* host2:/u04/oracle/dg/
DG_2fm656du_1_1

5. After copying the incremental backup pieces to the physical standby


machine, connect to the physical standby database using RMAN and catalog
those incremental backup pieces. Then recover the standby database with
the cataloged incremental backup pieces.
[oracle@host2 ~]$ rman target sys/MySysPassword@turlock
RMAN> catalog start with '/u04/oracle/dg/DG';
RMAN> recover database noredo;
Note: Turlock is the standby database
6. Connect to the primary database using RMAN and create a standby control file backup.

RMAN> backup current controlfile for standby format


'/u04/oracle/dg /DGCTRL.bck';

7. Using an OS remote copy utility, transfer the standby control file backup
created on the primary system to the physical standby database machine.
[oracle@host1 ~]$ scp /u04/oracle/dg /DGCTRL.bck host2:/u04/oracle/dg /
DGCTRL.bck

100% 10MB 9.8MB/s 00:01

8. Shut down the physical standby database and startup nomount:


sql> shutdown;
sql> startup nomount;

9. Connect to the physical standby database using RMAN and restore the
standby control file.
RMAN> restore standby controlfile from '/u04/oracle/dg /DGCTRL.bck';
10. Shut down the physical standby database again and startup mount:
sql> shutdown;
sql> startup mount;

11. If the primary and standby database data file directories are identical, skip
this step
RMAN> catalog start with '/u02/oradata/TURLOCK/datafile/';
12. After all standby database data file copies have been cataloged, switch the standby database to
use the just-cataloged data files.
RMAN> switch database to copy;

13.On the standby database, clear all of the online redo log and standby redo
log groups
SQL> select distinct group#, type from v$logfile order by group#;
GROUP#
---------1
2
3
4
5
6
7

TYPE
------ONLINE
ONLINE
ONLINE
STANDBY
STANDBY
STANDBY
STANDBY

Online Redo Log Groups


SQL> alter database clear logfile group 1;
SQL> alter database clear logfile group 2;
SQL> alter database clear logfile group 3;

Standby Redo Log Groups


SQL> alter database clear
SQL> alter database clear
SQL> alter database clear
SQL> alter database clear

logfile
logfile
logfile
logfile

group
group
group
group

4;
5;
6;
7;

14. Finally, on the physical standby database, restart the managed recovery process (MRP).

SQL> alter database recover managed standby database using current logfile
disconnect;

Вам также может понравиться