By William Sescu

I am planning to backup my 12R2 container database, because a huge application change is coming up,
and I want to be sure that I have a good RMAN backup beforehand. For that particular DB, I want to do it with a cold backup in combination with RMAN tags. Unfortunately I don’t have any backups at the moment, so I start with a full backup with the TAG ‘DBI_BACKUP’ to be 100% that I restore the correct one.

RMAN> list backup summary;

specification does not match any backup in the repository

RMAN> shutdown immediate

database closed
database dismounted
Oracle instance shut down

RMAN> startup mount

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area    1795162112 bytes

Fixed Size                     8793832 bytes
Variable Size                553648408 bytes
Database Buffers            1224736768 bytes
Redo Buffers                   7983104 bytes

RMAN> run
    {
         allocate channel c1 device type disk format '/u99/backup/CDB/database_%U';
     allocate channel c2 device type disk format '/u99/backup/CDB/database_%U';
         allocate channel c3 device type disk format '/u99/backup/CDB/database_%U';
     allocate channel c4 device type disk format '/u99/backup/CDB/database_%U';
     BACKUP INCREMENTAL LEVEL 0 FORCE AS COMPRESSED BACKUPSET DATABASE plus archivelog tag 'DBI_BACKUP';
         backup current controlfile tag 'DBI_BACKUP' format '/u99/backup/CDB/control_%U';
         backup spfile tag 'DBI_BACKUP' format '/u99/backup/CDB/spfile_%U';
         release channel c1;
         release channel c2;
         release channel c3;
         release channel c4;
    }2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14>

allocated channel: c1
channel c1: SID=16 device type=DISK

allocated channel: c2
channel c2: SID=271 device type=DISK

allocated channel: c3
channel c3: SID=31 device type=DISK

allocated channel: c4
channel c4: SID=272 device type=DISK


Starting backup at 26-JAN-2017 13:18:53
current log archived
channel c1: starting compressed archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=4 RECID=3 STAMP=934074668
input archived log thread=1 sequence=5 RECID=4 STAMP=934154679
channel c1: starting piece 1 at 26-JAN-2017 13:18:53
channel c2: starting compressed archived log backup set
channel c2: specifying archived log(s) in backup set
input archived log thread=1 sequence=2 RECID=1 STAMP=934038010
input archived log thread=1 sequence=3 RECID=2 STAMP=934066843
channel c2: starting piece 1 at 26-JAN-2017 13:18:53
channel c3: starting compressed archived log backup set
channel c3: specifying archived log(s) in backup set
input archived log thread=1 sequence=6 RECID=5 STAMP=934203623
input archived log thread=1 sequence=7 RECID=6 STAMP=934275778
input archived log thread=1 sequence=8 RECID=7 STAMP=934284094
channel c3: starting piece 1 at 26-JAN-2017 13:18:53
channel c4: starting compressed archived log backup set
channel c4: specifying archived log(s) in backup set
input archived log thread=1 sequence=9 RECID=8 STAMP=934284153
input archived log thread=1 sequence=10 RECID=9 STAMP=934284199
input archived log thread=1 sequence=11 RECID=10 STAMP=934291133
channel c4: starting piece 1 at 26-JAN-2017 13:18:53
channel c4: finished piece 1 at 26-JAN-2017 13:18:54
piece handle=/u99/backup/CDB/database_2arr09lt_1_1 tag=DBI_BACKUP comment=NONE
channel c4: backup set complete, elapsed time: 00:00:01
channel c1: finished piece 1 at 26-JAN-2017 13:19:08
piece handle=/u99/backup/CDB/database_27rr09lt_1_1 tag=DBI_BACKUP comment=NONE
channel c1: backup set complete, elapsed time: 00:00:15
channel c2: finished piece 1 at 26-JAN-2017 13:19:08
piece handle=/u99/backup/CDB/database_28rr09lt_1_1 tag=DBI_BACKUP comment=NONE
channel c2: backup set complete, elapsed time: 00:00:15
channel c3: finished piece 1 at 26-JAN-2017 13:19:08
piece handle=/u99/backup/CDB/database_29rr09lt_1_1 tag=DBI_BACKUP comment=NONE
channel c3: backup set complete, elapsed time: 00:00:15
Finished backup at 26-JAN-2017 13:19:08

Starting backup at 26-JAN-2017 13:19:08
channel c1: starting compressed incremental level 0 datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u02/oradata/CDB/datafile/o1_mf_system_d81c2wsf_.dbf
channel c1: starting piece 1 at 26-JAN-2017 13:19:09
channel c2: starting compressed incremental level 0 datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00003 name=/u02/oradata/CDB/datafile/o1_mf_sysaux_d81c49wd_.dbf
channel c2: starting piece 1 at 26-JAN-2017 13:19:09
channel c3: starting compressed incremental level 0 datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00010 name=/u02/oradata/CDB/46727C2ED8612B70E053CB38A8C078C9/datafile/o1_mf_sysaux_d81cgjc2_.dbf
channel c3: starting piece 1 at 26-JAN-2017 13:19:09
channel c4: starting compressed incremental level 0 datafile backup set
channel c4: specifying datafile(s) in backup set
input datafile file number=00009 name=/u02/oradata/CDB/46727C2ED8612B70E053CB38A8C078C9/datafile/o1_mf_system_d81cgjbv_.dbf
input datafile file number=00011 name=/u02/oradata/CDB/46727C2ED8612B70E053CB38A8C078C9/datafile/o1_mf_undotbs1_d81cgjc2_.dbf
channel c4: starting piece 1 at 26-JAN-2017 13:19:09
channel c4: finished piece 1 at 26-JAN-2017 13:19:24
piece handle=/u99/backup/CDB/database_2err09md_1_1 tag=TAG20170126T131908 comment=NONE
channel c4: backup set complete, elapsed time: 00:00:15
channel c4: starting compressed incremental level 0 datafile backup set
channel c4: specifying datafile(s) in backup set
input datafile file number=00006 name=/u02/oradata/CDB/datafile/o1_mf_sysaux_d81c6fqn_.dbf
channel c4: starting piece 1 at 26-JAN-2017 13:19:24
channel c3: finished piece 1 at 26-JAN-2017 13:19:39
piece handle=/u99/backup/CDB/database_2drr09md_1_1 tag=TAG20170126T131908 comment=NONE
channel c3: backup set complete, elapsed time: 00:00:30
channel c3: starting compressed incremental level 0 datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00013 name=/u02/oradata/CDB/46727C2ED8612B70E053CB38A8C078C9/datafile/o1_mf_rman_d8ccofgs_.dbf
input datafile file number=00012 name=/u02/oradata/CDB/46727C2ED8612B70E053CB38A8C078C9/datafile/o1_mf_users_d81cgq9f_.dbf
channel c3: starting piece 1 at 26-JAN-2017 13:19:39
channel c3: finished piece 1 at 26-JAN-2017 13:19:40
piece handle=/u99/backup/CDB/database_2grr09nb_1_1 tag=TAG20170126T131908 comment=NONE
channel c3: backup set complete, elapsed time: 00:00:01
channel c3: starting compressed incremental level 0 datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00005 name=/u02/oradata/CDB/datafile/o1_mf_system_d81c6fqo_.dbf
channel c3: starting piece 1 at 26-JAN-2017 13:19:41
channel c2: finished piece 1 at 26-JAN-2017 13:19:41
piece handle=/u99/backup/CDB/database_2crr09md_1_1 tag=TAG20170126T131908 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:32
channel c2: starting compressed incremental level 0 datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00008 name=/u02/oradata/CDB/datafile/o1_mf_undotbs1_d81c6fqp_.dbf
channel c2: starting piece 1 at 26-JAN-2017 13:19:41
channel c2: finished piece 1 at 26-JAN-2017 13:19:44
piece handle=/u99/backup/CDB/database_2irr09nd_1_1 tag=TAG20170126T131908 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:03
channel c2: starting compressed incremental level 0 datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00004 name=/u02/oradata/CDB/datafile/o1_mf_undotbs1_d81c530h_.dbf
channel c2: starting piece 1 at 26-JAN-2017 13:19:44
channel c2: finished piece 1 at 26-JAN-2017 13:19:45
piece handle=/u99/backup/CDB/database_2jrr09ng_1_1 tag=TAG20170126T131908 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:01
channel c2: starting compressed incremental level 0 datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00007 name=/u02/oradata/CDB/datafile/o1_mf_users_d81c542r_.dbf
channel c2: starting piece 1 at 26-JAN-2017 13:19:45
channel c2: finished piece 1 at 26-JAN-2017 13:19:46
piece handle=/u99/backup/CDB/database_2krr09nh_1_1 tag=TAG20170126T131908 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:01
channel c1: finished piece 1 at 26-JAN-2017 13:19:52
piece handle=/u99/backup/CDB/database_2brr09md_1_1 tag=TAG20170126T131908 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:43
channel c3: finished piece 1 at 26-JAN-2017 13:19:52
piece handle=/u99/backup/CDB/database_2hrr09nd_1_1 tag=TAG20170126T131908 comment=NONE
channel c3: backup set complete, elapsed time: 00:00:11
channel c4: finished piece 1 at 26-JAN-2017 13:19:52
piece handle=/u99/backup/CDB/database_2frr09ms_1_1 tag=TAG20170126T131908 comment=NONE
channel c4: backup set complete, elapsed time: 00:00:28
Finished backup at 26-JAN-2017 13:19:52

Starting backup at 26-JAN-2017 13:19:52
current log archived
channel c1: starting compressed archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=12 RECID=11 STAMP=934291192
channel c1: starting piece 1 at 26-JAN-2017 13:19:53
channel c1: finished piece 1 at 26-JAN-2017 13:19:54
piece handle=/u99/backup/CDB/database_2lrr09np_1_1 tag=DBI_BACKUP comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 26-JAN-2017 13:19:54

Starting backup at 26-JAN-2017 13:19:54
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
channel c1: starting piece 1 at 26-JAN-2017 13:19:55
channel c1: finished piece 1 at 26-JAN-2017 13:19:56
piece handle=/u99/backup/CDB/control_2mrr09nq_1_1 tag=DBI_BACKUP comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 26-JAN-2017 13:19:56

Starting backup at 26-JAN-2017 13:19:56
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel c1: starting piece 1 at 26-JAN-2017 13:19:56
channel c1: finished piece 1 at 26-JAN-2017 13:19:57
piece handle=/u99/backup/CDB/spfile_2nrr09ns_1_1 tag=DBI_BACKUP comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 26-JAN-2017 13:19:57

Starting Control File and SPFILE Autobackup at 26-JAN-2017 13:19:57
piece handle=/u03/fast_recovery_area/CDB/autobackup/2017_01_26/o1_mf_s_934291197_d8mtcfjz_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 26-JAN-2017 13:19:58

released channel: c1

released channel: c2

released channel: c3

released channel: c4

RMAN>

After the backup was done, I do a quick “list backup summary” to see if everything is there, and also check the destination directory.

RMAN> list backup summary tag 'DBI_BACKUP';

List of Backups
===============
Key     TY LV S Device Type Completion Time      #Pieces #Copies Compressed Tag
------- -- -- - ----------- -------------------- ------- ------- ---------- ---
67      B  A  A DISK        26-JAN-2017 13:18:54 1       1       YES        DBI_BACKUP
68      B  A  A DISK        26-JAN-2017 13:19:02 1       1       YES        DBI_BACKUP
69      B  A  A DISK        26-JAN-2017 13:19:07 1       1       YES        DBI_BACKUP
70      B  A  A DISK        26-JAN-2017 13:19:07 1       1       YES        DBI_BACKUP
81      B  A  A DISK        26-JAN-2017 13:19:53 1       1       YES        DBI_BACKUP
82      B  F  A DISK        26-JAN-2017 13:19:55 1       1       NO         DBI_BACKUP
83      B  F  A DISK        26-JAN-2017 13:19:56 1       1       NO         DBI_BACKUP

RMAN>

oracle@dbidg03:/u99/backup/CDB/ [CDB] ls -l
total 975304
-rw-r----- 1 oracle oinstall  18792448 Jan 26 13:19 control_2mrr09nq_1_1
-rw-r----- 1 oracle oinstall 112111616 Jan 26 13:19 database_27rr09lt_1_1
-rw-r----- 1 oracle oinstall 112711168 Jan 26 13:19 database_28rr09lt_1_1
-rw-r----- 1 oracle oinstall  58626048 Jan 26 13:19 database_29rr09lt_1_1
-rw-r----- 1 oracle oinstall   3691520 Jan 26 13:18 database_2arr09lt_1_1
-rw-r----- 1 oracle oinstall 215056384 Jan 26 13:19 database_2brr09md_1_1
-rw-r----- 1 oracle oinstall 132710400 Jan 26 13:19 database_2crr09md_1_1
-rw-r----- 1 oracle oinstall 112173056 Jan 26 13:19 database_2drr09md_1_1
-rw-r----- 1 oracle oinstall  56778752 Jan 26 13:19 database_2err09md_1_1
-rw-r----- 1 oracle oinstall 110149632 Jan 26 13:19 database_2frr09ms_1_1
-rw-r----- 1 oracle oinstall   1507328 Jan 26 13:19 database_2grr09nb_1_1
-rw-r----- 1 oracle oinstall  54157312 Jan 26 13:19 database_2hrr09nd_1_1
-rw-r----- 1 oracle oinstall   7716864 Jan 26 13:19 database_2irr09nd_1_1
-rw-r----- 1 oracle oinstall   1327104 Jan 26 13:19 database_2jrr09ng_1_1
-rw-r----- 1 oracle oinstall   1073152 Jan 26 13:19 database_2krr09nh_1_1
-rw-r----- 1 oracle oinstall      7680 Jan 26 13:19 database_2lrr09np_1_1
-rw-r----- 1 oracle oinstall    114688 Jan 26 13:19 spfile_2nrr09ns_1_1

But to be really 100% sure that I can restore the backup from TAG, I do a restore preview. The restore preview exists for quite a while now, but it is not so widly used for whatever reasons, I don’t know. I find it quite useful.

RMAN> restore database preview from tag 'DBI_BACKUP';

Starting restore at 26-JAN-2017 13:22:49
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=16 device type=DISK

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 01/26/2017 13:22:49
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 13 found to restore
RMAN-06023: no backup or copy of datafile 12 found to restore
RMAN-06023: no backup or copy of datafile 11 found to restore
RMAN-06023: no backup or copy of datafile 10 found to restore
RMAN-06023: no backup or copy of datafile 9 found to restore
RMAN-06023: no backup or copy of datafile 8 found to restore
RMAN-06023: no backup or copy of datafile 7 found to restore
RMAN-06023: no backup or copy of datafile 6 found to restore
RMAN-06023: no backup or copy of datafile 5 found to restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore

RMAN>

Oh no … that doesn’t look good. RMAN complaints that no backup or copy exists for all datafiles. What is going here? Is my backup useless? Yes and no. If I rely only on the TAG, then yes. However, the RMAN backup have been created successfully but with two different TAG’s. For the datafiles it used tag=TAG20170126T131908 and for the archivelogs, the controlfile and the spfile it used tag=DBI_BACKUP.

So what is wrong here? The TAG was simply specified at the wrong location. If you put tag after archivelog, then only the archivelogs get that tag.

BACKUP INCREMENTAL LEVEL 0 FORCE AS COMPRESSED BACKUPSET DATABASE plus archivelog tag 'DBI_BACKUP';

If you want to have the datafiles and the archivelogs tagged correctly, you have to put it after level 0 in my case. That’s usually enough.

BACKUP INCREMENTAL LEVEL 0 tag 'DBI_BACKUP' FORCE AS COMPRESSED BACKUPSET DATABASE plus archivelog;

Or if you want to be double sure and you are sort of paranoid, you can specify it twice, one after level 0, and one after archivelog.

BACKUP INCREMENTAL LEVEL 0 tag 'DBI_BACKUP' FORCE AS COMPRESSED BACKUPSET DATABASE plus archivelog tag 'DBI_BACKUP';

ok. So lets try it again from scratch. But this time I put the Tag after LEVEL 0.

RMAN> list backup summary;

specification does not match any backup in the repository

RMAN> shutdown immediate

database closed
database dismounted
Oracle instance shut down

RMAN> startup mount

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area    1795162112 bytes

Fixed Size                     8793832 bytes
Variable Size                553648408 bytes
Database Buffers            1224736768 bytes
Redo Buffers                   7983104 bytes


RMAN> run
    {
         allocate channel c1 device type disk format '/u99/backup/CDB/database_%U';
     allocate channel c2 device type disk format '/u99/backup/CDB/database_%U';
         allocate channel c3 device type disk format '/u99/backup/CDB/database_%U';
     allocate channel c4 device type disk format '/u99/backup/CDB/database_%U';
     BACKUP INCREMENTAL LEVEL 0 tag 'DBI_BACKUP' FORCE AS COMPRESSED BACKUPSET DATABASE plus archivelog;
         backup current controlfile tag 'DBI_BACKUP' format '/u99/backup/CDB/control_%U';
         backup spfile tag 'DBI_BACKUP' format '/u99/backup/CDB/spfile_%U';
         release channel c1;
         release channel c2;
         release channel c3;
         release channel c4;
    }2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14>

allocated channel: c1
channel c1: SID=237 device type=DISK

allocated channel: c2
channel c2: SID=20 device type=DISK

allocated channel: c3
channel c3: SID=254 device type=DISK

allocated channel: c4
channel c4: SID=22 device type=DISK


Starting backup at 26-JAN-2017 13:43:45
channel c1: starting compressed archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=4 RECID=3 STAMP=934074668
input archived log thread=1 sequence=5 RECID=4 STAMP=934154679
channel c1: starting piece 1 at 26-JAN-2017 13:43:46
channel c2: starting compressed archived log backup set
channel c2: specifying archived log(s) in backup set
input archived log thread=1 sequence=2 RECID=1 STAMP=934038010
input archived log thread=1 sequence=3 RECID=2 STAMP=934066843
channel c2: starting piece 1 at 26-JAN-2017 13:43:46
channel c3: starting compressed archived log backup set
channel c3: specifying archived log(s) in backup set
input archived log thread=1 sequence=6 RECID=5 STAMP=934203623
input archived log thread=1 sequence=7 RECID=6 STAMP=934275778
input archived log thread=1 sequence=8 RECID=7 STAMP=934284094
input archived log thread=1 sequence=9 RECID=8 STAMP=934284153
channel c3: starting piece 1 at 26-JAN-2017 13:43:46
channel c4: starting compressed archived log backup set
channel c4: specifying archived log(s) in backup set
input archived log thread=1 sequence=10 RECID=9 STAMP=934284199
input archived log thread=1 sequence=11 RECID=10 STAMP=934291133
input archived log thread=1 sequence=12 RECID=11 STAMP=934291192
input archived log thread=1 sequence=13 RECID=12 STAMP=934291966
channel c4: starting piece 1 at 26-JAN-2017 13:43:46
channel c4: finished piece 1 at 26-JAN-2017 13:43:47
piece handle=/u99/backup/CDB/database_3frr0b4i_1_1 tag=DBI_BACKUP comment=NONE
channel c4: backup set complete, elapsed time: 00:00:01
channel c4: starting compressed archived log backup set
channel c4: specifying archived log(s) in backup set
input archived log thread=1 sequence=14 RECID=13 STAMP=934292026
input archived log thread=1 sequence=15 RECID=14 STAMP=934292464
channel c4: starting piece 1 at 26-JAN-2017 13:43:47
channel c4: finished piece 1 at 26-JAN-2017 13:43:48
piece handle=/u99/backup/CDB/database_3grr0b4j_1_1 tag=DBI_BACKUP comment=NONE
channel c4: backup set complete, elapsed time: 00:00:01
channel c1: finished piece 1 at 26-JAN-2017 13:44:02
piece handle=/u99/backup/CDB/database_3crr0b4i_1_1 tag=DBI_BACKUP comment=NONE
channel c1: backup set complete, elapsed time: 00:00:16
channel c2: finished piece 1 at 26-JAN-2017 13:44:02
piece handle=/u99/backup/CDB/database_3drr0b4i_1_1 tag=DBI_BACKUP comment=NONE
channel c2: backup set complete, elapsed time: 00:00:16
channel c3: finished piece 1 at 26-JAN-2017 13:44:02
piece handle=/u99/backup/CDB/database_3err0b4i_1_1 tag=DBI_BACKUP comment=NONE
channel c3: backup set complete, elapsed time: 00:00:16
Finished backup at 26-JAN-2017 13:44:02

Starting backup at 26-JAN-2017 13:44:02
channel c1: starting compressed incremental level 0 datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u02/oradata/CDB/datafile/o1_mf_system_d81c2wsf_.dbf
channel c1: starting piece 1 at 26-JAN-2017 13:44:02
channel c2: starting compressed incremental level 0 datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00003 name=/u02/oradata/CDB/datafile/o1_mf_sysaux_d81c49wd_.dbf
channel c2: starting piece 1 at 26-JAN-2017 13:44:02
channel c3: starting compressed incremental level 0 datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00010 name=/u02/oradata/CDB/46727C2ED8612B70E053CB38A8C078C9/datafile/o1_mf_sysaux_d81cgjc2_.dbf
channel c3: starting piece 1 at 26-JAN-2017 13:44:02
channel c4: starting compressed incremental level 0 datafile backup set
channel c4: specifying datafile(s) in backup set
input datafile file number=00009 name=/u02/oradata/CDB/46727C2ED8612B70E053CB38A8C078C9/datafile/o1_mf_system_d81cgjbv_.dbf
input datafile file number=00011 name=/u02/oradata/CDB/46727C2ED8612B70E053CB38A8C078C9/datafile/o1_mf_undotbs1_d81cgjc2_.dbf
channel c4: starting piece 1 at 26-JAN-2017 13:44:03
channel c4: finished piece 1 at 26-JAN-2017 13:44:18
piece handle=/u99/backup/CDB/database_3krr0b52_1_1 tag=DBI_BACKUP comment=NONE
channel c4: backup set complete, elapsed time: 00:00:15
channel c4: starting compressed incremental level 0 datafile backup set
channel c4: specifying datafile(s) in backup set
input datafile file number=00006 name=/u02/oradata/CDB/datafile/o1_mf_sysaux_d81c6fqn_.dbf
channel c4: starting piece 1 at 26-JAN-2017 13:44:18
channel c3: finished piece 1 at 26-JAN-2017 13:44:33
piece handle=/u99/backup/CDB/database_3jrr0b52_1_1 tag=DBI_BACKUP comment=NONE
channel c3: backup set complete, elapsed time: 00:00:31
channel c3: starting compressed incremental level 0 datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00013 name=/u02/oradata/CDB/46727C2ED8612B70E053CB38A8C078C9/datafile/o1_mf_rman_d8ccofgs_.dbf
input datafile file number=00012 name=/u02/oradata/CDB/46727C2ED8612B70E053CB38A8C078C9/datafile/o1_mf_users_d81cgq9f_.dbf
channel c3: starting piece 1 at 26-JAN-2017 13:44:33
channel c3: finished piece 1 at 26-JAN-2017 13:44:34
piece handle=/u99/backup/CDB/database_3mrr0b61_1_1 tag=DBI_BACKUP comment=NONE
channel c3: backup set complete, elapsed time: 00:00:01
channel c3: starting compressed incremental level 0 datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00005 name=/u02/oradata/CDB/datafile/o1_mf_system_d81c6fqo_.dbf
channel c3: starting piece 1 at 26-JAN-2017 13:44:35
channel c2: finished piece 1 at 26-JAN-2017 13:44:38
piece handle=/u99/backup/CDB/database_3irr0b52_1_1 tag=DBI_BACKUP comment=NONE
channel c2: backup set complete, elapsed time: 00:00:36
channel c2: starting compressed incremental level 0 datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00008 name=/u02/oradata/CDB/datafile/o1_mf_undotbs1_d81c6fqp_.dbf
channel c2: starting piece 1 at 26-JAN-2017 13:44:38
channel c2: finished piece 1 at 26-JAN-2017 13:44:41
piece handle=/u99/backup/CDB/database_3orr0b66_1_1 tag=DBI_BACKUP comment=NONE
channel c2: backup set complete, elapsed time: 00:00:03
channel c2: starting compressed incremental level 0 datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00004 name=/u02/oradata/CDB/datafile/o1_mf_undotbs1_d81c530h_.dbf
channel c2: starting piece 1 at 26-JAN-2017 13:44:41
channel c2: finished piece 1 at 26-JAN-2017 13:44:42
piece handle=/u99/backup/CDB/database_3prr0b69_1_1 tag=DBI_BACKUP comment=NONE
channel c2: backup set complete, elapsed time: 00:00:01
channel c2: starting compressed incremental level 0 datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00007 name=/u02/oradata/CDB/datafile/o1_mf_users_d81c542r_.dbf
channel c2: starting piece 1 at 26-JAN-2017 13:44:43
channel c1: finished piece 1 at 26-JAN-2017 13:44:44
piece handle=/u99/backup/CDB/database_3hrr0b52_1_1 tag=DBI_BACKUP comment=NONE
channel c1: backup set complete, elapsed time: 00:00:42
channel c2: finished piece 1 at 26-JAN-2017 13:44:44
piece handle=/u99/backup/CDB/database_3qrr0b6b_1_1 tag=DBI_BACKUP comment=NONE
channel c2: backup set complete, elapsed time: 00:00:01
channel c3: finished piece 1 at 26-JAN-2017 13:44:46
piece handle=/u99/backup/CDB/database_3nrr0b62_1_1 tag=DBI_BACKUP comment=NONE
channel c3: backup set complete, elapsed time: 00:00:11
channel c4: finished piece 1 at 26-JAN-2017 13:44:46
piece handle=/u99/backup/CDB/database_3lrr0b5i_1_1 tag=DBI_BACKUP comment=NONE
channel c4: backup set complete, elapsed time: 00:00:28
Finished backup at 26-JAN-2017 13:44:46

Starting backup at 26-JAN-2017 13:44:46
specification does not match any archived log in the repository
backup cancelled because there are no files to backup
Finished backup at 26-JAN-2017 13:44:46

Starting backup at 26-JAN-2017 13:44:46
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
channel c1: starting piece 1 at 26-JAN-2017 13:44:47
channel c1: finished piece 1 at 26-JAN-2017 13:44:48
piece handle=/u99/backup/CDB/control_3rrr0b6e_1_1 tag=DBI_BACKUP comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 26-JAN-2017 13:44:48

Starting backup at 26-JAN-2017 13:44:48
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel c1: starting piece 1 at 26-JAN-2017 13:44:48
channel c1: finished piece 1 at 26-JAN-2017 13:44:49
piece handle=/u99/backup/CDB/spfile_3srr0b6g_1_1 tag=DBI_BACKUP comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 26-JAN-2017 13:44:49

Starting Control File and SPFILE Autobackup at 26-JAN-2017 13:44:49
piece handle=/u03/fast_recovery_area/CDB/autobackup/2017_01_26/o1_mf_s_934292553_d8mvt1l0_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 26-JAN-2017 13:44:50

released channel: c1

released channel: c2

released channel: c3

released channel: c4

RMAN>

As you can see in the log, all backup pieces have been done with tag=DBI_BACKUP. But let’s double check it again.

RMAN> list backup summary tag 'DBI_BACKUP';

List of Backups
===============
Key     TY LV S Device Type Completion Time      #Pieces #Copies Compressed Tag
------- -- -- - ----------- -------------------- ------- ------- ---------- ---
104     B  A  A DISK        26-JAN-2017 13:43:46 1       1       YES        DBI_BACKUP
105     B  A  A DISK        26-JAN-2017 13:43:47 1       1       YES        DBI_BACKUP
106     B  A  A DISK        26-JAN-2017 13:43:54 1       1       YES        DBI_BACKUP
107     B  A  A DISK        26-JAN-2017 13:43:59 1       1       YES        DBI_BACKUP
108     B  A  A DISK        26-JAN-2017 13:43:59 1       1       YES        DBI_BACKUP
109     B  0  A DISK        26-JAN-2017 13:44:14 1       1       YES        DBI_BACKUP
110     B  0  A DISK        26-JAN-2017 13:44:30 1       1       YES        DBI_BACKUP
111     B  0  A DISK        26-JAN-2017 13:44:34 1       1       YES        DBI_BACKUP
112     B  0  A DISK        26-JAN-2017 13:44:36 1       1       YES        DBI_BACKUP
113     B  0  A DISK        26-JAN-2017 13:44:39 1       1       YES        DBI_BACKUP
114     B  0  A DISK        26-JAN-2017 13:44:41 1       1       YES        DBI_BACKUP
115     B  0  A DISK        26-JAN-2017 13:44:43 1       1       YES        DBI_BACKUP
116     B  0  A DISK        26-JAN-2017 13:44:43 1       1       YES        DBI_BACKUP
117     B  0  A DISK        26-JAN-2017 13:44:44 1       1       YES        DBI_BACKUP
118     B  0  A DISK        26-JAN-2017 13:44:44 1       1       YES        DBI_BACKUP
119     B  F  A DISK        26-JAN-2017 13:44:47 1       1       NO         DBI_BACKUP
120     B  F  A DISK        26-JAN-2017 13:44:48 1       1       NO         DBI_BACKUP

RMAN> restore database preview summary from tag 'DBI_BACKUP';

Starting restore at 26-JAN-2017 13:45:26
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=237 device type=DISK

List of Backups
===============
Key     TY LV S Device Type Completion Time      #Pieces #Copies Compressed Tag
------- -- -- - ----------- -------------------- ------- ------- ---------- ---
116     B  0  A DISK        26-JAN-2017 13:44:43 1       1       YES        DBI_BACKUP
112     B  0  A DISK        26-JAN-2017 13:44:36 1       1       YES        DBI_BACKUP
114     B  0  A DISK        26-JAN-2017 13:44:41 1       1       YES        DBI_BACKUP
117     B  0  A DISK        26-JAN-2017 13:44:44 1       1       YES        DBI_BACKUP
118     B  0  A DISK        26-JAN-2017 13:44:44 1       1       YES        DBI_BACKUP
115     B  0  A DISK        26-JAN-2017 13:44:43 1       1       YES        DBI_BACKUP
113     B  0  A DISK        26-JAN-2017 13:44:39 1       1       YES        DBI_BACKUP
109     B  0  A DISK        26-JAN-2017 13:44:14 1       1       YES        DBI_BACKUP
110     B  0  A DISK        26-JAN-2017 13:44:30 1       1       YES        DBI_BACKUP
111     B  0  A DISK        26-JAN-2017 13:44:34 1       1       YES        DBI_BACKUP
using channel ORA_DISK_1

archived logs generated after SCN 1904449 not found in repository
recovery will be done up to SCN 1904449
Media recovery start SCN is 1904449
Recovery must be done beyond SCN 1904725 to clear datafile fuzziness
Finished restore at 26-JAN-2017 13:45:26

RMAN>

Ok. Very good. That looks promising now. 🙂 Let’s do the application changes now …

RMAN> alter database open;

Statement processed

-- Do some application changes ...

SQL> create table x ...
SQL> create table y ...
SQL> create table z ...

And the final test is of course, to do the real restore/recovery to the point where the cold backup was done.

RMAN> shutdown abort

Oracle instance shut down

RMAN> startup nomount

connected to target database (not started)
Oracle instance started

Total System Global Area    1795162112 bytes

Fixed Size                     8793832 bytes
Variable Size                553648408 bytes
Database Buffers            1224736768 bytes
Redo Buffers                   7983104 bytes

RMAN> restore controlfile from '/u99/backup/CDB/control_3rrr0b6e_1_1';

Starting restore at 26-JAN-2017 13:48:50
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=237 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u02/oradata/CDB/controlfile/o1_mf_d81c6189_.ctl
output file name=/u03/fast_recovery_area/CDB/controlfile/o1_mf_d81c61b4_.ctl
Finished restore at 26-JAN-2017 13:48:51

RMAN> alter database mount;

Statement processed
released channel: ORA_DISK_1

	
RMAN> run
    {
         allocate channel c1 device type disk;
     allocate channel c2 device type disk;
         allocate channel c3 device type disk;
     allocate channel c4 device type disk;
     restore database from tag 'DBI_BACKUP';
         release channel c1;
         release channel c2;
         release channel c3;
         release channel c4;
    }2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12>

allocated channel: c1
channel c1: SID=256 device type=DISK

allocated channel: c2
channel c2: SID=24 device type=DISK

allocated channel: c3
channel c3: SID=257 device type=DISK

allocated channel: c4
channel c4: SID=25 device type=DISK

Starting restore at 26-JAN-2017 13:49:39
Starting implicit crosscheck backup at 26-JAN-2017 13:49:39
Crosschecked 15 objects
Finished implicit crosscheck backup at 26-JAN-2017 13:49:40

Starting implicit crosscheck copy at 26-JAN-2017 13:49:40
Finished implicit crosscheck copy at 26-JAN-2017 13:49:40

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u03/fast_recovery_area/CDB/autobackup/2017_01_26/o1_mf_s_934292553_d8mvt1l0_.bkp


skipping datafile 5; already restored to file /u02/oradata/CDB/datafile/o1_mf_system_d81c6fqo_.dbf
skipping datafile 6; already restored to file /u02/oradata/CDB/datafile/o1_mf_sysaux_d81c6fqn_.dbf
skipping datafile 8; already restored to file /u02/oradata/CDB/datafile/o1_mf_undotbs1_d81c6fqp_.dbf
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00009 to /u02/oradata/CDB/46727C2ED8612B70E053CB38A8C078C9/datafile/o1_mf_system_d81cgjbv_.dbf
channel c1: restoring datafile 00011 to /u02/oradata/CDB/46727C2ED8612B70E053CB38A8C078C9/datafile/o1_mf_undotbs1_d81cgjc2_.dbf
channel c1: reading from backup piece /u99/backup/CDB/database_3krr0b52_1_1
channel c2: starting datafile backup set restore
channel c2: specifying datafile(s) to restore from backup set
channel c2: restoring datafile 00010 to /u02/oradata/CDB/46727C2ED8612B70E053CB38A8C078C9/datafile/o1_mf_sysaux_d81cgjc2_.dbf
channel c2: reading from backup piece /u99/backup/CDB/database_3jrr0b52_1_1
channel c3: starting datafile backup set restore
channel c3: specifying datafile(s) to restore from backup set
channel c3: restoring datafile 00012 to /u02/oradata/CDB/46727C2ED8612B70E053CB38A8C078C9/datafile/o1_mf_users_d81cgq9f_.dbf
channel c3: restoring datafile 00013 to /u02/oradata/CDB/46727C2ED8612B70E053CB38A8C078C9/datafile/o1_mf_rman_d8ccofgs_.dbf
channel c3: reading from backup piece /u99/backup/CDB/database_3mrr0b61_1_1
channel c4: starting datafile backup set restore
channel c4: specifying datafile(s) to restore from backup set
channel c4: restoring datafile 00003 to /u02/oradata/CDB/datafile/o1_mf_sysaux_d81c49wd_.dbf
channel c4: reading from backup piece /u99/backup/CDB/database_3irr0b52_1_1
channel c3: piece handle=/u99/backup/CDB/database_3mrr0b61_1_1 tag=DBI_BACKUP
channel c3: restored backup piece 1
channel c3: restore complete, elapsed time: 00:00:03
channel c3: starting datafile backup set restore
channel c3: specifying datafile(s) to restore from backup set
channel c3: restoring datafile 00004 to /u02/oradata/CDB/datafile/o1_mf_undotbs1_d81c530h_.dbf
channel c3: reading from backup piece /u99/backup/CDB/database_3prr0b69_1_1
channel c3: piece handle=/u99/backup/CDB/database_3prr0b69_1_1 tag=DBI_BACKUP
channel c3: restored backup piece 1
channel c3: restore complete, elapsed time: 00:00:01
channel c3: starting datafile backup set restore
channel c3: specifying datafile(s) to restore from backup set
channel c3: restoring datafile 00001 to /u02/oradata/CDB/datafile/o1_mf_system_d81c2wsf_.dbf
channel c3: reading from backup piece /u99/backup/CDB/database_3hrr0b52_1_1
channel c1: piece handle=/u99/backup/CDB/database_3krr0b52_1_1 tag=DBI_BACKUP
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:20
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00007 to /u02/oradata/CDB/datafile/o1_mf_users_d81c542r_.dbf
channel c1: reading from backup piece /u99/backup/CDB/database_3qrr0b6b_1_1
channel c1: piece handle=/u99/backup/CDB/database_3qrr0b6b_1_1 tag=DBI_BACKUP
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:01
channel c2: piece handle=/u99/backup/CDB/database_3jrr0b52_1_1 tag=DBI_BACKUP
channel c2: restored backup piece 1
channel c2: restore complete, elapsed time: 00:00:27
channel c4: piece handle=/u99/backup/CDB/database_3irr0b52_1_1 tag=DBI_BACKUP
channel c4: restored backup piece 1
channel c4: restore complete, elapsed time: 00:00:35
channel c3: piece handle=/u99/backup/CDB/database_3hrr0b52_1_1 tag=DBI_BACKUP
channel c3: restored backup piece 1
channel c3: restore complete, elapsed time: 00:00:40
Finished restore at 26-JAN-2017 13:50:25

released channel: c1

released channel: c2

released channel: c3

released channel: c4

RMAN>

No recovery is needed here, because it was an cold RMAN backup. You can just open the database with open resetslogs.

RMAN> alter database open RESETLOGS;

Statement processed

Conclusion

Take care that you put your RMAN Tags at the correct location.