| |
|
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.
|
 |

05-20-04, 16:15
|
|
Registered User
|
|
Join Date: Jun 2003
Posts: 77
|
|
|
information on logs needed to Rollforward
|
|
Hi All,
Is there any way to find out the name of logs needed in doing a rollforward up to a certain time?
Or, if we have a log file, is there a way to find out the time of last committed transaction written in it?
If available, this info will be very useful in planning a Rollforward operation.
I'm using DB2 v 7.2 on windows2000.
Appreciate any responses.
-Preeti
|
|

05-21-04, 08:56
|
|
Registered User
|
|
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
|
|
Quote:
|
Originally Posted by preetim
Hi All,
Is there any way to find out the name of logs needed in doing a rollforward up to a certain time?
Or, if we have a log file, is there a way to find out the time of last committed transaction written in it?
If available, this info will be very useful in planning a Rollforward operation.
I'm using DB2 v 7.2 on windows2000.
Appreciate any responses.
-Preeti
|
Yes, do a LIST HISTORY BACKUP ALL FOR <DBNAME>
It will show you the Earliest Log & Current Log, that's the range required for that image.
__________________
--
Jonathan Petruk
DB2 Database Consultant
|
|

05-21-04, 10:27
|
|
Super Moderator
|
|
Join Date: Aug 2001
Location: UK
Posts: 4,534
|
|
|
|
Jonathan , I think the question is slightly different ...
Assume you have a backup at 10 pm on 15 May and next day 5 pm, you decide to use the previous day's backup and rollforward till 2 pm that day ... Is there a command to list the logs which have been created till 2 pm ...
Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
|
|

05-21-04, 10:36
|
|
Registered User
|
|
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
|
|
Quote:
|
Originally Posted by sathyaram_s
Jonathan , I think the question is slightly different ...
Assume you have a backup at 10 pm on 15 May and next day 5 pm, you decide to use the previous day's backup and rollforward till 2 pm that day ... Is there a command to list the logs which have been created till 2 pm ...
Cheers
Sathyaram
|
Yeah, I realized that after I posted... :P
I don't think there is, although the timestamps on the logs might give some clues, especially if you can note when the Userexit is fired. No guarantees, though, but could give you a rough idea.
__________________
--
Jonathan Petruk
DB2 Database Consultant
|
|

05-21-04, 10:37
|
|
Registered User
|
|
Join Date: Mar 2004
Posts: 448
|
|
logs are operating system files, we can check the access time and modified
time at the operating system.
regards,
mujeeb
|
|

05-27-04, 15:08
|
|
Registered User
|
|
Join Date: Jun 2003
Posts: 77
|
|
Thanks to you all for providing your views.
I think there is no easy way to find out the information I was looking for.
But I found something that can help. I would like to share that.
On giving a rollforward (to a certain point-in-time) command when I had no logs in the target path, the error message said
SQL4970N Roll-forward recovery on database "TESTDB" cannot reach the
specified stop point (end-of-log or point-in-time) because of missing log
file(s) on node(s) "0".
To get a clue on which logs its talking about, do the following:
there is an entry in db2diag.log file about LSN needed to do the rollforward. The log looks like -
Invoking database rollforward forward recovery,
lowtranlsn 0000027400C0 minbufflsn 000002625574
You can find out the names of logs needed to do the recovery by using db2flsn like -
D:\DB2\NODE0000\SQL00001>db2flsn 0000027400C0
Given LSN is contained in log file S0000024.LOG
D:\DB2\NODE0000\SQL00001>db2flsn 000002625574
Given LSN is contained in log file S0000023.LOG
This way you know where the log trail needed for rollforward starts.
I'm investing more on how to get a complete list of all the logs.
-Preeti
|
|

05-27-04, 15:12
|
|
Registered User
|
|
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
|
|
Quote:
|
Originally Posted by preetim
Thanks to you all for providing your views.
I think there is no easy way to find out the information I was looking for.
But I found something that can help. I would like to share that.
On giving a rollforward (to a certain point-in-time) command when I had no logs in the target path, the error message said
SQL4970N Roll-forward recovery on database "TESTDB" cannot reach the
specified stop point (end-of-log or point-in-time) because of missing log
file(s) on node(s) "0".
To get a clue on which logs its talking about, do the following:
there is an entry in db2diag.log file about LSN needed to do the rollforward. The log looks like -
Invoking database rollforward forward recovery,
lowtranlsn 0000027400C0 minbufflsn 000002625574
You can find out the names of logs needed to do the recovery by using db2flsn like -
D:\DB2\NODE0000\SQL00001>db2flsn 0000027400C0
Given LSN is contained in log file S0000024.LOG
D:\DB2\NODE0000\SQL00001>db2flsn 000002625574
Given LSN is contained in log file S0000023.LOG
This way you know where the log trail needed for rollforward starts.
I'm investing more on how to get a complete list of all the logs.
-Preeti
|
If you're doing this for a restore, why not just use "LIST HISTORY BACKUP ALL FOR <DBNAME>"? That will tell you what logs you need for the image.
__________________
--
Jonathan Petruk
DB2 Database Consultant
|
|

05-27-04, 15:23
|
|
Registered User
|
|
Join Date: Jun 2003
Posts: 77
|
|
Hi,
The command "list history backup all for dbname" doesnt give rollforward logs information in all the cases. In mine, it is leaving those fields empty. Like -
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
R D 20040527134842001 F 20040520155014
--------------------------------------------------------------------------
May be this is happening because I'm restoring to a new Database and on a different machine. I dropped the current database and then restored from an image taken from a different db on a different machine.
Please let me know if you know how to get Earliest and Current logs info in this case. Or if any other command is available to get this info.
Thansk,
-Preeti
|
Last edited by preetim; 05-27-04 at 15:27.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|