26 July, 2015

RMAN -- 5c : (Some More) Useful KEYWORDs and SubClauses

Here are a few more useful KEYWORDs and SubClauses


AS COPY  and   COPY OF
Unlike the BACKUPSET format that is the default for an RMAN Backup, Image Copy backups (those that would be akin to backups created as User Managed Backups without RMAN) can be created in RMAN using the AS COPY specifer.   COPY OF allows backups of such backup copies.

Thus, I take an Image Copy backup of a datafile while the database is OPEN :

RMAN> backup as copy datafile 7 ;       

Starting backup at 26-JUL-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=35 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf
output file name=/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9s6b4o_.dbf tag=TAG20150726T214649 RECID=2 STAMP=886110422
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 26-JUL-15

Starting Control File and SPFILE Autobackup at 26-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_26/o1_mf_s_886110425_bv9s6trt_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 26-JUL-15

RMAN> 

Did you note how datafile 7 was copied to '/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9s6b4o_.dbf' by the BACKUP AS COPY command ?
Without me specifying a FORMAT, it created the copy in the datafile location under the FRA, not in the backupset location.
Next, I take a backup of this Image Copy backup.

RMAN> backup copy of datafile 7;

Starting backup at 26-JUL-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: including datafile copy of datafile 00007 in backup set
input file name=/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9s6b4o_.dbf
channel ORA_DISK_1: starting piece 1 at 26-JUL-15
channel ORA_DISK_1: finished piece 1 at 26-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_26/o1_mf_nnndf_TAG20150726T214939_bv9scm4h_.bkp tag=TAG20150726T214939 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 26-JUL-15

Starting Control File and SPFILE Autobackup at 26-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_26/o1_mf_s_886110582_bv9scp9w_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 26-JUL-15

RMAN> 

This time the copy in the datafile location was backed up to a backupset location.  This new backup is not an Image Copy format of datafile 7.  Note the differences in the filenames.   The Image Copy done with BACKUP AS COPY has an OMF filename similar to that of the source datafile.  The BackupSet format includes the TAG as part of the BackupPiece filename.

Let's run some checks, from RMAN and SQLPlus :

SQL> select file_name from dba_data_files where file_id=7;

FILE_NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf

SQL>

RMAN> list backup of datafile 7 completed after "trunc(sysdate)";

using target database control file instead of recovery catalog

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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
91      Full    7.40M      DISK        00:00:01     26-JUL-15      
        BP Key: 103   Status: AVAILABLE  Compressed: YES  Tag: TAG20150726T214939
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_26/o1_mf_nnndf_TAG20150726T214939_bv9scm4h_.bkp
  List of Datafiles in backup set 91
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  7       Full 14141418   26-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf

RMAN> list copy of datafile 7;

List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time       
------- ---- - --------------- ---------- ---------------
2       7    A 26-JUL-15       14141418   26-JUL-15      
        Name: /NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9s6b4o_.dbf
        Tag: TAG20150726T214649


RMAN>              

The LIST BACKUP command shows me the BackupSet backup of the Image Copy. If I want to see the Image Copy that I created first, I must run the command LIST COPY. LIST BACKUP shows BackupSets, not Image Copies themselves. Image Copies are displayed by the LIST COPY.

What is the advantage of Image Copy Backups ?  There are a few.
1)  You can integrate this with your User Managed Backups methods.
2)  You can "clone" a database without having to run a RESTORE(yes, with BACKUP AS COPY DATABASE)
3)  You can selectively relocate one or more datafiles with additonal usage of the SWITCH DATAFILE TO COPY command (see my previous post "BACKUP AS COPY")

Let me demonstrate advantage 3 with a tablespace.

SQL> select file_name from dba_data_files where tablespace_name = 'HEMANT';

FILE_NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf

SQL> 

RMAN> backup as copy tablespace HEMANT;

Starting backup at 26-JUL-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf
output file name=/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9tkkj1_.dbf tag=TAG20150726T220953 RECID=4 STAMP=886111799
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf
output file name=/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9tkrl9_.dbf tag=TAG20150726T220953 RECID=5 STAMP=886111807
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00008 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf
output file name=/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9tkzo0_.dbf tag=TAG20150726T220953 RECID=6 STAMP=886111825
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00009 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf
output file name=/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9tlrr3_.dbf tag=TAG20150726T220953 RECID=7 STAMP=886111843
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00011 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf
output file name=/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9tm7z2_.dbf tag=TAG20150726T220953 RECID=8 STAMP=886111860
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 26-JUL-15

Starting Control File and SPFILE Autobackup at 26-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_26/o1_mf_s_886111863_bv9tmq38_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 26-JUL-15

RMAN> 
RMAN> sql 'alter tablespace HEMANT offline';

sql statement: alter tablespace HEMANT offline

RMAN> switch tablespace HEMANT to copy;

datafile 6 switched to datafile copy "/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9tkkj1_.dbf"
datafile 7 switched to datafile copy "/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9tkrl9_.dbf"
datafile 8 switched to datafile copy "/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9tkzo0_.dbf"
datafile 9 switched to datafile copy "/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9tlrr3_.dbf"
datafile 11 switched to datafile copy "/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9tm7z2_.dbf"

RMAN> recover tablespace HEMANT;

Starting recover at 26-JUL-15
using channel ORA_DISK_1

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

Finished recover at 26-JUL-15

RMAN> sql 'alter tablespace HEMANT online';

sql statement: alter tablespace HEMANT online

RMAN> 

SQL> select file_name from dba_data_files where tablespace_name = 'HEMANT';

FILE_NAME
--------------------------------------------------------------------------------
/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9tkkj1_.dbf
/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9tkrl9_.dbf
/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9tkzo0_.dbf
/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9tlrr3_.dbf
/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9tm7z2_.dbf

SQL> 

Note how all the datafiles of the tablespace were copied and then the active copy of the datafiles has been switched to the new location (/NEW_FS/oracle/FRA/HEMANTDB/datafile/). Have the old datafiles (/home/oracle/app/oracle/oradata/HEMANTDB/datafile/) been deleted ?
Let's see :

RMAN> list copy of tablespace HEMANT;

List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time       
------- ---- - --------------- ---------- ---------------
9       6    A 26-JUL-15       14142997   26-JUL-15      
        Name: /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf

10      7    A 26-JUL-15       14142997   26-JUL-15      
        Name: /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf

2       7    A 26-JUL-15       14141418   26-JUL-15      
        Name: /NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9s6b4o_.dbf
        Tag: TAG20150726T214649

11      8    A 26-JUL-15       14142997   26-JUL-15      
        Name: /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf

12      9    A 26-JUL-15       14142997   26-JUL-15      
        Name: /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf

13      11   A 26-JUL-15       14142997   26-JUL-15      
        Name: /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf


RMAN> 
RMAN> delete copy of tablespace HEMANT;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=44 device type=DISK
List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time       
------- ---- - --------------- ---------- ---------------
9       6    A 26-JUL-15       14142997   26-JUL-15      
        Name: /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf

10      7    A 26-JUL-15       14142997   26-JUL-15      
        Name: /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf

2       7    A 26-JUL-15       14141418   26-JUL-15      
        Name: /NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9s6b4o_.dbf
        Tag: TAG20150726T214649

11      8    A 26-JUL-15       14142997   26-JUL-15      
        Name: /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf

12      9    A 26-JUL-15       14142997   26-JUL-15      
        Name: /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf

13      11   A 26-JUL-15       14142997   26-JUL-15      
        Name: /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf


Do you really want to delete the above objects (enter YES or NO)? YES
deleted datafile copy
datafile copy file name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf RECID=9 STAMP=886111907
deleted datafile copy
datafile copy file name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf RECID=10 STAMP=886111907
deleted datafile copy
datafile copy file name=/NEW_FS/oracle/FRA/HEMANTDB/datafile/o1_mf_hemant_bv9s6b4o_.dbf RECID=2 STAMP=886110422
deleted datafile copy
datafile copy file name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf RECID=11 STAMP=886111907
deleted datafile copy
datafile copy file name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf RECID=12 STAMP=886111907
deleted datafile copy
datafile copy file name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf RECID=13 STAMP=886111907
Deleted 6 objects


RMAN>   

(Note how datafile 7 had two datafile copies). I could delete the old copies of the datafiles.

 Note : The example with tablespace HEMANT uses OMF files. If I had non-OMF files, I could use the "%b" FORMAT modifier -- as demonstrated here.



ARCHIVELOG LIKE
The LIKE Keyword allows you to identify individual or groups of ArchiveLogs.

RMAN> list archivelog all;

List of Archived Log Copies for database with db_unique_name HEMANTDB
=====================================================================

Key     Thrd Seq     S Low Time 
------- ---- ------- - ---------
14      1    628     A 13-JUN-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_628_bsgrjztp_.arc

18      1    629     A 04-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_629_bsgrk0tw_.arc

16      1    630     A 04-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_630_bsgrk48j_.arc

22      1    631     A 04-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_631_bsgv6f02_.arc

17      1    631     A 04-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_631_bsgrk49w_.arc

23      1    632     A 04-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_632_bsgv6f1y_.arc

15      1    632     A 04-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_632_bsgrk8od_.arc

24      1    633     A 04-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_633_bsgv6f36_.arc

25      1    1       A 04-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_08/o1_mf_1_1_bst8r4yr_.arc

26      1    2       A 08-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_08/o1_mf_1_2_bstbf4nw_.arc

27      1    3       A 08-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_26/o1_mf_1_3_bv9vbq7c_.arc

28      1    4       A 26-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_26/o1_mf_1_4_bv9vbr1p_.arc

29      1    5       A 26-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_26/o1_mf_1_5_bv9vbtwz_.arc


RMAN> list archivelog like '%2015_07_26%';

List of Archived Log Copies for database with db_unique_name HEMANTDB
=====================================================================

Key     Thrd Seq     S Low Time 
------- ---- ------- - ---------
27      1    3       A 08-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_26/o1_mf_1_3_bv9vbq7c_.arc

28      1    4       A 26-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_26/o1_mf_1_4_bv9vbr1p_.arc

29      1    5       A 26-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_26/o1_mf_1_5_bv9vbtwz_.arc


RMAN> list archivelog like '%_6%';

List of Archived Log Copies for database with db_unique_name HEMANTDB
=====================================================================

Key     Thrd Seq     S Low Time 
------- ---- ------- - ---------
14      1    628     A 13-JUN-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_628_bsgrjztp_.arc

18      1    629     A 04-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_629_bsgrk0tw_.arc

16      1    630     A 04-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_630_bsgrk48j_.arc

22      1    631     A 04-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_631_bsgv6f02_.arc

17      1    631     A 04-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_631_bsgrk49w_.arc

23      1    632     A 04-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_632_bsgv6f1y_.arc

15      1    632     A 04-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_632_bsgrk8od_.arc

24      1    633     A 04-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_633_bsgv6f36_.arc

27      1    3       A 08-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_26/o1_mf_1_3_bv9vbq7c_.arc

28      1    4       A 26-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_26/o1_mf_1_4_bv9vbr1p_.arc

29      1    5       A 26-JUL-15
        Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_26/o1_mf_1_5_bv9vbtwz_.arc


RMAN> 

I can take advantage of this to backups of selective archivelogs.

RMAN> backup as compressed backupset archivelog like '%2015_07_26%';

Starting backup at 26-JUL-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=3 RECID=27 STAMP=886112599
input archived log thread=1 sequence=4 RECID=28 STAMP=886112600
input archived log thread=1 sequence=5 RECID=29 STAMP=886112602
channel ORA_DISK_1: starting piece 1 at 26-JUL-15
channel ORA_DISK_1: finished piece 1 at 26-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_26/o1_mf_annnn_TAG20150726T222529_bv9vgs8r_.bkp tag=TAG20150726T222529 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 26-JUL-15

Starting Control File and SPFILE Autobackup at 26-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_26/o1_mf_s_886112730_bv9vgtc5_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 26-JUL-15

RMAN> 

This is useful if you have been switching the archivelog destination to different locations during the course of the day.
.
.
.

19 July, 2015

RMAN -- 5b : (More) Useful KEYWORDs and SubClauses

Here are a few more useful KEYWORDs and SubClauses

SECTION SIZE 
SECTION SIZE allows you to split a single Database file into multiple sections.  Note : A Database File  span BackupPieces.  The difference between BackupPieces and Sections is that the former are serially done while Sections can be done in-parallel.  (SECTION SIZE cannot be used with MAXPIECESIZE).  Here, I first show a datafile in 4 BackupPieces defined by SECTION SIZE.

SQL> select file_id, size_mb
  2  from
  3  (select file_id, bytes/1048576 size_mb
  4  from dba_data_files
  5  order by 2 desc)
  6  where rownum = 1;

   FILE_ID    SIZE_MB
---------- ----------
         2       1259

SQL> 

RMAN> backup datafile 2 section size  400M;

Starting backup at 19-JUL-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=40 device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
backing up blocks 1 through 51200
channel ORA_DISK_1: starting piece 1 at 19-JUL-15
channel ORA_DISK_1: finished piece 1 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T223055_btqf5020_.bkp tag=TAG20150719T223055 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:26
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
backing up blocks 51201 through 102400
channel ORA_DISK_1: starting piece 2 at 19-JUL-15
channel ORA_DISK_1: finished piece 2 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T223055_btqf5sw2_.bkp tag=TAG20150719T223055 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
backing up blocks 102401 through 153600
channel ORA_DISK_1: starting piece 3 at 19-JUL-15
channel ORA_DISK_1: finished piece 3 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T223055_btqf76wl_.bkp tag=TAG20150719T223055 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:56
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
backing up blocks 153601 through 161152
channel ORA_DISK_1: starting piece 4 at 19-JUL-15
channel ORA_DISK_1: finished piece 4 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T223055_btqf8y7p_.bkp tag=TAG20150719T223055 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 19-JUL-15

Starting Control File and SPFILE Autobackup at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_19/o1_mf_s_885508385_btqf92c7_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 19-JUL-15

RMAN>  
RMAN> list backup of datafile 2 completed after "trunc(sysdate)";


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
68      Full    452.02M    DISK        00:02:09     19-JUL-15      
  List of Datafiles in backup set 68
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2       Full 14135401   19-JUL-15 /home/oracle/app/oracle/oradata/orcl/sysaux01.dbf

  Backup Set Copy #1 of backup set 68
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:02:09     19-JUL-15       YES        TAG20150719T223055

    List of Backup Pieces for backup set 68 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    71      1   AVAILABLE   /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T223055_btqf5020_.bkp
    72      2   AVAILABLE   /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T223055_btqf5sw2_.bkp
    73      3   AVAILABLE   /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T223055_btqf76wl_.bkp
    74      4   AVAILABLE   /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T223055_btqf8y7p_.bkp

RMAN> 
   

Note how the blocks of the datafile are allocated to each Section.  Section 1 is for Blocks 1 to 51200.  Section 2 is for Blocks 51201 to 102400.  And so on for subsequent Sections.
Next, I run two channels for in-parallel backups of the sections, still comprising of one BackupSet for the datafile.

RMAN> run
2> {    
3> allocate channel d1 device type disk;
4> allocate channel d2 device type disk; 
5> backup datafile 2 section size 400M;
6> }

released channel: ORA_DISK_1
allocated channel: d1
channel d1: SID=40 device type=DISK

allocated channel: d2
channel d2: SID=44 device type=DISK

Starting backup at 19-JUL-15
channel d1: starting compressed full datafile backup set
channel d1: specifying datafile(s) in backup set
input datafile file number=00002 name=/home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
backing up blocks 1 through 51200
channel d1: starting piece 1 at 19-JUL-15
channel d2: starting compressed full datafile backup set
channel d2: specifying datafile(s) in backup set
input datafile file number=00002 name=/home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
backing up blocks 51201 through 102400
channel d2: starting piece 2 at 19-JUL-15
channel d1: finished piece 1 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T224411_btqfxvrr_.bkp tag=TAG20150719T224411 comment=NONE
channel d1: backup set complete, elapsed time: 00:00:26
channel d1: starting compressed full datafile backup set
channel d1: specifying datafile(s) in backup set
input datafile file number=00002 name=/home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
backing up blocks 102401 through 153600
channel d1: starting piece 3 at 19-JUL-15
channel d2: finished piece 2 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T224411_btqfxvvv_.bkp tag=TAG20150719T224411 comment=NONE
channel d2: backup set complete, elapsed time: 00:00:51
channel d2: starting compressed full datafile backup set
channel d2: specifying datafile(s) in backup set
input datafile file number=00002 name=/home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
backing up blocks 153601 through 161152
channel d2: starting piece 4 at 19-JUL-15
channel d2: finished piece 4 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T224411_btqfzglf_.bkp tag=TAG20150719T224411 comment=NONE
channel d2: backup set complete, elapsed time: 00:00:03
channel d1: finished piece 3 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T224411_btqfyo8v_.bkp tag=TAG20150719T224411 comment=NONE
channel d1: backup set complete, elapsed time: 00:00:50
Finished backup at 19-JUL-15

Starting Control File and SPFILE Autobackup at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_19/o1_mf_s_885509127_btqg07qq_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 19-JUL-15
released channel: d1
released channel: d2

RMAN> list backupset 72;


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
72      Full    452.02M    DISK        00:01:13     19-JUL-15      
  List of Datafiles in backup set 72
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2       Full 14136475   19-JUL-15 /home/oracle/app/oracle/oradata/orcl/sysaux01.dbf

  Backup Set Copy #1 of backup set 72
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:01:13     19-JUL-15       YES        TAG20150719T224411

    List of Backup Pieces for backup set 72 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    81      1   AVAILABLE   /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T224411_btqfxvrr_.bkp
    82      2   AVAILABLE   /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T224411_btqfxvvv_.bkp
    84      3   AVAILABLE   /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T224411_btqfyo8v_.bkp
    83      4   AVAILABLE   /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T224411_btqfzglf_.bkp

RMAN> 

Thus, we have BackupSet 72 consisting of the 4 BackupPieces.  The BackupPieces were created using 2 Channels running in-parallel with different ranges of Blocks.



FORMAT (and the FRA)
If you use the FRA with db_recovery_file_dest, Oracle tracks usage against the limit specified by db_recovery_file_dest_size.
However, if you use the FORMAT clause, such backups are *not* tracked as being part of the FRA.  This also means that Oracle would under-report usage of the FRA and wouldn't be able to identify when the FRA nears the limit.

For example, I first report the FRA usage and then run Backups without and and then with the FORMAT clause.  Note how the FRA usage report reflects the Backups without the FORMAT clause only.

SQL> set linesize 132
SQL> show parameter db_recovery

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /NEW_FS/oracle/FRA
db_recovery_file_dest_size           big integer 8G

SQL> select * from v$flash_recovery_area_usage;

FILE_TYPE            PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
-------------------- ------------------ ------------------------- ---------------
CONTROL FILE                          0                         0               0
REDO LOG                              0                         0               0
ARCHIVED LOG                        .27                         0              10
BACKUP PIECE                      32.96                      22.4              34
IMAGE COPY                            0                         0               0
FLASHBACK LOG                         0                         0               0
FOREIGN ARCHIVED LOG                  0                         0               0

7 rows selected.

SQL> 

RMAN> backup as compressed backupset tablespace hemant filesperset=1;

Starting backup at 19-JUL-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=44 device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf
channel ORA_DISK_1: starting piece 1 at 19-JUL-15
channel ORA_DISK_1: finished piece 1 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T230355_btqh2vkb_.bkp tag=TAG20150719T230355 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf
channel ORA_DISK_1: starting piece 1 at 19-JUL-15
channel ORA_DISK_1: finished piece 1 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T230355_btqh2yoc_.bkp tag=TAG20150719T230355 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00008 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf
channel ORA_DISK_1: starting piece 1 at 19-JUL-15
channel ORA_DISK_1: finished piece 1 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T230355_btqh31vh_.bkp tag=TAG20150719T230355 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf
channel ORA_DISK_1: starting piece 1 at 19-JUL-15
channel ORA_DISK_1: finished piece 1 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T230355_btqh34ys_.bkp tag=TAG20150719T230355 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00011 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf
channel ORA_DISK_1: starting piece 1 at 19-JUL-15
channel ORA_DISK_1: finished piece 1 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T230355_btqh382g_.bkp tag=TAG20150719T230355 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 19-JUL-15

Starting Control File and SPFILE Autobackup at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_19/o1_mf_s_885510251_btqh3c9d_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 19-JUL-15

RMAN> 

SQL> select * from v$flash_recovery_area_usage;

FILE_TYPE            PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
-------------------- ------------------ ------------------------- ---------------
CONTROL FILE                          0                         0               0
REDO LOG                              0                         0               0
ARCHIVED LOG                        .27                         0              10
BACKUP PIECE                      33.54                     22.92              40
IMAGE COPY                            0                         0               0
FLASHBACK LOG                         0                         0               0
FOREIGN ARCHIVED LOG                  0                         0               0

7 rows selected.

SQL> 

RMAN> backup as compressed backupset tablespace hemant format '/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/%U' filesperset=1;

Starting backup at 19-JUL-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=41 device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf
channel ORA_DISK_1: starting piece 1 at 19-JUL-15
channel ORA_DISK_1: finished piece 1 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/2vqcfk8t_1_1 tag=TAG20150719T230709 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf
channel ORA_DISK_1: starting piece 1 at 19-JUL-15
channel ORA_DISK_1: finished piece 1 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/30qcfk90_1_1 tag=TAG20150719T230709 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00008 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf
channel ORA_DISK_1: starting piece 1 at 19-JUL-15
channel ORA_DISK_1: finished piece 1 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/31qcfk93_1_1 tag=TAG20150719T230709 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf
channel ORA_DISK_1: starting piece 1 at 19-JUL-15
channel ORA_DISK_1: finished piece 1 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/32qcfk96_1_1 tag=TAG20150719T230709 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00011 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf
channel ORA_DISK_1: starting piece 1 at 19-JUL-15
channel ORA_DISK_1: finished piece 1 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/33qcfk9a_1_1 tag=TAG20150719T230709 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 19-JUL-15

Starting Control File and SPFILE Autobackup at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_19/o1_mf_s_885510445_btqh9f6x_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 19-JUL-15

RMAN> 

SQL> select * from v$flash_recovery_area_usage;

FILE_TYPE            PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
-------------------- ------------------ ------------------------- ---------------
CONTROL FILE                          0                         0               0
REDO LOG                              0                         0               0
ARCHIVED LOG                        .27                         0              10
BACKUP PIECE                      33.65                      23.5              41
IMAGE COPY                            0                         0               0
FLASHBACK LOG                         0                         0               0
FOREIGN ARCHIVED LOG                  0                         0               0

7 rows selected.

SQL> 

Note how the first backup (which did NOT specify a FORMAT clause) consisted of 5 BackupPieces for the Datafiles plus 1 for the AutoBackup. The NUMBER_OF_FILES for BACKUP PIECE in v$flash_recovery_area_usage was updaetd from 34 to 40.
However, while the second backup with the FORMAT clause (actually pointing to the same physical directory) created 5 Datafile BackupPieces and 1 AutoBackup again, the count in v$flash_recovery_area_usage did NOT increment by 6  (the increment by 1 is for the AutoBackup).

Thus, for this second, with FORMAT clause, backup, while a LIST BACKUP command would show it and the backup would be usable for Restore scenarios, v$flash_recovery_area_usage does not track it.  Therefore, Oracle hasn't incremented the PERCENT_SPACE_USED either.  This PERCENT_SPACE_USED is very important for Oracle to automatically purge older (i.e. OBSOLETE) backups when space usage hits critical limits.



TAG
The TAG clause allows us to specifically define our own Tags.  Note my previous backups showed a TAG that indicates merely date and time as in :

RMAN> list backup summary;

using target database control file instead of recovery catalog

List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
28      B  F  A DISK        23-JUN-15       1       1       NO         TAG20150623T170721
29      B  F  A DISK        23-JUN-15       1       1       NO         TAG20150623T170846
30      B  F  A DISK        04-JUL-15       1       1       YES        TAG20150704T121859
31      B  F  A DISK        04-JUL-15       1       1       YES        TAG20150704T121859
32      B  F  A DISK        04-JUL-15       1       1       YES        TAG20150704T121859
33      B  F  A DISK        04-JUL-15       1       1       YES        TAG20150704T121859
34      B  F  A DISK        04-JUL-15       1       1       YES        TAG20150704T121859
35      B  F  A DISK        04-JUL-15       1       1       YES        TAG20150704T121859
36      B  F  A DISK        04-JUL-15       1       1       NO         TAG20150704T131927
37      B  F  A DISK        08-JUL-15       1       1       YES        TAG20150708T211100
38      B  F  A DISK        08-JUL-15       1       1       YES        TAG20150708T211100
39      B  F  A DISK        08-JUL-15       1       1       NO         TAG20150708T211118
40      B  F  A DISK        08-JUL-15       1       1       NO         TAG20150708T215526
60      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T222911
61      B  F  A DISK        12-JUL-15       1       1       NO         TAG20150712T222957
62      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T223210
63      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T223210
64      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T223210
65      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T223210
66      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T223210
67      B  F  A DISK        12-JUL-15       1       1       NO         TAG20150712T223226
68      B  F  A DISK        19-JUL-15       4       1       YES        TAG20150719T223055
69      B  F  A DISK        19-JUL-15       1       1       NO         TAG20150719T223305
71      B  F  A DISK        19-JUL-15       1       1       NO         TAG20150719T224023
72      B  F  A DISK        19-JUL-15       4       1       YES        TAG20150719T224411
73      B  F  A DISK        19-JUL-15       1       1       NO         TAG20150719T224527
74      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230053
75      B  F  A DISK        19-JUL-15       1       1       NO         TAG20150719T230119
76      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230355
77      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230355
78      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230355
79      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230355
80      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230355
81      B  F  A DISK        19-JUL-15       1       1       NO         TAG20150719T230411
82      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230709
83      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230709
84      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230709
85      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230709
86      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230709
87      B  F  A DISK        19-JUL-15       1       1       NO         TAG20150719T230725

RMAN> 

However, I can use the TAG clause to identify specific Backups distinctively. Later, for the RESTORE command, the known TAG becomes useful as I can RESTORE FROM TAG. Here's how I create backups with specific TAGs.

RMAN> backup as compressed backupset tablespace HEMANT TAG 'Hemant_19Jul15';

Starting backup at 19-JUL-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=64 device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf
input datafile file number=00007 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf
input datafile file number=00008 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf
input datafile file number=00009 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf
input datafile file number=00011 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf
channel ORA_DISK_1: starting piece 1 at 19-JUL-15
channel ORA_DISK_1: finished piece 1 at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_HEMANT_19JUL15_btqhy6js_.bkp tag=HEMANT_19JUL15 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 19-JUL-15

Starting Control File and SPFILE Autobackup at 19-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_19/o1_mf_s_885511125_btqhyoo9_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 19-JUL-15

RMAN>
RMAN> list backup of tablespace hemant completed after "(sysdate-5/1440)";


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
88      Full    33.82M     DISK        00:00:07     19-JUL-15      
        BP Key: 100   Status: AVAILABLE  Compressed: YES  Tag: HEMANT_19JUL15
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_HEMANT_19JUL15_btqhy6js_.bkp
  List of Datafiles in backup set 88
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6       Full 14138686   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf
  7       Full 14138686   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf
  8       Full 14138686   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf
  9       Full 14138686   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf
  11      Full 14138686   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf

RMAN> list backup of tablespace HEMANT summary;


List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
37      B  F  A DISK        08-JUL-15       1       1       YES        TAG20150708T211100
38      B  F  A DISK        08-JUL-15       1       1       YES        TAG20150708T211100
60      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T222911
62      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T223210
63      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T223210
64      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T223210
65      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T223210
66      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T223210
74      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230053
76      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230355
77      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230355
78      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230355
79      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230355
80      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230355
82      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230709
83      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230709
84      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230709
85      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230709
86      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230709
88      B  F  A DISK        19-JUL-15       1       1       YES        HEMANT_19JUL15

RMAN> 

Notice how the latest backup of Tablespace HEMANT is tagged by the TAG I had specified during the BACKUP run.




completed after "..date/time clause"
Note how, in the listings above, I have used the 'completed after "trunc(sysdate)" '  and  'completed after "(sysdate-5/1440)" to specify a Date/Time as a filter.

Here's another example to show Backups completed in the month of July-2015. (The two backups of 23-Jun-2015 are excluded).

RMAN> list backup summary completed after "to_date('JUL-15','MON-RR')";


List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
30      B  F  A DISK        04-JUL-15       1       1       YES        TAG20150704T121859
31      B  F  A DISK        04-JUL-15       1       1       YES        TAG20150704T121859
32      B  F  A DISK        04-JUL-15       1       1       YES        TAG20150704T121859
33      B  F  A DISK        04-JUL-15       1       1       YES        TAG20150704T121859
34      B  F  A DISK        04-JUL-15       1       1       YES        TAG20150704T121859
35      B  F  A DISK        04-JUL-15       1       1       YES        TAG20150704T121859
36      B  F  A DISK        04-JUL-15       1       1       NO         TAG20150704T131927
37      B  F  A DISK        08-JUL-15       1       1       YES        TAG20150708T211100
38      B  F  A DISK        08-JUL-15       1       1       YES        TAG20150708T211100
39      B  F  A DISK        08-JUL-15       1       1       NO         TAG20150708T211118
40      B  F  A DISK        08-JUL-15       1       1       NO         TAG20150708T215526
60      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T222911
61      B  F  A DISK        12-JUL-15       1       1       NO         TAG20150712T222957
62      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T223210
63      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T223210
64      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T223210
65      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T223210
66      B  F  A DISK        12-JUL-15       1       1       YES        TAG20150712T223210
67      B  F  A DISK        12-JUL-15       1       1       NO         TAG20150712T223226
68      B  F  A DISK        19-JUL-15       4       1       YES        TAG20150719T223055
69      B  F  A DISK        19-JUL-15       1       1       NO         TAG20150719T223305
71      B  F  A DISK        19-JUL-15       1       1       NO         TAG20150719T224023
72      B  F  A DISK        19-JUL-15       4       1       YES        TAG20150719T224411
73      B  F  A DISK        19-JUL-15       1       1       NO         TAG20150719T224527
74      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230053
75      B  F  A DISK        19-JUL-15       1       1       NO         TAG20150719T230119
76      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230355
77      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230355
78      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230355
79      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230355
80      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230355
81      B  F  A DISK        19-JUL-15       1       1       NO         TAG20150719T230411
82      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230709
83      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230709
84      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230709
85      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230709
86      B  F  A DISK        19-JUL-15       1       1       YES        TAG20150719T230709
87      B  F  A DISK        19-JUL-15       1       1       NO         TAG20150719T230725
88      B  F  A DISK        19-JUL-15       1       1       YES        HEMANT_19JUL15
89      B  F  A DISK        19-JUL-15       1       1       NO         TAG20150719T231845

RMAN> 

This shows that I can use Date Format masks in my filter.

Here's another example (note : if you use 'between', it seems that the two date formats must match, else no records are returned as in the first listing below):

RMAN> list backup completed between
2> "to_date('19-JUL-2015 22:45:00','DD-MON-YYYY HH24:MI:SS')"
3> and 
4> "to_date(sysdate)";

specification does not match any backup in the repository

RMAN> list backup completed between
2> "to_date('19-JUL-2015 22:45:00','DD-MON-YYYY HH24:MI:SS')"
3> and
4> "to_date('19-JUL-2015 23:15:00','DD-MON-YYYY HH24:MI:SS')";


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
72      Full    452.02M    DISK        00:01:13     19-JUL-15      
  List of Datafiles in backup set 72
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2       Full 14136475   19-JUL-15 /home/oracle/app/oracle/oradata/orcl/sysaux01.dbf

  Backup Set Copy #1 of backup set 72
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:01:13     19-JUL-15       YES        TAG20150719T224411

    List of Backup Pieces for backup set 72 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    81      1   AVAILABLE   /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T224411_btqfxvrr_.bkp
    82      2   AVAILABLE   /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T224411_btqfxvvv_.bkp
    84      3   AVAILABLE   /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T224411_btqfyo8v_.bkp
    83      4   AVAILABLE   /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T224411_btqfzglf_.bkp

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
73      Full    9.36M      DISK        00:00:00     19-JUL-15      
        BP Key: 85   Status: AVAILABLE  Compressed: NO  Tag: TAG20150719T224527
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_19/o1_mf_s_885509127_btqg07qq_.bkp
  SPFILE Included: Modification time: 19-JUL-15
  SPFILE db_unique_name: HEMANTDB
  Control File Included: Ckp SCN: 14136581     Ckp time: 19-JUL-15

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
74      Full    33.82M     DISK        00:00:23     19-JUL-15      
        BP Key: 86   Status: AVAILABLE  Compressed: YES  Tag: TAG20150719T230053
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T230053_btqgx5vx_.bkp
  List of Datafiles in backup set 74
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6       Full 14137744   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf
  7       Full 14137744   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf
  8       Full 14137744   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf
  9       Full 14137744   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf
  11      Full 14137744   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
75      Full    9.36M      DISK        00:00:00     19-JUL-15      
        BP Key: 87   Status: AVAILABLE  Compressed: NO  Tag: TAG20150719T230119
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_19/o1_mf_s_885510079_btqgxzd8_.bkp
  SPFILE Included: Modification time: 19-JUL-15
  SPFILE db_unique_name: HEMANTDB
  Control File Included: Ckp SCN: 14137759     Ckp time: 19-JUL-15

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
76      Full    7.41M      DISK        00:00:02     19-JUL-15      
        BP Key: 88   Status: AVAILABLE  Compressed: YES  Tag: TAG20150719T230355
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T230355_btqh2vkb_.bkp
  List of Datafiles in backup set 76
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6       Full 14137868   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
77      Full    7.40M      DISK        00:00:02     19-JUL-15      
        BP Key: 89   Status: AVAILABLE  Compressed: YES  Tag: TAG20150719T230355
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T230355_btqh2yoc_.bkp
  List of Datafiles in backup set 77
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  7       Full 14137870   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
78      Full    7.38M      DISK        00:00:02     19-JUL-15      
        BP Key: 90   Status: AVAILABLE  Compressed: YES  Tag: TAG20150719T230355
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T230355_btqh31vh_.bkp
  List of Datafiles in backup set 78
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  8       Full 14137872   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
79      Full    7.43M      DISK        00:00:02     19-JUL-15      
        BP Key: 91   Status: AVAILABLE  Compressed: YES  Tag: TAG20150719T230355
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T230355_btqh34ys_.bkp
  List of Datafiles in backup set 79
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  9       Full 14137874   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
80      Full    7.91M      DISK        00:00:01     19-JUL-15      
        BP Key: 92   Status: AVAILABLE  Compressed: YES  Tag: TAG20150719T230355
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/o1_mf_nnndf_TAG20150719T230355_btqh382g_.bkp
  List of Datafiles in backup set 80
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  11      Full 14137876   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
81      Full    9.36M      DISK        00:00:00     19-JUL-15      
        BP Key: 93   Status: AVAILABLE  Compressed: NO  Tag: TAG20150719T230411
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_19/o1_mf_s_885510251_btqh3c9d_.bkp
  SPFILE Included: Modification time: 19-JUL-15
  SPFILE db_unique_name: HEMANTDB
  Control File Included: Ckp SCN: 14137883     Ckp time: 19-JUL-15

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
82      Full    7.41M      DISK        00:00:01     19-JUL-15      
        BP Key: 94   Status: AVAILABLE  Compressed: YES  Tag: TAG20150719T230709
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/2vqcfk8t_1_1
  List of Datafiles in backup set 82
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6       Full 14138235   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
83      Full    7.40M      DISK        00:00:01     19-JUL-15      
        BP Key: 95   Status: AVAILABLE  Compressed: YES  Tag: TAG20150719T230709
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/30qcfk90_1_1
  List of Datafiles in backup set 83
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  7       Full 14138237   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
84      Full    7.38M      DISK        00:00:02     19-JUL-15      
        BP Key: 96   Status: AVAILABLE  Compressed: YES  Tag: TAG20150719T230709
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/31qcfk93_1_1
  List of Datafiles in backup set 84
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  8       Full 14138239   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
85      Full    7.43M      DISK        00:00:02     19-JUL-15      
        BP Key: 97   Status: AVAILABLE  Compressed: YES  Tag: TAG20150719T230709
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/32qcfk96_1_1
  List of Datafiles in backup set 85
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  9       Full 14138241   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
86      Full    7.91M      DISK        00:00:01     19-JUL-15      
        BP Key: 98   Status: AVAILABLE  Compressed: YES  Tag: TAG20150719T230709
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_19/33qcfk9a_1_1
  List of Datafiles in backup set 86
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  11      Full 14138243   19-JUL-15 /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
87      Full    9.36M      DISK        00:00:00     19-JUL-15      
        BP Key: 99   Status: AVAILABLE  Compressed: NO  Tag: TAG20150719T230725
        Piece Name: /NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_19/o1_mf_s_885510445_btqh9f6x_.bkp
  SPFILE Included: Modification time: 19-JUL-15
  SPFILE db_unique_name: HEMANTDB
  Control File Included: Ckp SCN: 14138250     Ckp time: 19-JUL-15

RMAN> 

Thus, you can identify a list of backups by time ranges as well !
.
.
.

12 July, 2015

RMAN -- 5 : Useful KEYWORDs and SubClauses

I begin a subseries on useful KEYWORDs and SubClauses in the RMAN Command Set.

This is on the less-commonly used KEYWORDs  (Thus, I don't show CONFIGURE CONTROLFILE AUTOBACKUP ON in this post or SET UNTIL in the next post).

(Note that specifications defined with CONFIGURE become "persistent" but can be overridden in the specific BACKUP or RESTORE runs)



COMPRESSED BACKUPSET
By default BackupSets are non-Compressed.  However, COMPRESSED BACKUPSET can be specified in either the BACKUP command OR in the CONFIGURE command.
RMAN> configure device type disk parallelism 2 backup type to compressed backupset;

old RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO COMPRESSED BACKUPSET;
new RMAN configuration parameters are successfully stored
released channel: ORA_DISK_1
released channel: ORA_DISK_2
released channel: ORA_DISK_3
released channel: ORA_DISK_4

RMAN>    

RMAN> backup tablespace hemant;

Starting backup at 12-JUL-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=49 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=29 device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf
input datafile file number=00008 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf
input datafile file number=00011 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf
channel ORA_DISK_1: starting piece 1 at 12-JUL-15
channel ORA_DISK_2: starting compressed full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00007 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf
input datafile file number=00009 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf
channel ORA_DISK_2: starting piece 1 at 12-JUL-15
channel ORA_DISK_2: finished piece 1 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T182836_bt4jbnxh_.bkp tag=TAG20150712T182836 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:08
channel ORA_DISK_1: finished piece 1 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T182836_bt4jbnx1_.bkp tag=TAG20150712T182836 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:16
Finished backup at 12-JUL-15

Starting Control File and SPFILE Autobackup at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_12/o1_mf_s_884888932_bt4jc47o_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 12-JUL-15

RMAN> 
Note how I did not have to specify "AS COMPRESSED BACKUPSET" in the BACKUP command. The CONFIGURE command had configured the DISK device type backups to be COMPRESSED BACKUPSETs as "the default".  I can override the *configured* COMPRESSED BACKUPSET by including the "AS BACKUPSET" Keywords in the BACKUP command. (Out-of-the-box, RMAN is NOT configured for COMPRESSED BACKUPSET !)



PARALLELISM in the deviceConf SubClause of the CONFIGURE command
This allows RMAN to automatically create multiple Channels when running a Backup.  Therefore, individual CONFIGURE CHANNEL commands are not required.  Note : each Channel creates a separate BackupSet !

With PARALLELISM 2, we see 2 Channels ORA_DISK_1 and ORA_DISK_2 created and used :
RMAN> configure device type disk parallelism 2 backup type to backupset;

new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters are successfully stored
released channel: ORA_DISK_1

RMAN>   
RMAN> backup tablespace HEMANT;

Starting backup at 12-JUL-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=49 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=29 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf
input datafile file number=00008 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf
input datafile file number=00011 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf
channel ORA_DISK_1: starting piece 1 at 12-JUL-15
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00007 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf
input datafile file number=00009 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf
channel ORA_DISK_2: starting piece 1 at 12-JUL-15
channel ORA_DISK_2: finished piece 1 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T182024_bt4hv96z_.bkp tag=TAG20150712T182024 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:36
channel ORA_DISK_1: finished piece 1 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T182024_bt4hv973_.bkp tag=TAG20150712T182024 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:36
Finished backup at 12-JUL-15

Starting Control File and SPFILE Autobackup at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_12/o1_mf_s_884888462_bt4hwn9c_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 12-JUL-15

RMAN> 

With PARALLELISM 4, we see 4 Channels ORA_DISK_1 to ORA_DISK_4 being created :
RMAN> configure device type disk parallelism 4 backup type to backupset;

old RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters are successfully stored
released channel: ORA_DISK_1
released channel: ORA_DISK_2

RMAN>      
RMAN> backup tablespace HEMANT;

Starting backup at 12-JUL-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=49 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=29 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=32 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=28 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf
input datafile file number=00009 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf
channel ORA_DISK_1: starting piece 1 at 12-JUL-15
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00007 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf
input datafile file number=00011 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf
channel ORA_DISK_2: starting piece 1 at 12-JUL-15
channel ORA_DISK_3: starting full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
input datafile file number=00008 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf
channel ORA_DISK_3: starting piece 1 at 12-JUL-15
channel ORA_DISK_1: finished piece 1 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T182301_bt4j05dl_.bkp tag=TAG20150712T182301 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_2: finished piece 1 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T182301_bt4j05f7_.bkp tag=TAG20150712T182301 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_3: finished piece 1 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T182301_bt4j05jz_.bkp tag=TAG20150712T182301 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:03
Finished backup at 12-JUL-15

Starting Control File and SPFILE Autobackup at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_12/o1_mf_s_884888584_bt4j08mc_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 12-JUL-15

RMAN> 

In the latter case, although 4 Channels were created, RMAN actually used only 3 Channels.  So, RMAN can still automatically adjust the allocation of datafiles across the Channels.



MAXSETSIZE in the BACKUP command.
A BACKUP run (whether at Database level or for specific Tablespace(s) or Datafiles or ArchiveLogs), by default, creates BackupSets.  However, a BACKUP run can create multiple BackupSets.
This can happen when :
a.  The number of datafiles (or ArchiveLogs) in the Backup is "large"  (e.g. by default, unless FILESPERSET is specified, a max of 64 datafiles make up one BackupSet).
b.  Multiple Channels are used for the BACKUP run
c.  The PARALLEL Keyword is used  (as demonstrated above)
The MAXSETSIZE is actually a way to specify the maximum size of a BackupSet.  A datafile cannot span BackupSets, so the MAXSETSIZE must be, at least, as large as the largest datafile in the database.

SQL> select max(bytes)/1048576 from dba_data_files;

MAX(BYTES)/1048576
------------------
              1259

SQL>   

RMAN> backup as compressed backupset database maxsetsize 1200M;

Starting backup at 12-JUL-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=49 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 07/12/2015 18:14:37
RMAN-06183: datafile or datafile copy /home/oracle/app/oracle/oradata/orcl/sysaux01.dbf (file number 2) larger than MAXSETSIZE

RMAN> 

Thus, we can see that Oracle automatically checks the largest datafile against the MAXSETSIZE. Note, also, that it does not estimate a Compressed size for this check, even though I've specified "AS COMPRESSED BACKUPSET".



MAXPIECESIZE
Just as a Backup can consist of multiple BackupSets, a BackupSet can consist of multiple BackupPieces.  A BackupSet can consist of multiple datafiles and a datafile may be split across multiple BackupPieces. However, unlike the MAXSETSIZE that can be specified with the BACKUP command, MAXPIECESIZE is specified with the CONFIGURE CHANNEL. (However, unlike the MAXSETSIZE which runs a check before beginning the backup, this limit is applied when creating backuppieces !)

RMAN> configure device type disk parallelism 1 backup type to compressed backupset;

old RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO COMPRESSED BACKUPSET;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;
new RMAN configuration parameters are successfully stored
released channel: ORA_DISK_1
released channel: ORA_DISK_2

RMAN> configure channel device type disk maxpiecesize 25M;

new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 25 M;
new RMAN configuration parameters are successfully stored


RMAN> configure channel device type disk maxpiecesize 5M;

old RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 25 M;
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 5 M;
new RMAN configuration parameters are successfully stored
released channel: ORA_DISK_1

RMAN> backup datafile 6;

Starting backup at 12-JUL-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=49 device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf
channel ORA_DISK_1: starting piece 1 at 12-JUL-15
channel ORA_DISK_1: finished piece 1 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T184704_bt4kf8jm_.bkp tag=TAG20150712T184704 comment=NONE
channel ORA_DISK_1: starting piece 2 at 12-JUL-15
channel ORA_DISK_1: finished piece 2 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T184704_bt4kf9jn_.bkp tag=TAG20150712T184704 comment=NONE
channel ORA_DISK_1: starting piece 3 at 12-JUL-15
channel ORA_DISK_1: finished piece 3 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T184704_bt4kfbjs_.bkp tag=TAG20150712T184704 comment=NONE
channel ORA_DISK_1: starting piece 4 at 12-JUL-15
channel ORA_DISK_1: finished piece 4 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T184704_bt4kfcjy_.bkp tag=TAG20150712T184704 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 12-JUL-15

Starting Control File and SPFILE Autobackup at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_12/o1_mf_s_884890028_bt4kfdn9_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 12-JUL-15

RMAN> 

SQL> !du -sh /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T184704*
3.1M    /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T184704_bt4kf8jm_.bkp
3.1M    /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T184704_bt4kf9jn_.bkp
3.1M    /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T184704_bt4kfbjs_.bkp
68K     /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T184704_bt4kfcjy_.bkp

SQL> 

The configured MAXPIECESIZE limit applied to the compressed piecesize. !



FILESPERSET
I have mentioned FILESPERSET earlier in this post and in another blog post.  This Keyword allows us to limit a BackupSet to a certain number of files.

RMAN> backup as compressed backupset tablespace HEMANT filesperset=6;

Starting backup at 12-JUL-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=42 device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf
input datafile file number=00007 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf
input datafile file number=00008 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf
input datafile file number=00009 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf
input datafile file number=00011 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf
channel ORA_DISK_1: starting piece 1 at 12-JUL-15
channel ORA_DISK_1: finished piece 1 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T222911_bt4yfrd6_.bkp tag=TAG20150712T222911 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
Finished backup at 12-JUL-15

Starting Control File and SPFILE Autobackup at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_12/o1_mf_s_884903397_bt4yh670_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 12-JUL-15

RMAN> 

With FILEPERSET=6, all 5 datafiles are in one BackupSet (as long as the total size is less than the limit on a BackupSet Size / MAXSETSIZE).

Now, let's rerun the backup with FILESPERSET=1

RMAN> backup as compressed backupset tablespace HEMANT filesperset=1;

Starting backup at 12-JUL-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf
channel ORA_DISK_1: starting piece 1 at 12-JUL-15
channel ORA_DISK_1: finished piece 1 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T223210_bt4ymbh5_.bkp tag=TAG20150712T223210 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf
channel ORA_DISK_1: starting piece 1 at 12-JUL-15
channel ORA_DISK_1: finished piece 1 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T223210_bt4ymfnl_.bkp tag=TAG20150712T223210 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00008 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf
channel ORA_DISK_1: starting piece 1 at 12-JUL-15
channel ORA_DISK_1: finished piece 1 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T223210_bt4ymjq8_.bkp tag=TAG20150712T223210 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf
channel ORA_DISK_1: starting piece 1 at 12-JUL-15
channel ORA_DISK_1: finished piece 1 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T223210_bt4ymmt5_.bkp tag=TAG20150712T223210 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00011 name=/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf
channel ORA_DISK_1: starting piece 1 at 12-JUL-15
channel ORA_DISK_1: finished piece 1 at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_12/o1_mf_nnndf_TAG20150712T223210_bt4ympxr_.bkp tag=TAG20150712T223210 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 12-JUL-15

Starting Control File and SPFILE Autobackup at 12-JUL-15
piece handle=/NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_12/o1_mf_s_884903546_bt4ymtdr_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 12-JUL-15

RMAN> 
Now, I can have each datafile go into a separate BackupSet. The advantage of using FILESPERSET in one context was shown in a previous post. Another advantage is obvious when we have to restore a single datafile. If we had 16 datafiles in a BackupSet, and we need to restore a single datafile, RMAN still has to read the entire BackupSet of 16 datafiles to be able to restore that single datafile.  If each BackupSet was limited in size by using MAXSETSIZE and/or FILESPERSET, restoring a single datafile can be faster as the Restore has to read a smaller BackupSet.

.
.
.

08 July, 2015

RMAN -- 4b : Recovering from an Incomplete Restore with OMF Files

Following up on my previous post (which had the datafiles as non-OMF), here is a case with OMF files.

SQL> select file_name from dba_data_files
  2  where tablespace_name = 'HEMANT';

FILE_NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst84r1w_.dbf
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst850ts_.dbf
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst85312_.dbf
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst85njw_.dbf
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst85qsq_.dbf

SQL> 
SQL> !rm /home/oracle/app/oracle/oradata/HEMANTDB/datafile/*hemant*dbf

SQL> shutdown immediate;
ORA-01116: error in opening database file 6
ORA-01110: data file 6: '/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst84r1w_.dbf'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3
SQL> shutdown abort;
ORACLE instance shut down.
SQL> 

I have removed the datafiles for a tablespace. Note that the datafiles are all OMF.  I then attempt to restore the tablespace.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@localhost ~]$ sqlplus

SQL*Plus: Release 11.2.0.2.0 Production on Wed Jul 8 21:15:21 2015

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Enter user-name: / as sysdba
Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area  456146944 bytes
Fixed Size                  1344840 bytes
Variable Size             390073016 bytes
Database Buffers           58720256 bytes
Redo Buffers                6008832 bytes
Database mounted.
SQL> select file# from v$datafile
  2  where  ts# = (select ts# from v$tablespace where name = 'HEMANT')
  3  order by 1;

     FILE#
----------
         6
         7
         8
         9
        11

SQL> 
SQL> alter database datafile 6 offline;

Database altered.

SQL> alter database datafile 7 offline;

Database altered.

SQL> alter database datafile 8 offline;

Database altered.

SQL> alter database datafile 9 offline;

Database altered.

SQL> alter database datafile 11 offline;

Database altered.

SQL> alter database open;

Database altered.

SQL> 
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@localhost ~]$ rman target /

Recovery Manager: Release 11.2.0.2.0 - Production on Wed Jul 8 21:22:02 2015

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

connected to target database: ORCL (DBID=1229390655)

RMAN>    
RMAN> restore tablespace HEMANT;

Starting restore at 08-JUL-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=36 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 00007 to /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst8szss_.dbf
channel ORA_DISK_1: restoring datafile 00009 to /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst8szxb_.dbf
channel ORA_DISK_1: reading from backup piece /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_08/o1_mf_nnndf_TAG20150708T211100_bst8c58p_.bkp
channel ORA_DISK_1: piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_08/o1_mf_nnndf_TAG20150708T211100_bst8c58p_.bkp tag=TAG20150708T211100
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
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 00006 to /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst8szv5_.dbf
channel ORA_DISK_1: restoring datafile 00008 to /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst8szwh_.dbf
channel ORA_DISK_1: restoring datafile 00011 to /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst8t089_.dbf
channel ORA_DISK_1: reading from backup piece /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_08/o1_mf_nnndf_TAG20150708T211100_bst8c58n_.bkp
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00601: fatal error in recovery manager
RMAN-03004: fatal error during execution of command
ORA-01092: ORACLE instance terminated. Disconnection forced
ORACLE error from target database: 
ORA-03135: connection lost contact
Process ID: 3615
Session ID: 29 Serial number: 21

[oracle@localhost ~]$ 

Once again, the database has crashed in the midst of the RESTORE. Let's check the datafile names.

[oracle@localhost ~]$ sqlplus '/ as sysdba'

SQL*Plus: Release 11.2.0.2.0 Production on Wed Jul 8 21:25:12 2015

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area  456146944 bytes
Fixed Size                  1344840 bytes
Variable Size             394267320 bytes
Database Buffers           54525952 bytes
Redo Buffers                6008832 bytes
Database mounted.
SQL> set pages60
SQL> select file#, name from v$datafile where file# in (6,7,8,9,11) order by 1;

     FILE#
----------
NAME
--------------------------------------------------------------------------------
         6
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst8szv5_.dbf

         7
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf

         8
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst8szwh_.dbf

         9
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf

        11
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst8t089_.dbf


SQL> 
SQL> select file#, name from v$datafile_header where file# in (6,7,8,9,11) order by 1;

     FILE#
----------
NAME
--------------------------------------------------------------------------------
         6


         7
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf

         8


         9
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf

        11



SQL> 

[To understand why I queried both V$DATAFILE and V$DATAFILE_HEADER, see my previous post "Datafiles not Restored  --  using V$DATAFILE and V$DATAFILE_HEADER".]

So, datafiles 7 and 9 have been restored. We can see that in the RESTORE log as well -- "backup piece 1" in the RESTORE had datafiles 7 and 9 and was the only one to complete. Let's check the datafile names. Datafiles 7 and 9 are differently named from what they were earlier.  Earlier, they were "%bst85%", now they are "%bst90%".

So, if we want to re-run the restore, we can use SET NEWNAME for datafiles 7 and 9 to allow Oracle to check that they are already restored.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@localhost ~]$ rman target /

Recovery Manager: Release 11.2.0.2.0 - Production on Wed Jul 8 21:32:12 2015

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

connected to target database: ORCL (DBID=1229390655, not open)

RMAN> run 
2> {set newname for datafile 7 to '/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf';
3> set newname for datafile 9 to '/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf';
4> restore tablespace HEMANT;}

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 08-JUL-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK

skipping datafile 7; already restored to file /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf
skipping datafile 9; already restored to file /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.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 00006 to /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst8szv5_.dbf
channel ORA_DISK_1: restoring datafile 00008 to /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst8szwh_.dbf
channel ORA_DISK_1: restoring datafile 00011 to /home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst8t089_.dbf
channel ORA_DISK_1: reading from backup piece /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_08/o1_mf_nnndf_TAG20150708T211100_bst8c58n_.bkp
channel ORA_DISK_1: piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_08/o1_mf_nnndf_TAG20150708T211100_bst8c58n_.bkp tag=TAG20150708T211100
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 08-JUL-15

RMAN> 

YES ! Datafiles 7 and 9 were identified as "already restored".
Let's re-check the datafiles and then RECOVER them.

RMAN> exit


Recovery Manager complete.
[oracle@localhost ~]$ sqlplus '/ as sysdba'

SQL*Plus: Release 11.2.0.2.0 Production on Wed Jul 8 21:37:29 2015

Copyright (c) 1982, 2010, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> 
SQL> select name from v$datafile
  2  where ts#=(select ts# from v$tablespace where name = 'HEMANT')
  3  minus
  4  select name from v$datafile_header
  5  where ts#=(select ts# from v$tablespace where name = 'HEMANT')
  6  /

no rows selected

SQL> 
SQL> select * from v$datafile_header where name is null;

no rows selected

SQL> 
SQL> recover datafile 6;
Media recovery complete.
SQL> recover datafile 7;
Media recovery complete.
SQL> recover datafile 8; 
Media recovery complete.
SQL> recover datafile 9;
Media recovery complete.
SQL> recover datafile 11;
Media recovery complete.
SQL> alter tablespace HEMANT online;
alter tablespace HEMANT online
*
ERROR at line 1:
ORA-01109: database not open


SQL> alter database open;

Database altered.

SQL> alter tablespace HEMANT online;

Tablespace altered.

SQL> 
SQL> select owner, segment_name, bytes/1048576 from dba_segments where tablespace_name = 'HEMANT';

OWNER
------------------------------
SEGMENT_NAME
--------------------------------------------------------------------------------
BYTES/1048576
-------------
HEMANT
LARGE_TABLE
          272


SQL> select  count(*) from hemant.large_table;

  COUNT(*)
----------
   2404256

SQL> 

Yes, I have been able to verify that all the datafiles have been restored.  I have been able to bring the tablespace online and query the data in it.

SQL> set pages60
SQL> select file_id, file_name from dba_data_files where tablespace_name = 'HEMANT';

   FILE_ID
----------
FILE_NAME
--------------------------------------------------------------------------------
         6
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4vt_.dbf

         7
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jct_.dbf

         8
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x0_.dbf

         9
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst90jf1_.dbf

        11
/home/oracle/app/oracle/oradata/HEMANTDB/datafile/o1_mf_hemant_bst9o4x5_.dbf


SQL> 

And, yes the datafile names (%bst90%) are different from what they were earlier (%bst84% and %bst85%).

(Reference :  See Oracle Support Note Doc ID 1621319.1)
.
.
.

04 July, 2015

RMAN -- 4 : Recovering from an Incomplete Restore

What do you do if a RESTORE fails mid-way ?  Do you need to rerun the whole restore ?  If it is a very large database, it could take [many ?] hours.

RMAN is "smart" enough to detect datafiles that have been restored and not re-attempt a restore.

UPDATE 08-Jul-15 :  For a database with Oracle Managed Files  (OMF), please see Oracle Support Note Doc ID 1621319.1  {Thus, see my next blog post on Recovering from an Incomplete Restore with OMF Files}

This example below is for non-OMF files.

Here, I begin a database restore.

 
RMAN> restore controlfile from autobackup;

Starting restore at 04-JUL-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK

recovery area destination: /NEW_FS/oracle/FRA
database name (or database unique name) used for search: HEMANTDB
channel ORA_DISK_1: AUTOBACKUP /NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_04/o1_mf_s_884175832_bsgqysyq_.bkp found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring control file from AUTOBACKUP /NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_04/o1_mf_s_884175832_bsgqysyq_.bkp
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=/home/oracle/app/oracle/oradata/orcl/control01.ctl
output file name=/home/oracle/app/oracle/flash_recovery_area/orcl/control02.ctl
Finished restore at 04-JUL-15

RMAN> 
RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

RMAN> 
RMAN> restore database;

Starting restore at 04-JUL-15
Starting implicit crosscheck backup at 04-JUL-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=21 device type=DISK
Crosschecked 8 objects
Finished implicit crosscheck backup at 04-JUL-15

Starting implicit crosscheck copy at 04-JUL-15
using channel ORA_DISK_1
using channel ORA_DISK_2
Finished implicit crosscheck copy at 04-JUL-15

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

List of Cataloged Files
=======================
File Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_628_bsgrjztp_.arc
File Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_632_bsgrk8od_.arc
File Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_630_bsgrk48j_.arc
File Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_631_bsgrk49w_.arc
File Name: /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_629_bsgrk0tw_.arc
File Name: /NEW_FS/oracle/FRA/HEMANTDB/autobackup/2015_07_04/o1_mf_s_884175832_bsgqysyq_.bkp

using channel ORA_DISK_1
using channel ORA_DISK_2

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 /home/oracle/app/oracle/oradata/orcl/system01.dbf
channel ORA_DISK_1: reading from backup piece /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_04/o1_mf_nnndf_TAG20150704T121859_bsgqonjj_.bkp
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 00004 to /home/oracle/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_2: reading from backup piece /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_04/o1_mf_nnndf_TAG20150704T121859_bsgqsccg_.bkp
channel ORA_DISK_2: piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_04/o1_mf_nnndf_TAG20150704T121859_bsgqsccg_.bkp tag=TAG20150704T121859
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:02:34
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 00003 to /home/oracle/app/oracle/oradata/orcl/undotbs01.dbf
channel ORA_DISK_2: reading from backup piece /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_04/o1_mf_nnndf_TAG20150704T121859_bsgqwt4s_.bkp
channel ORA_DISK_2: piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_04/o1_mf_nnndf_TAG20150704T121859_bsgqwt4s_.bkp tag=TAG20150704T121859
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:35
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 00002 to /home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
channel ORA_DISK_2: reading from backup piece /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_04/o1_mf_nnndf_TAG20150704T121859_bsgqonjl_.bkp
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00601: fatal error in recovery manager
RMAN-03004: fatal error during execution of command
ORA-01092: ORACLE instance terminated. Disconnection forced
ORACLE error from target database: 
ORA-03135: connection lost contact
Process ID: 3777
Session ID: 1 Serial number: 9

[oracle@localhost ~]$ 

After having restored a few datafiles, the restore failed on being disconnected from the database. (The  server or database instance has crashed).  Since the controlfile has been restored, I can bring up the database in MOUNT mode and then re-attempt a RESTORE DATABASE.

[oracle@localhost ~]$ rman target sys/oracle@orcl

Recovery Manager: Release 11.2.0.2.0 - Production on Sat Jul 4 12:56:41 2015

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

connected to target database: ORCL (DBID=1229390655, not open)

RMAN> 
RMAN> restore database;

Starting restore at 04-JUL-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=21 device type=DISK

skipping datafile 3; already restored to file /home/oracle/app/oracle/oradata/orcl/undotbs01.dbf
skipping datafile 4; already restored to file /home/oracle/app/oracle/oradata/orcl/users01.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 /home/oracle/app/oracle/oradata/orcl/system01.dbf
channel ORA_DISK_1: reading from backup piece /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_04/o1_mf_nnndf_TAG20150704T121859_bsgqonjj_.bkp
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 00002 to /home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
channel ORA_DISK_2: reading from backup piece /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_04/o1_mf_nnndf_TAG20150704T121859_bsgqonjl_.bkp
channel ORA_DISK_1: piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_04/o1_mf_nnndf_TAG20150704T121859_bsgqonjj_.bkp tag=TAG20150704T121859
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:02:36
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 /home/oracle/app/oracle/oradata/orcl/APEX_2614203650434107.dbf
channel ORA_DISK_1: reading from backup piece /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_04/o1_mf_nnndf_TAG20150704T121859_bsgqxovh_.bkp
channel ORA_DISK_1: piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_04/o1_mf_nnndf_TAG20150704T121859_bsgqxovh_.bkp tag=TAG20150704T121859
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
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 00005 to /home/oracle/app/oracle/oradata/orcl/example01.dbf
channel ORA_DISK_1: reading from backup piece /NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_04/o1_mf_nnndf_TAG20150704T121859_bsgqxjv6_.bkp
channel ORA_DISK_1: piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_04/o1_mf_nnndf_TAG20150704T121859_bsgqxjv6_.bkp tag=TAG20150704T121859
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_DISK_2: piece handle=/NEW_FS/oracle/FRA/HEMANTDB/backupset/2015_07_04/o1_mf_nnndf_TAG20150704T121859_bsgqonjl_.bkp tag=TAG20150704T121859
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:04:02
Finished restore at 04-JUL-15

RMAN> 

RMAN detects that datafiles 3 (undotbs01.dbf) and 4 (users01.dbf) had already been restored.
 If you look at the previous RESTORE run, you can see that these were restored by Channel ORA_DISK_2. The first channel ORA_DISK_1 had started restoring system01.dbf but hadn't completed restoring the datafile when the restore crashed. That restore of datafile 1 (system01.dbf) had to be redone.

 (Another thing to note : Oracle doesn't necessarily restore datafiles in the order of file_id (file#) ! There really is no ORDER BY for a RESTORE)

RMAN> recover database;

Starting recover at 04-JUL-15
using channel ORA_DISK_1
using channel ORA_DISK_2

starting media recovery

archived log for thread 1 with sequence 628 is already on disk as file /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_628_bsgrjztp_.arc
archived log for thread 1 with sequence 629 is already on disk as file /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_629_bsgrk0tw_.arc
archived log for thread 1 with sequence 630 is already on disk as file /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_630_bsgrk48j_.arc
archived log for thread 1 with sequence 631 is already on disk as file /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_631_bsgrk49w_.arc
archived log for thread 1 with sequence 632 is already on disk as file /NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_632_bsgrk8od_.arc
archived log for thread 1 with sequence 633 is already on disk as file /home/oracle/app/oracle/oradata/orcl/redo03.log
archived log file name=/NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_628_bsgrjztp_.arc thread=1 sequence=628
archived log file name=/NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_629_bsgrk0tw_.arc thread=1 sequence=629
archived log file name=/NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_630_bsgrk48j_.arc thread=1 sequence=630
archived log file name=/NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_631_bsgrk49w_.arc thread=1 sequence=631
archived log file name=/NEW_FS/oracle/FRA/HEMANTDB/archivelog/2015_07_04/o1_mf_1_632_bsgrk8od_.arc thread=1 sequence=632
archived log file name=/home/oracle/app/oracle/oradata/orcl/redo03.log thread=1 sequence=633
media recovery complete, elapsed time: 00:00:02
Finished recover at 04-JUL-15

RMAN>
RMAN> alter database open resetlogs;

database opened

RMAN> 


UPDATE 07-Jul-15 :  Also see my earlier (year 2012) post "Datafiles not Restored -- using V$DATAFILE and V$DATAFILE_HEADER"  which also shows retrying a RESTORE DATABASE after a failure of restoring a datafile.  There, a single file in a BackupSet failed to restore.  Oracle didn't continue and try the other datafiles in that BackupSet.  I could either fix the error and retry the entire BackupSet (RESTORE DATABASE would have identified the right BackupSet containing those files) OR I could, as I did in that scenario, individually restore DataFiles from the BackupSet.

It can be a good idea to have your database backup consist of multiple BackupSets, using either multiple CHANNELs or FILESPERSET during the BACKUP.


You could also note, as an aside, that Log Sequence 633 was an online redo log file. RMAN automatically verifies that the online redo log files designated by the controlfile are present and uses them.

.
.
.