How to duplicate a database FROM ACTIVE DATABASE with rman for 11g version without backup.


 

 

 

Sumary:


With this method we do not need a previous backup from the source database. The database cloning is performed through the network using rman script.
Is important that source database be in archive mode and both databases (source and target databases) are of 11g version onwards.
For this scenario the source database and destination database will have the same directory structure for control file, datafiles, redologs and tempfiles.



1- This is the information for two database environtments :

Primary server : 10.1.0.1
target server     : 10.1.0.2 (Destiny server)
Primary DB     : TST
Target DB        : TSTAUX  (Database to be copied)



2- In both servers under $ORACLE_HOME/network/admin in tnsnames.ora set the following entries :

TST_DB=
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.0.1)(PORT = 1529))
    (CONNECT_DATA =
      (SID = tst)
    )
  )


TSTAUX_DB=
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.0.2)(PORT = 1529))
    (CONNECT_DATA =
      (SID = tstaux)
    )
  )

3- You'll need a password file under $ORACLE_HOME/dbs (if is not already there) in primary server.

orapwd file=orapwTST password=password1 entries=30


Copy this "orapwTST" file from $ORACLE_HOME/dbs from primary server to stand-by server under same location with "orapwTSTAUX" name.
On TST database, database sys password MUST be same than orapwTST that you created.

4- On the TSTAUX server under $ORACLE_HOME/dbs create pfile/spfile.
   You could use same spfile from TST database, but you'll need to change db_name to tstaux in target  database in that case.


5- TST database must be in archive mode, in case not do the following :

    shutdown immediate
    startup mount;
    alter database archivelog;
    alter database open;


6- Connect to TSTAUX database server annd perform a startup nomount

    export ORACLE_SID=tstaux
    sqlplus / as sysdba
    startup nomount


7- On tst database connect with rman :

rman target sys/password1@TST_DB  auxiliary sys/password1@TSTAUX_DB


8- From tst server execute rman command duplicate :

run {
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate channel prmy3 type disk;
allocate channel prmy4 type disk;
allocate auxiliary channel stby type disk;

DUPLICATE TARGET DATABASE TO tstaux FROM ACTIVE DATABASE NOFILENAMECHECK;

release channel prmy1;
release channel prmy2;
release channel prmy3;
release channel prmy4;
release channel stby;
}

Comments