Docstoc

R1211_clone_using_rman

Document Sample
R1211_clone_using_rman Powered By Docstoc
					                            Author – A.Kishore
                            http:/www.appsdba.info



This article details the steps used to clone R12.1.1 RAC database to Single
instance database using RMAN duplicate command, Notice that we used the
target control file as a catalog database and the Production will keep up and
running.


The databases used here are:

Production: RACDB

Cloned: RCLONE



1- On the source system; Run the preclone script on both database
and apps tiers.

   Database:

   $ cd ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME/
Author – A.Kishore
http:/www.appsdba.info
                      Author – A.Kishore
                      http:/www.appsdba.info
Application:

$ cd $ADMIN_SCRIPTS_HOME/

$ perl adpreclone.pl appsTier




2- Archive and move the Apps tier and Database home form the
   source to the target server:
                           Author – A.Kishore
                           http:/www.appsdba.info
        For the application tier:

        $ cd $APPL_TOP/../../..

        $ tar cvf - apps| gzip > /d03/oracle/apps_RACDB.tar.gz &

        For the database tier

        $ cd $ORACLE_HOME/..

        $ tar cvf – db | gzip > /d03/oracle/db_RACDB.tar.gz &



      3- Create full RMAN backup for the source database:

rman target /

run

{
allocate channel d1 type disk;
allocate channel d2 type disk;

backup format '/d03/oracle/RMAN_BACKUP/df_prodt%t_s%s_p%p.bak' database;

sql 'alter system archive log current';

backup format '/d03/oracle/RMAN_BACKUP/df_archive%t_s%s_p%p.arc' archivelog
all;

release channel d1; release channel d2;

}
                      Author – A.Kishore
                      http:/www.appsdba.info

4- Move the backup pieces generated from Rman to the target
   server to the same path or make a soft link as the same backup
   original path to let Rman see it.

Example $ ln –f -s /u02/RCLONE/backup /backup/MASTER/ERP.

5- Extract the archive files on the Target servers

   For the application tier:

   $ tar cvf - apps| gzip > apps_RACDB.tar.gz

   For the database tier

   $ tar cvf – db | gzip > db_RACDB.tar.gz

Note: The current path depends on your configuration.



6- On the target system; Run the preclone script on the database
   tier.

$ cd $ORACLE_HOME/appsutil/clone/bin

$ perl adcfgclone.pl dbTechStack

7- Edit the new created init file under $ORACLE_HOME/dbs to
   include the following parameters; Note we are using ASM as data
   storage:

_no_recovery_through_resetlogs=TRUE

db_file_name_convert =('+DATA1/prod', '/d01/RCLONE/oradata')

log_file_name_convert =('+DATA1/prod', '/d01/RCLONE/oradata')

8- On the target system; Startup the database on nomount state:

   $ export $ORACLE_SID=CPCLONE
                     Author – A.Kishore
                     http:/www.appsdba.info
  $ sqlplus / as sysdba

  SQL> startup nomount pfile=initCPCLONE.ora;

9- Make the production database accessible from the clone
   database:

  $ cd $TNS_ADMIN

  $ vi tnsnames.ora

  And insert the follow entries:

  PROD= (

  DESCRIPTION=

  (

  ADDRESS=(PROTOCOL=tcp)(HOST=gfmisdb1)

  (PORT=1521))

  (CONNECT_DATA=

  (SERVICE_NAME=PROD)

  (INSTANCE_NAME=PROD1)

  )

  )



10- Test the connection to the production database:

$ tnsping PROD

$ sqlplus apps/apps@PROD

11- Lunch rman to start the duplicate process:
                  Author – A.Kishore
                   http:/www.appsdba.info
$ export $ORACLE_SID=CPCLONE

$ rman target sys/sys@prod auxiliary /

    run

{

allocate auxiliary channel C1 device type disk;

allocate auxiliary channel C2 device type disk;

duplicate target database to cpclone;

release channel C1;

release channel C2;

}

12- Shutdown the cpclone database and edit the parameter file as:

          $ sqlplus / as sysdba

          $ shutdown abort;

          Edit the following parameters:

          undo_management to =MANUAL

          undo_tablespace=UNDOTBS1

13- Open the database in with resetlogs option:

          $ sqlplus / as sysdba

          Sql> startup mount;

          Sql> alter database open resetlogs;

          Sql> drop tablespace APPS_UNDOTS1 including contents;
                   Author – A.Kishore
                    http:/www.appsdba.info
         Sql> CREATE UNDO TABLESPACE APPS_UNDOTS1
         DATAFILE

         '/u02/CPCLONE/oradata/datafile/undo01.dbf' SIZE 4000M
         AUTOEXTEND

         ON NEXT 100M MAXSIZE 7000M

         ONLINE

         RETENTION NOGUARANTEE

         BLOCKSIZE 8K

         FLASHBACK ON;

         Then shutdown the database

         Sql> shutdown immediate;

14- Edit the parameter file:

         Remove _no_recovery_through_resetlogs=TRUE and edit

         undo_management=AUTO

         undo_tablespace=APPS_UNDOTS1

15- Change the database mode to be in no archive log mode:

         $ sqlplus / as sysdba

         Sql> startup mount;

         Sql> alter database noarchivelog;

         Sql> alter database open;

         Execute the following script

         Sql> @ $ORACLE_HOME/appsutil/install/[CONTEXT
         NAME]/ adupdlib.sql so
                     Author – A.Kishore
                      http:/www.appsdba.info
         Sql> create spfile from pfile.

         Sql> shutdown immediate;

         Sql> startup;

16- After the database opened; execute the following script:

         cd $ORACLE_HOME/appsutil/clone/bin

         perl adcfgclone.pl dbconfig
         $ORACLE_HOME/appsutil/$CONTEXT_NAME.xml

17- On the application tier run the following script:

         cd $COMMON_TOP/clone/bin

         perl adcfgclone.pl appsTier

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:8
posted:9/8/2012
language:English
pages:9