DB2 10.5 for Linux, UNIX, and Windows

Log archiving using db2tapemgr

You can use the db2tapemgr utility to store archived log files to tape devices. The db2tapemgr utility copies log files from disk to the specified tape device, and updates the recovery history file with the new location of the copied log files.

Configuration

Set the database configuration parameter logarchmeth1 to the location on disk of the log files you want to copy to tape. The db2tapemgr utility reads this logarchmeth1 value to find the log files to copy. In a partitioned database environment, the logarchmeth1 configuration parameter must be set on each database partition that contains log files to be copied.

The db2tapemgr utility does not use the logarchmeth2 database configuration parameter.

STORE and DOUBLE STORE parameters

Issue the db2tapemgr command with either the STORE or DOUBLE STORE parameter to transfer archived logs from disk to tape.

When you issue the db2tapemgr command with either the STORE or DOUBLE STORE parameter, the db2tapemgr utility first scans the history file for entries where the logarchmeth1 configuration parameter is set to disk. If it finds that any files that are supposed to be on disk, are not on disk, it issues a warning. If the db2tapemgr utility finds no log files to store, it stops the operation and issues a message to inform you that there is nothing to do.

RETRIEVE parameters

Issue the db2tapemgr command with the RETRIEVE parameter to transfer files from tape to disk.

Behavior

Examples

The following example shows how to use the db2tapemgr command to store all log files from the primary archive log path for database sample on database partition number 0 to a tape device and remove them from the archive log path:

db2tapemgr db sample on dbpartitionnum 0 store on /dev/rmt0.1 all logs

The following example shows how to store the first 10 log files from the primary archive log path to a tape device and remove them from the archive log path:

db2tapemgr db sample on dbpartitionnum store on /dev/rmt0.1 10 logs

The following example shows how to store the first 10 log files from the primary archive log path to a tape device and then store the same log files to a second tape and remove them from the archive log path:

db2tapemgr db sample on dbpartitionnum double store on /dev/rmt0.1 10 logs
db2tapemgr db sample on dbpartitionnum double store on /dev/rmt1.1 10 logs

The following example shows how to retrieve all log files from a tape to a directory:

db2tapemgr db sample on dbpartitionnum retrieve all logs from /dev/rmt1.1
      to /home/dbuser/archived_logs