Search This Blog

Monday, March 20, 2017

RMAN Active database duplication

Hello Everyone,

Below is tested in my environment and i have done refresh successfully using this method. Following will be Active database duplication. Here i have done the refresh for oracle e-business suite.


DB CLONING – RMAN Active Duplication


Source
Target
Host name
ORAPROD
ORACLONE
Instance name
PROD
CLONE






Preclone in Prod dbTier : 

Go to /u01/oracle/PROD/11.2.0/appsutil/scripts/PROD_oraprod

Perl adpreclone.pl dbTier

Please make sure stage created successfully.

Login to clone server :

Create directory for clone oracle home.

Mkdir –p /a02/oraclone/CLONE/11.2.0
Mkdir –p /a02/oraclone/CLONE/data

Copy oracle home from prod to clone server.

(Note : Copy only oracle home, don’t copy any db files since we will duplicating the db through RMAN.)

Adcfgclone in CLONE server :

Once oracle home copied to clone server, Execute the below.

Go to $ORACLE_HOME/clone/bin

Perl adcfgclone.pl dbTechStack

dbTechSTack – It will configure the clone oracle home and will make necessary directories and configuration files for clone instance.
Once adcfgclone.pl completes successfully, we can get the env file clone instance under $ORACLE_HOME. We can use the populated env file for clone instance.


TNSNAMES.ORA :

Make sure both servers able to ping with each other. Add the both instance tns entries in both tnsnames.ora

Prod :

PROD=
        (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=oraprod.ebs.com)(PORT=1521))
            (CONNECT_DATA=
                (SERVICE_NAME=PROD)
                (INSTANCE_NAME=PROD)
            )
        )

CLONE = (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=oraclone)(PORT=1542))
                (CONNECT_DATA=(SID=CLONE))
            )

Clone :

CLONE = (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=oraclone)(PORT=1542))
                (CONNECT_DATA=(SID=CLONE))
            )

PROD=
        (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=oraprod.ebs.com)(PORT=1521))
            (CONNECT_DATA=
                (SERVICE_NAME=PROD)
                (INSTANCE_NAME=PROD)
            )
        )

Orapwd creation :

Please make sure both oracle homes have password file with same password.
orapwd file=$ORACLE_HOME/dbs/orapwPROD password=sys123 entries=4
orapwd file=$ORACLE_HOME/dbs/orapwCLONE password=sys123 entries=4

Please read my blog once before you do the above. It may be helpful to create password file.
http://sikkyappsdba.blogspot.com/2016/10/ora-01994-grant-failed-password-file.html

Pfile creation :

If prod is running with spfile create a pfile from spfile and scp it to clone server.

$sqlplus / as sysdba
SQL > create pfile from spfile;

Scp pfile to $ORACLE_HOME/dbs to clone server.

Edit the pfile and update the below parameters.

db_name                         = CLONE
control_files                   = /a02/oraclone/CLONE/data/cntrl01.dbf,/a02/oraclone/CLONE/data/cntrl02.dbf,/a02/oraclone/CLONE/data/cntrl03.dbf
db_file_name_convert='/u01/oracle/PROD/data','/a02/oraclone/CLONE/data'
log_file_name_convert='/u01/oracle/PROD/data','/a02/oraclone/CLONE/data'

Clone instance :

Once pfile is created start the instance in nomount.
sqlplus / as sysdba
startup nomount pfile=initCLONE.ora

RMAN Connectivity :

Check whether you are able to connect to both database through RMAN.
Rman> connect target sys/sys123@PROD
RMAN> connect auxiliary sys/sys123@CLONE

Rman command to trigger active duplication :


Script :

bash-3.2$ cat active_dup.rcv
connect auxiliary sys/change_on_install@DEV
RUN
{
duplicate target database to 'oradev' FROM ACTIVE DATABASE;
}


RMAN will do the refresh and will open the database. It is recommended to Create spfile once and bounce the database.

No comments:

Post a Comment

You cannot complete this task because one of the following events caused a loss of page data: A system failure has occurred "Front end is locked after 12.2 upgrade"

  If you have upgraded to Oracle E-Business Suite 12.2.10 Release Update Pack from Oracle E-Business Suite 12.2.6 Release Update Pack (or ea...