Friday, February 20, 2015

DB2 History Backup Information

If you need information about backup images, such as type and range of logs used, perform the following command:

db2 list history backup all for <db_name>

It will show you all information about the backup images created recently


db2udb@testdb02b-prd:~> db2 list history backup all for testdb

                    List History File for testdb

Number of matching file entries = 5



 Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID
 -- --- ------------------ ---- --- ------------ ------------ --------------
  B  D  20150220090240021   N    D  S0015572.LOG S0015572.LOG
 ----------------------------------------------------------------------------
  Contains 7 tablespace(s):

  00001 SYSCATSPACE
  00002 USERSPACE1
  00003 DIGITALSUPERVISOR
  00004 testdb_INDEXES
  00005 QUERYPERSISTENCE
  00006 BLOB_TBSPACE
  00007 SYSTOOLSPACE
 ----------------------------------------------------------------------------
    Comment: DB2 BACKUP testdb ONLINE
 Start Time: 20150220090240
   End Time: 20150220172258
     Status: A
 ----------------------------------------------------------------------------
  EID: 69169 Location: /db2/testdb_backups/db2backup0011


 Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID
 -- --- ------------------ ---- --- ------------ ------------ --------------
  B  D  20150220090240022   N    D  S0015572.LOG S0015572.LOG
 ----------------------------------------------------------------------------
  Contains 7 tablespace(s):

  00001 SYSCATSPACE
  00002 USERSPACE1
  00003 DIGITALSUPERVISOR
  00004 testdb_INDEXES
  00005 QUERYPERSISTENCE
  00006 BLOB_TBSPACE
  00007 SYSTOOLSPACE
 ----------------------------------------------------------------------------
    Comment: DB2 BACKUP testdb ONLINE
 Start Time: 20150220090240
   End Time: 20150220172258
     Status: A
 ----------------------------------------------------------------------------
  EID: 69170 Location: /db2/testdb_backups/db2backup0012


 Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID
 -- --- ------------------ ---- --- ------------ ------------ --------------
  B  D  20150220090240023   N    D  S0015572.LOG S0015572.LOG
 ----------------------------------------------------------------------------
  Contains 7 tablespace(s):

  00001 SYSCATSPACE
  00002 USERSPACE1
  00003 DIGITALSUPERVISOR
  00004 testdb_INDEXES
  00005 QUERYPERSISTENCE
  00006 BLOB_TBSPACE
  00007 SYSTOOLSPACE
 ----------------------------------------------------------------------------
    Comment: DB2 BACKUP testdb ONLINE
 Start Time: 20150220090240
   End Time: 20150220172258
     Status: A
 ----------------------------------------------------------------------------
  EID: 69171 Location: /db2/testdb_backups/db2backup0023


 Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID
 -- --- ------------------ ---- --- ------------ ------------ --------------
  B  D  20150220090240024   N    D  S0015572.LOG S0015572.LOG
 ----------------------------------------------------------------------------
  Contains 7 tablespace(s):

  00001 SYSCATSPACE
  00002 USERSPACE1
  00003 DIGITALSUPERVISOR
  00004 testdb_INDEXES
  00005 QUERYPERSISTENCE
  00006 BLOB_TBSPACE
  00007 SYSTOOLSPACE
 ----------------------------------------------------------------------------
    Comment: DB2 BACKUP testdb ONLINE
 Start Time: 20150220090240
   End Time: 20150220172258
     Status: A
 ----------------------------------------------------------------------------
  EID: 69172 Location: /db2/testdb_backups/db2backup0016


 Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID
 -- --- ------------------ ---- --- ------------ ------------ --------------
  B  D  20150220090240025   N    D  S0015572.LOG S0015572.LOG
 ----------------------------------------------------------------------------
  Contains 7 tablespace(s):

  00001 SYSCATSPACE
  00002 USERSPACE1
  00003 DIGITALSUPERVISOR
  00004 testdb_INDEXES
  00005 QUERYPERSISTENCE
  00006 BLOB_TBSPACE
  00007 SYSTOOLSPACE
 ----------------------------------------------------------------------------
    Comment: DB2 BACKUP testdb ONLINE
 Start Time: 20150220090240
   End Time: 20150220172258
     Status: A
 ----------------------------------------------------------------------------
  EID: 69173 Location: /db2/testdb_backups/db2backup0017

You have new mail in /var/spool/mail/db2udb
db2udb@testdb02b-prd:~>



As you can see, it is possible with the command to check several information about the created backup images, such as which table spaces was made backup, what was the range of log files used, the directory where the image was created, the backup type and the start / end time of the backup process.

Some of the important information in the history file is:

Op
    This is the operation that was performed. In the exampled above it is a "B" which stands for backup. A list of the possible values for Op can be found in the Command Reference under the LIST HISTORY command.

Obj
    This is the granularity of the backup. "D" for database backup . "T" for tablespace backup.

Earliest Log
    In the case of an online backup, this is the first log required for the rollforward operation.

Current Log
    The last log that was written to when the backup completed. In the case of an online backup, this is the minimum log required for the backup to complete.

Type
    For backup operations, type "F" means full offline backup, "N" means full online backup, "I" means incremental offline backup, "O" means incremental online backup, "D" means delta offline backup and "E" means delta online backup.

The status of a backup operation: A - active, I - inactive, E - expired, or D - deleted


Thank You