9 Replies Latest reply: Oct 20, 2013 8:51 PM by kevin.mills RSS

    rman duplication of database to the same server and same disk group

    user10162619
      Hi,

      We have multiple databases - rmsprd1 and oidprd1 on asm disk groups - ASMDG_DAT01 and ASMDG_FRA01 on a server.

      Both these databases are single instance asm based databases.

      I am trying to do a rman duplication from rmsprd1 to rmsprd2 in the same server. I intend to use the same asm disk groups - ASMDG_DAT01 and ASMDG_FRA01.

      Is this possible ?

      Currently I have the following structure

      +ASMDG_DAT01/RMSPRD1/DATAFILE
      +ASMDG_DAT01/RMSPRD1/CHANGETRACKING/
      +ASMDG_DAT01/RMSPRD1/CONTROLFILE/
      +ASMDG_DAT01/RMSPRD1/DATAFILE/
      +ASMDG_DAT01/RMSPRD1/ONLINELOG/
      +ASMDG_DAT01/RMSPRD1/PARAMETERFILE/
      +ASMDG_DAT01/RMSPRD1/TEMPFILE/

      +ASMDG_FRA01/RMSPRD1/AUTOBACKUP/
      +ASMDG_FRA01/RMSPRD1/BACKUPSET/
      +ASMDG_FRA01/RMSPRD1/CONTROLFILE/
      +ASMDG_FRA01/RMSPRD1/DATAFILE/
      +ASMDG_FRA01/RMSPRD1/ONLINELOG/

      Will I be able to create something like
      +ASMDG_DAT01/RMSPRD2/DATAFILE
      +ASMDG_DAT01/RMSPRD2/CHANGETRACKING/
      +ASMDG_DAT01/RMSPRD2/CONTROLFILE/
      +ASMDG_DAT01/RMSPRD2/DATAFILE/
      +ASMDG_DAT01/RMSPRD2/ONLINELOG/
      +ASMDG_DAT01/RMSPRD2/PARAMETERFILE/
      +ASMDG_DAT01/RMSPRD2/TEMPFILE/

      +ASMDG_FRA01/RMSPRD2/AUTOBACKUP/
      +ASMDG_FRA01/RMSPRD2/BACKUPSET/
      +ASMDG_FRA01/RMSPRD2/CONTROLFILE/
      +ASMDG_FRA01/RMSPRD2/DATAFILE/
      +ASMDG_FRA01/RMSPRD2/ONLINELOG/

      I know that I can create a different asm disk group for the rman duplication but this is proving to be a hassle.

      Thanks
      Sandeep
        • 1. Re: rman duplication of database to the same server and same disk group
          415289
          I am trying to do a rman duplication from rmsprd1 to rmsprd2 in the same server. I intend to use the same asm disk groups - ASMDG_DAT01 and ASMDG_FRA01.
          Is this possible ?
          Yes,its possible.

          you can get detail of rman cloning from below guide

          http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmdupdb.htm#i1008564
          • 2. Re: rman duplication of database to the same server and same disk group
            Suraj R-OC
            Hello,

            Requesting to refer the metalink note Performing duplicate database with ASM/OMF/RMAN [ID 340848.1] about this. …


            Regards
            Suraj
            • 3. Re: rman duplication of database to the same server and same disk group
              user10162619
              Hi Kuljeet,

              Thanks for your reply. But I am finding a hard time finding the steps required for ASM to same ASM diskgroup duplication on the same server in the url provided by you.

              Do you by chance have exact steps ?

              Thanks
              Sandeep
              • 4. Re: rman duplication of database to the same server and same disk group
                user10162619
                Hi Suraj,

                Thanks for your reply. But I am finding a hard time finding the steps required for ASM to same ASM diskgroup duplication on the same server in the url provided by you.

                Do you by chance have exact steps ?

                Thanks
                Sandeep
                • 5. Re: rman duplication of database to the same server and same disk group
                  user10162619
                  Hi,

                  I have found the answer working with Oracle via a service request. Admittedly there was no direct oracle documentation for doing this and hence documenting the steps here.
                  No legalities, formalities involved please.

                  Here are the steps - rmsprd1 is the source, rmsprd2 is the target, +ASM is the asm instance supporting both rmsprd1 and rmsprd2. The intention is to put both the source and destination in the same server. The backupset backup in location /dbaadm/sandeep_rman_refresh will be used for the duplication.

                  1) Take rman backupset backup of the source database - rmsprd1
                  rman_take_backup.ksh ( Take backup of source - rmsprd1 using rman ). The contents of the rman_take_backup.sh script are given below :

                  rm /dbaadm/sandeep_rman_refresh/*

                  export NLS_DATE_FORMAT='YYYY-MM-DD:HH24:MI:SS'

                  rman target / <<EOF

                  run

                  {

                  allocate channel d1 device type disk format '/dbaadm/sandeep_rman_refresh/%U';
                  allocate channel d2 device type disk format '/dbaadm/sandeep_rman_refresh/%U';
                  allocate channel d3 device type disk format '/dbaadm/sandeep_rman_refresh/%U';
                  allocate channel d4 device type disk format '/dbaadm/sandeep_rman_refresh/%U';
                  allocate channel d5 device type disk format '/dbaadm/sandeep_rman_refresh/%U';
                  allocate channel d6 device type disk format '/dbaadm/sandeep_rman_refresh/%U';

                  CONFIGURE CONTROLFILE AUTOBACKUP ON;
                  CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/dbaadm/sandeep_rman_refresh/%F';
                  backup as backupset database plus archivelog tag 'clonebackupset';

                  }
                  EOF

                  2) Make the directories for destination database ( rmsprd2 )
                  /opt/oracle/admin> mkdir -p rmsprd2/adump rmsprd2/dpdump rmsprd2/pfile rmsprd2/scripts

                  3) Create pfile from rmsprd1 spfile. copy/rename the pfile to make a pfile for rmsprd2.
                  4) Edit listener.ora in ASM ORACLE_HOME and edit tnsnames.ora in DB ORACLE_HOME
                  listener.ora
                  LISTENER_RMSPRD2 =
                  (DESCRIPTION_LIST =
                  (DESCRIPTION =
                  (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
                  (ADDRESS = (PROTOCOL = TCP)(HOST = kirkjerpdb01.kirklands.com)(PORT = 1522))
                  )
                  )
                  SID_LIST_LISTENER_RMSPRD2 =
                  (SID_LIST =
                  (SID_DESC =
                  ( ORACLE_HOME = /opt/oracle/product/11.2.0/db_1 )
                  ( SID_NAME = rmsprd2 )
                  )
                  )

                  ADR_BASE_LISTENER_RMSPRD2 = /opt/oracle

                  ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_RMSPRD2=ON # Section added by Sandeep
                  SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER_RMSPRD2=OFF
                  ADMIN_RESTRICTIONS_LISTENER_RMSPRD2=ON


                  tnsnames.ora ( http://francispaulraj.wordpress.com/ora-12528-tnslistener-all-appropriate-instances-are-blocking-new-connections/ )
                  RMSPRD2 =
                  (DESCRIPTION =
                  (ADDRESS = (PROTOCOL = TCP)(HOST = kirkjerpdb01.kirklands.com)(PORT = 1522))
                  (CONNECT_DATA =
                  (SERVER = DEDICATED)
                  (SERVICE_NAME = rmsprd2)
                  (UR = A)
                  )
                  )
                  5) Build a passwordfile ( I just copied and renamed it )
                  6) Edit /etc/oratab to add database entry for rmsprd2
                  7) Set the environment for rmsprd2
                  . oraenv
                  rmsprd2
                  8) Startup nomount of rmsprd2
                  sqlplus / as sysdba
                  startup nomount pfile=/opt/oracle/admin/rmsprd2/pfile/initrmsprd2.ora
                  9) Create spfile from pfile='/opt/oracle/admin/rmsprd2/pfile/initrmsprd2.ora';
                  10) shutdown and startup rmsprd2 with spfile
                  SQL> shutdown abort;
                  ORACLE instance shut down.
                  SQL> startup nomount;
                  ORACLE instance started.

                  Total System Global Area 1068937216 bytes
                  Fixed Size 2213632 bytes
                  Variable Size 788531456 bytes
                  Database Buffers 268435456 bytes
                  Redo Buffers 9756672 bytes
                  11) We are now ready for duplication from rmsprd1 ( source ) to rmsprd2 ( destination ) both using +ASM standalone asm instance. set the environment to rmsprd1and fire away.
                  Please note that the duplicate script is only connecting to auxilary database ( rmsprd2 ) and using the backup location for the duplication.

                  I used a unix shell script -rman_duplicate_from_backup.ksh. The contents are given below :
                  $ORACLE_HOME/bin/rman auxiliary sys/prd123@rmsprd2 log=rman_duplicate_from_backup.log << EOF
                  run
                  {
                  allocate auxiliary channel d1 device type disk;
                  allocate auxiliary channel d2 device type disk;
                  allocate auxiliary channel d3 device type disk;
                  allocate auxiliary channel d4 device type disk;
                  allocate auxiliary channel d5 device type disk;
                  allocate auxiliary channel d6 device type disk;
                  DUPLICATE DATABASE TO rmsprd2
                  BACKUP LOCATION '/dbaadm/sandeep_rman_refresh';
                  }
                  EOF

                  12) Voila - the rmsprd1 to rmsprd2 is done.....

                  Hope this helps somebody else wanting to do the same excercize. Have Fun.....

                  regards
                  Sandeep
                  • 6. Re: rman duplication of database to the same server and same disk group
                    user10162619
                    This question is resolved....

                    Sandeep
                    • 7. Re: rman duplication of database to the same server and same disk group
                      sachin_uk
                      Hi,

                      Do you happen to have the contents of your Auxiliary pfile?

                      Thanks
                      • 8. Re: rman duplication of database to the same server and same disk group
                        user10864391
                        Hi,
                        I want to do the same thing. I have a question ..What is the location of the duplicated datafiles when you execute the duplicate command(How do you determine the location of duplicated datafiles)? Is there any risk overwriting the source datafiles? I thing the path of the datafiles are determined in the spfile..So when you copy the spfile from the source database you must change it somehow to restore the datafiles in the desired paths.

                        In your case:
                        +ASMDG_DAT01/RMSPRD2/DATAFILE
                        +ASMDG_DAT01/RMSPRD2/CHANGETRACKING/
                        +ASMDG_DAT01/RMSPRD2/CONTROLFILE/
                        +ASMDG_DAT01/RMSPRD2/DATAFILE/
                        +ASMDG_DAT01/RMSPRD2/ONLINELOG/
                        +ASMDG_DAT01/RMSPRD2/PARAMETERFILE/
                        +ASMDG_DAT01/RMSPRD2/TEMPFILE/

                        +ASMDG_FRA01/RMSPRD2/AUTOBACKUP/
                        +ASMDG_FRA01/RMSPRD2/BACKUPSET/
                        +ASMDG_FRA01/RMSPRD2/CONTROLFILE/
                        +ASMDG_FRA01/RMSPRD2/DATAFILE/
                        +ASMDG_FRA01/RMSPRD2/ONLINELOG/

                        How did you managed to restore the datafiles in the above paths? Thank you!!
                        • 9. Re: rman duplication of database to the same server and same disk group
                          kevin.mills

                          This is over a year old, but just in case someone else is coming through the forums looking to duplicate a database in an ASM/OMF environment.  This is taken care of automatically when you duplicate the database.  The dbname and db_create_file_dest parameters in the copied pfile/spfile are used to determine the location of the files in a ASM/OMF environment.