I have this 19c database, SOUR1CDB. In mounted state I did take a backup and left it as is (mounted).
I then created new instance, called CLONE, then created pfile, then created spfile. All in all I started this new instance in nomount state.
Recovery Manager: Release 19.0.0.0.0 - Production on Wed Jul 22 15:53:13 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: SOUR1CDB (DBID=3153670755, not open)
connected to auxiliary database: CLONE (not mounted)
RMAN> run {
2> set newname for datafile 1 TO
3> 'D:\ORADATA\CLONE\SYSTEM01.DBF';
4> set newname for datafile 2 TO
5> 'D:\ORADATA\CLONE\PDBSEED\SYSTEM01.DBF';
6> set newname for datafile 3 TO
7> 'D:\ORADATA\CLONE\SYSAUX01.DBF';
8> set newname for datafile 4 TO
9> 'D:\ORADATA\CLONE\PDBSEED\SYSAUX01.DBF';
10> set newname for datafile 5 TO
11> 'D:\ORADATA\CLONE\UNDOTBS01.DBF';
12> set newname for datafile 6 TO
13> 'D:\ORADATA\CLONE\PDBSEED\UNDOTBS01.DBF';
14> set newname for datafile 7 TO
15> 'D:\ORADATA\CLONE\USERS01.DBF';
16> set newname for datafile 8 TO
17> 'D:\ORADATA\CLONE\PDB1\SYSTEM01.DBF';
18> set newname for datafile 9 TO
19> 'D:\ORADATA\CLONE\PDB1\SYSAUX01.DBF';
20> set newname for datafile 11 TO
21> 'D:\ORADATA\CLONE\PDB1\USERS01.DBF';
22> set newname for datafile 12 TO
23> 'D:\ORADATA\CLONE\PDB1\REPORT_INDEX01.DBF';
24> set newname for datafile 13 TO
25> 'D:\ORADATA\CLONE\PDB1\REPORT_DATA01.DBF';
26> set newname for datafile 14 TO
27> 'D:\ORADATA\CLONE\PDB1\LOB01.DBF';
28> set newname for datafile 15 TO
29> 'D:\ORADATA\CLONE\PDB1\INDEX01.DBF';
30> set newname for datafile 16 TO
31> 'D:\ORADATA\CLONE\PDB1\DATA01.DBF';
32> set newname for datafile 17 TO
33> 'D:\ORADATA\CLONE\PDB1\ARCHIVE_INDEX01.DBF';
34> set newname for datafile 18 TO
35> 'D:\ORADATA\CLONE\PDB1\ARCHIVE_DATA01.DBF';
36> set newname for datafile 20 TO
37> 'D:\ORADATA\CLONE\PDB1\UNDOTBS01.DBF';
38> set newname for tempfile 1 TO 'D:\ORADATA\CLONE\TEMP01.DBF';
39> set newname for tempfile 2 TO 'D:\ORADATA\CLONE\PDBSEED\TEMP01.DBF';
40> set newname for tempfile 3 TO 'D:\ORADATA\CLONE\PDB1\TEMP01.DBF';
41> duplicate target database to CLONE
42> logfile
43> 'D:\oradata\CLONE\redo010.log' SIZE 100M,
44> 'D:\oradata\CLONE\redo020.log' SIZE 100M,
45> 'D:\oradata\CLONE\redo030.log' SIZE 100M,
46> 'D:\oradata\CLONE\redo040.log' SIZE 100M,
47> 'D:\oradata\CLONE\redo050.log' SIZE 100M,
48> 'D:\oradata\CLONE\redo060.log' SIZE 100M;
49> }
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 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 NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting Duplicate Db at 22-JUL-20
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=311 device type=DISK
contents of Memory Script:
{
sql clone "alter system set db_name =
''SOUR1CDB'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''CLONE'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
restore clone primary controlfile;
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''SOUR1CDB'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''CLONE'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 3238002128 bytes
Fixed Size 9272784 bytes
Variable Size 2147483648 bytes
Database Buffers 1073741824 bytes
Redo Buffers 7503872 bytes
Starting restore at 22-JUL-20
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=465 device type=DISK
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece E:\TEMP\BACKUP04V59U2N_1_1
channel ORA_AUX_DISK_1: piece handle=E:\TEMP\BACKUP04V59U2N_1_1 tag=FOR DUPLICATION
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
output file name=D:\ORADATA\CLONE\CONTROL01.CTL
Finished restore at 22-JUL-20
database mounted
contents of Memory Script:
{
set newname for datafile 1 to
"D:\ORADATA\CLONE\SYSTEM01.DBF";
set newname for datafile 2 to
"D:\ORADATA\CLONE\PDBSEED\SYSTEM01.DBF";
set newname for datafile 3 to
"D:\ORADATA\CLONE\SYSAUX01.DBF";
set newname for datafile 4 to
"D:\ORADATA\CLONE\PDBSEED\SYSAUX01.DBF";
set newname for datafile 5 to
"D:\ORADATA\CLONE\UNDOTBS01.DBF";
set newname for datafile 6 to
"D:\ORADATA\CLONE\PDBSEED\UNDOTBS01.DBF";
set newname for datafile 7 to
"D:\ORADATA\CLONE\USERS01.DBF";
set newname for datafile 8 to
"D:\ORADATA\CLONE\PDB1\SYSTEM01.DBF";
set newname for datafile 9 to
"D:\ORADATA\CLONE\PDB1\SYSAUX01.DBF";
set newname for datafile 11 to
"D:\ORADATA\CLONE\PDB1\USERS01.DBF";
set newname for datafile 12 to
"D:\ORADATA\CLONE\PDB1\REPORT_INDEX01.DBF";
set newname for datafile 13 to
"D:\ORADATA\CLONE\PDB1\REPORT_DATA01.DBF";
set newname for datafile 14 to
"D:\ORADATA\CLONE\PDB1\LOB01.DBF";
set newname for datafile 15 to
"D:\ORADATA\CLONE\PDB1\INDEX01.DBF";
set newname for datafile 16 to
"D:\ORADATA\CLONE\PDB1\DATA01.DBF";
set newname for datafile 17 to
"D:\ORADATA\CLONE\PDB1\ARCHIVE_INDEX01.DBF";
set newname for datafile 18 to
"D:\ORADATA\CLONE\PDB1\ARCHIVE_DATA01.DBF";
set newname for datafile 20 to
"D:\ORADATA\CLONE\PDB1\UNDOTBS01.DBF";
restore
clone database
;
}
executing Memory Script
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 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 22-JUL-20
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00008 to D:\ORADATA\CLONE\PDB1\SYSTEM01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00009 to D:\ORADATA\CLONE\PDB1\SYSAUX01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00011 to D:\ORADATA\CLONE\PDB1\USERS01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00012 to D:\ORADATA\CLONE\PDB1\REPORT_INDEX01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00013 to D:\ORADATA\CLONE\PDB1\REPORT_DATA01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00014 to D:\ORADATA\CLONE\PDB1\LOB01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00015 to D:\ORADATA\CLONE\PDB1\INDEX01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00016 to D:\ORADATA\CLONE\PDB1\DATA01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00017 to D:\ORADATA\CLONE\PDB1\ARCHIVE_INDEX01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00018 to D:\ORADATA\CLONE\PDB1\ARCHIVE_DATA01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00020 to D:\ORADATA\CLONE\PDB1\UNDOTBS01.DBF
channel ORA_AUX_DISK_1: reading from backup piece E:\TEMP\BACKUP01V59TTN_1_1
channel ORA_AUX_DISK_1: piece handle=E:\TEMP\BACKUP01V59TTN_1_1 tag=FOR DUPLICATION
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:02:35
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to D:\ORADATA\CLONE\SYSTEM01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00003 to D:\ORADATA\CLONE\SYSAUX01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00005 to D:\ORADATA\CLONE\UNDOTBS01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00007 to D:\ORADATA\CLONE\USERS01.DBF
channel ORA_AUX_DISK_1: reading from backup piece E:\TEMP\BACKUP02V59U28_1_1
channel ORA_AUX_DISK_1: piece handle=E:\TEMP\BACKUP02V59U28_1_1 tag=FOR DUPLICATION
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00002 to D:\ORADATA\CLONE\PDBSEED\SYSTEM01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00004 to D:\ORADATA\CLONE\PDBSEED\SYSAUX01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00006 to D:\ORADATA\CLONE\PDBSEED\UNDOTBS01.DBF
channel ORA_AUX_DISK_1: reading from backup piece E:\TEMP\BACKUP03V59U2F_1_1
channel ORA_AUX_DISK_1: piece handle=E:\TEMP\BACKUP03V59U2F_1_1 tag=FOR DUPLICATION
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 22-JUL-20
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=19 STAMP=1046447889 file name=D:\ORADATA\CLONE\SYSTEM01.DBF
datafile 2 switched to datafile copy
input datafile copy RECID=20 STAMP=1046447889 file name=D:\ORADATA\CLONE\PDBSEED\SYSTEM01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=21 STAMP=1046447890 file name=D:\ORADATA\CLONE\SYSAUX01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=22 STAMP=1046447890 file name=D:\ORADATA\CLONE\PDBSEED\SYSAUX01.DBF
datafile 5 switched to datafile copy
input datafile copy RECID=23 STAMP=1046447890 file name=D:\ORADATA\CLONE\UNDOTBS01.DBF
datafile 6 switched to datafile copy
input datafile copy RECID=24 STAMP=1046447890 file name=D:\ORADATA\CLONE\PDBSEED\UNDOTBS01.DBF
datafile 7 switched to datafile copy
input datafile copy RECID=25 STAMP=1046447890 file name=D:\ORADATA\CLONE\USERS01.DBF
datafile 8 switched to datafile copy
input datafile copy RECID=26 STAMP=1046447890 file name=D:\ORADATA\CLONE\PDB1\SYSTEM01.DBF
datafile 9 switched to datafile copy
input datafile copy RECID=27 STAMP=1046447890 file name=D:\ORADATA\CLONE\PDB1\SYSAUX01.DBF
datafile 11 switched to datafile copy
input datafile copy RECID=28 STAMP=1046447890 file name=D:\ORADATA\CLONE\PDB1\USERS01.DBF
datafile 12 switched to datafile copy
input datafile copy RECID=29 STAMP=1046447890 file name=D:\ORADATA\CLONE\PDB1\REPORT_INDEX01.DBF
datafile 13 switched to datafile copy
input datafile copy RECID=30 STAMP=1046447890 file name=D:\ORADATA\CLONE\PDB1\REPORT_DATA01.DBF
datafile 14 switched to datafile copy
input datafile copy RECID=31 STAMP=1046447890 file name=D:\ORADATA\CLONE\PDB1\LOB01.DBF
datafile 15 switched to datafile copy
input datafile copy RECID=32 STAMP=1046447890 file name=D:\ORADATA\CLONE\PDB1\INDEX01.DBF
datafile 16 switched to datafile copy
input datafile copy RECID=33 STAMP=1046447890 file name=D:\ORADATA\CLONE\PDB1\DATA01.DBF
datafile 17 switched to datafile copy
input datafile copy RECID=34 STAMP=1046447890 file name=D:\ORADATA\CLONE\PDB1\ARCHIVE_INDEX01.DBF
datafile 18 switched to datafile copy
input datafile copy RECID=35 STAMP=1046447890 file name=D:\ORADATA\CLONE\PDB1\ARCHIVE_DATA01.DBF
datafile 20 switched to datafile copy
input datafile copy RECID=36 STAMP=1046447890 file name=D:\ORADATA\CLONE\PDB1\UNDOTBS01.DBF
contents of Memory Script:
{
recover
clone database
noredo
delete archivelog
;
}
executing Memory Script
Starting recover at 22-JUL-20
using channel ORA_AUX_DISK_1
Oracle instance started
Total System Global Area 3238002128 bytes
Fixed Size 9272784 bytes
Variable Size 2147483648 bytes
Database Buffers 1073741824 bytes
Redo Buffers 7503872 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''CLONE'' comment=
''Reset to original value by RMAN'' scope=spfile";
sql clone "alter system reset db_unique_name scope=spfile";
shutdown clone immediate;
}
executing Memory Script
sql statement: alter system set db_name = ''CLONE'' comment= ''Reset to original value by RMAN'' scope=spfile
sql statement: alter system reset db_unique_name scope=spfile
Oracle instance shut down
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 07/22/2020 15:59:30
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
ORA-19649: offline-range record RECID 180 STAMP 1045848118 not found in file current controlfile
RMAN>
cloning is successful.
Now, after trying this and that, I decided to restore my target database (SOUR1CDB) from the taken backup (used for cloning), to verify that backup is ok.
When doing so, I was surprised I needed to recover the database.
but this time, I straight away issued recover database command (seems like nothing done):
and managed to open CLONE database with resetlogs.
Can someone tell me please what this RMAN error is telling me and comment on the whole situation?
My joy was premature. I thought I managed to open CLONE database with resetlogs (as it seemed)
when I did quit RMAN (without issues) the instance was in idle. I started it in nomount, then
I realized, that opening database with resetlogs worked as it was applied to target database (SOUR1CDB), not auxiliary. I guess for many RMANers this was obvious. So my basic puzzle is, why this process is failing when duplicate target database to CLONE and not when duplicate target database to CLONE FROM ACTIVE DATABASE.