Phil Phil - 1 year ago 96
SQL Question

DB2: restore an online backup image that has TSM as log archiving method

I am trying to locally restore a DB2 online backup image from a remote server. I can restore it successfully, but when I try to roll the db forward I get this error:

SQL2071N An error occurred while accessing the shared library
"/home/db2inst1/sqllib/adsm/libtsm.a". Reason code: "2".

I realized, by looking at the db configuration, that
is set to
, meaning TSM was the log archiving method on the original DB2 installation. I set the value to
and ran the roll forward operation again. This is the status:

Rollforward Status

Input database alias = devcldx
Number of members have returned status = 1

Member ID = 0
Rollforward status = DB pending
Next log file to be read = S0000645.LOG
Log files processed = -
Last committed transaction = 2016-08-30- UTC

And this is what I get when I try rolling forward to the end of logs:

An operation reading the logs on database "DEVCLDX" cannot continue
because of a missing log file "S0000645.LOG" on database partition "0" and log
stream "0".

Obviously that log file doesn't exist on my local machine.

Is there any way I can complete the roll forward?

Answer Source

The proper way to do this would be to either:

  1. Use the db2adutl utility to extract the log files from the TSM server on the source machine and then copy them to the target machine.

  2. Install the TSM client on the machine and configure it to act as the primary server so it can retrieve the log files. (This is somewhat complicated).

Either of these options would allow you to restore to any point in time.

If neither of these is an option, and if restoring the database only to the point in time that the backup completed is acceptable, you have one more option:

  1. The database backup image has a copy of the active transaction log file from when the backup was running. You can extract these to disk.

In your RESTORE DATABASE command, you include the logtarget /path/to/write/files option: DB2 will extract the included log files from the backup image into the specified directory as it performs the restore.

You can then perform the roll forward to the end of the backup using the path:

roll forward database X 
    to end of backup and complete
    overflow log path (/path/to/write/files)