In this document, we are going to
explain the step by step configuration details to duplicate a database from a
different previous incarnation without connecting to the target database.
I have seen many articles on google about this and found no article with the practical approach. Many articles described to duplicate the database without connecting to target database, but copying the backups to auxiliary database server. In this article, i will show you the practical approach how the backup available on tsm should be configured to be available to auxiliary server.
1.
Environment :
|
Environment
|
Host
|
Version
|
TSM
configuration
|
Rman
Catalog
|
TARGET
|
CRPROD
|
dbprl.askmlabs.com
|
11gR2
|
tsm5
|
rcatprod
|
AUXILIARY
|
CRPERF
|
dbrfl.askmlabs.com
|
11gR2
|
tsm6
|
rcatdev
|
Please
note here that the target environment is the environment which we use as source
to duplicate database and auxiliary database is the database which is to be
created by using the target database backups.
Please try to understand the complexity of the environment. Here, target database and auxiliary databases are configured with different tsm's. The target database backups are available on tsm5 and we need to present these backups to dbrfl server.
2.
Task :
We need to create a new duplicated database
CRPERF from the backups of CRPROD to a date prior to the point that it is
opened with resetlogs ie we need to duplicate CRPROD to CRPERF, to the
parent incarnation of the CRPROD. There are different approaches to complete
this task. In the present document, we are going to use "duplicating a
database without connecting to target database" as described in the oracle
documentation here.
RMAN> list incarnation of database crprod;
List of Database Incarnations
DB Key Inc
Key DB Name DB ID STATUS
Reset SCN Reset Time
------- ------- -------- ---------------- ---
---------- ----------
2721859 2721860 CRPROD 1190017710 PARENT
1 18-MAR-11
2721859 233687610 CRPROD 1190017710 CURRENT 2321471232053 21-MAR-14
CRPROD is opened with reset logs on
21-MAR-2014 and it started a new incarnation. Our aim is to restore and recover
the CRPROD as of time 13-MAR-2014. The time 13-MAR-2014 is not in the current
incarnation and it is in the parent incarnation. We will get the following
error if we try to duplicate the database connecting to target database
RMAN-06004: ORACLE error from recovery catalog
database: RMAN-20207: UNTIL TIME or RECOVERY WINDOW is before RESETLOGS time
3.
Procedure
3.1
Prepare auxiliary environment :
Calculate the space requirements and
make sure you have enough space available for duplicating database.
Prepare init.ora file for auxiliary
database and make sure you include following two variables in the init.ora
file.
db_file_name_convert
=("/u02/oradata/crprod/", "/u02/oradata/crperf/")
log_file_name_convert
=("/u02/oradata/crprod/", "/u02/oradata/crperf/")
Please refer to my other article for detailed steps on how to configure environment for duplication RMAN DUPLICATION FROM TAPE BACKUPS.
3.2
Configure TSM on auxiliary environment:
The tsm backups for production are
available on tsm5 where as the CRPERF environment is configured to have its
backups on tsm6. So we need to complete the following configuration to make
sure that the production backups available on tsm5 are available to crperf
servers.
Create
a temporary directory on dbrfl.askmlabs.com to keep all the tsm5
configuration files.
mkdir $HOME/dup_perf
Copy the following files to the
directory created above from the server dbprl.askmlabs.com.
- dsm.opt.tsm5 ( This configuration file specified whether
tsm backups are on tsm5 or tsm6)
- CRPROD_tdpo.opt ( tsm tape configuration files to
connect to the tsm5)
- TDPO.tdpdbprl ( password files from production dbprl.askmlabs.com )
Now create the following symlinks to
point the configuration files.
$ cd $HOME/dup_perf
$ ln -s dsm.opt.tsm5 dsm.opt
$ ln -s /opt/tivoli/tsm/client/ba/bin/dsm.sys dsm.sys
Now the directory $HOME/dup_perf should look as below ...
[oracle@dbrfl ~]$ ls -lrt /home/oracle/dup_perf
total
32
-rw-r--r--
1 oracle dba 48 Mar 27 16:34
TDPO.tdpdbprl
-rw-r--r--
1 oracle dba 744 Mar 27 16:39 dsm.opt.tsm5
lrwxrwxrwx
1 oracle dba 12 Mar 27 16:40 dsm.opt
-> dsm.opt.tsm5
lrwxrwxrwx
1 oracle dba 37 Mar 27 16:40 dsm.sys
-> /opt/tivoli/tsm/client/ba/bin/dsm.sys
-rwxr-xr-x
1 oracle dba 693 Mar 27 16:45 CRPROD_tdpo.opt
[oracle@dbrfl ~]$
Edit the CRPROD_tdpo.opt file to point
the password file(TDPO_PSWDPATH) and DSM configuration files (DSMI_ORC_CONFIG ) to
the location created above.
DSMI_ORC_CONFIG
/home/oracle/ dup_perf/dsm.opt
TDPO_PSWDPATH
/home/oracle/ dup_perf
Execute the following command to verify
the tsm configuration on perf server :
# tdpoconf showenv -TDPO_OPT=/home/oracle/ dup_perf /CRPROD_tdpo.opt
( in the output verify the details Server Name , Server Address and Node
Name that they are reflecting the correct values)
3.3
Execute the duplicate command :
Connect to the production database and
get the database id which will be used in the rman duplication command.
Connect to the auxiliary database server
and start the database in nomount.
Connect to the rman as below ( NOTE : we
are not connecting to the target database)
rman auxiliary /
catalog rmancat/xxxxxxxx@rcatprod
RMAN> run {
configure auxiliary channel 1 device type sbt
parms="ENV=(TDPO_OPTFILE=/home/oracle/dup_perf /CRPROD_tdpo.opt)";
DUPLICATE DATABASE crprod DBID 1895637710 to crperf
until time "TO_DATE('03/13/2014', 'MM/DD/YYYY')" NOFILENAMECHECK;
}
4.
Verification:
Connect to the newly duplicated database
and exeucute the following commands
SQL> select instance_name,status from v$instance;
SQL> select created from v$database;
SQL> archive log list; ( disable archive log if it is enabled)
5.
Post Duplication Steps :
Register the CRPERF database with the RMAN
dev catalog.
Contact me if you have any doubts in this process.
Hope this helps
SRI