Clone production database | dbazone

Clone production database

Posted on January 19th, 2010 in Installation ,

Database cloning is a procedure to create an exact copy of a database.
As an oracle DBA,you  have to update test or development environments from production database using database cloning procedure.

Following is the steps to clone oracle database.

1. Take a copy of the production database’s initialization file .
2. Take a backup of the production database’s control file using the following command on SQL prompt( Sign in as SYSDBA)
SQL>alter database backup controlfile to trace;
This command will create trace file in udump folder.

3. FTP the new initialization file and  trace file  created on step 2 to destination server into temp folder.
4. Shutdown the production database
5. Copy all datafiles from production server  to new server using rcp command
rcp /u01/oradata/oldsid/* newhost:/u01/oradata/newsid
rcp /u01/oradata/oldsid/* newhost:/u01/oradata/newsid
rcp /u03/oradata/oldsid/* newhost:/u03/oradata/newsid
rcp /u04/oradata/oldsid/* newhost:/u04/oradata/newsid
Please note that you must edit the control file created at sept 2 and modify the new datafile name.

6.Edit control file  on new server and make the modifications as follows

a) CREATE CONTROLFILE REUSE DATABASE “<old db name>” NORESETLOGS
TO
CREATE CONTROLFILE SET DATABASE “<new db name>” RESETLOGS ARCHIVELOG

b) Remove the “recover database” and “alter database open statement” from the control file.
c) Rename the datafile name as stored on the new server.
7. Save the control file as clone_dbname_server.sql
8. Create the required directories like bdump ,cdump,udump,pfile etc.
cd /u01/app/oracle/
mkdir newsid
cd newsid
mkdir bdump
mkdir cdump
mkdir udump
mkdir pfile
9. Copy the initialization file from temp folder which was  copied from production at step 3  to pfile folder.
10. Edit the initialization file make the necessary modification of parameters like log_archieve_dest_1 ,bdump,cdump etc.
11. Start the new instance on nomount mode with the following command.
sqlplus
startup nomount pfile=<complete path of filename>

12. On SQL prompt execute the command as @<controlfile with complete path>
13. Alter database mount
14. alter database archievelog
15. Alter database open

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Related posts:

  1. Create Oracle Database Manually As being an Oracle DBA , we can create database...
  2. Recover database when all control file and Redo log files are lost As an Oracle DBA , Recover database and maintain high...
  3. Oracle Installation One of the most important duties of an Oracle DBA...

Related posts brought to you by Yet Another Related Posts Plugin.

Published by Paresh Sarma

Leave a Comment

Follow dbazonein on Twitter
Increase Google Page Rank