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 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 DATABASE;
RMAN> restore database;
Starting restore at 01-DEC-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=22 device type=DISK
skipping datafile 5; already restored to file /u01/oradata/cdb1/pdbseed/system01.dbf
skipping datafile 7; already restored to file /u01/oradata/cdb1/pdbseed/sysaux01.dbf
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 00001 to /u01/oradata/cdb1/system01.dbf
…………….
…………….
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 RECOVER DATABASE;
RMAN> RECOVER DATABASE;
Starting recover at 01-DEC-15
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:04
Finished recover 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:00
Finished recover at 01-DEC-15
RMAN>
- Open the database for normal operation with command: alter database open;
RMAN> alter database open;
Statement processed
RMAN>
- This completes recovery of CDB database with all PDBs.
Larry Catt
OCP