1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| # start RMAN and then connect to the databases
connect target /
connect catalog rman/rman@rcat
connect auxiliary sys/change_on_install@dupdb
# set auxiliary names for the datafiles only once
set auxname for datafile 1 TO '$ORACLE_HOME/dbs/tbs_01.f';
set auxname for datafile 2 TO '$ORACLE_HOME/dbs/tbs_02.f';
set auxname for datafile 3 TO '$ORACLE_HOME/dbs/tbs_03.f';
set auxname for datafile 4 TO '$ORACLE_HOME/dbs/tbs_04.f';
set auxname for datafile 5 TO '$ORACLE_HOME/dbs/tbs_05.f';
set auxname for datafile 6 TO '$ORACLE_HOME/dbs/tbs_06.f';
set auxname for datafile 7 TO '$ORACLE_HOME/dbs/tbs_07.f';
set auxname for datafile 8 TO '$ORACLE_HOME/dbs/tbs_08.f';
set auxname for datafile 9 TO '$ORACLE_HOME/dbs/tbs_09.f';
# Create the duplicate database. Issue the same command daily
# to re-create the database, thereby keeping the duplicate
# in sync with the target.
run {
# allocate auxiliary channels
allocate auxiliary channel dupdb1 type disk;
allocate auxiliary channel dupdb2 type disk;
allocate auxiliary channel dupdb3 type disk;
allocate auxiliary channel dupdb4 type disk;
duplicate target database to dupdb
logfile
group 1 ('$ORACLE_HOME/dbs/log_1_1.f',
'$ORACLE_HOME/dbs/log_1_2.f') size 200K reuse,
group 2 ('$ORACLE_HOME/dbs/log_2_1.f',
'$ORACLE_HOME/dbs/log_2_2.f') size 200K reuse;
} |