RMAN Backup and Restore Scenario for Oracle 12C Multitenancy System – Part 1

1)Performing Level 0 Backup of Pluggable Database:

Below mentioned command should be run by connecting to container database i.e in our case it is IMADB

We have to connect to RMAN prompt–

rman target sys/imadb@imadb catalog rcat01/rcat01@masterdb

NOTE:- In above example IMADB is container database and MASTERDB is holding Catalog for our pluggable database confdb.

Below mentioned command will be used to take incremental level backup of pluggable database confdb.

RMAN> BACKUP INCREMENTAL LEVEL 0 MAXSETSIZE  2G FILESPERSET 2 TAG 'Level0_32122' PLUGGABLE DATABASE confdb SKIP READONLY plus archivelog;

Starting backup at 03-APR-18

current log archived

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=138 device type=DISK

allocated channel: ORA_DISK_2

channel ORA_DISK_2: SID=263 device type=DISK

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=218 RECID=218 STAMP=972436655

input archived log thread=1 sequence=219 RECID=219 STAMP=972436681

channel ORA_DISK_1: starting piece 1 at 03-APR-18

channel ORA_DISK_2: starting archived log backup set

channel ORA_DISK_2: specifying archived log(s) in backup set

input archived log thread=1 sequence=216 RECID=217 STAMP=972436651

input archived log thread=1 sequence=217 RECID=216 STAMP=972436651

channel ORA_DISK_2: starting piece 1 at 03-APR-18

channel ORA_DISK_1: finished piece 1 at 03-APR-18

piece handle=+REDO2/IMADB/BACKUPSET/2018_04_03/annnf0_level0_3222_0.394.972440729 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=220 RECID=220 STAMP=972440727

channel ORA_DISK_1: starting piece 1 at 03-APR-18

channel ORA_DISK_2: finished piece 1 at 03-APR-18

piece handle=+REDO2/IMADB/BACKUPSET/2018_04_03/annnf0_level0_3222_0.393.972440729 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_2: backup set complete, elapsed time: 00:00:03

channel ORA_DISK_1: finished piece 1 at 03-APR-18

piece handle=+REDO2/IMADB/BACKUPSET/2018_04_03/annnf0_level0_3222_0.392.972440733 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 03-APR-18

Starting backup at 03-APR-18

using channel ORA_DISK_1

using channel ORA_DISK_2

channel ORA_DISK_1: starting incremental level 0 datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00009 name=+ORACONF/oradata/confdb/system01confdb.dbf

input datafile file number=00037 name=+ORACONF/oradata/confdb/ncrcattbsp01.dbf

channel ORA_DISK_1: starting piece 1 at 03-APR-18

channel ORA_DISK_2: starting incremental level 0 datafile backup set

channel ORA_DISK_2: specifying datafile(s) in backup set

input datafile file number=00010 name=+ORACONF/oradata/confdb/sysaux01confdb.dbf

channel ORA_DISK_2: starting piece 1 at 03-APR-18

channel ORA_DISK_1: finished piece 1 at 03-APR-18

piece handle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn0_level0_3222_0.391.972440733 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15

channel ORA_DISK_1: starting incremental level 0 datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00011 name=+ORACONF/oradata/confdb/undo01confdb.dbf

channel ORA_DISK_1: starting piece 1 at 03-APR-18

channel ORA_DISK_2: finished piece 1 at 03-APR-18

piece handle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn0_level0_3222_0.390.972440733 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_2: backup set complete, elapsed time: 00:00:15

channel ORA_DISK_2: starting incremental level 0 datafile backup set

channel ORA_DISK_2: specifying datafile(s) in backup set

input datafile file number=00012 name=+ORACONF/oradata/confdb/configdata01.dbf

channel ORA_DISK_2: starting piece 1 at 03-APR-18

channel ORA_DISK_2: finished piece 1 at 03-APR-18

piece handle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn0_level0_3222_0.388.972440749 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01

channel ORA_DISK_1: finished piece 1 at 03-APR-18

piece handle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn0_level0_3222_0.389.972440749 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

Finished backup at 03-APR-18

Starting backup at 03-APR-18

current log archived

using channel ORA_DISK_1

using channel ORA_DISK_2

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=221 RECID=221 STAMP=972440752

channel ORA_DISK_1: starting piece 1 at 03-APR-18

channel ORA_DISK_1: finished piece 1 at 03-APR-18

piece handle=+REDO2/IMADB/BACKUPSET/2018_04_03/annnf0_level0_3222_0.386.972440753 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 03-APR-18

Starting Control File Autobackup at 03-APR-18

piece handle=/ora00/app/oracle/bkp/sep02pvvm392/IMADB/LEVEL0/imadbcfc-194714882-20180403-03.RW99 comment=NONE

Finished Control File Autobackup at 03-APR-18

 

2)Performing Level 1 Backup of Pluggable Database:

We have to connect to RMAN prompt–

rman target sys/imadb@imadb catalog rcat01/rcat01@masterdb

Here we will be taking incremental level 1 backup of pluggable database confdb .Above mentioned command will be run while connecting to Container database:

RMAN> BACKUP INCREMENTAL LEVEL 1 MAXSETSIZE  2G FILESPERSET 2 TAG 'Level0_3222' PLUGGABLE DATABASE CONFDB SKIP READONLY plus archivelog;

Starting backup at 03-APR-18

current log archived

using channel ORA_DISK_1

using channel ORA_DISK_2

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=218 RECID=218 STAMP=972436655

input archived log thread=1 sequence=219 RECID=219 STAMP=972436681

channel ORA_DISK_1: starting piece 1 at 03-APR-18

channel ORA_DISK_2: starting archived log backup set

channel ORA_DISK_2: specifying archived log(s) in backup set

input archived log thread=1 sequence=216 RECID=217 STAMP=972436651

input archived log thread=1 sequence=217 RECID=216 STAMP=972436651

channel ORA_DISK_2: starting piece 1 at 03-APR-18

channel ORA_DISK_1: finished piece 1 at 03-APR-18

piece handle=+REDO2/IMADB/BACKUPSET/2018_04_03/annnf0_level0_3222_0.384.972440905 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=220 RECID=220 STAMP=972440727

input archived log thread=1 sequence=221 RECID=221 STAMP=972440752

channel ORA_DISK_1: starting piece 1 at 03-APR-18

channel ORA_DISK_2: finished piece 1 at 03-APR-18

piece handle=+REDO2/IMADB/BACKUPSET/2018_04_03/annnf0_level0_3222_0.383.972440905 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_2: backup set complete, elapsed time: 00:00:03

channel ORA_DISK_2: starting archived log backup set

channel ORA_DISK_2: specifying archived log(s) in backup set

input archived log thread=1 sequence=222 RECID=222 STAMP=972440904

channel ORA_DISK_2: starting piece 1 at 03-APR-18

channel ORA_DISK_1: finished piece 1 at 03-APR-18

piece handle=+REDO2/IMADB/BACKUPSET/2018_04_03/annnf0_level0_3222_0.382.972440907 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

channel ORA_DISK_2: finished piece 1 at 03-APR-18

piece handle=+REDO2/IMADB/BACKUPSET/2018_04_03/annnf0_level0_3222_0.381.972440907 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01

Finished backup at 03-APR-18

Starting backup at 03-APR-18

using channel ORA_DISK_1

using channel ORA_DISK_2

channel ORA_DISK_1: starting incremental level 1 datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00009 name=+ORACONF/oradata/confdb/system01confdb.dbf

input datafile file number=00037 name=+ORACONF/oradata/confdb/ncrcattbsp01.dbf

channel ORA_DISK_1: starting piece 1 at 03-APR-18

channel ORA_DISK_2: starting incremental level 1 datafile backup set

channel ORA_DISK_2: specifying datafile(s) in backup set

input datafile file number=00010 name=+ORACONF/oradata/confdb/sysaux01confdb.dbf

channel ORA_DISK_2: starting piece 1 at 03-APR-18

channel ORA_DISK_1: finished piece 1 at 03-APR-18

piece handle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn1_level0_3222_0.380.972440909 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07

channel ORA_DISK_1: starting incremental level 1 datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00011 name=+ORACONF/oradata/confdb/undo01confdb.dbf

channel ORA_DISK_1: starting piece 1 at 03-APR-18

channel ORA_DISK_2: finished piece 1 at 03-APR-18

piece handle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn1_level0_3222_0.379.972440909 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_2: backup set complete, elapsed time: 00:00:07

channel ORA_DISK_2: starting incremental level 1 datafile backup set

channel ORA_DISK_2: specifying datafile(s) in backup set

input datafile file number=00012 name=+ORACONF/oradata/confdb/configdata01.dbf

channel ORA_DISK_2: starting piece 1 at 03-APR-18

channel ORA_DISK_2: finished piece 1 at 03-APR-18

piecehandle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn1_level0_3222_0.377.972440917 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01

channel ORA_DISK_1: finished piece 1 at 03-APR-18

piecehandle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn1_level0_3222_0.378.972440917 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

Finished backup at 03-APR-18

Starting backup at 03-APR-18

current log archived

using channel ORA_DISK_1

using channel ORA_DISK_2

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=223 RECID=223 STAMP=972440919

channel ORA_DISK_1: starting piece 1 at 03-APR-18

channel ORA_DISK_1: finished piece 1 at 03-APR-18

piece handle=+REDO2/IMADB/BACKUPSET/2018_04_03/annnf0_level0_3222_0.375.972440919 tag=LEVEL0_3222 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 03-APR-18

Starting Control File Autobackup at 03-APR-18

piece handle=/ora00/app/oracle/bkp/sep02pvvm392/IMADB/LEVEL0/imadbcfc-194714882-20180403-04.RW99 comment=NONE

Finished Control File Autobackup at 03-APR-18

 

3)Restoring pluggable database.

Now we be restoring above mentioned pluggable database with incremental backup taken above:

We have to connect to RMAN prompt–

rman target sys/imadb@imadb catalog rcat01/rcat01@masterdb

We have to close existing database if we need to test restore pluggable database:

RMAN> alter pluggable database confdb close;

Statement processed

Below mentioned command will Restore pluggable database confdb with backup taken above:

RMAN> restore pluggable database confdb;

Starting restore at 04-APR-18

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=27 device type=DISK

allocated channel: ORA_DISK_2

channel ORA_DISK_2: SID=391 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 00010 to +ORACONF/oradata/confdb/sysaux01confdb.dbf

channel ORA_DISK_1: reading from backup piece +REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn0_level0_3222_0.390.972440733

channel ORA_DISK_2: starting datafile backup set restore

channel ORA_DISK_2: specifying datafile(s) to restore from backup set

channel ORA_DISK_2: restoring datafile 00009 to +ORACONF/oradata/confdb/system01confdb.dbf

channel ORA_DISK_2: restoring datafile 00037 to +ORACONF/oradata/confdb/ncrcattbsp01.dbf

channel ORA_DISK_2: reading from backup piece +REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn0_level0_3222_0.391.972440733

channel ORA_DISK_2: piece handle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn0_level0_3222_0.391.972440733 tag=LEVEL0_3222

channel ORA_DISK_2: restored backup piece 1

channel ORA_DISK_2: restore complete, elapsed time: 00:00:08

channel ORA_DISK_2: starting datafile backup set restore

channel ORA_DISK_2: specifying datafile(s) to restore from backup set

channel ORA_DISK_2: restoring datafile 00012 to +ORACONF/oradata/confdb/configdata01.dbf

channel ORA_DISK_2: reading from backup piece +REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn0_level0_3222_0.388.972440749

channel ORA_DISK_2: piece handle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn0_level0_3222_0.388.972440749 tag=LEVEL0_3222

channel ORA_DISK_2: restored backup piece 1

channel ORA_DISK_2: restore complete, elapsed time: 00:00:01

channel ORA_DISK_2: starting datafile backup set restore

channel ORA_DISK_2: specifying datafile(s) to restore from backup set

channel ORA_DISK_2: restoring datafile 00011 to +ORACONF/oradata/confdb/undo01confdb.dbf

channel ORA_DISK_2: reading from backup piece +REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn0_level0_3222_0.389.972440749

channel ORA_DISK_1: piece handle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn0_level0_3222_0.390.972440733 tag=LEVEL0_3222

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time: 00:00:12

channel ORA_DISK_2: piece handle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn0_level0_3222_0.389.972440749 tag=LEVEL0_3222

channel ORA_DISK_2: restored backup piece 1

channel ORA_DISK_2: restore complete, elapsed time: 00:00:03

 

Once restore has been done we will be performing recovery of database

RMAN> recover pluggable database confdb;

Starting recover at 04-APR-18

using channel ORA_DISK_1

using channel ORA_DISK_2

channel ORA_DISK_1: starting incremental datafile backup set restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

destination for restore of datafile 00010: +ORACONF/oradata/confdb/sysaux01confdb.dbf

channel ORA_DISK_1: reading from backup piece +REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn1_level0_3222_0.379.972440909

channel ORA_DISK_2: starting incremental datafile backup set restore

channel ORA_DISK_2: specifying datafile(s) to restore from backup set

destination for restore of datafile 00009: +ORACONF/oradata/confdb/system01confdb.dbf

destination for restore of datafile 00037: +ORACONF/oradata/confdb/ncrcattbsp01.dbf

channel ORA_DISK_2: reading from backup piece +REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn1_level0_3222_0.380.972440909

channel ORA_DISK_1: piece handle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn1_level0_3222_0.379.972440909 tag=LEVEL0_3222

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time: 00:00:01

channel ORA_DISK_1: starting incremental datafile backup set restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

destination for restore of datafile 00012: +ORACONF/oradata/confdb/configdata01.dbf

channel ORA_DISK_1: reading from backup piece +REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn1_level0_3222_0.377.972440917

channel ORA_DISK_2: piece handle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn1_level0_3222_0.380.972440909 tag=LEVEL0_3222

channel ORA_DISK_2: restored backup piece 1

channel ORA_DISK_2: restore complete, elapsed time: 00:00:01

channel ORA_DISK_2: starting incremental datafile backup set restore

channel ORA_DISK_2: specifying datafile(s) to restore from backup set

destination for restore of datafile 00011: +ORACONF/oradata/confdb/undo01confdb.dbf

channel ORA_DISK_2: reading from backup piece +REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn1_level0_3222_0.378.972440917

channel ORA_DISK_1: piece handle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn1_level0_3222_0.377.972440917 tag=LEVEL0_3222

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time: 00:00:00

channel ORA_DISK_2: piece handle=+REDO2/IMADB/382313F87C9C26CAE053334F47997B44/BACKUPSET/2018_04_03/nnndn1_level0_3222_0.378.972440917 tag=LEVEL0_3222

channel ORA_DISK_2: restored backup piece 1

channel ORA_DISK_2: restore complete, elapsed time: 00:00:01
starting media recovery
archived log for thread 1 with sequence 223 is already on disk as file +REDO2/IMADB/ARCHIVELOG/2018_04_03/thread_1_seq_223.376.972440919

archived log for thread 1 with sequence 224 is already on disk as file +REDO2/IMADB/ARCHIVELOG/2018_04_03/thread_1_seq_224.374.972479867

archived log for thread 1 with sequence 225 is already on disk as file +REDO2/IMADB/ARCHIVELOG/2018_04_03/thread_1_seq_225.373.972501467

archived log for thread 1 with sequence 226 is already on disk as file +REDO2/IMADB/ARCHIVELOG/2018_04_03/thread_1_seq_226.372.972511235

archived log for thread 1 with sequence 227 is already on disk as file +REDO2/IMADB/ARCHIVELOG/2018_04_03/thread_1_seq_227.371.972516715

archived log for thread 1 with sequence 228 is already on disk as file +REDO2/IMADB/ARCHIVELOG/2018_04_04/thread_1_seq_228.370.972523167

archived log for thread 1 with sequence 229 is already on disk as file +REDO2/IMADB/ARCHIVELOG/2018_04_04/thread_1_seq_229.369.972544671

archived log file name=+REDO2/IMADB/ARCHIVELOG/2018_04_03/thread_1_seq_223.376.972440919 thread=1 sequence=223

archived log file name=+REDO2/IMADB/ARCHIVELOG/2018_04_03/thread_1_seq_224.374.972479867 thread=1 sequence=224

archived log file name=+REDO2/IMADB/ARCHIVELOG/2018_04_03/thread_1_seq_225.373.972501467 thread=1 sequence=225

archived log file name=+REDO2/IMADB/ARCHIVELOG/2018_04_03/thread_1_seq_226.372.972511235 thread=1 sequence=226

archived log file name=+REDO2/IMADB/ARCHIVELOG/2018_04_03/thread_1_seq_227.371.972516715 thread=1 sequence=227

media recovery complete, elapsed time: 00:00:15

Finished recover at 04-APR-18

 

4)Open the database for user operation once database has been recovered:

Once database has been restored and recovered we will open the pluggable database in READ-WRITE MODE

RMAN> alter pluggable database confdb open;

Statement processed