3/06/2016

Checking archive log files with the db2cklog tool

Checking archive log files with the db2cklog tool

Checking archive log files with the db2cklog toolChecking your archive log files ensures that known good log files are available in case a rollforward recovery becomes necessary and that the recovery operation does not fail because of a problem with a log file. The db2cklog tool reads either single log files or a range of numbered log files and performs checks on the internal validity of the files. Log files that pass validation without any error messages or warnings are known good files and you can use them during a rollforward recovery operation. If an archive log file fails validation with an error message or if a warning is returned, then you must not use that log file during rollforward recovery.

Whenever we want to do rollforward we must need to check for the logfile with the db2cklog tool it will helps us to avoid error due to logfile damage while recovering the database.

Procedure

To check your archive log files, you issue the db2cklog command from the command line and include the log file or files you want checked. Note that you do not specify full log file names with the db2cklog command but only the numeric identifiers that are part of the log file names. The numeric identifier of the S0000001.LOG log file is 1, for example; to check that log file, you specify db2cklog 1.

Example:

db2cklog 1

If you want to check for range of logfiles then

db2cklog 0 to 5

1 comment:

  1. You've really only given a fraction of the information you should when writing a blog post like this. For example you make no reference to the following APAR:

    http://www-01.ibm.com/support/docview.wss?uid=swg1IC98063

    It's important to know about things such as this to avoid issues if you're on the version of DB2 that is susceptible to it.

    Also you make no mention of how to interrupt the output from checking logs as this deserves some further explanation as it can be confusing if you're using the tool for the first time.

    ReplyDelete

ads