Cloning a db in 'noarchivelog' mode using 'create controlfile set database' option

Cloning a db in ‘noarchivelog’ mode on the same server without using ‘rman’ backups and duplicate option.



1. Identify the list of data files, control files, redo logs of the db to be cloned
2. Create backup control file from trace
3. Create pfile from spfile (if it’s not already available)
4. Copy it as init.ora and edit the below
               a. Path of ‘control files’ to reflect the new directory path
               b. dump directories etc
               c. db_name is set to “clonedb”
5. alter system switch logfile
6. shutdown immediate
7. cp –rp  datafiles and redologs to the new clonedb path
8. edit the original control file from the trace from step 2 above
similar to below
CREATE CONTROLFILE SET DATABASE "" RESETLOGS NOARCHIVELOG
......
.......
LOGFILE
GROUP 1 '/u01/oradata//clonedb/redo01.log' SIZE 50M,
........
DATAFILE
/u01/oradata/clonedb/system01.dbf,
......
.......
CHARACTER SET WE8ISO8859P1;
RECOVER DATABASE USING BACKUP CONTROLFILE;
ALTER DATABASE OPEN RESETLOGS;
ALTER TABLESPACE TEMP ADD TEMPFILE ‘/u01/oradata/clonedb/temp01.dbf,
SIZE ......;


9. export ORACLE_SID=clonedb
10. sqlplus /nolog
startup nomount pfile=’path to edited init.ora’ from step 4 above
11. Run the create-controlfile script prepared at step 8
12. Create spfile from pfile
13. Shutdown immediate
14. Create password file
15. Startup
16. Show parameter db_name


The above process doesn’t change the ‘dbid’ and if that too needs to be changed, we need to use dbnewid (nid) utility.


The only reason you need to copy the redologs too is if the 'recover using backup contolfile' does ask for a change in the redolog, you need to manually provide the path of the redolog.
If you switch the logfile prior to shutdown, it won't be required but it's better to copy them anyway.