If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Rollforward problem using image from backup inlude logs option

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-28-07, 02:28
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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
Reply With Quote
  #2 (permalink)  
Old 03-28-07, 02:53
guyprzytula guyprzytula is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 03-28-07, 05:59
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
  #4 (permalink)  
Old 03-28-07, 08:00
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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
Reply With Quote
  #5 (permalink)  
Old 03-28-07, 08:14
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
  #6 (permalink)  
Old 03-29-07, 01:11
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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
Reply With Quote
  #7 (permalink)  
Old 03-29-07, 03:48
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
  #8 (permalink)  
Old 03-29-07, 12:45
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
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.
Reply With Quote
  #9 (permalink)  
Old 03-29-07, 16:08
ramesh jampala ramesh jampala is offline
Registered User
 
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 16:37.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On