7 Replies Latest reply: Jul 30, 2012 1:13 PM by mseberg RSS

    How to find contents of Backuppiece ?

    868608
      Dear Experts,

      Where I can find the contents of a backuppiece.


      Thanks in advance.
        • 1. Re: How to find contents of Backuppiece ?
          mseberg
          Hello;

          Assuming oracle 10 or higher I would look at these Catalog views :
          RC_BACKUP_PIECE
          RC_BACKUP_PIECE_DETAILS
          Generally RC views have similar views at the local database level that contain the same, but less information. For example V$BACKUP_PIECE.

          http://docs.oracle.com/cd/B19306_01/backup.102/b14194/rcviews015.htm

          Best Regards

          mseberg
          • 2. Re: How to find contents of Backuppiece ?
            868608
            Thanks Mseberg for your reply.

            I believe RC_% views can use only on recovery catalog. Is there any other way to find/list the backup piece contents.

            Eg:

            List backup command is listing all the details of the backup details including contents.
            Backup Piece name +RECO01/lcbt04u/backupset/ora_arc_lcbt04u_20120725_2rnh0mi0_1_1_789600832*


            BS Key Size Device Type Elapsed Time Completion Time
            ------- ---------- ----------- ------------ ---------------
            6115 376.00K DISK 00:00:00 25-JUL-12
            BP Key: 6125 Status: AVAILABLE Compressed: YES Tag: DAILY_ARC_25JUL2012_2102
            Piece Name: +RECO01/lcbt04u/backupset/ora_arc_lcbt04u_20120725_2rnh0mi0_1_1_789600832

            List of Archived Logs in backup set 6115
            Thrd Seq Low SCN Low Time Next SCN Next Time
            ---- ------- ---------- --------- ---------- ---------
            1 5286 1501116915 25-JUL-12 1501117660 25-JUL-12
            2 5205 1501116921 25-JUL-12 1501117656 25-JUL-12

            but when i try the list backup piece, it is showing only backup piece name and availability, not showing the contents. and i dont find the content info on v$backpack_piece. is there any way to find the contents of particular backup piece other than RC_% views?

            RMAN> list backuppiece '+RECO01/trtdb/backupset/ora_arc_trtdb_20120725_2rnh0mi0_1_1_789600832';

            using target database control file instead of recovery catalog

            List of Backup Pieces
            BP Key BS Key Pc# Cp# Status Device Type Piece Name
            ------- ------- --- --- ----------- ----------- ----------
            6125 6115 1 1 AVAILABLE DISK +RECO01/trtdb/backupset/ora_arc_trtdb_20120725_2rnh0mi0_1_1_789600832


            Regards,
            Abk

            Edited by: 865605 on Jul 29, 2012 9:01 PM
            • 3. Re: How to find contents of Backuppiece ?
              Shivananda Rao
              You can query the v$backup_piece to view the backup piece details.

              http://docs.oracle.com/cd/B19306_01/backup.102/b14194/rcviews001.htm
              • 4. Re: How to find contents of Backuppiece ?
                868608
                Thanks Rao for your reply.

                I don't find any columns in v$backup_piece related to contents.

                SQL> desc v$backup_piece;
                Name
                ----------------------------
                RECID
                STAMP
                SET_STAMP
                SET_COUNT
                PIECE#
                COPY#
                DEVICE_TYPE
                HANDLE
                COMMENTS
                MEDIA
                MEDIA_POOL
                CONCUR
                TAG
                STATUS
                START_TIME
                COMPLETION_TIME
                ELAPSED_SECONDS
                DELETED
                BYTES
                IS_RECOVERY_DEST_FILE
                RMAN_STATUS_RECID
                RMAN_STATUS_STAMP
                COMPRESSED
                BACKED_BY_VSS
                ENCRYPTED
                BACKED_BY_OSB

                SQL>
                • 5. Re: How to find contents of Backuppiece ?
                  Balazs Papp
                  BP Key  BS Key 
                  ------- ------- 
                  6125    6115   
                  list backupset 6115;
                  from SQL:

                  as that piece contains archivelogs:
                  select sequence# from v$backup_archivelog_details where btype_key=6125;
                  backup type can be found in: V$BACKUP_SET_DETAILS
                  BACKUP_TYPE
                  CONTROLFILE_INCLUDED
                  INCREMENTAL_LEVEL
                  • 6. Re: How to find contents of Backuppiece ?
                    Shivananda Rao
                    RMAN> list backuppiece 'C:\ARCH\BKP\TEST_INC_20120726_01NH2VO4_1_1.BAK';
                    
                    List of Backup Pieces
                    BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
                    ------- ------- --- --- ----------- ----------- ----------
                    1       1       1   1   AVAILABLE   DISK        C:\ARCH\BKP\TEST_INC_20120726_01NH2VO4_1_1.BAK
                    
                    RMAN>
                    
                    RMAN> list backupset 1;
                    
                    
                    List of Backup Sets
                    ===================
                    
                    BS Key  Type LV Size       Device Type Elapsed Time Completion Time
                    ------- ---- -- ---------- ----------- ------------ ---------------
                    1       Full    282.25M    DISK        00:00:52     26-JUL-12
                    BP Key: 1   Status: AVAILABLE  Compressed: YES  Tag: TAG20120726T182300
                    Piece Name: C:\ARCH\BKP\TEST_INC_20120726_01NH2VO4_1_1.BAK
                    List of Datafiles in backup set 1
                    File LV Type Ckp SCN    Ckp Time  Name
                    ---- -- ---- ---------- --------- ----
                    1       Full 985447     26-JUL-12 C:\APP\SHIVANANDA.RAO\ORADATA\TEST\SYSTEM01.DBF
                    2       Full 985447     26-JUL-12 C:\APP\SHIVANANDA.RAO\ORADATA\TEST\SYSAUX01.DBF
                    3       Full 985447     26-JUL-12 C:\APP\SHIVANANDA.RAO\ORADATA\TEST\UNDOTBS01.DBF
                    4       Full 985447     26-JUL-12 C:\APP\SHIVANANDA.RAO\ORADATA\TEST\USERS01.DBF
                    5       Full 985447     26-JUL-12 C:\APP\SHIVANANDA.RAO\ORADATA\TEST\EXAMPLE01.DBF
                    You can use "list backuppiece <piece name>" to determine the backupset key and use this backupset key as "list backupset <set number>";
                    • 7. Re: How to find contents of Backuppiece ?
                      mseberg
                      Hello;

                      Sorry for the delay I was at the end of my day. If you want to do this without the catalog you can use this :
                      SELECT 
                        D.FILE#, P.HANDLE ,  N.NAME 
                      FROM 
                        V$BACKUP_PIECE P, V$BACKUP_DATAFILE D , V$DATAFILE N
                      WHERE 
                        D.SET_STAMP = P.SET_STAMP 
                       AND
                         D.FILE# = N.FILE#  
                       AND 
                           D.SET_COUNT = P.SET_COUNT ;
                      For an Spfile :
                      SELECT 
                        D.BYTES, D.COMPLETION_TIME, P.HANDLE 
                      FROM 
                        V$BACKUP_PIECE P, V_$BACKUP_SPFILE D 
                      WHERE 
                        D.SET_STAMP = P.SET_STAMP;    
                      For archive ( redo by sequence number ) :
                      SELECT 
                        D.SEQUENCE#, D.THREAD#, P.HANDLE 
                      FROM 
                        V$BACKUP_PIECE P, V$BACKUP_REDOLOG D 
                      WHERE 
                        D.SET_STAMP = P.SET_STAMP ;  
                      The catalog should contain a much larger history if its available.


                      Best Regards

                      mseberg