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.***

Wednesday, 7 March 2012

Create Duplicate Oracle Server

OS : Windows 2003 service pack 3
Oracle : 9i
Script : Applied and Tested
---------------------------------------------------------------------------------------------------------------------
1. Prepare new host of same OS and install oracle 9i (software only) on d: drive of new host.
2. Create a Database RMAN on New host using DBCA or at the time of oracle installation.
3. ‎Create new tablespace RTBS to keep catalog information separate.
SQL>create tablespace RTBS datafile 'H:\Oracle1\Oradata\RMAN\RTBS01.dbf' size 200m autoextend on;‎
4. Create user CATALOG on RMAN DB assigning default tablespace RTBS ‎to manage backup.‎
SQL>create user CATALOG identified by CATALOG
Temporary tablespace TEMP
Default tablespace RTBS
Quota‎ unlimited on RTBS;
5. Create recovery catalog and registered with the database rman
login to rman database as sysdba
SQL>create user catalog identified by catalog
Temporary tablespace TEMP
default tablespace RTBS
quota‎ unlimited on RTBS;‎
SQL>Grant connect, resource, recovery_catalog_owner to RMAN;‎
SQL>Exit
CMD>connect catalog/*****@RMAN
Create catalog
Exit
6. Steps to register recovery catalog with target database:‎
CMD>Connect Target Sys/Oracle@DTBR.world catalog catalog/catalog@RMAN
CMD>register database.‎
7. Configure the RMAN paramter to take full backup of original database.
CMD>RMAN TARGET SYS/*****@DTBR.world CATALOG catalog/catalog@RMAN
RMAN> backup database tag= First_full_DTBR_backup;
SQL> Alter system switch logfile;
RMAN> Backup Archivelog all TAG= First_full_DTBR_ARC;
RMAN>BACKUP DATABASE PLUS ARCHIVELOG;‎
8. Create Required directory on Duplicate host as similar to Original host.
NOTE: If Using Online Cloning then you must copy all the Archive log to the DUPLICATE Host computer in the similar location as in Original database.
9. Create Pfile with Original database and transfer it into duplicate host and edit it.
db_file_name_convert='G:\ORA_DBF_EXTENDED','D:\oracle\oradata\DTBR'
db_file_name_convert='F:\ORACLE\DTBR','D:\oracle\oradata\‎DTBR'‎
Note: no need to convert if you required same structure of original.
EDIT rest of the as per location Mentioned for Duplicate (if any change in location) such as dup destination, controlfile, archive etc.
Note: check the Pfile carefully specially these paramters:
compatible=
Db_name=
db_block_size=
remote_login_passwordfile=exclusive
10. create a password file for duplicate database (DTBR).
CMD>ORAPWD FILE=D:\oracle\ora92\database\PWDDTBR.ora PASSWORD=oracle entries=5
Note: Create password file in the duplicate host ORACLE-BASE directory. where the actual oracle software installed.
11. Edit the TNSNAME.ORA AND LISTENER.ORA by the adding
Note: check the listenr is started for duplicate database if getting problem use the
concept NET MANAGER for setting listener. Add the listener in Oracle-HOME Of duplicate
database original home (where the oracle software installed).
12. Create Service of Database for Windows:
CMD> ORADIM -NEW -SID DTBR -PFILE='D:\oracle\admin\DTBR\pfile\initDTBR.ora';
13. Start Duplicate Database in Nomount using this Pfile.
CMD> SET ORACLE_SID=DTBR
SQLPLUS / AS SYSDBA
databse connected in idle mode
-or-
SQL> STARTUP NOMOUNT PFILE='D:\oracle\admin\DTBR\pfile\initDTBR.ora‎'
SQL> CREATE SPFILE FROM PFILE='D:\oracle\admin\DTBR\pfile\initDTBR.ora‎';
CMD> RMAN TARGET SYS/****@DTBR.world CATALOG catalog/****@RMAN auxiliary SYS/****@DTBR
RMAN> DUPLICATE TARGET DATABASE TO DTBR NOFILENAMECHECK PFILE=D:\oracle\admin\DTBR\pfile\initDTBR.ora
After successfull Duplication you have to create temp file
select file_name from dba_data_files, dba_tablespaces where
dba_data_files.tablespace_name = dba_tablespaces.tablespace_name and dba_tablespaces.contents = 'TEMPORARY';
select * from dba_temp_files;
ALTER TABLESPACE TEMP
ADD TEMPFILE 'D:\ORACLE\ORADATA\DTBR\TEMP02.DBF' SIZE 15G
AUTOEXTEND ON NEXT 5M MAXSIZE 30G;

0 comments:

Post a Comment