rman duplicate with no target connection fails with RMAN-06024: no backup or copy of the control file found to restore after resetlogs

From: Andrea Monti <ilsuonogiallo_at_gmail.com>
Date: Thu, 12 Dec 2019 17:33:27 +0100
Message-ID: <CAAQVbZansBedr9sQBBpvcgK6Uvzgow5ojeqQumq0DFhNgOQr6Q_at_mail.gmail.com>



Hello all,

I found out that rman duplicate with no target connection fails if the primary database has several incarnation.

I'm running Oracle 12.2.0.1.191015 SE2.
Target (source) database has been opened resetlogs last time on 2019-12-12 15:21 and I took rman backups (level0, archivelog, controlfile) even after the "open resetlogs".
RMAN restore/recover works fine (so far, so good) but DUPLICATE fails as long as I am not connected to the target database. The same rman scripts work fine, as long as the database has 1 incarnation. Any clue/suggestion? More details in the following. I'm still experimenting, but this is getting me quite worried.... thanks,
Andrea

My rman scripts is:

connect auxiliary sys/yyyyyyyy
connect catalog RMANCAT_XXXXXX1O/zzzzzzzz_at_RMANCAT

list incarnation ;

RUN {
 ALLOCATE AUXILIARY CHANNEL A1 TYPE DISK ;  DUPLICATE DATABASE 'XXXXXX1O' TO 'XXXXXX2O' UNTIL TIME ' sysdate - 30 / 1440 ';
}

EXIT Its output is:

RMAN>
RMAN> connect auxiliary *

2> connect catalog *
3>
4> list incarnation ;
5>
6> RUN {
7>  ALLOCATE AUXILIARY CHANNEL A1 TYPE DISK ;
8>  DUPLICATE DATABASE 'XXXXXX1O' TO 'XXXXXX2O' UNTIL TIME ' sysdate - 30 /
1440 ';
9> }
10>
11> EXIT
connected to auxiliary database: XXXXXX2O (not mounted)

connected to recovery catalog database

List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time

------- ------- -------- ---------------- --- ---------- ----------
1       2       XXXXXX1O 4285476555       PARENT  1          2019-05-29
16:21:31
1       82641   XXXXXX1O 4285476555       ORPHAN  616134344  2019-12-06
15:01:17
1       82910   XXXXXX1O 4285476555       ORPHAN  634776472  2019-12-10
11:38:01
1       94735   XXXXXX1O 4285476555       PARENT  635343712  2019-12-11
16:11:03
1       98260   XXXXXX1O 4285476555       CURRENT 635756878  2019-12-12
15:21:33

allocated channel: A1
channel A1: SID=50 device type=DISK

Starting Duplicate Db at 2019-12-12 17:15:28

contents of Memory Script:
{

   set until scn 635786761;
   sql clone "alter system set db_name =
''XXXXXX1O'' comment=
''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set db_unique_name =
''XXXXXX2O'' 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

executing command: SET until clause

sql statement: alter system set db_name = ''XXXXXX1O'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set db_unique_name = ''XXXXXX2O'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area 8589934592 bytes

Fixed Size                    12180200 bytes
Variable Size               2516583704 bytes
Database Buffers            6039797760 bytes
Redo Buffers                  21372928 bytes
allocated channel: A1
channel A1: SID=50 device type=DISK

Starting restore at 2019-12-12 17:15:56

Oracle instance started

Total System Global Area 8589934592 bytes

Fixed Size                    12180200 bytes
Variable Size               2516583704 bytes
Database Buffers            6039797760 bytes
Redo Buffers                  21372928 bytes

contents of Memory Script:
{

   sql clone "alter system set db_name =
''XXXXXX2O'' 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 = ''XXXXXX2O'' 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 12/12/2019 17:16:25
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-06026: some targets not found - aborting restore RMAN-06024: no backup or copy of the control file found to restore

But I do have rman backups! Restore works and I can see I do have backups:

$ rman

Recovery Manager: Release 12.2.0.1.0 - Production on Thu Dec 12 17:22:17 2019

Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.

RMAN> connect target /

connected to target database: XXXXXX1O (DBID=4285476555)

RMAN> connect catalog RMANCAT_XXXXXX1O/zzzzzzzz_at_RMANCAT

connected to recovery catalog database

RMAN> list incarnatin ;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands RMAN-01009: syntax error: found "identifier": expecting one of: "all, archivelog, backed, backuppiece, backupset, backup, completed, controlfilecopy, copy, datafilecopy, db_unique_name, device, expired, failure, foreign, global, guid, incarnation, like, proxy, preplugin, recoverable, restore, script, tag"
RMAN-01008: the bad identifier was: incarnatin RMAN-01007: at line 1 column 6 file: standard input

RMAN> list incarnation ;

List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time

------- ------- -------- ---------------- --- ---------- ----------
1       2       XXXXXX1O 4285476555       PARENT  1          2019-05-29
16:21:31
1       82641   XXXXXX1O 4285476555       ORPHAN  616134344  2019-12-06
15:01:17
1       82910   XXXXXX1O 4285476555       ORPHAN  634776472  2019-12-10
11:38:01
1       94735   XXXXXX1O 4285476555       PARENT  635343712  2019-12-11
16:11:03
1       98260   XXXXXX1O 4285476555       CURRENT 635756878  2019-12-12
15:21:33

RMAN> list backup of controlfile completed after ' sysdate - 90 / 1440 ' ;

List of Backup Sets


BS Key Type LV Size Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ -------------------
99807   Full    1.98M      DISK        00:00:01     2019-12-12 16:00:13
        BP Key: 99809   Status: AVAILABLE  Compressed: YES  Tag: CTRL
        Piece Name:

/oracle/oradata/XXXXXX1O/backup/XXXXXX1O_20191212_4nuj8goc_ctrl.bkp   Control File Included: Ckp SCN: 635769952 Ckp time: 2019-12-12 16:00:12

BS Key Type LV Size Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ -------------------
99849   Full    1.98M      DISK        00:00:02     2019-12-12 16:15:11
        BP Key: 99851   Status: AVAILABLE  Compressed: YES  Tag: CTRL
        Piece Name:

/oracle/oradata/XXXXXX1O/backup/XXXXXX1O_20191212_4puj8hkd_ctrl.bkp   Control File Included: Ckp SCN: 635771455 Ckp time: 2019-12-12 16:15:09

BS Key Type LV Size Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ -------------------
99881   Full    1.98M      DISK        00:00:01     2019-12-12 16:30:13
        BP Key: 99883   Status: AVAILABLE  Compressed: YES  Tag: CTRL
        Piece Name:

/oracle/oradata/XXXXXX1O/backup/XXXXXX1O_20191212_4ruj8igk_ctrl.bkp   Control File Included: Ckp SCN: 635783819 Ckp time: 2019-12-12 16:30:12

BS Key Type LV Size Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ -------------------
99913   Full    1.98M      DISK        00:00:01     2019-12-12 16:45:12
        BP Key: 99915   Status: AVAILABLE  Compressed: YES  Tag: CTRL
        Piece Name:

/oracle/oradata/XXXXXX1O/backup/XXXXXX1O_20191212_4tuj8jcn_ctrl.bkp   Control File Included: Ckp SCN: 635786761 Ckp time: 2019-12-12 16:45:11

BS Key Type LV Size Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ -------------------
99945   Full    1.98M      DISK        00:00:01     2019-12-12 17:00:10
        BP Key: 99947   Status: AVAILABLE  Compressed: YES  Tag: CTRL
        Piece Name:

/oracle/oradata/XXXXXX1O/backup/XXXXXX1O_20191212_4vuj8k8p_ctrl.bkp   Control File Included: Ckp SCN: 635787635 Ckp time: 2019-12-12 17:00:09

BS Key Type LV Size Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ -------------------
99977   Full    1.98M      DISK        00:00:01     2019-12-12 17:15:11
        BP Key: 99979   Status: AVAILABLE  Compressed: YES  Tag: CTRL
        Piece Name:

/oracle/oradata/XXXXXX1O/backup/XXXXXX1O_20191212_51uj8l4u_ctrl.bkp   Control File Included: Ckp SCN: 635788962 Ckp time: 2019-12-12 17:15:10

RMAN>

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Dec 12 2019 - 17:33:27 CET

Original text of this message