RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
DILIP@orcl> create table recotest as select * from tab;
Table created.
DILIP@orcl>select count(1) from recotest;
COUNT(1)
1 row selected.
DILIP@orcl>
TO_CHAR(SYSDATE,'DD-
1 row selected.
DILIP@orcl> drop table recotest;
Table dropped.
DILIP@orcl>
RMAN> backup archivelog all;
Starting backup at 13-apr-2014 01:58:49
C:\app\Dilip\product\11.1.0\db_1\dbs>rman auxiliary / target sys/orcl@orcl
C:\app\Dilip\product\11.1.0\db_1\dbs>rman auxiliary / target sys/orcl@orcl
Recovery Manager: Release 11.1.0.6.0 - Production on Sun Apr 13 02:04:39 2014
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1218380266)
RMAN> run
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
executing command: SET until clause
Starting Duplicate Db at 13-APR-14
contents of 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
Starting restore at 13-APR-14
channel ORA_AUX_DISK_1: starting datafile backup set restore
contents of Memory Script:
datafile 2 switched to datafile copy
contents of Memory Script:
executing command: SET until clause
Starting recover at 13-APR-14
starting media recovery
archived log for thread 1 with sequence 67 is already on disk as file C:\APP\DILIP\ORADATA\ORCLARCH\ARC00067_0784393201.001
contents of Memory Script:
database dismounted
connected to auxiliary database (not started)
Total System Global Area 150667264 bytes
Fixed Size 1331740 bytes
contents of Memory Script:
executing command: SET NEWNAME
renamed tempfile 1 to C:\APP\DILIP\ORADATA\clone1\TEMP01.DBF in control file
cataloged datafile copy
cataloged datafile copy
cataloged datafile copy
cataloged datafile copy
cataloged datafile copy
cataloged datafile copy
cataloged datafile copy
datafile 2 switched to datafile copy
contents of Memory Script:
database opened
RMAN>
RMAN>
DILIP@clone1> select count(1) from recotest;
COUNT(1)
1 row selected.
-----------------
126
DILIP@orcl> select to_char(sysdate,'dd-mon-yyyy hh24:mi:ss') from dual;
--------------------
13-apr-2014 00:37:26 <--- need this date for point in time recovery
run
{
set newname for datafile 1 to 'C:\APP\DILIP\ORADATA\clone1\SYSTEM01.DBF';
set newname for datafile 2 to 'C:\APP\DILIP\ORADATA\clone1\SYSAUX01.DBF';
set newname for datafile 3 to 'C:\APP\DILIP\ORADATA\clone1\UNDOTBS01.DBF';
set newname for datafile 4 to 'C:\APP\DILIP\ORADATA\clone1\USERS01.DBF';
set newname for datafile 5 to 'C:\APP\DILIP\ORADATA\clone1\EXAMPLE01.DBF';
set newname for datafile 6 to 'C:\APP\DILIP\ORADATA\clone1\INDX01.DBF';
set newname for datafile 7 to 'C:\APP\DILIP\ORADATA\clone1\DILIP01.DBF';
set newname for datafile 8 to 'C:\APP\DILIP\ORADATA\clone1\FLS_TEST01.DBF';
set newname for tempfile 1 to 'C:\APP\DILIP\ORADATA\clone1\TEMP01.DBF';
set until time "to_date('13-apr-2014 00:37:26', 'dd-mon-yyyy hh24:mi:ss')";
DUPLICATE TARGET DATABASE TO clone1
LOGFILE
GROUP 1 ('C:\APP\DILIP\ORADATA\clone1\t_log1.f') SIZE 10m,
GROUP 2 ('C:\APP\DILIP\ORADATA\clone1\t_log2.f') SIZE 10m;
}
connected to auxiliary database: CLONE1 (not mounted)
2> {
3> set newname for datafile 1 to 'C:\APP\DILIP\ORADATA\clone1\SYSTEM01.DBF';
4> set newname for datafile 2 to 'C:\APP\DILIP\ORADATA\clone1\SYSAUX01.DBF';
5> set newname for datafile 3 to 'C:\APP\DILIP\ORADATA\clone1\UNDOTBS01.DBF';
6> set newname for datafile 4 to 'C:\APP\DILIP\ORADATA\clone1\USERS01.DBF';
7> set newname for datafile 5 to 'C:\APP\DILIP\ORADATA\clone1\EXAMPLE01.DBF';
8> set newname for datafile 6 to 'C:\APP\DILIP\ORADATA\clone1\INDX01.DBF';
9> set newname for datafile 7 to 'C:\APP\DILIP\ORADATA\clone1\DILIP01.DBF';
10> set newname for datafile 8 to 'C:\APP\DILIP\ORADATA\clone1\FLS_TEST01.DBF';
11> set newname for tempfile 1 to 'C:\APP\DILIP\ORADATA\clone1\TEMP01.DBF';
12> set until time "to_date('13-apr-2014 00:37:26', 'dd-mon-yyyy hh24:mi:ss')";
13> DUPLICATE TARGET DATABASE TO clone1
14> LOGFILE
15> GROUP 1 ('C:\APP\DILIP\ORADATA\clone1\t_log1.f') SIZE 10m,
16> GROUP 2 ('C:\APP\DILIP\ORADATA\clone1\t_log2.f') SIZE 10m;
17> }
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=97 device type=DISK
allocated channel: ORA_AUX_DISK_2
channel ORA_AUX_DISK_2: SID=96 device type=DISK
allocated channel: ORA_AUX_DISK_3
channel ORA_AUX_DISK_3: SID=95 device type=DISK
{
set until scn 5084622;
set newname for datafile 1 to
"C:\APP\DILIP\ORADATA\CLONE1\SYSTEM01.DBF";
set newname for datafile 2 to
"C:\APP\DILIP\ORADATA\CLONE1\SYSAUX01.DBF";
set newname for datafile 3 to
"C:\APP\DILIP\ORADATA\CLONE1\UNDOTBS01.DBF";
set newname for datafile 4 to
"C:\APP\DILIP\ORADATA\CLONE1\USERS01.DBF";
set newname for datafile 5 to
"C:\APP\DILIP\ORADATA\CLONE1\EXAMPLE01.DBF";
set newname for datafile 6 to
"C:\APP\DILIP\ORADATA\CLONE1\INDX01.DBF";
set newname for datafile 7 to
"C:\APP\DILIP\ORADATA\CLONE1\DILIP01.DBF";
set newname for datafile 8 to
"C:\APP\DILIP\ORADATA\CLONE1\FLS_TEST01.DBF";
restore
clone database
;
}
executing Memory Script
using channel ORA_AUX_DISK_1
using channel ORA_AUX_DISK_2
using channel ORA_AUX_DISK_3
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to C:\APP\DILIP\ORADATA\CLONE1\USERS01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00007 to C:\APP\DILIP\ORADATA\CLONE1\DILIP01.DBF
channel ORA_AUX_DISK_1: reading from backup piece C:\APP\DILIP\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2014_04_12\O1_MF_NNNDF_TAG20140412T232823_9NLZPFND_.BKP
channel ORA_AUX_DISK_2: starting datafile backup set restore
channel ORA_AUX_DISK_2: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_2: restoring datafile 00002 to C:\APP\DILIP\ORADATA\CLONE1\SYSAUX01.DBF
channel ORA_AUX_DISK_2: restoring datafile 00003 to C:\APP\DILIP\ORADATA\CLONE1\UNDOTBS01.DBF
channel ORA_AUX_DISK_2: restoring datafile 00008 to C:\APP\DILIP\ORADATA\CLONE1\FLS_TEST01.DBF
channel ORA_AUX_DISK_2: reading from backup piece C:\APP\DILIP\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2014_04_12\O1_MF_NNNDF_TAG20140412T232823_9NLZTGDZ_.BKP
channel ORA_AUX_DISK_3: starting datafile backup set restore
channel ORA_AUX_DISK_3: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_3: restoring datafile 00001 to C:\APP\DILIP\ORADATA\CLONE1\SYSTEM01.DBF
channel ORA_AUX_DISK_3: restoring datafile 00005 to C:\APP\DILIP\ORADATA\CLONE1\EXAMPLE01.DBF
channel ORA_AUX_DISK_3: restoring datafile 00006 to C:\APP\DILIP\ORADATA\CLONE1\INDX01.DBF
channel ORA_AUX_DISK_3: reading from backup piece C:\APP\DILIP\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2014_04_12\O1_MF_NNNDF_TAG20140412T232823_9NLZSLMH_.BKP
channel ORA_AUX_DISK_2: piece handle=C:\APP\DILIP\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2014_04_12\O1_MF_NNNDF_TAG20140412T232823_9NLZTGDZ_.BKP tag=TAG20140412T232823
channel ORA_AUX_DISK_2: restored backup piece 1
channel ORA_AUX_DISK_2: restore complete, elapsed time: 00:02:55
channel ORA_AUX_DISK_3: piece handle=C:\APP\DILIP\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2014_04_12\O1_MF_NNNDF_TAG20140412T232823_9NLZSLMH_.BKP tag=TAG20140412T232823
channel ORA_AUX_DISK_3: restored backup piece 1
channel ORA_AUX_DISK_3: restore complete, elapsed time: 00:03:15
channel ORA_AUX_DISK_1: piece handle=C:\APP\DILIP\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2014_04_12\O1_MF_NNNDF_TAG20140412T232823_9NLZPFND_.BKP tag=TAG20140412T232823
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:04:25
Finished restore at 13-APR-14
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONE1" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( 'C:\APP\DILIP\ORADATA\clone1\t_log1.f' ) SIZE 10 M ,
GROUP 2 ( 'C:\APP\DILIP\ORADATA\clone1\t_log2.f' ) SIZE 10 M
DATAFILE
'C:\APP\DILIP\ORADATA\CLONE1\SYSTEM01.DBF'
CHARACTER SET WE8MSWIN1252
{
switch clone datafile all;
}
executing Memory Script
input datafile copy RECID=1 STAMP=844740625 file name=C:\APP\DILIP\ORADATA\CLONE1\SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=844740625 file name=C:\APP\DILIP\ORADATA\CLONE1\UNDOTBS01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=844740625 file name=C:\APP\DILIP\ORADATA\CLONE1\USERS01.DBF
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=844740625 file name=C:\APP\DILIP\ORADATA\CLONE1\EXAMPLE01.DBF
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=844740625 file name=C:\APP\DILIP\ORADATA\CLONE1\INDX01.DBF
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=844740625 file name=C:\APP\DILIP\ORADATA\CLONE1\DILIP01.DBF
datafile 8 switched to datafile copy
input datafile copy RECID=7 STAMP=844740625 file name=C:\APP\DILIP\ORADATA\CLONE1\FLS_TEST01.DBF
{
set until time "to_date('13-apr-2014 00:37:26', 'dd-mon-yyyy hh24:mi:ss')";
recover
clone database
delete archivelog
;
}
executing Memory Script
using channel ORA_AUX_DISK_1
using channel ORA_AUX_DISK_2
using channel ORA_AUX_DISK_3
archived log for thread 1 with sequence 68 is already on disk as file C:\APP\DILIP\ORADATA\ORCLARCH\ARC00068_0784393201.001
archived log file name=C:\APP\DILIP\ORADATA\ORCLARCH\ARC00067_0784393201.001 thread=1 sequence=67
archived log file name=C:\APP\DILIP\ORADATA\ORCLARCH\ARC00068_0784393201.001 thread=1 sequence=68
media recovery complete, elapsed time: 00:00:07
Finished recover at 13-APR-14
{
shutdown clone immediate;
startup clone nomount ;
}
executing Memory Script
Oracle instance shut down
Oracle instance started
Variable Size 92278244 bytes
Database Buffers 50331648 bytes
Redo Buffers 6725632 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONE1" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( 'C:\APP\DILIP\ORADATA\clone1\t_log1.f' ) SIZE 10 M ,
GROUP 2 ( 'C:\APP\DILIP\ORADATA\clone1\t_log2.f' ) SIZE 10 M
DATAFILE
'C:\APP\DILIP\ORADATA\CLONE1\SYSTEM01.DBF'
CHARACTER SET WE8MSWIN1252
{
set newname for tempfile 1 to
"C:\APP\DILIP\ORADATA\clone1\TEMP01.DBF";
switch clone tempfile all;
catalog clone datafilecopy "C:\APP\DILIP\ORADATA\CLONE1\SYSAUX01.DBF";
catalog clone datafilecopy "C:\APP\DILIP\ORADATA\CLONE1\UNDOTBS01.DBF";
catalog clone datafilecopy "C:\APP\DILIP\ORADATA\CLONE1\USERS01.DBF";
catalog clone datafilecopy "C:\APP\DILIP\ORADATA\CLONE1\EXAMPLE01.DBF";
catalog clone datafilecopy "C:\APP\DILIP\ORADATA\CLONE1\INDX01.DBF";
catalog clone datafilecopy "C:\APP\DILIP\ORADATA\CLONE1\DILIP01.DBF";
catalog clone datafilecopy "C:\APP\DILIP\ORADATA\CLONE1\FLS_TEST01.DBF";
switch clone datafile all;
}
executing Memory Script
datafile copy file name=C:\APP\DILIP\ORADATA\CLONE1\SYSAUX01.DBF RECID=1 STAMP=844740669
datafile copy file name=C:\APP\DILIP\ORADATA\CLONE1\UNDOTBS01.DBF RECID=2 STAMP=844740670
datafile copy file name=C:\APP\DILIP\ORADATA\CLONE1\USERS01.DBF RECID=3 STAMP=844740671
datafile copy file name=C:\APP\DILIP\ORADATA\CLONE1\EXAMPLE01.DBF RECID=4 STAMP=844740672
datafile copy file name=C:\APP\DILIP\ORADATA\CLONE1\INDX01.DBF RECID=5 STAMP=844740674
datafile copy file name=C:\APP\DILIP\ORADATA\CLONE1\DILIP01.DBF RECID=6 STAMP=844740675
datafile copy file name=C:\APP\DILIP\ORADATA\CLONE1\FLS_TEST01.DBF RECID=7 STAMP=844740676
input datafile copy RECID=1 STAMP=844740669 file name=C:\APP\DILIP\ORADATA\CLONE1\SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=844740670 file name=C:\APP\DILIP\ORADATA\CLONE1\UNDOTBS01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=844740671 file name=C:\APP\DILIP\ORADATA\CLONE1\USERS01.DBF
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=844740672 file name=C:\APP\DILIP\ORADATA\CLONE1\EXAMPLE01.DBF
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=844740674 file name=C:\APP\DILIP\ORADATA\CLONE1\INDX01.DBF
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=844740675 file name=C:\APP\DILIP\ORADATA\CLONE1\DILIP01.DBF
datafile 8 switched to datafile copy
input datafile copy RECID=7 STAMP=844740676 file name=C:\APP\DILIP\ORADATA\CLONE1\FLS_TEST01.DBF
{
Alter clone database open resetlogs;
}
executing Memory Script
Finished Duplicate Db at 13-APR-14
-----------------
126