UPDATE HISTORY command using the ADMIN_CMD procedure

The UPDATE HISTORY command updates the location, device type, comment, or status in a database history records entry on the currently connected database partition.

Authorization

One of the following authorities:
  • SYSADM
  • SYSCTRL
  • SYSMAINT
  • DBADM

Required connection

Database

Command syntax

Read syntax diagramSkip visual syntax diagramUPDATE HISTORYFORobject-partEIDeidWITHLOCATIONnew-locationDEVICE TYPEnew-device-typeCOMMENTnew-commentSTATUSnew-status

Command parameters

FOR object-part
Specifies the identifier for the history entry to be updated. It is a time stamp with an optional sequence number from 001 to 999. For history entries, such as backups, that make use of the sequence number, if the sequence number is not included in the object-part, the default sequence number 001 will be used. That is, if there are history entries with the same time stamp but different sequence numbers, and only the time stamp is used as the object-part, the UPDATE HISTORY command will only update the matching entry with sequence number 001.

This parameter cannot be used to update the entry status. To update the entry status, specify an EID instead.

EID eid
Specifies the history entry ID.
LOCATION new-location
Specifies the new physical location of a backup image. The interpretation of this parameter depends on the device type.
DEVICE TYPE new-device-type
Specifies a new device type for storing the backup image. Valid device types are:
D
Disk
K
Diskette
T
Tape
A
Tivoli® Storage Manager
F
Snapshot backup
f
Snapshot backup that was generated by a custom script.
U
User exit
P
Pipe
N
Null device
X
XBSA
Q
SQL statement
O
Other
COMMENT new-comment
Specifies a new comment to describe the entry. The size of new-comment cannot exceed 30 ASCII characters.
STATUS new-status
Specifies a new status for an entry. Only backup entries can have their status updated. Valid values are:
A
Active. The backup image is on the active log chain. Most entries are active.
I
Inactive. Backup images that no longer correspond to the current log sequence, also called the current log chain, are flagged as inactive.
E
Expired. Backup images that are no longer required, because there are more than NUM_DB_BACKUPS active images, are flagged as expired.
D
Deleted. Backup images that are no longer available for recovery should be marked as having been deleted.
X
Do not delete. Recovery database history records file entries that are marked DB2HISTORY_STATUS_DO_NOT_DELETE will not be pruned by calls to the PRUNE HISTORY command, running the ADMIN_CMD procedure with PRUNE HISTORY, calls to the db2Prune API, or automated recovery database history records pruning. You can use the DB2HISTORY_STATUS_DO_NOT_DELETE status to protect key recovery file entries from being pruned and the recovery objects associated with them from being deleted. Only log files, backup images, and load copy images can be marked as DB2HISTORY_STATUS_DO_NOT_DELETE.

Example

The object-part of a backup database history record entry consists of a 14 digit time stamp associated to the backup image and a 3 digit sequence number of this backup image. To update the database history record entries for a full database backup taken to 2 target devices on April 13, 1997 at 10:00 a.m., enter:
CALL SYSPROC.ADMIN_CMD('update history 
   for 19970413100000001 with location 
   /backup/dbbackup.1 device type D')

Usage notes

The primary purpose of the database history records is to record information, but the data contained in the history is used directly by automatic restore operations. During any restore where the AUTOMATIC option is specified, the history of backup images and their locations will be referenced and used by the restore utility to fulfill the automatic restore request. If the automatic restore function is to be used and backup images have been relocated since they were created, it is recommended that the database history record for those images be updated to reflect the current location. If the backup image location in the database history is not updated, automatic restore will not be able to locate the backup images, but manual restore commands can still be used successfully.

Command execution status is returned in the SQLCA resulting from the CALL statement.

The object-part or eid must refer to the log history entries on the connected database partition.