Point In Time Recovery (PITR) of a Pluggable Database (PDB)
In oracle 12c, a PITR can be performed at PDB level as well just as a PITR for a non-CDB. This post demonstrates on how to perform a Point In Time Recovery (PITR) of a Pluggable Database (PDB).
RMAN backups, in oracle 12c, can be taken either of a complete CDB or of a specific PDB or just of a ROOT. Backup taken of a CDB includes the ROOT, SEED and all the PDBs of that CDB. To proceed with, I’m taking a level 0 backup of the CDB.
Environment:
CDB Name : oracdb PDB Name : pdb1 Hostname : ora12c-1
[oracle@ora12c-1 ~]$ rman target / Recovery Manager: Release 12.1.0.1.0 - Production on Fri Oct 2 18:31:11 2015 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. connected to target database: ORACDB (DBID=2564384489) RMAN> run 2> { 3> backup as compressed backupset incremental level 0 database format '/u02/bkp/%d_inc0_%T_%U.bak'; 4> backup as compressed backupset archivelog all delete input format '/u02/bkp/%d_arc_%T_%U.bak'; 5> } Starting backup at 02-OCT-15 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=36 device type=DISK channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=/u01/app/oracle/oradata/oracdb/system01.dbf input datafile file number=00004 name=/u01/app/oracle/oradata/oracdb/undotbs01.dbf input datafile file number=00003 name=/u01/app/oracle/oradata/oracdb/sysaux01.dbf input datafile file number=00006 name=/u01/app/oracle/oradata/oracdb/users01.dbf channel ORA_DISK_1: starting piece 1 at 02-OCT-15 channel ORA_DISK_1: finished piece 1 at 02-OCT-15 piece handle=/u02/bkp/ORACDB_inc0_20151002_01qinglk_1_1.bak tag=TAG20151002T183220 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:01:45 channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00033 name=/u02/oradata/pdb1/sysaux01.dbf input datafile file number=00032 name=/u02/oradata/pdb1/system01.dbf input datafile file number=00034 name=/u02/oradata/pdb1/myts01.dbf channel ORA_DISK_1: starting piece 1 at 02-OCT-15 channel ORA_DISK_1: finished piece 1 at 02-OCT-15 piece handle=/u02/bkp/ORACDB_inc0_20151002_02qingot_1_1.bak tag=TAG20151002T183220 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:56 channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00007 name=/u01/app/oracle/oradata/oracdb/pdbseed/sysaux01.dbf input datafile file number=00005 name=/u01/app/oracle/oradata/oracdb/pdbseed/system01.dbf channel ORA_DISK_1: starting piece 1 at 02-OCT-15 channel ORA_DISK_1: finished piece 1 at 02-OCT-15 piece handle=/u02/bkp/ORACDB_inc0_20151002_03qingql_1_1.bak tag=TAG20151002T183220 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55 Finished backup at 02-OCT-15 Starting backup at 02-OCT-15 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting compressed archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=60 RECID=1 STAMP=892060183 input archived log thread=1 sequence=61 RECID=2 STAMP=892060184 input archived log thread=1 sequence=62 RECID=3 STAMP=892060185 input archived log thread=1 sequence=63 RECID=4 STAMP=892060186 input archived log thread=1 sequence=64 RECID=5 STAMP=892060186 input archived log thread=1 sequence=65 RECID=6 STAMP=892060188 input archived log thread=1 sequence=66 RECID=7 STAMP=892060558 channel ORA_DISK_1: starting piece 1 at 02-OCT-15 channel ORA_DISK_1: finished piece 1 at 02-OCT-15 piece handle=/u02/bkp/ORACDB_arc_20151002_04qingsf_1_1.bak tag=TAG20151002T183559 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: deleting archived log(s) archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_60_c0wzxzr0_.arc RECID=1 STAMP=892060183 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_61_c0wzy0qo_.arc RECID=2 STAMP=892060184 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_62_c0wzy1nd_.arc RECID=3 STAMP=892060185 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_63_c0wzy21y_.arc RECID=4 STAMP=892060186 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_64_c0wzy2mg_.arc RECID=5 STAMP=892060186 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_65_c0wzy456_.arc RECID=6 STAMP=892060188 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_66_c0x09pwf_.arc RECID=7 STAMP=892060558 Finished backup at 02-OCT-15 Starting Control File and SPFILE Autobackup at 02-OCT-15 piece handle=/u01/app/oracle/fast_recovery_area/ORACDB/autobackup/2015_10_02/o1_mf_s_892060560_c0x09s9z_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 02-OCT-15 RMAN>
The database (CDB and the PDB) details along with their incarnation is as shown below.
SQL> show con_name CON_NAME ------------------------------ CDB$ROOT SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ------ ---------- ---------------- ------------ 2 PDB$SEED READ ONLY NO 3 PDB1 MOUNTED
SQL>select DB_INCARNATION#,PDB_INCARNATION#,STATUS,INCARNATION_SCN,INCARNATION_TIME,BEGIN_RESETLOGS_SCN,BEGIN_RESETLOGS_TIME,CON_ID from v$pdb_incarnation order by con_id; DB_INCARNATION# PDB_INCARNATION# STATUS INCARNATION_SCN INCARNATI BEGIN_RESETLOGS_SCN BEGIN_RES CON_ID --------------- ---------------- ------- --------------- --------- ------------------- --------- ---------- 2 0 CURRENT 1720082 09-SEP-15 1720082 09-SEP-15 1 1 0 PARENT 1 24-MAY-13 1 24-MAY-13 1 2 0 CURRENT 1720082 09-SEP-15 1720082 09-SEP-15 2 1 0 PARENT 1 24-MAY-13 1 24-MAY-13 2 2 0 CURRENT 1720082 09-SEP-15 1720082 09-SEP-15 3 1 0 PARENT 1 24-MAY-13 1 24-MAY-13 3 6 rows selected.
We can see that the Incarnation SCN of CON_ID 3 (PDB1) was started at 1720082 on “9th September 2015”.
Here is a case where all the datafiles of the PDB1 were accidentally removed. This prevents me from starting the PDB1.
SQL> alter pluggable database pdb1 open; alter pluggable database pdb1 open * ERROR at line 1: ORA-01157: cannot identify/lock data file 34 - see DBWR trace file ORA-01110: data file 34: '/u02/oradata/pdb1/myts01.dbf' Sat Oct 03 10:52:21 2015 Errors in file /u01/app/oracle/diag/rdbms/oracdb/oracdb/trace/oracdb_dbw0_2854.trc: ORA-01157: cannot identify/lock data file 34 - see DBWR trace file ORA-01110: data file 34: '/u02/oradata/pdb1/myts01.dbf' ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 3
To add up, even some of the latest archive logs that weren’t backed up too were deleted. The latest archive log sequence generated by the database is 91 but what I could see is that I have the archive logs only until log sequence 80. The remaining 10 archives (from log sequence 81 to 91) have gone missing.
SQL> archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 91 Next log sequence to archive 93 Current log sequence 93 SQL> SQL> sho parameter db_reco NAME TYPE VALUE -------------------------- ------------- ---------------------------------- db_recovery_file_dest string /u01/app/oracle/fast_recovery_area db_recovery_file_dest_size big integer 4800M
[oracle@ora12c-1 2015_10_03]$ pwd /u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_03 [oracle@ora12c-1 2015_10_03]$ ls -lrt *90* ls: *90*: No such file or directory [oracle@ora12c-1 2015_10_03]$ ls -lrt total 120028 -rw-r----- 1 oracle oinstall 1324032 Oct 3 10:23 o1_mf_1_75_c0yqtc57_.arc -rw-r----- 1 oracle oinstall 28605440 Oct 3 10:31 o1_mf_1_76_c0yr8f4z_.arc -rw-r----- 1 oracle oinstall 39796736 Oct 3 10:33 o1_mf_1_77_c0yrdrco_.arc -rw-r----- 1 oracle oinstall 49885696 Oct 3 10:34 o1_mf_1_78_c0yrhl8n_.arc -rw-r----- 1 oracle oinstall 3145728 Oct 3 10:51 o1_mf_1_79_c0ysgkf7_.arc -rw-r----- 1 oracle oinstall 1024 Oct 3 10:51 o1_mf_1_80_c0ysglos_.arc
Let me perform a PITR of PDB1 until log sequence 80. Connect RMAN to the CDB and issue “restore pluggable database <pdbname>” and “recover pluggable database <pdbname> auxiliary destination <dest locn>” command to restore and recover a particular PDB from the backup taken at the CDB level.
While recoverying a PDB, include the “auxiliary destination” clause if FRA is not configured. Also make sure that there is enough free space available in the FRA. If not, then use the “AUXILIARY DESTINATION” clause to specify a temporary location.
When a PITR is performed, all the data files of the PDB are recovered until the time / sequence / SCN that is specified. But, as we know, that the Undo tablespace in 12c architecture is shared by all the PDBs, it’s not possible to recover Undo tablespace for a specific PDB alone. As a result, RMAN creates a dummy database under the FRA location (if FRA isn’t configured, then RMAN creates the dummy database in the “auxiliary destination” location) by restoring all the datafiles of the ROOT (SYSTEM, SYSAUX and UNDO specifically) and then uses the undo information to recover the PDB.
Here is how it works. Connect RMAN to the CDB and restore/recover the required PDB. Make sure that the PDB is closed by performing the PITR. In my case, it’s already crashed. I’m using “/u03/temp_pdb” as an auxiliary destination.
[oracle@ora12c-1 pdb1]$ rman target / Recovery Manager: Release 12.1.0.1.0 - Production on Sat Oct 3 10:52:29 2015 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. connected to target database: ORACDB (DBID=2564384489) RMAN> run 2> { 3> set until sequence 80; 4> restore pluggable database pdb1; 5> recover pluggable database pdb1 auxiliary destination '/u03/temp_pdb'; 6> alter pluggable database pdb1 open resetlogs; 7> }
So what this does is that, it first restores the datafiles of the PDB to it’s location.
channel ORA_DISK_1: restoring datafile 00032 to /u02/oradata/pdb1/system01.dbf channel ORA_DISK_1: restoring datafile 00033 to /u02/oradata/pdb1/sysaux01.dbf channel ORA_DISK_1: restoring datafile 00034 to /u02/oradata/pdb1/myts01.dbf channel ORA_DISK_1: reading from backup piece /u02/bkp/ORACDB_inc0_20151002_02qingot_1_1.bak channel ORA_DISK_1: piece handle=/u02/bkp/ORACDB_inc0_20151002_02qingot_1_1.bak tag=TAG20151002T183220 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:55 Finished restore at 03-OCT-15
It then identifies the list of tablespaces that hold the UNDO segments.
List of tablespaces expected to have UNDO segments Tablespace SYSTEM Tablespace UNDOTBS1
Then creates a dummy instance with system generated name. Here it created with name “EbFT”.
Creating automatic instance, with SID='EbFt' initialization parameters used for automatic instance: db_name=ORACDB db_unique_name=EbFt_pitr_pdb1_ORACDB compatible=12.1.0.0.0 db_block_size=8192 db_files=200 sga_target=1G processes=80 diagnostic_dest=/u01/app/oracle db_create_file_dest=/u03/temp_pdb log_archive_dest_1='location=/u03/temp_pdb' enable_pluggable_database=true _clone_one_pdb_recovery=true #No auxiliary parameter file used
It then restores the controlfile for the dummy instance and mounts it.
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/ORACDB/autobackup/2015_10_02/o1_mf_s_892060560_c0x09s9z_.bkp channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/ORACDB/autobackup/2015_10_02/o1_mf_s_892060560_c0x09s9z_.bkp tag=TAG20151002T183600 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03 output file name=/u03/temp_pdb/ORACDB/controlfile/o1_mf_c0ysohd3_.ctl Finished restore at 03-OCT-15 sql statement: alter database mount clone database
Then restores all the datafiles of the CDB, it uses the previously restored datafiles of PDB as a copy and then recovers the PDB.
# set requested point in time set until logseq 80 thread 1; # switch to valid datafilecopies switch clone datafile 32 to datafilecopy "/u02/oradata/pdb1/system01.dbf"; switch clone datafile 33 to datafilecopy "/u02/oradata/pdb1/sysaux01.dbf"; switch clone datafile 34 to datafilecopy "/u02/oradata/pdb1/myts01.dbf"; # set destinations for recovery set and auxiliary set datafiles set newname for clone datafile 1 to new; set newname for clone datafile 4 to new; set newname for clone datafile 3 to new; set newname for clone datafile 6 to new; # restore the tablespaces in the recovery set and the auxiliary set restore clone datafile 1, 4, 3, 6; switch clone datafile all; }
Here is the complete log of PDB PITR.
[oracle@ora12c-1 pdb1]$ rman target / Recovery Manager: Release 12.1.0.1.0 - Production on Sat Oct 3 10:52:29 2015 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. connected to target database: ORACDB (DBID=2564384489) RMAN> run 2> { 3> set until sequence 80; 4> restore pluggable database pdb1; 5> recover pluggable database pdb1 auxiliary destination '/u03/temp_pdb'; 6> alter pluggable database pdb1 open resetlogs; 7> } executing command: SET until clause Starting restore at 03-OCT-15 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=55 device type=DISK channel ORA_DISK_1: starting datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set channel ORA_DISK_1: restoring datafile 00032 to /u02/oradata/pdb1/system01.dbf channel ORA_DISK_1: restoring datafile 00033 to /u02/oradata/pdb1/sysaux01.dbf channel ORA_DISK_1: restoring datafile 00034 to /u02/oradata/pdb1/myts01.dbf channel ORA_DISK_1: reading from backup piece /u02/bkp/ORACDB_inc0_20151002_02qingot_1_1.bak channel ORA_DISK_1: piece handle=/u02/bkp/ORACDB_inc0_20151002_02qingot_1_1.bak tag=TAG20151002T183220 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:55 Finished restore at 03-OCT-15 Starting recover at 03-OCT-15 using channel ORA_DISK_1 RMAN-05026: WARNING: presuming following set of tablespaces applies to specified Point-in-Time List of tablespaces expected to have UNDO segments Tablespace SYSTEM Tablespace UNDOTBS1 Creating automatic instance, with SID='EbFt' initialization parameters used for automatic instance: db_name=ORACDB db_unique_name=EbFt_pitr_pdb1_ORACDB compatible=12.1.0.0.0 db_block_size=8192 db_files=200 sga_target=1G processes=80 diagnostic_dest=/u01/app/oracle db_create_file_dest=/u03/temp_pdb log_archive_dest_1='location=/u03/temp_pdb' enable_pluggable_database=true _clone_one_pdb_recovery=true #No auxiliary parameter file used starting up automatic instance ORACDB Oracle instance started Total System Global Area 1068937216 bytes Fixed Size 2296576 bytes Variable Size 281019648 bytes Database Buffers 780140544 bytes Redo Buffers 5480448 bytes Automatic instance created contents of Memory Script: { # set requested point in time set until logseq 80 thread 1; # restore the controlfile restore clone controlfile; # mount the controlfile sql clone 'alter database mount clone database'; } executing Memory Script executing command: SET until clause Starting restore at 03-OCT-15 allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: SID=19 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 /u01/app/oracle/fast_recovery_area/ORACDB/autobackup/2015_10_02/o1_mf_s_892060560_c0x09s9z_.bkp channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/ORACDB/autobackup/2015_10_02/o1_mf_s_892060560_c0x09s9z_.bkp tag=TAG20151002T183600 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03 output file name=/u03/temp_pdb/ORACDB/controlfile/o1_mf_c0ysohd3_.ctl Finished restore at 03-OCT-15 sql statement: alter database mount clone database contents of Memory Script: { # set requested point in time set until logseq 80 thread 1; # switch to valid datafilecopies switch clone datafile 32 to datafilecopy "/u02/oradata/pdb1/system01.dbf"; switch clone datafile 33 to datafilecopy "/u02/oradata/pdb1/sysaux01.dbf"; switch clone datafile 34 to datafilecopy "/u02/oradata/pdb1/myts01.dbf"; # set destinations for recovery set and auxiliary set datafiles set newname for clone datafile 1 to new; set newname for clone datafile 4 to new; set newname for clone datafile 3 to new; set newname for clone datafile 6 to new; # restore the tablespaces in the recovery set and the auxiliary set restore clone datafile 1, 4, 3, 6; switch clone datafile all; } executing Memory Script executing command: SET until clause datafile 32 switched to datafile copy input datafile copy RECID=7 STAMP=892119312 file name=/u02/oradata/pdb1/system01.dbf datafile 33 switched to datafile copy input datafile copy RECID=8 STAMP=892119312 file name=/u02/oradata/pdb1/sysaux01.dbf datafile 34 switched to datafile copy input datafile copy RECID=9 STAMP=892119312 file name=/u02/oradata/pdb1/myts01.dbf executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME Starting restore at 03-OCT-15 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 00001 to /u03/temp_pdb/ORACDB/datafile/o1_mf_system_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00004 to /u03/temp_pdb/ORACDB/datafile/o1_mf_undotbs1_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00003 to /u03/temp_pdb/ORACDB/datafile/o1_mf_sysaux_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00006 to /u03/temp_pdb/ORACDB/datafile/o1_mf_users_%u_.dbf channel ORA_AUX_DISK_1: reading from backup piece /u02/bkp/ORACDB_inc0_20151002_01qinglk_1_1.bak channel ORA_AUX_DISK_1: piece handle=/u02/bkp/ORACDB_inc0_20151002_01qinglk_1_1.bak tag=TAG20151002T183220 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:02:28 Finished restore at 03-OCT-15 datafile 1 switched to datafile copy input datafile copy RECID=14 STAMP=892119459 file name=/u03/temp_pdb/ORACDB/datafile/o1_mf_system_c0ysoqlk_.dbf datafile 4 switched to datafile copy input datafile copy RECID=15 STAMP=892119459 file name=/u03/temp_pdb/ORACDB/datafile/o1_mf_undotbs1_c0ysoqn1_.dbf datafile 3 switched to datafile copy input datafile copy RECID=16 STAMP=892119459 file name=/u03/temp_pdb/ORACDB/datafile/o1_mf_sysaux_c0ysoqnf_.dbf datafile 6 switched to datafile copy input datafile copy RECID=17 STAMP=892119459 file name=/u03/temp_pdb/ORACDB/datafile/o1_mf_users_c0ysoqo1_.dbf contents of Memory Script: { # set requested point in time set until logseq 80 thread 1; # online the datafiles restored or switched sql clone "alter database datafile 1 online"; sql clone "alter database datafile 4 online"; sql clone "alter database datafile 3 online"; sql clone 'PDB1' "alter database datafile 32 online"; sql clone 'PDB1' "alter database datafile 33 online"; sql clone 'PDB1' "alter database datafile 34 online"; sql clone "alter database datafile 6 online"; # recover pdb recover clone database tablespace "SYSTEM", "UNDOTBS1", "SYSAUX", "USERS" pluggable database 'PDB1' delete archivelog; sql clone 'alter database open read only'; plsql <<<begin add_dropped_ts; end; >>>; plsql <<<begin save_pdb_clean_scn; end; >>>; # shutdown clone before import shutdown clone abort plsql <<<begin pdbpitr_inspect(pdbname => 'PDB1'); end; >>>; } executing Memory Script executing command: SET until clause sql statement: alter database datafile 1 online sql statement: alter database datafile 4 online sql statement: alter database datafile 3 online sql statement: alter database datafile 32 online sql statement: alter database datafile 33 online sql statement: alter database datafile 34 online sql statement: alter database datafile 6 online Starting recover at 03-OCT-15 using channel ORA_AUX_DISK_1 starting media recovery archived log for thread 1 with sequence 67 is already on disk as file /u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_67_c0x0q1yd_.arc archived log for thread 1 with sequence 68 is already on disk as file /u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_68_c0x0q8v7_.arc archived log for thread 1 with sequence 69 is already on disk as file /u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_69_c0x0qfom_.arc archived log for thread 1 with sequence 70 is already on disk as file /u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_70_c0x0qfpp_.arc archived log for thread 1 with sequence 71 is already on disk as file /u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_71_c0x0qfps_.arc archived log for thread 1 with sequence 72 is already on disk as file /u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_72_c0x0qjvc_.arc archived log for thread 1 with sequence 73 is already on disk as file /u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_73_c0x0qjvp_.arc archived log for thread 1 with sequence 74 is already on disk as file /u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_74_c0x0qloh_.arc archived log for thread 1 with sequence 75 is already on disk as file /u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_03/o1_mf_1_75_c0yqtc57_.arc archived log for thread 1 with sequence 76 is already on disk as file /u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_03/o1_mf_1_76_c0yr8f4z_.arc archived log for thread 1 with sequence 77 is already on disk as file /u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_03/o1_mf_1_77_c0yrdrco_.arc archived log for thread 1 with sequence 78 is already on disk as file /u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_03/o1_mf_1_78_c0yrhl8n_.arc archived log for thread 1 with sequence 79 is already on disk as file /u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_03/o1_mf_1_79_c0ysgkf7_.arc channel ORA_AUX_DISK_1: starting archived log restore to default destination channel ORA_AUX_DISK_1: restoring archived log archived log thread=1 sequence=66 channel ORA_AUX_DISK_1: reading from backup piece /u02/bkp/ORACDB_arc_20151002_04qingsf_1_1.bak channel ORA_AUX_DISK_1: piece handle=/u02/bkp/ORACDB_arc_20151002_04qingsf_1_1.bak tag=TAG20151002T183559 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01 archived log file name=/u03/temp_pdb/1_66_889990250.dbf thread=1 sequence=66 channel clone_default: deleting archived log(s) archived log file name=/u03/temp_pdb/1_66_889990250.dbf RECID=8 STAMP=892119461 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_67_c0x0q1yd_.arc thread=1 sequence=67 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_68_c0x0q8v7_.arc thread=1 sequence=68 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_69_c0x0qfom_.arc thread=1 sequence=69 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_70_c0x0qfpp_.arc thread=1 sequence=70 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_71_c0x0qfps_.arc thread=1 sequence=71 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_72_c0x0qjvc_.arc thread=1 sequence=72 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_73_c0x0qjvp_.arc thread=1 sequence=73 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_02/o1_mf_1_74_c0x0qloh_.arc thread=1 sequence=74 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_03/o1_mf_1_75_c0yqtc57_.arc thread=1 sequence=75 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_03/o1_mf_1_76_c0yr8f4z_.arc thread=1 sequence=76 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_03/o1_mf_1_77_c0yrdrco_.arc thread=1 sequence=77 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_03/o1_mf_1_78_c0yrhl8n_.arc thread=1 sequence=78 archived log file name=/u01/app/oracle/fast_recovery_area/ORACDB/archivelog/2015_10_03/o1_mf_1_79_c0ysgkf7_.arc thread=1 sequence=79 media recovery complete, elapsed time: 00:00:32 Finished recover at 03-OCT-15 sql statement: alter database open read only Oracle instance shut down Removing automatic instance Automatic instance removed auxiliary instance file /u03/temp_pdb/ORACDB/datafile/o1_mf_sysaux_c0ysoqnf_.dbf deleted auxiliary instance file /u03/temp_pdb/ORACDB/controlfile/o1_mf_c0ysohd3_.ctl deleted Finished recover at 03-OCT-15 Statement processed RMAN>
After the PDB is recovered, connect to the CDB and verify the status.
We could see that PDB is back online in READ WRITE mode.
SQL> show con_name CON_NAME ------------------------------ CDB$ROOT SQL> SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ------ ---------- ------------ ----------- 2 PDB$SEED READ ONLY NO 3 PDB1 READ WRITE NO
Also, the incarnation details of the CDB, SEED and the PDB is as follows with the current incarnation of CON_ID 3 (PDB1) being set to the time it was recovered (3rd Oct 2015).
SQL> select DB_INCARNATION#,PDB_INCARNATION#,STATUS,INCARNATION_SCN,INCARNATION_TIME,BEGIN_RESETLOGS_SCN,BEGIN_RESETLOGS_TIME,CON_ID from v$pdb_incarnation order by con_id; DB_INCARNATION# PDB_INCARNATION# STATUS INCARNATION_SCN INCARNATI BEGIN_RESETLOGS_SCN BEGIN_RES CON_ID --------------- ---------------- ------- --------------- --------- ------------------- --------- ---------- 2 0 CURRENT 1720082 09-SEP-15 1720082 09-SEP-15 1 1 0 PARENT 1 24-MAY-13 1 24-MAY-13 1 2 0 CURRENT 1720082 09-SEP-15 1720082 09-SEP-15 2 1 0 PARENT 1 24-MAY-13 1 24-MAY-13 2 2 1 CURRENT 2394990 03-OCT-15 2395699 03-OCT-15 3 2 0 PARENT 1720082 09-SEP-15 1720082 09-SEP-15 3 6 rows selected.
COPYRIGHT
© Shivananda Rao P, 2012 to 2018. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Shivananda Rao and http://www.shivanandarao-oracle.com with appropriate and specific direction to the original content.
DISCLAIMER
The views expressed here are my own and do not necessarily reflect the views of any other individual, business entity, or organization. The views expressed by visitors on this blog are theirs solely and may not reflect mine.
Leave a Reply