Duplicate database Using RMAN

6,536 views

Published on

Step by Step Tutorial for Duplicating a Database using RMAN within a same computer.

Published in: Technology, News & Politics

Duplicate database Using RMAN

  1. 1. Written By: Ahmer MansoorEmail : ahmer_mansoor@hotmail.comProfile : http://www.linkedin.com/in/ahmermansoor DUPLICATE A DATABASE USING RMANConsiderations: Operating System : Windows 7 Oracle Database : 11g Target Database : ORCL Auxiliary Database : CLONE1) Create Necessary Directories C:MKDIR %ORACLE_BASE%ORADATACLONE C:MKDIR %ORACLE_BASE%FLASH_RECOVERY_AREACLONE C:MKDIR %ORACLE_BASE%ADMINCLONE <Make sure the ORACLE_BASE environment variable is properly set.>2) Create SPFILE for CLONE. C:>SET ORACLE_SID=ORCL C:>SQLPLUS / AS SYSDBA SQL>STARTUP SQL>CREATE PFILE FROM SPFILE; <Creates ORACLE_HOMEDATABASEINITORCL.ORA> SQL> EXIT C:>COPY %ORACLE_HOME%DATABASEINITORCL.ORA %ORACLE_HOME%DATABASEINITCLONE.ORA <Make sure the ORACLE_HOME environment variable is properly set.> C:>NOTEPAD %ORACLE_HOME%DATABASEINITCLONE.ORA • Find & replace all occurances of orcl with clone. • Add Following Two Parameters o *.db_file_name_convert=orcl,clone o *.log_file_name_convert=orcl,clone • Save and Close File.3) Create Password File for CLONE C:>COPY %ORACLE_HOME%DATABASEPWDORCL.ORA %ORACLE_HOME%DATABASEPWDCLONE.ORA 1|Page
  2. 2. Written By: Ahmer MansoorEmail : ahmer_mansoor@hotmail.comProfile : http://www.linkedin.com/in/ahmermansoor4) Create Oracle Service for CLONE C:>ORADIM –NEW –SID CLONE5) Start Clone Database Instance C:>SET ORACLE_SID=CLONE C:>SQLPLUS / AS SYSDBA SQL>STARTUP NOMOUNT PFILE=%ORACLE_HOME%DATABASEINITCLONE.ORA SQL>CREATE SPFILE FROM PFILE; SQL>SHUTDOWN IMMEDIATE; SQL>STARTUP NOMOUNT;6) Listener Configuration C:>NOTEPAD %ORACLE_HOME%NETWORKADMINTNSNAMES.ORA Add following lines: CLONE = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = clONE) ) ) Use Oracle Net Manager to statically register the Instances with LISTENER. 2|Page
  3. 3. Written By: Ahmer MansoorEmail : ahmer_mansoor@hotmail.comProfile : http://www.linkedin.com/in/ahmermansoor Save Network Configuration & Exit. C:LSNRCTL STOP C:LSNRCTL START C:TNSPING CLONE <TO CHECK THE STATUS OF CLONE SERVICE>7) Use RMAN for Database Duplication C:>RMAN TARGET sys/oracle@ORCL AUXILIARY sys/oracle@CLONE RMAN> DUPLICATE TARGET DATABASE TO ‘CLONE’ FROM ACTIVE DATABASE; RMAN> EXIT 3|Page

×