IBM Support

DB2 fails to retrieve archived log after Redirected Restore into a new database name

Troubleshooting


Problem

After performing a redirected restore, the DB2 database is not able to retrieve the logs from the Tivoli Storage Manager / IBM Spectrum Protect Server for the Rollforward processing and fails with an RC124

Symptom

After performing a redirected restore of a DB2 database, if the rollforward recovery is then attempted the process fails, even though the logs exist on the Tivoli Storage Manager Server.

Cause

The redirected restore processing is using the new database name. This new database name is used for the filespace specification when looking for the logs. However, the logs are stored on the Tivoli Storage Manager Server under the old database name.

Diagnosing The Problem

2014-10-09-20.03.43.520877+000 E224516A347 LEVEL: Error
PID : 9830790 TID : 1 PROC : db2vend
INSTANCE: db2newdb NODE : 000
EDUID : 1
FUNCTION: DB2 UDB, database utilities, sqluvint, probe:697
DATA #1 : TSM RC, PD_DB2_TYPE_TSM_RC, 4 bytes
TSM RC=0x0000007C=124 -- see TSM API Reference for meaning.

2014-10-09-20.03.44.772119+000 I224864A438 LEVEL: Error
PID : 5898430 TID : 5888 PROC : db2sysc 0
INSTANCE: db2newdb NODE : 000
EDUID : 5888 EDUNAME: db2logmgr (db2newdb) 0
FUNCTION: DB2 UDB, data protection services, sqlpSearchForLogArchiveOnVendor, probe:8200
RETCODE : ZRC=0x860F000A=-2045837302=SQLO_FNEX "File not found."

Resolving The Problem

The problem is that the redirected restore processing will change the name of the database and this new database name is used to search for the logs on the Tivoli Storage Manager server. Since the log files exist under the filespace for the old database name, they are not found when using this new name.
For example, if the old/existing database name is: DB2DB
and the redirected restore is performed to the database name of: DB2NEWDB

Running the rollforward command after the redirected restore:
$ db2 rollforward db db2newdb stop
will result in an RC=124 indicating that the filespace does not exist and a failure to find the logs with an RC=2. This failure occurs because the new database name "db2newdb" is being used as the filespace name when looking for the logs on the Tivoli Storage Manager server. However the logs were backed up under the old database name "db2db" and thus are held under the old filespace name "/DB2DB".

To work around this problem, it is possible to perform the redirected restore with the "LOGTARGET" parameter, which will place the logs on the machine during the restore. This will allow the logs to be available for the subsequent rollforward processing.

If the redirected restore has already been completed it is still possible to perform the rollforward recovery by tricking the new DB2 database into using the old name. This can be done by setting the "--DBNAME" parameter to the old database name. First update the db2 cfg with the parameter then run the rollforward process. For example:

    db2 update db cfg for DB2NEWDB using logarchopt1 "--DBNAME=DB2DB"
This will force the DB2 logger process to use the old "DB2DB" name when looking for the log files on the Tivoli Storage Manager server.

NOTE:
  • The "--DBNAME" should be in capital letters, preceded by 2 dashes, and must be the first entry in the options list.
  • The "--DBNAME" work around has the potential for log archives from the new db2newdb database to get stored on the Tivoli Storage Manager server under the old database (db2db) name.

There are 2 possibilities to avoid archiving the logs for this DB2NEWDB to the old DB2DB filespace on the Tivoli Storage Manager Server:

a. db2 update db cfg for DB2NEWDB using logarchopt1 "--DBNAME=DB2DB"
b. db2 rollforward db db2newdb to PIT
c. db2 update db cfg for DB2NEWDB using LOGARCHOPT1 <null>
d. db2 rollforward db db2newdb stop"

OR...

a. db2 update db cfg for DB2NEWDB using logarchopt1 "--DBNAME=DB2DB"
b. db2 rollforward db db2newdb to PIT
c. db2 update db cfg for DB2NEWDB using LOGARCHMETH1 LOGRETAIN
d. db2 rollforward db db2newdb stop"

Either unsetting LOGARCHOPT1 or setting LOGARCHMETH1 to LOGRETAIN will prevent archived logs from being written to the old database filespace if the rollforward "stop" command triggers a rollback and archiving of the new log containing the undo records at the end of the rollforward stop invocation. This procedure will split the processing into two commands, which will allow for the retrieval of the logs during the forward phase and then not write to the location after the stop phase.

[{"Product":{"code":"SSGSG7","label":"Tivoli Storage Manager"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Client","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB26","label":"Storage"}}]

Product Synonym

TSM

Document Information

Modified date:
17 June 2018

UID

swg21687492