Skip to content
Home » Oracle Database » How RMAN List Backup Piece Content

How RMAN List Backup Piece Content

Backup Piece

A backup piece is a physical file that contain a part of backup targets in a backup operation. In a backup piece, the type of backup targets would be one of the followings.

  • Archived Logs
  • Data Files
  • SPFILE
  • Control File

Sometimes, we're unable to know the backup contents from the path and filename of backup pieces. For example:

/backup/4k0vtlt7_8268_1_1

As we can see, the filename is system-generated by a RMAN format variable (formatSpec) %U, we can barely know what targets are backed up in the file from its name.

To exactly list the content of a specific backup piece by RMAN, we can take the following steps:

Get BS Key by the Filename

Usually, one backup set contains one backup piece except that you set MAXPIECESIZE, a limited piece size to split a backup set into several physical pieces.

Now, we can use the filename to get the backup set key (BS Key) by RMAN command list backuppiece.

RMAN> list backuppiece '/backup/4k0vtlt7_8268_1_1';

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
7177    7177    1   1   AVAILABLE   DISK        /backup/4k0vtlt7_8268_1_1

We see no content here, but we got the BS Key. In this case, it's 7177.

Use BS Key to List Content

Since we have the BS Key, we can use it to look up the content in the backup set by RMAN command list backupset.

Archived Logs Backup Piece

RMAN> list backupset 7177;


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


BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -------------------
7177    676.79M    DISK        00:01:12     2022-06-13 01:14:23
        BP Key: 7177   Status: AVAILABLE  Compressed: YES  Tag: TAG20220613T011311
        Piece Name: /backup/4k0vtlt7_8268_1_1

  List of Archived Logs in backup set 7177
  Thrd Seq     Low SCN      Low Time            Next SCN     Next Time
  ---- ------- ------------ ------------------- ------------ ---------
  2    8554    226101149872 2022-06-13 00:12:43 226108384945 2022-06-13 01:13:09

As we can see, the backup piece contains only one archived log.

Let's see more backup pieces.

SPFILE Backup Piece

RMAN> list backupset 7178;


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
7178    Full    96.00K     DISK        00:00:00     2022-06-13 01:14:27
        BP Key: 7178   Status: AVAILABLE  Compressed: NO  Tag: TAG20220613T011427
        Piece Name: /backup/4n0vtlvj_8271_1_1
  SPFILE Included: Modification time: 2022-06-10 23:42:58
  SPFILE db_unique_name: ORCLCDB

By the way, the datetime in RMAN are formatted as what we want.

Control File Backup Piece

RMAN> list backupset 7179;


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
7179    Full    59.45M     DISK        00:00:02     2022-06-13 01:14:29
        BP Key: 7179   Status: AVAILABLE  Compressed: NO  Tag: TAG20220613T011427
        Piece Name: /backup/4m0vtlvj_8270_1_1
  Control File Included: Ckp SCN: 226108564223   Ckp time: 2022-06-13 01:14:27

Through BS Key, we can see the content of a backup piece. If you still see no content in the backup set, your backup records might be lost regularly.

Leave a Reply

Your email address will not be published. Required fields are marked *