You are on page 1of 3

1. Check the current archive log change number of Production database.

PROD> select max(first_change#) chng from v$archived_log; eg SQL> select max(first_change#) chng from v$archived_log; CHNG ---------1208744642

2. Check archive number

Archive Log list; SQL> archive log list; Database log mode Automatic archival Archive destination Oldest online log sequence Next log sequence to archive Current log sequence

Archive Mode Enabled /archive/PROD 50270 50272 50272

3. Take the backup of controlfile to trace and copy to CLONE server.

alter database backup controlfile to trace as 'Location/create_CLONE.sql';

4. Take backup of spfile to pfile from Production and copy to Clone server
create pfile='init<new database sid>.ora' from spfile;

5. Create the password file on CLONE Database Server.

orapwd file=${ORACLE_HOME}/dbs/orapw${ORACLE_SID} password=<your password>

6. Take the database in begin backup mode.

alter database begin backup; SCP all the database files from production to Clone server. alter database end backup;

you can also take table space wise backup mode enable. and transfer only that tablespace datafiles and disable the tablespace backup mode. select 'alter tablespace '||NAME||' begin backup;' from v$tablespace union select 'alter tablespace '||NAME||' end backup;' from v$tablespace order by 1; eg. alter tablespace users01 begin backup;

SCP the datafiles belong to only user01 tablespace. alter tablespace users01 end backup; and then go to another table space similarly. After that verify that all tablespace is in disable backup mode. SELECT * FROM V$BACKUP WHERE STATUS = 'ACTIVE';

7. After taking the data files copy to clone server, Issue this command to production server.

8. Check the current archive and take archives to CLONE Server.

Archive Log list; SCP all the archive generated from first issued command to this command.

9. Edit the Control file and PFILE if location of data files and control files is different.
Control file: create_control.sql STARTUP NOMOUNT pfile = 'location of pfile' CREATE CONTROLFILE SET DATABASE "CLON" RESETLOGS ARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 4672 LOGFILE GROUP 1 '/u02/oradata/CLON/redo01.log' SIZE 50M BLOCKSIZE 512, GROUP 2 '/u02/oradata/CLON/redo02.log' SIZE 50M BLOCKSIZE 512, GROUP 3 '/u02/oradata/CLON/redo03.log' SIZE 50M BLOCKSIZE 512 DATAFILE '/u02/oradata/CLON/system01.dbf', '/u02/oradata/CLON/sysaux01.dbf', '/u02/oradata/CLON/undotbs01.dbf', '/u02/oradata/CLON/users01.dbf' CHARACTER SET AL32UTF8 ; PFILE: If Location is different from production database. Edit the following paramter in pfile bdump , cdump , udump , controlfiles , log_archive_dest to new location.

10. Creation of control file script.

Connect the database " sqlplus / as sysdba' SQL> @create_controlfile.sql;

11. Recover and Open the database

SQL> recover database using backup controlfile until cancel; When prompted to 'Specify log' enter 'auto'. Oracle will then apply all the available logs, and then error with ORA-00308. This is normal, it simply means that all available logs have been applied. Open the database with reset logs: SQL> alter database open resetlogs;

12. Create Temporary tablespace and tempfiles to database. 13. Create SPFILE from PFILE
Create spfile from pfile;

14. Shutdown the database. and startup with spfile. 15. Configure TNS
Add entries for new database in the listener.ora and tnsnames.ora as necessary.

16. Change the database ID

If RMAN is going to be used to back-up the database, the database ID must be changed. If RMAN isn't going to be used, there is no harm in changing the ID anyway - and it's a good practice to do so. From sqlplus: shutdown immediate startup mount exit From unix: nid target=/ NID will ask if you want to change the ID. Respond with 'Y'. Once it has finished, start the database up : shutdown immediate startup mount alter database open resetlogs /