Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2003
    Posts
    1,605

    Unanswered: Rollforward problem using image from backup inlude logs option

    Hi,
    On DB2 9 on Linux x86 32-bit I would like to create on-line backup with include logs option. My idea is to have log files saved into backup image to have only one file for image and logs.

    I did the following:
    1. I created database
    db2 create database mydb

    2. I set-up parameters to make database on-line:
    db2 update db cfg for mydb using logretain yes
    db2 update db cfg for mydb using userexit yes
    db2 terminate

    3. I created off-line backup to enable access to database:
    db2 backup database mydb to /backup

    4. I created one table, inserted one row into table and connection put open
    db2 connect to mydb user db2inst1 using db2inst1
    db2 create table db2admin.mytable (a int)
    db2 insert into db2admin.mytable values (1)

    5. I created on-line backup with include logs option
    db2 backup database mydb online to /backup include logs

    6. Restore database to new database from secund backup image
    db2 restore database mydb from /backup taken at 20070328075657 into mydbnew

    7. Rollforward new database to the end of logs
    db2 rollforward db mydbnew to end of logs

    Above command returns error message:
    SQL1268N Roll-forward recovery stopped due to error "24" while retrieving
    log file "S0000000.LOG" for database "MYDBNEW" on node "0".

    How do I specify the "logs are in database image"?

    Thanks,
    Grofaty

  2. #2
    Join Date
    Jun 2006
    Posts
    471
    what I would try would be :
    specify newlogpath with restore command or
    restore the db - restore the logs (restore db ... logs..)- rollforward the db
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    You will have to use LOGTARGET option in the RESTORE command to get the logs to a directory ... In the ROLLFORWARD command, use this directory as OVERFLOWLOGPATH

    HTH

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    Sathyaram,

    I have tried (step 6 in 7):
    db2 restore database mydb from /backup taken at 20070328075657 into mydbnew logtarget /logs
    db2 rollforward db mydbnew to end of logs overflow log path /logs

    The above command returns error:
    SQL0104N An unexpected token "/logs" was found following "PATH".
    Expected tokens may include: "(". SQLSTATE=42601

    Any idea why?

    Thanks,
    Grofaty

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    db2 rollforward db mydbnew to end of logs overflow log path (/logs)

    HTH

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  6. #6
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,
    I have executed above command and got error:
    SQL1268N Roll-forward recovery stopped due to error "24" while retrieving log
    file "S0000006.LOG" for database "MYDBNEW" on node "0".

    I have checked the /logs directory but there is only one file with name S0000005.LOG. There is no "6" log file.

    Then I have droped the database mydbnew and recreated backup/restore/rollforward and got the sam error. Strange. Any idea?
    Thanks,
    Grofaty

  7. #7
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Do a db2 list history command and confirm the log files you need ...

    Looks like there is a bug ... I would suggest raising a call with IBM .. Have you checked the APARs of FP1 and FP2 of DB2 9 ?

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  8. #8
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by grofaty
    Hi,
    I have executed above command and got error:
    SQL1268N Roll-forward recovery stopped due to error "24" while retrieving log
    file "S0000006.LOG" for database "MYDBNEW" on node "0".

    I have checked the /logs directory but there is only one file with name S0000005.LOG. There is no "6" log file.
    Use NORETRIEVE option when issuing ROLLFORWARD. It tries to retrieve logs from userexit since that's what is configured.
    ---
    "It does not work" is not a valid problem statement.

  9. #9
    Join Date
    Mar 2007
    Posts
    15
    Hi,

    You are rolling forward to end of logs. But the backup image contains only the log files at the time of online backup. So you need to copy the remaining log files from the old database logpath or overflow log path to one target location and use that location as overflow log path in your rollforward command. So just use following commands....

    1.
    db2 restore database mydb from /backup taken at 20070328075657 into mydbnew

    In the above command you dont require logtarget. The logs that are present in the backup image will be available in newlogpath or overflowlogpath location of mydb database. Then copy all the logs from those locations into some location like... /temp, then issue the following roll forward command

    2.

    db2 rollforward db mydbnew to end of logs overflow log path /temp



    Incase If you miss log files in logpath or oveflowlogpath of mydb, then you can use logtaget option to get the log files from backup image during restore, then rollforward the database to point in time but not to end of logs. For that rollforward command looks like..

    db2 rollforward db mydbnew to 2007-03-26-11.12.13.240000 USING LOCAL TIME overflow log path /logs

    Note that i have given you sample timestamp. You need to change it to valid time stamp that is within 05 log file end time.
    Last edited by ramesh jampala; 03-29-07 at 17:37.

Posting Permissions

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