Forum Stats

  • 3,824,774 Users
  • 2,260,416 Discussions
  • 7,896,309 Comments

Discussions

Duplicate CDB to new CDB based backup via catalog db hit RMAN-06024

User_XYKV0
User_XYKV0 Member Posts: 3 Employee
edited Jan 13, 2020 10:24AM in Recovery Manager (RMAN)

My environment is two CDBs.

Catalog Database (db name is catadb) on host A.

Client Database (db name is orcl) on host B.

Steps:

1. Register orcl on catadb.

2. Backup orcl via catadb (All good):

[email protected]: $ rman catalog rco/[email protected] target sys/[email protected]>  run {backup database format '/scratch/sysvldb/valen/adwbk/tcdb_%U.bak' tag 'full_orcl';backup archivelog all  format '/scratch/sysvldb/valen/adwbk/arc_%U.bak' tag 'full_orcl';backup current controlfile format '/scratch/sysvldb/valen/adwbk/ctl_%U.bak' tag 'full_orcl'  ;}

3. Create a new instance as lucky. And startup lucky nomount;

4.  Clone lucky from orcl backup (All good)

[email protected]:$  rman catalog rco/[email protected] auxiliary sys/[email protected]

RMAN> duplicate database orcl to lucky;

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 /scratch/sysvldb/app/sysvldb/fast_recovery_area/ORCL/autobackup/2020_01_12/o1_mf_s_1029539575_h1

r63q4q_.bkp

channel ORA_AUX_DISK_1: piece handle=/scratch/sysvldb/app/sysvldb/fast_recovery_area/ORCL/autobackup/2020_01_12/o1_mf_s_1029539575_h1r63q4q_.bkp t

ag=TAG20200112T231255

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01

output file name=/scratch/sysvldb/app/sysvldb/oradata/SUNAB/controlfile/o1_mf_h1ltz2r3_.ctl

output file name=/scratch/sysvldb/app/sysvldb/fast_recovery_area/SUNAB/controlfile/o1_mf_h1ltz2s5_.ctl

Finished restore at 13-JAN-20

database mounted

contents of Memory Script:

{

   set until scn 2934804;  <====We will use this SCN later

   set newname for clone datafile  1 to new;

   set newname for clone datafile  3 to new;

   set newname for clone datafile  4 to new;

   set newname for clone datafile  5 to new;

   set newname for clone datafile  6 to new;

   set newname for clone datafile  7 to new;

   set newname for clone datafile  8 to new;

   set newname for clone datafile  9 to new;

   set newname for clone datafile  10 to new;

   set newname for clone datafile  11 to new;

   set newname for clone datafile  12 to new;

   set newname for clone datafile  13 to new;

   restore

   clone database

   ;

}

...

contents of Memory Script:

{

   Alter clone database open resetlogs;

}

executing Memory Script

database opened

contents of Memory Script:

{

   sql clone "alter pluggable database all open";

}

executing Memory Script

sql statement: alter pluggable database all open

Cannot remove created server parameter file

Finished Duplicate Db at 13-JAN-20

RMAN> exit

============================================================

My issue is :

If step3 , I create a new instance as sunai, and startup it nomount;

Will hit RMAN-06024 at step4.  Clone sunai from orcl backup at point-in-time

============================================================

[email protected]:~ $  rman catalog rco/[email protected] auxiliary sys/[email protected]

RMAN> duplicate database orcl to sunai nofilenamecheck until scn  2934804; <======This is the last SCN in archived logs, and if I use scn 2934800 would get RMAN-06024 too.

Starting Duplicate Db at 13-JAN-20

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=1 device type=DISK

contents of Memory Script:

{

   sql clone "create spfile from memory";

}

executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:

{

   shutdown clone immediate;

   startup clone nomount;

}

executing Memory Script

Oracle instance shut down

connected to auxiliary database (not started)

Oracle instance started

Total System Global Area   19931329832 bytes

Fixed Size                    13116712 bytes

Variable Size               2415919104 bytes

Database Buffers           17448304640 bytes

Redo Buffers                  53989376 bytes

duplicating Online logs to Oracle Managed File (OMF) location

duplicating Datafiles to Oracle Managed File (OMF) location

contents of Memory Script:

{

   set until scn  2934804;

   sql clone "alter system set  control_files =

  ''/scratch/sysvldb/app/sysvldb/oradata/SUNAI/controlfile/o1_mf_h1ltz2r3_.ctl'', ''/scratch/sysvldb/app/sysvldb/fast_recovery_area/SUNAI/controlf

ile/o1_mf_h1ltz2s5_.ctl'' comment=

''Set by RMAN'' scope=spfile";

   sql clone "alter system set  db_name =

''ORCL'' comment=

''Modified by RMAN duplicate'' scope=spfile";

   sql clone "alter system set  db_unique_name =

''sunai'' 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  control_files =   ''/scratch/sysvldb/app/sysvldb/oradata/SUNAI/controlfile/o1_mf_h1ltz2r3_.ctl'', ''/scratch/sysvldb/app/sysvldb/fast_recovery_area/SUNAI/controlfile/o1_mf_h1ltz2s5_.ctl'' comment= ''Set by RMAN'' scope=spfile

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

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

Oracle instance shut down

Oracle instance started

Total System Global Area   19931329832 bytes

Fixed Size                    13116712 bytes

Variable Size               2415919104 bytes

Database Buffers           17448304640 bytes

Redo Buffers                  53989376 bytes

Starting restore at 13-JAN-20

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=252 device type=DISK

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of Duplicate Db command at 01/13/2020 06:56:06

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

And I tried rman catalog rco/[email protected] auxiliary sys/[email protected] target sys/[email protected]

RMAN>  duplicate target database to sunah backup location '/scratch/sysvldb/valen/adwbk' nofilenamecheck until scn 2934804;

Would get the same error as above.

Could anyone help me out about how to use RMAN duplicate do PITR via catalog db,pls?

Thanks a lot.

-Valen

Tagged: