Sunday, September 26, 2010

Cloning an 11g ASM database to an 11g ASM database on different Host

I am going to clone (i.e. duplicate) a database residing on host A to a different host B. Both databases have thier datafiles, online redo logs, control files, archive logs on ASM.



HOST A:

The source database is on Host A. Its name is 'SOURCE'. It has also a diskgroup called '+DATA'. All the data files, control files, online redo logs and archive logs are in this group.

I have taken its full database backup with archive logs, and have also created a pfile from its spfile.

I have transfered this backup and pfile to Host B, where I will create the duplicate database.

Host B:

The backup from Host A has been copied to the same directory structure as of Host B, so I dont have to configure channel in the RMAN.

On this host, I already have created the ASM instance and its running. It has also a diskgroup called '+DATA'. All the data files, control files, online redo logs and archive logs will be in this group.

I will create the duplicate database with name 'CLONE'.

Create adump, bdump, udump, and cdump directories for the CLONE database, and change the paths to these directories in the pfile you brought from the source database.

Also CONTROL_FILES parameter would be:

CONTROL_FILES='+DATA'

Other parameters to change are:

DB_NAME=CLONE

DB_UNIQUE_NAME=CLONE

DB_FILE_NAME_CONVERT='SOURCE','CLONE'

LOG_FILE_NAME_CONVERT='SOURCE','CLONE'

Place the pfile in

Now, export the instance, and create the password file.

export ORACLE_SID=CLONE

and then create the password file, orapwd file=$ORACLE_HOME/dbs/orapwCLONE password=

and in sqlplus do:

sqlplus '/ as sysdba'

SQL> startup nomount

exit

and in RMAN duplicate the database:

$ rman target sys@source nocatalog auxiliary /

rman> duplicate target database to 'CLONE';

It will run to completion.


No comments: