Backing up an Oracle Data Guard environment

For recreating the SITE oracle2, first we need to create a standby database on SITE oracle2
and afterwards perform a switchover. With the switchover, the database roles will be switched
again: SITE oracle2 will become primary and SITE oracle1 standby, as it was originally
Startup nomount the new standby;
With this in place and assuming the need tapes are available on SITE oracle2, we can then
execute the RMAN script to recreate a standby database using an existing backup;
The script used is the following:
oracle@oracle2[DG1]:/oradata/DG1$ cat recreate_standby.rcv
run {
allocate auxiliary channel 'dev_0' type 'sbt_tape' parms
'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=DG1,OB2BARLIST=Ora1_DG1_Online)';
allocate auxiliary channel 'dev_1' type 'sbt_tape' parms
'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=DG1,OB2BARLIST=Ora1_DG1_Online)';
duplicate target database for standby nofilenamecheck ;
}
Basically, the script uses the RMAN “duplicate target database for standby” command, which
creates a copy of the primary, performing afterwards a recovery of the database.
For recreating the standby using RMAN and the existing backup you need to connect to the
new standby (SITE oracle2) as auxiliary, to the primary as target and to the recovery catalog:
oracle@oracle2[DG1]:/oradata/DG1$ rman auxiliary / target \ sys/xxxx@dg1_stdby catalog
rman/xxxx@rcat_oracle3
Recovery Manager: Release 10.1.0.3.0 - 64bit Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
connected to target database: DG1 (DBID=1531960840)
connected to recovery catalog database
connected to auxiliary database: DG1 (not mounted)
RMAN>
The script to create the target standby can be seen below; the RMAN protocol for the
duplicate database is in the appendix for completeness:
RMAN> @recreate_standby.rcv
RMAN> run {
2> allocate auxiliary channel 'dev_0' type 'sbt_tape'
3> parms 'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=DG1,OB2BARLIST=Ora1_DG1_Online)';
4> allocate auxiliary channel 'dev_1' type 'sbt_tape'
5> parms 'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=DG1,OB2BARLIST=Ora1_DG1_Online)';
6> duplicate target database for standby nofilenamecheck ;
7> }
After running the scripts, the new standby has been created and is already started:
17