Monday, January 25, 2010

Old fashion database cloning with RMAN.



I used to do this a few times a day in 2005-2008. Oracle 10.1 was glorious back then. Somedays, I lost track of what incremental number I need to use for my next target database.


In this example, dupr7710 is the auxiliary and qa7710 is the target.

Pre-RMAN requirements


1) a backup of the source database AKA target


RMAN> list backup;

2) set the tnsnames.ora


3) set the oratab


4) create all necessary directories in /oracle/product/admin/dbname/


5) create orapwd


e.g:
orapwd file=/oracle/product/9.2.0.1/dbs/orapwDUP password=password entries=10

6) target in mount mode


7) auxiliary in nomount mode


** beware of compatibility of oracle version

Making the connections

. oraenv
<to auxiliary>

/stage/conversion/Install_10:(dupr7710)$

rman
Recovery Manager: Release 10.1.0.5.0 - Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
RMAN> connect auxiliary /
connected to auxiliary database: dupr7710 (not mounted)
RMAN> connect target sys@qa7710
target database Password:
connected to target database: QA7710 (DBID=3895033173)

Performing the duplication using pfile


RMAN>
run {
allocate channel ch1 type disk;
allocate auxiliary channel ch3 type disk;
duplicate target database to dupr7710 pfile=/oracle/product/admin/dupr7710/pfile/initdupr7710.ora;

}

Playing with my thumbs and move on to other database cloning ....

No comments:

Post a Comment