Command Reference

db2flsn - Find Log Sequence Number

Returns the name of the file that contains the log record identified by a specified log sequence number (LSN).

Authorization

None

Command Syntax

>>-db2flsn----+-----+--input_LSN-------------------------------><
              '--q--'
 

Command Parameters

-q
Specifies that only the log file name be printed. No error or warning messages will be printed, and status can only be determined through the return code. Valid error codes are:

Other valid return codes are:

input_LSN
A 12-byte string that represents the internal (6-byte) hexadecimal value with leading zeros.

Examples

   db2flsn 000000BF0030
      Given LSN is contained in log file S0000002.LOG
 
   db2flsn -q 000000BF0030
      S0000002.LOG
 
   db2flsn 000000BE0030
      Warning: the result is based on the last known log file size.
      The last known log file size is 23 4K pages starting from log extent 2.
 
      Given LSN is contained in log file S0000001.LOG
 
   db2flsn -q 000000BE0030
      S0000001.LOG

Usage Notes

The log header control file sqlogctl.lfh must reside in the current directory. Since this file is located in the database directory, the tool can be run from the database directory, or the control file can be copied to the directory from which the tool will be run.

The tool uses the logfilsiz database configuration parameter. DB2 records the three most recent values for this parameter, and the first log file that is created with each logfilsiz value; this enables the tool to work correctly when logfilsiz changes. If the specified LSN predates the earliest recorded value of logfilsiz, the tool uses this value, and returns a warning. The tool can be used with database managers prior to UDB Version 5.2; in this case, the warning is returned even with a correct result (obtained if the value of logfilsiz remains unchanged).

This tool can only be used with recoverable databases. A database is recoverable if it is configured with logretain or userexit on.

See Also

"sqlurlog - Asynchronous Read Log" API in the Administrative API Reference.


[ Top of Page | Previous Page | Next Page ]