Make a clone of your database with RMAN (on the same server as the target database) - windows

posted Mar 16, 2011, 6:35 PM by Sachchida Ojha

Before execution of the clone script I

1. Created the directories for the datafiles, controlfiles, redologfiles for the new clone database

2. I opened the target database with db_name = UTF8. UTF8 is the database which I would like to clone to a database with db_name = CLONE

3. I copied and renamed the passwordfile 

4. I created the windows service oracleserviceclone ( with oradim )

5. I made the pfile / spfile for the new database with db_name = CLONE. Please note I had to take away the OMF entry for the controlfiles. There are still some issues left with OMF redolog files and OMF controlfiles.

C:\> SET ORACLE_SID=CLONE

C:\>sqlplus sys/utf as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Feb 12 13:41:09 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.

SQL> startup nomount;
-- I startup nomount the clone database
ORACLE instance started.
Total System Global Area 524288000 bytes
Fixed Size 1249968 bytes
Variable Size 473959760 bytes
Database Buffers 46137344 bytes
Redo Buffers 2940928 bytes

C:\>lsnrctl services listener1
-- I check the services of the listener

It is time for the real work right now

C:\>rman target "sys/utf@to_brussels"
-- Connection to target database
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Feb 10 16:44:46 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: UTF8 (DBID=1828263075)

RMAN> connect auxiliary sys/utf
-- Connection to clone database
connected to auxiliary database: CLONE (not mounted)

I used this script in order to invoke the cloning work

RUN

set newname for datafile 1 to 'C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_SYSTEM_1DT8JGN2_.DBF';
set newname for datafile 2 to 'C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_16_1M08DN7D_.DBF';
set newname for datafile 3 to 'C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_SYSAUX_1NBJ85GR_.DBF';
set newname for datafile 4 to 'C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_1DT8LVYG_.DBF';
set newname for datafile 5 to 'C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_UNDOTBS2_1JOTM2S4_.DBF';
set newname for datafile 6 to 'C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_D_1OH2VGQP_.DBF';
set newname for datafile 7 to 'C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_I_1OH2XWW4_.DBF';
set newname for datafile 8 to 'C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS2_1V1OPZWO_.DBF';
set newname for datafile 9 to 'C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USER_LOB_1WKM1WSD_.DBF';
set newname for tempfile 1 to 'C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_TEMP_1P47MLKR_.TMP';
DUPLICATE TARGET DATABASE TO "CLONE"
LOGFILE
GROUP 1 ('C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO01.RDO') SIZE 10M,
-- I made an error in the path name
GROUP 2 ('C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO02.RDO') SIZE 10M,
-- I made an error in the path name
GROUP 3 ('C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO03.RDO') SIZE 10M;
-- I made an error in the path name
}

This is the output of the script. Please note that only at the final end I had do some manual work, since I made a mistake at the level of the path for the online redo logs.

executing command: SET NEWNAME
using target database control file instead of recovery catalog

executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME

Starting Duplicate Db at 12-FEB-06
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=157 devtype=DISK
allocated channel: ORA_AUX_DISK_2
channel ORA_AUX_DISK_2: sid=156 devtype=DISK
allocated channel: ORA_AUX_DISK_3
channel ORA_AUX_DISK_3: sid=155 devtype=DISK
allocated channel: ORA_AUX_DISK_4
channel ORA_AUX_DISK_4: sid=154 devtype=DISK

contents of Memory Script:
{
set until scn 10616265;
set newname for datafile 1 to
"C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_SYSTEM_1DT8JGN2_.DBF";
set newname for datafile 2 to
"C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_16_1M08DN7D_.DBF";
set newname for datafile 3 to
"C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_SYSAUX_1NBJ85GR_.DBF";
set newname for datafile 4 to
"C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_1DT8LVYG_.DBF";
set newname for datafile 5 to
"C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_UNDOTBS2_1JOTM2S4_.DBF";
set newname for datafile 6 to
"C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_D_1OH2VGQP_.DBF";
set newname for datafile 7 to
"C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_I_1OH2XWW4_.DBF";
set newname for datafile 8 to
"C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS2_1V1OPZWO_.DBF";
set newname for datafile 9 to
"C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USER_LOB_1WKM1WSD_.DBF";
restore
check readonly
clone database
;
}
executing Memory Script

executing command: SET until clause
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME

Starting restore at 12-FEB-06
using channel ORA_AUX_DISK_1
using channel ORA_AUX_DISK_2
using channel ORA_AUX_DISK_3
using channel ORA_AUX_DISK_4

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00006 to C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_D_1OH2VGQP_.DBF
restoring datafile 00008 to C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS2_1V1OPZWO_.DBF
channel ORA_AUX_DISK_1: reading from backup piece C:\ORACLE\FLASH_RECOVERY_AREA\BRUSSELS\BACKUPSET\2006_02_10\O1_MF_NNNDF_TAG20060210T151853_1YS86P37_.BKP
channel ORA_AUX_DISK_2: starting datafile backupset restore
channel ORA_AUX_DISK_2: specifying datafile(s) to restore from backup set
restoring datafile 00001 to C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_SYSTEM_1DT8JGN2_.DBF
restoring datafile 00003 to C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_SYSAUX_1NBJ85GR_.DBF
channel ORA_AUX_DISK_2: reading from backup piece C:\ORACLE\FLASH_RECOVERY_AREA\BRUSSELS\BACKUPSET\2006_02_10\O1_MF_NNNDF_TAG20060210T151853_1YS87YMF_.BKP
channel ORA_AUX_DISK_3: starting datafile backupset restore
channel ORA_AUX_DISK_3: specifying datafile(s) to restore from backup set
restoring datafile 00005 to C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_UNDOTBS2_1JOTM2S4_.DBF
restoring datafile 00007 to C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_I_1OH2XWW4_.DBF
channel ORA_AUX_DISK_3: reading from backup piece C:\ORACLE\FLASH_RECOVERY_AREA\BRUSSELS\BACKUPSET\2006_02_10\O1_MF_NNNDF_TAG20060210T151853_1YS87FFC_.BKP
channel ORA_AUX_DISK_4: starting datafile backupset restore
channel ORA_AUX_DISK_4: specifying datafile(s) to restore from backup set
restoring datafile 00002 to C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_16_1M08DN7D_.DBF
channel ORA_AUX_DISK_4: reading from backup piece C:\ORACLE\FLASH_RECOVERY_AREA\BRUSSELS\BACKUPSET\2006_02_10\O1_MF_NNNDF_TAG20060210T151853_1YS8GYHF_.BKP
channel ORA_AUX_DISK_4: restored backup piece 1
piece handle=C:\ORACLE\FLASH_RECOVERY_AREA\BRUSSELS\BACKUPSET\2006_02_10\O1_MF_NNNDF_TAG20060210T151853_1YS8GYHF_.BKP tag=TAG20060210T151853
channel ORA_AUX_DISK_4: restore complete, elapsed time: 00:09:08
channel ORA_AUX_DISK_4: starting datafile backupset restore
channel ORA_AUX_DISK_4: specifying datafile(s) to restore from backup set
restoring datafile 00004 to C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_1DT8LVYG_.DBF
restoring datafile 00009 to C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USER_LOB_1WKM1WSD_.DBF
channel ORA_AUX_DISK_4: reading from backup piece C:\ORACLE\FLASH_RECOVERY_AREA\BRUSSELS\BACKUPSET\2006_02_10\O1_MF_NNNDF_TAG20060210T151853_1YS86JRL_.BKP
channel ORA_AUX_DISK_2: restored backup piece 1
piece handle=C:\ORACLE\FLASH_RECOVERY_AREA\BRUSSELS\BACKUPSET\2006_02_10\O1_MF_NNNDF_TAG20060210T151853_1YS87YMF_.BKP tag=TAG20060210T151853
channel ORA_AUX_DISK_2: restore complete, elapsed time: 00:11:24
channel ORA_AUX_DISK_3: restored backup piece 1
piece handle=C:\ORACLE\FLASH_RECOVERY_AREA\BRUSSELS\BACKUPSET\2006_02_10\O1_MF_NNNDF_TAG20060210T151853_1YS87FFC_.BKP tag=TAG20060210T151853
channel ORA_AUX_DISK_3: restore complete, elapsed time: 00:11:31
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=C:\ORACLE\FLASH_RECOVERY_AREA\BRUSSELS\BACKUPSET\2006_02_10\O1_MF_NNNDF_TAG20060210T151853_1YS86P37_.BKP tag=TAG20060210T151853
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:12:17
channel ORA_AUX_DISK_4: restored backup piece 1
piece handle=C:\ORACLE\FLASH_RECOVERY_AREA\BRUSSELS\BACKUPSET\2006_02_10\O1_MF_NNNDF_TAG20060210T151853_1YS86JRL_.BKP tag=TAG20060210T151853
channel ORA_AUX_DISK_4: restore complete, elapsed time: 00:07:04
Finished restore at 12-FEB-06
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONE" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 4090
LOGFILE
GROUP 1 ( 'C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO01.RDO' ) SIZE 10 M ,
GROUP 2 ( 'C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO02.RDO' ) SIZE 10 M ,
GROUP 3 ( 'C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO03.RDO' ) SIZE 10 M
DATAFILE
'C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_SYSTEM_1YYG2RXX_.DBF'
CHARACTER SET AL32UTF8


contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script

released channel: ORA_AUX_DISK_1
released channel: ORA_AUX_DISK_2
released channel: ORA_AUX_DISK_3
released channel: ORA_AUX_DISK_4
datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=582216382 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_16_1YYG2S9N_.DBF
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=582216382 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_SYSAUX_1YYG2T33_.DBF
datafile 4 switched to datafile copy
input datafile copy recid=3 stamp=582216382 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_1YYGMYBV_.DBF
datafile 5 switched to datafile copy
input datafile copy recid=4 stamp=582216382 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_UNDOTBS2_1YYG2SHW_.DBF
datafile 6 switched to datafile copy
input datafile copy recid=5 stamp=582216383 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_D_1YYG2RVQ_.DBF
datafile 7 switched to datafile copy
input datafile copy recid=6 stamp=582216383 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_I_1YYG2S9Y_.DBF
datafile 8 switched to datafile copy
input datafile copy recid=7 stamp=582216383 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS2_1YYG2T8Q_.DBF
datafile 9 switched to datafile copy
input datafile copy recid=8 stamp=582216383 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USER_LOB_1YYGMZ6K_.DBF

contents of Memory Script:
{
set until scn 10616265;
recover
clone database
delete archivelog
;
}
executing Memory Script

executing command: SET until clause

Starting recover at 12-FEB-06
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=158 devtype=DISK
allocated channel: ORA_AUX_DISK_2
channel ORA_AUX_DISK_2: sid=154 devtype=DISK
allocated channel: ORA_AUX_DISK_3
channel ORA_AUX_DISK_3: sid=155 devtype=DISK
allocated channel: ORA_AUX_DISK_4
channel ORA_AUX_DISK_4: sid=156 devtype=DISK

starting media recovery

channel ORA_AUX_DISK_1: starting archive log restore to default destination
channel ORA_AUX_DISK_1: restoring archive log
archive log thread=1 sequence=4407
channel ORA_AUX_DISK_1: reading from backup piece C:\ORACLE\FLASH_RECOVERY_AREA\BRUSSELS\BACKUPSET\2006_02_10\O1_MF_ANNNN_TAG20060210T153431_1YS9F8S9_.BKP
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=C:\ORACLE\FLASH_RECOVERY_AREA\BRUSSELS\BACKUPSET\2006_02_10\O1_MF_ANNNN_TAG20060210T153431_1YS9F8S9_.BKP tag=TAG20060210T153431
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:27
archive log filename=C:\ORACLE\FLASH_RECOVERY_AREA\DUPLICAT\ARCHIVELOG\2006_02_12\O1_MF_1_4407_1YYH1YVL_.ARC thread=1 sequence=4407
channel clone_default: deleting archive log(s)
archive log filename=C:\ORACLE\FLASH_RECOVERY_AREA\DUPLICAT\ARCHIVELOG\2006_02_12\O1_MF_1_4407_1YYH1YVL_.ARC recid=1 stamp=582216415
media recovery complete, elapsed time: 00:00:08
Finished recover at 12-FEB-06

contents of Memory Script:
{
shutdown clone;
startup clone nomount ;
}
executing Memory Script

database dismounted
Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area 524288000 bytes

Fixed Size 1249968 bytes
Variable Size 473959760 bytes
Database Buffers 46137344 bytes
Redo Buffers 2940928 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONE" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 4090
LOGFILE
GROUP 1 ( 'C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO01.RDO' ) SIZE 10 M ,
GROUP 2 ( 'C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO02.RDO' ) SIZE 10 M ,
GROUP 3 ( 'C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO03.RDO' ) SIZE 10 M
DATAFILE
'C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_SYSTEM_1YYG2RXX_.DBF'
CHARACTER SET AL32UTF8


contents of Memory Script:
{
set newname for tempfile 1 to
"C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_TEMP_1P47MLKR_.TMP";
switch clone tempfile all;
catalog clone datafilecopy "C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_16_1YYG2S9N_.DBF";
catalog clone datafilecopy "C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_SYSAUX_1YYG2T33_.DBF";
catalog clone datafilecopy "C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_1YYGMYBV_.DBF";
catalog clone datafilecopy "C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_UNDOTBS2_1YYG2SHW_.DBF";
catalog clone datafilecopy "C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_D_1YYG2RVQ_.DBF";
catalog clone datafilecopy "C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_I_1YYG2S9Y_.DBF";
catalog clone datafilecopy "C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS2_1YYG2T8Q_.DBF";
catalog clone datafilecopy "C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USER_LOB_1YYGMZ6K_.DBF";
switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed temporary file 1 to C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_TEMP_1P47MLKR_.TMP in control file

cataloged datafile copy
datafile copy filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_16_1YYG2S9N_.DBF recid=1 stamp=582216453

cataloged datafile copy
datafile copy filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_SYSAUX_1YYG2T33_.DBF recid=2 stamp=582216454

cataloged datafile copy
datafile copy filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_1YYGMYBV_.DBF recid=3 stamp=582216455

cataloged datafile copy
datafile copy filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_UNDOTBS2_1YYG2SHW_.DBF recid=4 stamp=582216455

cataloged datafile copy
datafile copy filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_D_1YYG2RVQ_.DBF recid=5 stamp=582216456

cataloged datafile copy
datafile copy filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_I_1YYG2S9Y_.DBF recid=6 stamp=582216457

cataloged datafile copy
datafile copy filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS2_1YYG2T8Q_.DBF recid=7 stamp=582216458

cataloged datafile copy
datafile copy filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USER_LOB_1YYGMZ6K_.DBF recid=8 stamp=582216459

datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=582216453 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_16_1YYG2S9N_.DBF
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=582216454 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_SYSAUX_1YYG2T33_.DBF
datafile 4 switched to datafile copy
input datafile copy recid=3 stamp=582216455 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_1YYGMYBV_.DBF
datafile 5 switched to datafile copy
input datafile copy recid=4 stamp=582216455 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_UNDOTBS2_1YYG2SHW_.DBF
datafile 6 switched to datafile copy
input datafile copy recid=5 stamp=582216456 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_D_1YYG2RVQ_.DBF
datafile 7 switched to datafile copy
input datafile copy recid=6 stamp=582216457 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_I_1YYG2S9Y_.DBF
datafile 8 switched to datafile copy
input datafile copy recid=7 stamp=582216458 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS2_1YYG2T8Q_.DBF
datafile 9 switched to datafile copy
input datafile copy recid=8 stamp=582216459 filename=C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USER_LOB_1YYGMZ6K_.DBF

contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 02/12/2006 14:47:44
RMAN-03015: error occurred in stored script Memory Script
RMAN-06136: ORACLE error from auxiliary database: ORA-00344: unable to re-create
online log 'C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO01.RDO'
ORA-27040: file create error, unable to create file
OSD-04002: unable to open file
O/S-Error: (OS 3) The system cannot find the path specified.

At the end, something went wrong , I made an error in the directory paths of the online redo logs as such they couldn' t have been created by the alter database open resetlogs. Let us take a look and let us correct in a traditional way

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------

C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO03.RDO
C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO02.RDO
C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO01.RDO

SQL> alter database rename file 'C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO03.RDO' to 'C:\ORACLE\ORADATA\CLONE\DUPLICAT\ONLINELOG\REDO03.RDO';
Database altered.

SQL> alter database rename file 'C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO01.RDO' to 'C:\ORACLE\ORADATA\CLONE\DUPLICAT\ONLINELOG\REDO01.RDO';
Database altered.

SQL> alter database rename file 'C:\ORACLE\ORADATA\UTF\CLONE\DUPLICAT\REDO02.RDO' to 'C:\ORACLE\ORADATA\CLONE\DUPLICAT\ONLINELOG\REDO02.RDO';
Database altered.

SQL> alter database open resetlogs;
Database altered.

My database with db_name UTF8 has been copied, cloned on the same server, other directories, other db_name and offcourse other dbid, let us explore some well known v$-views 

SQL> select dbid,name from v$database;

DBID NAME
---------- ---------
781032125 CLONE

SQL> select name from v$datafile;

NAME
-------------------------------------------------------------------------

C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_SYSTEM_1YYG2RXX_.DBF
C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_16_1YYG2S9N_.DBF
C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_SYSAUX_1YYG2T33_.DBF
C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS_1YYGMYBV_.DBF
C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_UNDOTBS2_1YYG2SHW_.DBF
C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_D_1YYG2RVQ_.DBF
C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_CW4ORA_I_1YYG2S9Y_.DBF
C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USERS2_1YYG2T8Q_.DBF
C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_USER_LOB_1YYGMZ6K_.DBF

9 rows selected.

SQL> select name from v$controlfile;

NAME
-------------------------------------------------------------------------

C:\ORACLE\ORADATA\CLONE\DUPLICAT\CONTROLFILE\O1_MF_1YYH15D2_.CTL
C:\ORACLE\FLASH_RECOVERY_AREA\DUPLICAT\CONTROLFILE\O1_MF_1YYH16VG_.CTL

SQL> select member from v$logfile;

MEMBER
-------------------------------------------------------------------------

C:\ORACLE\ORADATA\CLONE\DUPLICAT\ONLINELOG\REDO03.RDO
C:\ORACLE\ORADATA\CLONE\DUPLICAT\ONLINELOG\REDO02.RDO
C:\ORACLE\ORADATA\CLONE\DUPLICAT\ONLINELOG\REDO01.RDO

SQL> select name from v$tempfile;

NAME
-------------------------------------------------------------------------

C:\ORACLE\ORADATA\CLONE\DUPLICAT\DATAFILE\O1_MF_TEMP_1YYHPXV3_.TMP
Comments