How to Recover DROPPED PDB After Flashback of CDB

Hello Friends,

In this post we will talk about how we can recover dropped PDB after we flashback CDB (root container)

So the scenario is :

We were attempting database cloning; however, before cloning, we dropped PDB on the target side; moreover, due to some difficulty, it had to rollback the target to its former state, nevertheless, owing to the issue we dropped PDB, the datafiles were in Offline mode after flashback. Today, in this article, I'll explain how to solve the problem and restore the PDB to its original state.

How to Recover DROPPED PDB After Flashback of CDB

So lets get started.

So we will start with the point of roll back of target CDB.

Step 1 Roll back target CDB -:


SQL> flashback database to restore point FB_DROP;

Flashback complete.

Step 2 -: check for the SCN on which Restore point was created


SQL> SELECT NAME, SCN, TIME FROM V$RESTORE_POINT;

NAME              SCN         TIME
----------------- ---------- ---------------------------------
FB_DROP           540454493   02-APR-23 09.06.58.000000000 PM

Step 3 -: Check status of database (PDB) will be unnamed


SQL> select file#,name from v$datafile;

     FILE# NAME
---------- ----------------------------------------------------------------------------------------
         1 +DATAC1/CDBFIN_2/datafile/system.1573.1119710777
         2 +DATAC1/CDBFIN_2/846C1C4258D9012DE053C00DD10A4631/DATAFILE/system.1559.1119710779
         3 +DATAC1/CDBFIN_2/datafile/sysaux.1560.1119710779
         4 +DATAC1/CDBFIN_2/datafile/sysaux.1564.1119710777
         5 +DATAC1/CDBFIN_2/datafile/undotbs1.1569.1119710777
         7 +DATAC1/CDBFIN_2/datafile/undotbs2.1566.1119710779
        11 +DATAC1/CDBFIN_2/datafile/users.1567.1119710779
        13 /u02/app/oracle/product/12.1.0/dbhome_1/dbs/UNNAMED00013
        14 /u02/app/oracle/product/12.1.0/dbhome_1/dbs/UNNAMED00014
        15 /u02/app/oracle/product/12.1.0/dbhome_1/dbs/UNNAMED00015
        16 /u02/app/oracle/product/12.1.0/dbhome_1/dbs/UNNAMED00016
        17 /u02/app/oracle/product/12.1.0/dbhome_1/dbs/UNNAMED00017

Step 4 -: Srart with the restore of datafiles of PDB


[oracle@dm01db01 CDBFIN]$ rman target / catalog vpcrman/*******@dm01zdlra-scan:1521/zdlra1

Recovery Manager: Release 12.1.0.2.0 - Production on Sun Apr 2 23:28:22 2023

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

connected to target database: CDBFIN (DBID=1994598409, not open)
connected to recovery catalog database
recovery catalog schema release 21.01.00.00. is newer than RMAN release

RMAN> run {
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT   '%d_%U' PARMS  "SBT_LIBRARY=/u02/app/oracle/product/12.1.0/dbhome_1/lib/libra.so, ENV=(RA_WALLET='location=file:/var/opt/oracle/dbaas_acfs/CDBFIN/db_wallet credential_alias=dm01zdlra-scan:1521/zdlra1')";
set until scn 540454493;
set newname for datafile 13 to '+DATAC1';
set newname for datafile 14 to '+DATAC1';
set newname for datafile 15 to '+DATAC1';
set newname for datafile 16 to '+DATAC1';
set newname for datafile 17 to '+DATAC1';
restore pluggable database FINDB;
}

old RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
new RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
new RMAN configuration parameters are successfully stored

old RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT   '%d_%U' PARMS  "SBT_LIBRARY=/u02/app/oracle/product/12.1.0/dbhome_1/lib/libra.so, ENV=(RA_WALLET='location=file:/var/opt/oracle/dbaas_acfs/CDBFIN/db_wallet credential_alias=dm01zdlra-scan:1521/zdlra1')";
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT   '%d_%U' PARMS  "SBT_LIBRARY=/u02/app/oracle/product/12.1.0/dbhome_1/lib/libra.so, ENV=(RA_WALLET='location=file:/var/opt/oracle/dbaas_acfs/CDBFIN/db_wallet credential_alias=dm01zdlra-scan:1521/zdlra1')";
new RMAN configuration parameters are successfully stored

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

Starting restore at 02-APR-23
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 04/02/2023 23:29:05
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20208: UNTIL CHANGE is before RESETLOGS change

Here we got the error of incarnation as we did a resetlogs before. Solution is as below

Check the incarnation of database till now from Rman prompt


RMAN> list incarnation of database;


List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
55248702 55248703 CDBFIN 1994598409       PARENT  243241977  03-NOV-22
55248702 63791290 CDBFIN 1994598409       ORPHAN  540454495  02-APR-23
55248702 63818222 CDBFIN 1994598409       ORPHAN  540454495  02-APR-23
55248702 63818897 CDBFIN 1994598409       CURRENT 540454495  02-APR-23

Reset the incarnation to parent one -:


RMAN> reset database to incarnation 55248703;

database reset to incarnation 55248703

Step 5 -: Now start with the restore again .


RMAN> run {
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT   '%d_%U' PARMS  "SBT_LIBRARY=/u02/app/oracle/product/12.1.0/dbhome_1/lib/libra.so, ENV=(RA_WALLET='location=file:/var/opt/oracle/dbaas_acfs/CDBFIN/db_wallet credential_alias=dm01zdlra-scan:1521/zdlra1')";
set until scn 540454493;
set newname for datafile 13 to '+DATAC1';
set newname for datafile 14 to '+DATAC1';
set newname for datafile 15 to '+DATAC1';
set newname for datafile 16 to '+DATAC1';
set newname for datafile 17 to '+DATAC1';
restore pluggable database FINDB;
}

old RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
new RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
new RMAN configuration parameters are successfully stored

old RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT   '%d_%U' PARMS  "SBT_LIBRARY=/u02/app/oracle/product/12.1.0/dbhome_1/lib/libra.so, ENV=(RA_WALLET='location=file:/var/opt/oracle/dbaas_acfs/CDBFIN/db_wallet credential_alias=dm01zdlra-scan:1521/zdlra1')";
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT   '%d_%U' PARMS  "SBT_LIBRARY=/u02/app/oracle/product/12.1.0/dbhome_1/lib/libra.so, ENV=(RA_WALLET='location=file:/var/opt/oracle/dbaas_acfs/CDBFIN/db_wallet credential_alias=dm01zdlra-scan:1521/zdlra1')";
new RMAN configuration parameters are successfully stored

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

Starting restore at 02-APR-23
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=202 instance=CDBFIN1 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: RA Library (ZDLRA1) SID=F861563E4A875013E0530259010AB373
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=399 instance=CDBFIN1 device type=DISK

channel ORA_SBT_TAPE_1: starting datafile backup set restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
channel ORA_SBT_TAPE_1: restoring datafile 00013 to +DATAC1
channel ORA_SBT_TAPE_1: reading from backup piece VB$_3571773944_63759700_13
channel ORA_SBT_TAPE_1: piece handle=VB$_3571773944_63759700_13 tag=RA_VB
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:15
channel ORA_SBT_TAPE_1: starting datafile backup set restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
channel ORA_SBT_TAPE_1: restoring datafile 00014 to +DATAC1
channel ORA_SBT_TAPE_1: reading from backup piece VB$_3571773944_63759700_14
channel ORA_SBT_TAPE_1: piece handle=VB$_3571773944_63759700_14 tag=RA_VB
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:15
channel ORA_SBT_TAPE_1: starting datafile backup set restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
channel ORA_SBT_TAPE_1: restoring datafile 00017 to +DATAC1
channel ORA_SBT_TAPE_1: reading from backup piece VB$_3571773944_63759700_17
channel ORA_SBT_TAPE_1: piece handle=VB$_3571773944_63759700_17 tag=RA_VB
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:15
channel ORA_SBT_TAPE_1: starting datafile backup set restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
channel ORA_SBT_TAPE_1: restoring datafile 00016 to +DATAC1
channel ORA_SBT_TAPE_1: reading from backup piece VB$_3571773944_63759700_16
channel ORA_SBT_TAPE_1: piece handle=VB$_3571773944_63759700_16 tag=RA_VB
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:15
channel ORA_SBT_TAPE_1: starting datafile backup set restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
channel ORA_SBT_TAPE_1: restoring datafile 00015 to +DATAC1
channel ORA_SBT_TAPE_1: reading from backup piece VB$_3571773944_63759700_15
channel ORA_SBT_TAPE_1: piece handle=VB$_3571773944_63759700_15 tag=RA_VB
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:25
Finished restore at 02-APR-23

RMAN> exit

Recovery Manager complete.

Step 6 -: Once restore is completed , Open database in resetlogs mode.


[oracle@dm01db01 CDBFIN]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Sun Apr 2 23:36:19 2023

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c EE Extreme Perf Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       MOUNTED
         4 FINDB                          MOUNTED
SQL> alter database open resetlogs;

Database altered.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         4 FINDB                          MOUNTED
SQL>
SQL> exit
Disconnected from Oracle Database 12c EE Extreme Perf Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
[oracle@dm01db01 CDBFIN]$

Step 7 -: Switch to Rman Prompt and switch the restored datafiles.


[oracle@dm01db01 CDBFIN]$ rman target / catalog vpcrman/*******@dm01zdlra-scan:1521/zdlra1

Recovery Manager: Release 12.1.0.2.0 - Production on Sun Apr 2 23:37:52 2023

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

connected to target database: CDBFIN (DBID=1994598409)
connected to recovery catalog database
recovery catalog schema release 21.01.00.00. is newer than RMAN release

RMAN> switch datafile 13 to copy;

new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
datafile 13 switched to datafile copy "+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/system.1587.1133134349"
starting full resync of recovery catalog
full resync complete

RMAN> switch datafile 14 to copy;

datafile 14 switched to datafile copy "+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/sysaux.1568.1133134363"
starting full resync of recovery catalog
full resync complete

RMAN> switch datafile 15 to copy;

datafile 15 switched to datafile copy "+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/users.1588.1133134403"
starting full resync of recovery catalog
full resync complete

RMAN> switch datafile 16 to copy;

datafile 16 switched to datafile copy "+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/indx.1561.1133134391"
starting full resync of recovery catalog
full resync complete

RMAN> switch datafile 17 to copy;

datafile 17 switched to datafile copy "+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/perfstat.1557.1133134375"
starting full resync of recovery catalog
full resync complete

RMAN> exit


Recovery Manager complete.

Step 8 -: Switch to sql prompt and make the datafiles restored online.


[oracle@dm01db01 CDBFIN]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Sun Apr 2 23:39:41 2023

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c EE Extreme Perf Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, Oracle Label Security,
OLAP, Advanced Analytics and Real Application Testing options

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         4 FINDB                          MOUNTED
SQL> alter session set container=FINDB;

Session altered.

SQL> alter database datafile '+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/system.1587.1133134349' online;

Database altered.

SQL> alter database datafile 14 online;

Database altered.

SQL> alter database datafile 15 online;

Database altered.

SQL> alter database datafile 16 online;

Database altered.

SQL> alter database datafile 17 online;

Database altered.

SQL> exit
Disconnected from Oracle Database 12c EE Extreme Perf Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, Oracle Label Security,
OLAP, Advanced Analytics and Real Application Testing options

Step 9 -: Now switch back to rman prompt and recover PDB until SCN.


[oracle@dm01db01 CDBFIN]$
[oracle@dm01db01 CDBFIN]$ rman target / catalog vpcrman/*******@dm01zdlra-scan:1521/zdlra1

Recovery Manager: Release 12.1.0.2.0 - Production on Sun Apr 2 23:41:43 2023

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

connected to target database: CDBFIN (DBID=1994598409)
connected to recovery catalog database
recovery catalog schema release 21.01.00.00. is newer than RMAN release

RMAN> run {
2> CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT   '%d_%U' PARMS  "SBT_LIBRARY=/u02/app/oracle/product/12.1.0/dbhome_1/lib/libra.so, ENV=(RA_WALLET='location=file:/var/opt/oracle/dbaas_acfs/CDBFIN/db_wallet credential_alias=dm01zdlra-scan:1521/zdlra1')";
set until scn 540454493;
recover pluggable database FINDB;
}3> 4> 5> 6>

old RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
new RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

old RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT   '%d_%U' PARMS  "SBT_LIBRARY=/u02/app/oracle/product/12.1.0/dbhome_1/lib/libra.so, ENV=(RA_WALLET='location=file:/var/opt/oracle/dbaas_acfs/CDBFIN/db_wallet credential_alias=dm01zdlra-scan:1521/zdlra1')";
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT   '%d_%U' PARMS  "SBT_LIBRARY=/u02/app/oracle/product/12.1.0/dbhome_1/lib/libra.so, ENV=(RA_WALLET='location=file:/var/opt/oracle/dbaas_acfs/CDBFIN/db_wallet credential_alias=dm01zdlra-scan:1521/zdlra1')";
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

executing command: SET until clause

Starting recover at 02-APR-23
current log archived
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=595 instance=CDBFIN1 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: RA Library (ZDLRA1) SID=F8617988B49480BDE0530259010A972C
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=789 instance=CDBFIN1 device type=DISK

Creating automatic instance, with SID='eFea'

initialization parameters used for automatic instance:
db_name=CDBFIN
db_unique_name=eFea_pitr_FINDB_CDBFIN
compatible=12.1.0.2.0
db_block_size=8192
db_files=1024
diagnostic_dest=/u02/app/oracle
_system_trig_enabled=FALSE
sga_target=2560M
processes=200
#No auxiliary destination in use
enable_pluggable_database=true
_clone_one_pdb_recovery=true
control_files=+RECOC1/CDBFIN_2/DATAFILE/current.641.1133134925
#No auxiliary parameter file used


starting up automatic instance CDBFIN

Oracle instance started

Total System Global Area    2684354560 bytes

Fixed Size                     2928008 bytes
Variable Size                677806712 bytes
Database Buffers            1996488704 bytes
Redo Buffers                   7131136 bytes
Automatic instance created

contents of Memory Script:
{
# set requested point in time
set until  scn 540454493;
# restore the controlfile
restore clone controlfile;

# mount the controlfile
sql clone 'alter database mount clone database';
# resync catalog
resync catalog;
}
executing Memory Script

executing command: SET until clause

Starting restore at 02-APR-23
allocated channel: ORA_AUX_SBT_TAPE_1
channel ORA_AUX_SBT_TAPE_1: SID=314 device type=SBT_TAPE
channel ORA_AUX_SBT_TAPE_1: RA Library (ZDLRA1) SID=F8617AED04E79AC5E0530259010AE093
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=15 device type=DISK

channel ORA_AUX_SBT_TAPE_1: starting datafile backup set restore
channel ORA_AUX_SBT_TAPE_1: restoring control file
channel ORA_AUX_SBT_TAPE_1: reading from backup piece c-1994598409-20230402-07
channel ORA_AUX_SBT_TAPE_1: piece handle=c-1994598409-20230402-07 tag=TAG20230402T201824
channel ORA_AUX_SBT_TAPE_1: restored backup piece 1
channel ORA_AUX_SBT_TAPE_1: restore complete, elapsed time: 00:00:01
output file name=+RECOC1/CDBFIN_2/DATAFILE/current.641.1133134925
Finished restore at 02-APR-23

sql statement: alter database mount clone database

starting full resync of recovery catalog
full resync complete

contents of Memory Script:
{
# set requested point in time
set until  scn 540454493;
# switch to valid datafilecopies
switch clone datafile  13 to datafilecopy
 "+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/system.1587.1133134349";
switch clone datafile  14 to datafilecopy
 "+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/sysaux.1568.1133134363";
switch clone datafile  15 to datafilecopy
 "+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/users.1588.1133134403";
switch clone datafile  16 to datafilecopy
 "+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/indx.1561.1133134391";
switch clone datafile  17 to datafilecopy
 "+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/perfstat.1557.1133134375";
# set destinations for recovery set and auxiliary set datafiles
set newname for datafile  1 to
 "+RECOC1/CDBFIN_2/DATAFILE/system.1031.1133134945";
set newname for datafile  5 to
 "+RECOC1/CDBFIN_2/DATAFILE/undotbs1.3321.1133134945";
set newname for datafile  7 to
 "+RECOC1/CDBFIN_2/DATAFILE/undotbs2.851.1133134945";
set newname for datafile  3 to
 "+RECOC1/CDBFIN_2/DATAFILE/sysaux.3262.1133134945";
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile  1, 5, 7, 3;

switch clone datafile all;
}
executing Memory Script

executing command: SET until clause

datafile 13 switched to datafile copy
input datafile copy RECID=18 STAMP=1133134957 file name=+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/system.1587.1133134349

datafile 14 switched to datafile copy
input datafile copy RECID=19 STAMP=1133134957 file name=+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/sysaux.1568.1133134363

datafile 15 switched to datafile copy
input datafile copy RECID=20 STAMP=1133134957 file name=+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/users.1588.1133134403

datafile 16 switched to datafile copy
input datafile copy RECID=21 STAMP=1133134957 file name=+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/indx.1561.1133134391

datafile 17 switched to datafile copy
input datafile copy RECID=22 STAMP=1133134957 file name=+DATAC1/CDBFIN_2/B2E3BCA1E64B4198E0530257010ABD0B/DATAFILE/perfstat.1557.1133134375

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 02-APR-23
using channel ORA_AUX_SBT_TAPE_1
using channel ORA_AUX_DISK_1

channel ORA_AUX_SBT_TAPE_1: starting datafile backup set restore
channel ORA_AUX_SBT_TAPE_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_SBT_TAPE_1: restoring datafile 00001 to +RECOC1/CDBFIN_2/DATAFILE/system.1031.1133134945
channel ORA_AUX_SBT_TAPE_1: reading from backup piece VB$_3571773944_63759728_1
channel ORA_AUX_SBT_TAPE_1: piece handle=VB$_3571773944_63759728_1 tag=RA_VB
channel ORA_AUX_SBT_TAPE_1: restored backup piece 1
channel ORA_AUX_SBT_TAPE_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_SBT_TAPE_1: starting datafile backup set restore
channel ORA_AUX_SBT_TAPE_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_SBT_TAPE_1: restoring datafile 00005 to +RECOC1/CDBFIN_2/DATAFILE/undotbs1.3321.1133134945
channel ORA_AUX_SBT_TAPE_1: reading from backup piece VB$_3571773944_63759728_5
channel ORA_AUX_SBT_TAPE_1: piece handle=VB$_3571773944_63759728_5 tag=RA_VB
channel ORA_AUX_SBT_TAPE_1: restored backup piece 1
channel ORA_AUX_SBT_TAPE_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_SBT_TAPE_1: starting datafile backup set restore
channel ORA_AUX_SBT_TAPE_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_SBT_TAPE_1: restoring datafile 00007 to +RECOC1/CDBFIN_2/DATAFILE/undotbs2.851.1133134945
channel ORA_AUX_SBT_TAPE_1: reading from backup piece VB$_3571773944_63759728_7
channel ORA_AUX_SBT_TAPE_1: piece handle=VB$_3571773944_63759728_7 tag=RA_VB
channel ORA_AUX_SBT_TAPE_1: restored backup piece 1
channel ORA_AUX_SBT_TAPE_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_SBT_TAPE_1: starting datafile backup set restore
channel ORA_AUX_SBT_TAPE_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_SBT_TAPE_1: restoring datafile 00003 to +RECOC1/CDBFIN_2/DATAFILE/sysaux.3262.1133134945
channel ORA_AUX_SBT_TAPE_1: reading from backup piece VB$_3571773944_63759728_3
channel ORA_AUX_SBT_TAPE_1: piece handle=VB$_3571773944_63759728_3 tag=RA_VB
channel ORA_AUX_SBT_TAPE_1: restored backup piece 1
channel ORA_AUX_SBT_TAPE_1: restore complete, elapsed time: 00:00:15
Finished restore at 02-APR-23

datafile 1 switched to datafile copy
input datafile copy RECID=27 STAMP=1133135020 file name=+RECOC1/CDBFIN_2/DATAFILE/system.1031.1133134945
datafile 5 switched to datafile copy
input datafile copy RECID=28 STAMP=1133135020 file name=+RECOC1/CDBFIN_2/DATAFILE/undotbs1.3321.1133134945
datafile 7 switched to datafile copy
input datafile copy RECID=29 STAMP=1133135020 file name=+RECOC1/CDBFIN_2/DATAFILE/undotbs2.851.1133134945
datafile 3 switched to datafile copy
input datafile copy RECID=30 STAMP=1133135020 file name=+RECOC1/CDBFIN_2/DATAFILE/sysaux.3262.1133134945

contents of Memory Script:
{
# set requested point in time
set until  scn 540454493;
# online the datafiles restored or switched
sql clone "alter database datafile  1 online";
sql clone "alter database datafile  5 online";
sql clone "alter database datafile  7 online";
sql clone "alter database datafile  3 online";
sql clone 'FINDB' "alter database datafile
 13 online";
sql clone 'FINDB' "alter database datafile
 14 online";
sql clone 'FINDB' "alter database datafile
 15 online";
sql clone 'FINDB' "alter database datafile
 16 online";
sql clone 'FINDB' "alter database datafile
 17 online";
# recover pdb
recover clone database tablespace  "SYSTEM", "UNDOTBS1", "UNDOTBS2", "SYSAUX" pluggable database
 'FINDB'   delete archivelog;
sql clone 'alter database open read only';
plsql <<>>;
plsql <<>>;
# shutdown clone before import
shutdown clone abort
plsql <<  'FINDB');
end; >>>;
}
executing Memory Script

executing command: SET until clause

sql statement: alter database datafile  1 online

sql statement: alter database datafile  5 online

sql statement: alter database datafile  7 online

sql statement: alter database datafile  3 online

sql statement: alter database datafile  13 online

sql statement: alter database datafile  14 online

sql statement: alter database datafile  15 online

sql statement: alter database datafile  16 online

sql statement: alter database datafile  17 online

Starting recover at 02-APR-23
using channel ORA_AUX_SBT_TAPE_1
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 1351 is already on disk as file +RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1351.1136.1133129305
archived log for thread 2 with sequence 1350 is already on disk as file +RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1350.3327.1133129309
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=2 sequence=1341
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_t31ohnpf_1_1
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_t31ohnpf_1_1 tag=TAG20230401T221822
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:01
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=1 sequence=1342
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_t21ohnpf_1_1
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_t21ohnpf_1_1 tag=TAG20230401T221822
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:01
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=1 sequence=1343
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_t51ohuqf_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1342.768.1133135027 thread=1 sequence=1342
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1341.879.1133135025 thread=2 sequence=1341
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1342.768.1133135027 RECID=9044 STAMP=1133135026
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_t51ohuqf_1_1 tag=TAG20230402T001822
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:02
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=2 sequence=1342
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_t61ohuqf_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1343.820.1133135027 thread=1 sequence=1343
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1341.879.1133135025 RECID=9043 STAMP=1133135025
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_t61ohuqf_1_1 tag=TAG20230402T001822
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:01
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=1 sequence=1344
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_t81oijtd_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1342.768.1133135029 thread=2 sequence=1342
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1343.820.1133135027 RECID=9045 STAMP=1133135028
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_t81oijtd_1_1 tag=TAG20230402T061821
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:01
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=2 sequence=1343
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_t91oijtd_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1344.879.1133135031 thread=1 sequence=1344
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1342.768.1133135029 RECID=9046 STAMP=1133135029
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_t91oijtd_1_1 tag=TAG20230402T061821
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:01
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=2 sequence=1344
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_tc1oiquf_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1343.768.1133135031 thread=2 sequence=1343
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1343.768.1133135031 RECID=9048 STAMP=1133135031
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_tc1oiquf_1_1 tag=TAG20230402T081822
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:02
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=1 sequence=1345
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_tb1oique_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1344.820.1133135033 thread=2 sequence=1344
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1344.879.1133135031 RECID=9047 STAMP=1133135030
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_tb1oique_1_1 tag=TAG20230402T081822
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:00
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=1 sequence=1346
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_te1oj1ve_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1345.768.1133135035 thread=1 sequence=1345
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1345.768.1133135035 RECID=9050 STAMP=1133135034
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_te1oj1ve_1_1 tag=TAG20230402T101822
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:02
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=2 sequence=1345
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_tf1oj1ve_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1346.879.1133135035 thread=1 sequence=1346
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1344.820.1133135033 RECID=9049 STAMP=1133135032
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_tf1oj1ve_1_1 tag=TAG20230402T101822
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:00
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=1 sequence=1347
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_th1oj90e_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1345.768.1133135037 thread=2 sequence=1345
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1346.879.1133135035 RECID=9051 STAMP=1133135035
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_th1oj90e_1_1 tag=TAG20230402T121822
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:02
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=2 sequence=1346
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_ti1oj90e_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1347.820.1133135037 thread=1 sequence=1347
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1345.768.1133135037 RECID=9052 STAMP=1133135036
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_ti1oj90e_1_1 tag=TAG20230402T121822
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:01
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=1 sequence=1348
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_tk1ojg1h_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1346.879.1133135039 thread=2 sequence=1346
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1347.820.1133135037 RECID=9053 STAMP=1133135037
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_tk1ojg1h_1_1 tag=TAG20230402T141825
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:00
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=2 sequence=1347
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_tl1ojg1h_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1348.768.1133135039 thread=1 sequence=1348
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1346.879.1133135039 RECID=9054 STAMP=1133135038
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_tl1ojg1h_1_1 tag=TAG20230402T141825
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:02
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=2 sequence=1348
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_to1ojn2f_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1347.820.1133135041 thread=2 sequence=1347
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1347.820.1133135041 RECID=9056 STAMP=1133135040
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_to1ojn2f_1_1 tag=TAG20230402T161823
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:01
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=1 sequence=1349
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_tn1ojn2f_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1348.879.1133135041 thread=2 sequence=1348
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1348.768.1133135039 RECID=9055 STAMP=1133135039
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_tn1ojn2f_1_1 tag=TAG20230402T161823
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:00
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=1 sequence=1350
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_tr1ok54e_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1349.820.1133135043 thread=1 sequence=1349
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1349.820.1133135043 RECID=9058 STAMP=1133135042
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_tr1ok54e_1_1 tag=TAG20230402T201822
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:01
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=2 sequence=1349
channel ORA_SBT_TAPE_1: reading from backup piece CDBFIN_tq1ok54e_1_1
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1350.768.1133135043 thread=1 sequence=1350
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1348.879.1133135041 RECID=9057 STAMP=1133135041
channel ORA_SBT_TAPE_1: piece handle=CDBFIN_tq1ok54e_1_1 tag=TAG20230402T201822
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:01
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1349.820.1133135045 thread=2 sequence=1349
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1350.768.1133135043 RECID=9059 STAMP=1133135043
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_1_seq_1351.1136.1133129305 thread=1 sequence=1351
channel clone_default: deleting archived log(s)
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1349.820.1133135045 RECID=9060 STAMP=1133135043
archived log file name=+RECOC1/CDBFIN_2/ARCHIVELOG/2023_04_02/thread_2_seq_1350.3327.1133129309 thread=2 sequence=1350
media recovery complete, elapsed time: 00:00:02
Finished recover at 02-APR-23

sql statement: alter database open read only



Oracle instance shut down


Removing automatic instance
Automatic instance removed
auxiliary instance file +RECOC1/CDBFIN_2/DATAFILE/sysaux.3262.1133134945 deleted
auxiliary instance file +RECOC1/CDBFIN_2/DATAFILE/current.641.1133134925 deleted
Finished recover at 02-APR-23

Step 10 -: Once the recovery is completed Switch to sql prompt and open PDB in resetlogs mode.Nw the PDB should open in non restricted mode.


SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         4 FINDB                          MOUNTED
SQL> alter pluggable database FINDB open resetlogs;

Pluggable database altered.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         4 FINDB                          READ WRITE NO

Step 11 -: Stop start database and Backup full database once.


[oracle@dm01db01 CDBFIN]$ srvctl stop database -d CDBFIN_2;

[oracle@dm01db01 CDBFIN]$ srvctl start database -d CDBFIN_2
Previous
Next Post »