Tuesday, 13 October 2015

Full Restore and Recovery of an PDB

Full Restore/Recovery of PDB

Only the PDB which is currently being recovered is affected, other PDB are not affected.

Manually removing all the datafiles of an PDB to mitigate entire loss of an PDB db hrdepts.

SQL> ! rm -f /oracle/product/oradata/sec_cdb/hrdept/system01.dbf /oracle/product/oradata/sec_cdb/hrdept/sysaux01.dbf /oracle/product/oradata/sec_cdb/hrdept/users01.dbf

SQL> ! rm -f /oracle/product/oradata/sec_cdb/hrdept/manzoor01.dbf


SQL> alter pluggable database hrdepts open;
alter pluggable database hrdepts open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 12 - see DBWR trace file
ORA-01110: data file 12: '/oracle/product/oradata/sec_cdb/hrdept/manzoor01.dbf'

[oracle@rhel11gr2rac1 auxiliary_dest]$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Tue Aug 25 11:35:55 2015

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

connected to target database: SEC_CDB (DBID=54313082)


RMAN> list backup of pluggable database hrdepts;

using target database control file instead of recovery catalog

List of Backup Sets
===================
--


RMAN> run
2> {
3> allocate channel a1 device type disk;
4> allocate channel a2 device type disk;
5> restore pluggable database hrdepts;
6> recover pluggable database hrdepts;
7> }

allocated channel: a1
channel a1: SID=61 device type=DISK

allocated channel: a2
channel a2: SID=53 device type=DISK

Starting restore at 25-AUG-15

channel a1: starting datafile backup set restore
channel a1: specifying datafile(s) to restore from backup set
channel a1: restoring datafile 00009 to /oracle/product/oradata/sec_cdb/hrdept/sysaux01.dbf
channel a1: reading from backup piece /oracle/bkp_seccdb/bkp_cold_1iqfe1la_1_1_20150824
channel a2: starting datafile backup set restore
channel a2: specifying datafile(s) to restore from backup set
channel a2: restoring datafile 00008 to /oracle/product/oradata/sec_cdb/hrdept/system01.dbf
channel a2: restoring datafile 00010 to /oracle/product/oradata/sec_cdb/hrdept/users01.dbf
channel a2: reading from backup piece /oracle/bkp_seccdb/bkp_cold_1kqfe1ql_1_1_20150824
channel a2: piece handle=/oracle/bkp_seccdb/bkp_cold_1kqfe1ql_1_1_20150824 tag=TAG20150824T182943
channel a2: restored backup piece 1
channel a2: restore complete, elapsed time: 00:01:26
channel a2: starting datafile backup set restore
channel a2: specifying datafile(s) to restore from backup set
channel a2: restoring datafile 00012 to /oracle/product/oradata/sec_cdb/hrdept/manzoor01.dbf
channel a2: reading from backup piece /oracle/bkp_seccdb/pdb_inc_0_1qqffq3r_1_1_20150825.bkp
channel a2: piece handle=/oracle/bkp_seccdb/pdb_inc_0_1qqffq3r_1_1_20150825.bkp tag=TAG20150825T103538
channel a2: restored backup piece 1
channel a2: restore complete, elapsed time: 00:00:03
channel a1: piece handle=/oracle/bkp_seccdb/bkp_cold_1iqfe1la_1_1_20150824 tag=TAG20150824T182943
channel a1: restored backup piece 1
channel a1: restore complete, elapsed time: 00:02:21
Finished restore at 25-AUG-15

Starting recover at 25-AUG-15
channel a1: starting incremental datafile backup set restore
channel a1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00008: /oracle/product/oradata/sec_cdb/hrdept/system01.dbf
destination for restore of datafile 00010: /oracle/product/oradata/sec_cdb/hrdept/users01.dbf
channel a1: reading from backup piece /oracle/bkp_seccdb/pdb_inc_0_1rqffq3r_1_1_20150825.bkp
channel a2: starting incremental datafile backup set restore
channel a2: specifying datafile(s) to restore from backup set
destination for restore of datafile 00009: /oracle/product/oradata/sec_cdb/hrdept/sysaux01.dbf
channel a2: reading from backup piece /oracle/bkp_seccdb/pdb_inc_0_1qqffq3r_1_1_20150825.bkp
channel a1: piece handle=/oracle/bkp_seccdb/pdb_inc_0_1rqffq3r_1_1_20150825.bkp tag=TAG20150825T103538
channel a1: restored backup piece 1
channel a1: restore complete, elapsed time: 00:00:01
channel a2: piece handle=/oracle/bkp_seccdb/pdb_inc_0_1qqffq3r_1_1_20150825.bkp tag=TAG20150825T103538
channel a2: restored backup piece 1
channel a2: restore complete, elapsed time: 00:00:01

starting media recovery
media recovery complete, elapsed time: 00:00:01

Finished recover at 25-AUG-15
released channel: a1
released channel: a2

RMAN> alter pluggable database hrdepts open;

Statement processed




No comments:

Post a Comment