How does DB2 UDB v9.& determine the last log in a set of logs for rollforward purposes?

Enyinnaya used Ask the Experts™
Hi all,

How does DB2 UDB v9.& determine the last log in a set of logs for rollforward purposes?

Does DB2 v9.7 have anything comparable to the RBA or LRSN that is used sometimes to roll forward to a point in time?

And if DB2 v9.7 have the comparable RBA or LRSn, how can you determine the last log in a set of archive logs to roll forward to?

Appreciate all the help I can get.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2013
Top Expert 2013

it's all in the recovery history file, a file created with each database and continuously maintained.

Here is more:

There is the LIST HISTORY command which can be used to show the logs:

list history archive log all for database mydb

db2 maintains the rba, which indicates how much log data was written so far.
DB2 has control files which maps the rba ranges of each log file, so when you specify the rba you wish to roll back to, db2 can check which log files are required (it also knows the rba of each image copy, so the log range that is required for a roll forward is the range from the image copy to the rba you requested)
In DB2, you have LSN (Log Sequence Numbers). The infomrmation is available (in binary format) in SQLOGCTL.LFH.1/2 ,

The log control file has information on the logs required for the future. AFAIK, DB2 does not bother or check which log files is the last one, but rather is concerned only about what is next.

For manual purposes, as mentioned by wmp, you can use the list history command to check the log files required for rollforward recovery.


Thank you guys

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial