Oracle 12c multitenant database can use the Recovery Manager utility or EM Cloud control to recover a database from a previously taken backup set. This procedure outlines the general steps to recover a PDB database using the RMAN utility.
- Logon to your database server as the oracle software owner.
[root@linux2 etc]# su – oracle
Last login: Wed Nov 30 11:45:07 EST 2015 on pts/1
[oracle@linux2 ~]$
- Logon to RMAN utility with sysbackup privileges.
[oracle@linux2 ~]$ rman target ‘”/ as sysbackup”‘
Recovery Manager: Release 12.1.0.2.0 – Production on Thu Dec 1 09:26:07 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDB1 (DBID=898155058)
RMAN>
- Place the database in mount mode.
RMAN> shutdown immediate
Oracle instance shut down
RMAN> startup mount
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 734003200 bytes
Fixed Size 2928728 bytes
Variable Size 524292008 bytes
Database Buffers 201326592 bytes
Redo Buffers 5455872 bytes
RMAN>
- Issue the command; RESTORE PLUGGABLE DATABASE <PDB>;
RMAN> RESTORE PLUGGABLE DATABASE pdb1;
Starting restore at 01-DEC-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=22 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 00008 to /u01/oradata/cdb1/pdb1/system01.dbf
channel ORA_DISK_1: restoring datafile 00009 to /u01/oradata/cdb1/pdb1/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00010 to /u01/oradata/cdb1/pdb1/pdb1_users01.dbf
channel ORA_DISK_1: restoring datafile 00015 to /opt/app/oradata/pdb1_users.dbf
channel ORA_DISK_1: reading from backup piece /opt/app/oracle/fast_recovery_area/CDB1/3F4D938FE2151097E0534B0F1E0A4221/backupset/2015_12_01/o1_mf_nnndf_TAG20151201T092735_d40dy1qr_.bkp
channel ORA_DISK_1: piece handle=/opt/app/oracle/fast_recovery_area/CDB1/3F4D938FE2151097E0534B0F1E0A4221/backupset/2015_12_01/o1_mf_nnndf_TAG20151201T092735_d40dy1qr_.bkp tag=TAG20151201T092735
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:45
Finished restore at 01-DEC-15
RMAN>
- Issue the command RESTORE PLUGGABLE DATABASE <PDB>;
RMAN> RESTORE PLUGGABLE DATABASE pdb1;
Starting restore at 01-DEC-15
using channel ORA_DISK_1
skipping datafile 8; already restored to file /u01/oradata/cdb1/pdb1/system01.dbf
skipping datafile 9; already restored to file /u01/oradata/cdb1/pdb1/sysaux01.dbf
skipping datafile 10; already restored to file /u01/oradata/cdb1/pdb1/pdb1_users01.dbf
skipping datafile 15; already restored to file /opt/app/oradata/pdb1_users.dbf
restore not done; all files read only, offline, or already restored
Finished restore at 01-DEC-15
RMAN>
- You can remove any database archive redo logs after they are no longer needed using command: RECOVER DATABASE DELETE ARCHIVELOG;
RMAN> RECOVER DATABASE DELETE ARCHIVELOG;
Starting recover at 01-DEC-15
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:03
Finished recover at 01-DEC-15
RMAN>
- Examine RMAN logs for errors and if no errors open root and PDBs.
ALTER DATABASE OPEN;
ALTER PLUGGABLE DATABASE ALL OPEN;
RMAN> ALTER DATABASE OPEN;
Statement processed
RMAN> ALTER PLUGGABLE DATABASE ALL OPEN;
Statement processed
RMAN>
- This completes recovery of PDB database.
Larry Catt
OCP