Tuesday, January 24, 2006

Oracle: Rman: Duplicate database on remote site

1) create a password file for duplicate instance(since you will connect as sysdba)
orapwd file=/u01/app/oracle/product/9.2.0.1.0/dbs/orapwDUP password=password entries=10

2) edit listener.ora and tnsnames.ora to make sure dup instance can be accessed from network.

3) create pfile with minimum requirement.
# Minimum Requirement.
DB_NAME=DUP
CONTROL_FILES=(/u02/oradata/DUP/control01.ctl,
/u02/oradata/DUP/control02.ctl,
/u02/oradata/DUP/control03.ctl)

# Convert file names to allow for different directory structure.
DB_FILE_NAME_CONVERT=(/u02/oradata/TSH1/,/u02/oradata/DUP/)
LOG_FILE_NAME_CONVERT=(/u01/oradata/TSH1/,/u01/oradata/DUP/)

# make sure block_size and compatible parameters
# match if you are not using the default.
DB_BLOCK_SIZE=8192
COMPATIBLE=9.2.0.0.0

4) create spfile from pfile and start instance
sqlplus /nolog
conn / as sysdba
CREATE SPFILE FROM PFILE='/u01/app/oracle/admin/DUP/pfile/init.ora';
STARTUP FORCE NOMOUNT;

5) Backup original database
rman target / catalog rman/cat@oem
rman> backup database
rman> backup archivelog all delete input

6) duplicate database
man TARGET sys/password@tsh1 CATALOG rman/rman@tshadm AUXILIARY /
DUPLICATE TARGET DATABASE TO DUP;
or
# Duplicate database to TARGET's state 4 days ago.
DUPLICATE TARGET DATABASE TO DUP UNTIL TIME 'SYSDATE-4'

0 Comments:

Post a Comment

<< Home