Search

Join this Blog for direct reference of any post into your inbox. To join just click on "Join this Site" under "Follower" then Login with your Email.*** DECLARATION: I Maintain this Blog for Helping Myself While at Work and Welcome any body Needing Help!!!.*** CAUTION: Using any of the script from this Blog may contain at Own Risk. These scripts May or May not have been Tested.***

Tuesday, 15 May 2012

Re-synchronizing Duplicate Database

Database: Oracle 9i
OS: Windows 2003 Sever
Backup used: Rman Full Backup
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
You may want to synchronize a duplicate database with the original database that was duplicated. The only solution is to run the DUPLICATE DATABASE command again, essentially re-creating the duplicate database. This technique requires making complete copies of the datafiles of the duplicate database.
In this example, RMAN connects to the database on original host_Dbserver as its target database and the duplicate database on host_ITBackup as an auxiliary database.
The example uses the DUPLICATE DATABASE command to transfer complete copies of all updated datafiles from the source database to the duplicate site. This example makes the same assumptions about file names, locations, and the datafiles to be duplicated.
As an initial setup step, the CONFIGURE command is used to set persistent new names for the datafiles. These new names are recorded in the control file and used every time you perform the duplication in the future.
The script shown in Example below performs one-time setup of the names for the datafiles.
# start RMAN and then connect to the target and auxiliary databases    
CONNECT TARGET sys/****@sadhan.world;
CONNECT CATALOG catalog/****@rman1;
CONNECT AUXILIARY SYS/****@sadhan;
# configure auxiliary names for the datafiles only once    
CONFIGURE AUXNAME FOR DATAFILE 1 TO 'D:\ORACLE\ORADATA\SADHAN\SYSTEM01.DBF';
CONFIGURE AUXNAME FOR DATAFILE 2 TO 'D:\ORACLE\ORADATA\SADHAN\UNDOTBS01.DBF';
CONFIGURE AUXNAME FOR DATAFILE 3 TO 'D:\ORACLE\ORADATA\SADHAN\EXAMPLE01.DBF';
CONFIGURE AUXNAME FOR DATAFILE 4 TO 'D:\ORACLE\ORADATA\SADHAN\INDX01.DBF';
CONFIGURE AUXNAME FOR DATAFILE 5 TO 'D:\ORACLE\ORADATA\SADHAN\USERS01.DBF';
CONFIGURE AUXNAME FOR DATAFILE 6 TO 'D:\ORACLE\ORADATA\SADHAN\SDH_TIMS01.DBF';
CONFIGURE AUXNAME FOR DATAFILE 7 TO 'D:\ORACLE\ORADATA\SADHAN\SDH_TIMS02.DBF';
CONFIGURE AUXNAME FOR DATAFILE 8 TO 'G:\ORA_DBF_EXTENDED\SDH_HRMS01.DBF';
CONFIGURE AUXNAME FOR DATAFILE 9 TO 'F:\ORACLE\SADHAN\SDH_EDSS01.DBF';
CONFIGURE AUXNAME FOR DATAFILE 10 TO 'G:\ORA_DBF_EXTENDED\SDH_SHTR01.DBF';
CONFIGURE AUXNAME FOR DATAFILE 11 TO 'D:\ORACLE\ORADATA\SADHAN\SDH_FIN01.DBF';
CONFIGURE AUXNAME FOR DATAFILE 12 TO 'F:\ORACLE\SADHAN\SDH_EDSS02.DBF';
CONFIGURE AUXNAME FOR DATAFILE 13 TO 'D:\ORACLE\ORADATA\SADHAN\INDX02.DBF';
# Do not set a newname for datafile 5, because it is in the tools tablespace and in this example you are excluding tools from the duplicate database.
CONFIGURE AUXNAME FOR DATAFILE 6 onwards TO '/oradata7/users01.dbf';
Syncrhonizing the Duplicate With the Target Using Auxnames
# start RMAN and then connect to the target and auxiliary databases    
CONNECT TARGET SYS/****@SADHAN.WORLD CATALOG CATALOG/****@RMAN1 AUXILIARY SYS/****@SADHAN;
# Create the duplicate database. Run the same command periodically to re-create the database, thereby keeping the duplicate in sync with the target.
DUPLICATE TARGET DATABASE TO sadhan
SKIP TABLESPACE tools
  LOGFILE
    GROUP 1 ('D:\ORACLE\ORADATA\SADHAN\REDO01.LOG','E:\ORACLE\ORADATA\SADHAN\REDO01B.LOG') SIZE 100M REUSE,
    GROUP 2 ('D:\ORACLE\ORADATA\SADHAN\REDO02.LOG','E:\ORACLE\ORADATA\SADHAN\REDO02B.LOG') SIZE 100M REUSE,
    GROUP 3 ('D:\ORACLE\ORADATA\SADHAN\REDO03.LOG','D:\ORACLE\ORADATA\SADHAN\REDO03B.LOG') SIZE 100M REUSE;
Verify the Synchronization
  1. Compare and verify the change of size in datafiles.
  2. Query a record which is committed after the last sync.

3 comments:

  1. how much time it will take to resync the duplicate to target ? will the resync process take same time as it takes to originally create a duplicate ?

    ReplyDelete
    Replies
    1. Dear,
      Re-sync time is fully depends on database size (datafiles size). Offcourse not incase of ‎duplication all the datafiles is going to re-create where as in case of re-sync only changed ‎datafiles is going to modified. Thus re-sync will take less time otherwise there is no use ‎of this facility.‎

      Delete
  2. Hi here the logfile represents to which database.

    duplicate
    logfile??????

    ReplyDelete