MANUALLY CLONE DATABASE
To clone a database manually, we need first use the operating system(OS) to copy all of the source database files to the target location.
If we are on the same server we need to change the name of the database. If we are on a different server we can keep the database name as it is.
We should first backup the source database control file to trace using the statement
SQL>ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
Using the trace file contents create a new control file that will help us create the new clone database.
Steps to Manually Clone a Database :
We follow the steps given below assuming that our source database is the production database named "prod" and our destination (target) database is the database named "test".
1) Copy the prod database files to the target location
2) Prepare a text file for the creation of a control file or the new database as follows :
SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
3) On the target location, create all the directories for the various files
4) Copy the following four sets of files from the production(source) database to the target database :
parameter files
control files
data files
redo log files
5) In all the clone database files, change the database name to test
6) Run the CREATE DATABASE statement,which was prepared with the ALTER DATABASE BACKUP CONTROLFILE TO TRACE statement
7) Create the controlfile for the test database using the following statement:
SQL> CREATE CONTROLFILE REUSE SET DATABASE "TEST" RESETLOGS
NOARCHIVELOG;
We'll now have a new database called test that has a new controlfile pointing to the copied(target) version of the production database
8) Once we get the prompt back from the previous command, run this command :
SQL> ALTER DATABASE OPEN RESETLOGS USING BACKUP CONTROLFILE;
9) Finally, change the global name of the database we just created by running the following command:
SQL> UPDATE global_name SQT global_name='test.world';
1 comment:
Manually cloning a database is very easy procedure once you know what initially it does and I too recommend that we should always backup the files.the steps you provided are really very easy to follow and I hope it may help many who need to clone db manually
Post a Comment