Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2005

    Unanswered: Redirected Restore using online backup

    HI everybody

    I know that this topic has been discussed quite a number of times in this forum but I have a peculiar problem.

    I had to restore an online backup image of production which was taken on 7th july to my test environment. We use TSM for storing backup images and for log archiving.

    ENV: DB2 UDB v8.2 FP 7, AIX (both the servers are on AIX)

    This the process that I followed:

    1. first I extracted the backup images and the associated logs from TSM (for prod) using db2adutl extract
    2. Copied these to our test server.
    3. Did the restore using the backup image that I copied form TSM

    db2 "restore database db2inst1 taken at 20060707225033 into sample nwelogpath /test1/sms/log/sample redirect"

    4. then redefined all the tablespaces using

    db2 "set tablespace containers for 0 using (path '/test1/sms/tmp/')"

    similarly for all the other tablespaces

    5. db2 "restore db sample continue"

    Till here everything works fine. The problem comes when I try to rollforward the database.

    The command I am using
    db2 "rollforward database sample to <timestamp> using local time and complete"

    This always throws the error that there are missing logs

    SQL4970N Roll-forward recovery on database "SAMPLE" cannot reach the
    specified stop point (end-of-log or point-in-time) because of missing log
    file(s) on node(s) "0".

    I copied the logs to the active directory of sample database. I tried giving the rollforward command using the overflow log path and the path I gave is of active directory log path. In this case its throwing an error saying overflow log path is invalid.

    Here's a snapshot of the db cfg of sample.

    User exit for logging status = YES
    Catalog cache size (4KB) (CATALOGCACHE_SZ) = (MAXAPPLS*4)
    Number of primary log files (LOGPRIMARY) = 30
    Number of secondary log files (LOGSECOND) = 20
    Changed path to log files (NEWLOGPATH) =
    Path to log files = /test1/sms/log/sample/
    Overflow log path (OVERFLOWLOGPATH) =
    Mirror log path (MIRRORLOGPATH) =
    First active log file = S0000354.LOG
    Block log on disk full (BLK_LOG_DSK_FUL) = NO
    Percent of max active log space by transaction(MAX_LOG) = 0
    Num. of active log files for 1 active UOW(NUM_LOG_SPAN) = 0
    Percent log file reclaimed before soft chckpt (SOFTMAX) = 100
    User exit for logging enabled (USEREXIT) = OFF
    HADR log write synchronization mode (HADR_SYNCMODE) = NEARSYNC
    First log archive method (LOGARCHMETH1) = TSM
    Options for logarchmeth1 (LOGARCHOPT1) =
    Second log archive method (LOGARCHMETH2) = OFF
    Options for logarchmeth2 (LOGARCHOPT2) =
    Failover log archive path (FAILARCHPATH) =
    Number of log archive retries on error (NUMARCHRETRY) = 5

    Now I think that DB2 goes to TSM to look for the log that I have mentioned in the Rollforward command but since its not there and is lying in the active directory it throws this error.

    P.S. The database sample already exists in the test environment.

    I am really stuck don't know what to do, can't connect to the database, can't rollforward. Any help would be appreciated.



  2. #2
    Join Date
    Jun 2006


    have you tried
    db2 rollforward to end of logs and complete
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  3. #3
    Join Date
    Sep 2003
    After db2 restore db sample continue I do
    db2 ROLLFORWARD DATABASE sample query status

    this should give you the Next log file to be read; you can verify you have the log; then I use something like
    db2 "rollforward db law to 2005-11-18- and stop overflow log path(/DBHOME/db2inst9/log)"

    What errors are you getting for overflow log path:are the permissions OK?newlogpath HAS to be EMPTY; will not work otherwise(poorly, if at all documented)

  4. #4
    Join Date
    Jul 2005
    I tried the db2 rollforward database sample to end of logs and complete, but the error I got was that there are missing logs.

    I also tried the db2 rollforward database sample to <timestamp> using local time and stop overflow log path (/...), this time I got an error that overflow log path is not valid.

    I want the Db2 to somewhow go and fetch the logs from the active log directory. Thats where I copied all the logs from the other server.

    I also gave the db2 rollforward database sample query status command and the output shows the first active log is S0000354.LOG and that is the log which is associated with that backup image that i restored. So if I give the timestamp of this log in my rollforward database command i get an error that I need to give the timestamp greater than this. So , i don't know how to get out of this. Its just not reading these logs, don't know why??


  5. #5
    Join Date
    Sep 2003
    What messages are you getting in the diaglog and notify log? Does the user doing the restore, have rwx permissions on newlogpath ? You must have also gotten the "EARLIEST time you can restore to" information. I have no problems restoring from tsm where I use db2adutl to stage the logs; also check the owner,group permissions on the logs and make sure the user doing the restore has the right permissions on this.

  6. #6
    Join Date
    Jul 2005
    Well here I am not restoring from tsm directly. What I am doing is extracting log files and backup images from tsm to the production server and then copying it to the test server(source database). The reason being the tsm node is different for both the servers.

    I can't pull the exact error now because our app dev guys needed that box, so I had to recreate the database and used the latest export we had from production.

    But I know this for sure that I had the right permissions -rwx- for the newlogpath. And the Earliest time that I could rollforward to was greater than the timestamp for S0000354.LOG. SO I used that timestamp but i still got that error saying "db2 cannot rollforward to a point in time or end of logs because of missing logs on node (0)".


  7. #7
    Join Date
    Sep 2003
    By setting test db config parameters tsm_node to PRODNODE and tsm_password to PRODpassword, you can get data from PROD into test system. The exact steps are well explained in the redbook Backing Up DB2 Using Tivoli Storage Manager(SG24-6247-00)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts