Anyone can run the command, but you must have read permission on the archive log files.
None
.-CHECK-. >>-DB2CKLOG--+-------+--log_file_number1--+----------------------+--> '-TO--log-file-number2-' >--+-------------------------------+----------------------------> '-ARCHLOGPATH--archive_log_path-' >--+-------------------------------------+--------------------->< +- -kspassword--password--------------+ +- -kspassarg--+-fd:file_descriptor-+-+ | '-filename:file_name-' | '- -ksprompt--------------------------'
The following example shows the successful validation of the archive log file S0000003.LOG in the path tests (output is abridged). This file can be used during rollforward recovery.
$ db2cklog CHECK 3 ARCHLOGPATH tests
____________________________________________________________________
_____ D B 2 C K L O G _____
DB2 Check Log File tool
...
"db2cklog": Finished processing log file "S0000003.LOG". Return code: "0".
The following example shows the successful validation of a range of archive log files (S0000003.LOG to S0000005.LOG; output is abridged). Successful validation of each file is indicated in the output. These files can be used during rollforward recovery.
$ db2cklog 3 TO 5
____________________________________________________________________
_____ D B 2 C K L O G _____
DB2 Check Log File tool
...
"db2cklog": Finished processing log file "S0000003.LOG". Return code: "0".
...
"db2cklog": Finished processing log file "S0000004.LOG". Return code: "0".
...
"db2cklog": Finished processing log file "S0000005.LOG". Return code: "0".
The following example shows how the first log file in a range of archive log files returns an error and fails validation (output is abridged). Once an error is encountered, a DBT error message is returned, and the db2cklog command exits without processing further log files. This log file should not be used for rollforward recovery, because it will cause the recovery operation to fail.
$ db2cklog 0 TO 1
____________________________________________________________________
_____ D B 2 C K L O G _____
DB2 Check Log File tool
...
DBT7053E Log file validation failed because the specified log file contains an invalid log page followed by another invalid log page.
DBT7048E The db2cklog utility determined that the current log file is invalid.
"db2cklog": Finished processing log file "S0000000.LOG". Return code: "-2000".