Cold database backup means while taking backup or doing cloning, we need to shutdown the source database. This method is usually used for test database when database is in noarchivelog mode.

Note- Both the source and target db server should be on same platform and the target db version will be that of the source db.So make sure oracle binary is already installed on target db server.

Here we will clone a database SRCDB to a new server with name TRGDB

SOURCE DB – SRCDB
TARGET DB – TRGDB

 

1.Take backup of controlfile as trace:[SOURCE DB]

2. Note down the location of datafiles[SOURCE DB]

3. Shutdown the database:[SOURCE DB]

4. Copy the datafiles and tempfiles to the target db server

5. Prepare the init file for target db:[TARGET DB]

We can copy the pfile from source db and the change the required parameters like DB_NAME and control_file,audit_file_dest,diag location.

6. Start the database in nomount stage:[TARGET DB]

export ORACLE_SID=TRGDB

startup nomount pfile=initTRGDB.ora

7. Re-recreate the controlfile [ TARGET DB ]

This is an important steps in cloning process. In step 1 , We had taken backup of the controlfile as trace, We will use that sql file to re-create the controlfile.

SNIPPET FROM controlfile sql script:

Lets modify this sql by replacing the datafile location of source with that of target and the new db name as TRGDB.

After changing it will look as below:

SET DATABASE:

Here we have use SET DATABASE, Because we are cloning the database in target with a new db name.

CREATE CONTROLFILE SET DATABASE “SRCDB” RESETLOGS FORCE LOGGING ARCHIVELOG

If you wish to keep the database same as source, then you can use the command REUSE DATABASE command.

Run the create controlfile statement:

8. Open the database in resetlog mode:

9. Add the temp files:

You can get this tempfile script in the end controlfile script .

Replace the tempfile location as per target db and execute in target db: