The db2diag.log file is an ASCII file that contains information logged by DB2. It is located in the directory specified by the DIAGPATH database manager configuration parameter. Use a text editor to view the file on the machine where you suspect a problem to have occurred.
The information in the db2diag.log file includes the following:
There are two types of entries in the db2diag.log file:
If the database is behaving normally, this type of information is not important and can be ignored.
Notes:
The following example shows the header information for a sample
db2diag.log file entry.
1997-03-16-11.53.18.001160 (1) Instance:payroll (2) Node:000 (3) PID:44829(db2agent (SAMPLE)) (4) Appid:*LOCAL.payroll.970317140834 (5) lock_manager (6) sqlplrq (7) Probe:111 (8) Database:SAMPLE (9) DIA9999E (10) An internal return code occurred. Report the following: "0xFFFFE10E". (11) |
Legend:
Note: If the application is operating in a DUOW environment, the ID shown is the DUOW correlation token.
To identify more about a particular application ID, either:
To find out more about the type of activity performed by a function, look at the fourth letter of its name. In this example, the letter "p" in the function "sqlplrq" indicates a data protection problem. (Logs could be damaged, for example.)
The following list shows some of the letters used in the fourth position of the function name, and the type of activity they identify:
For severe errors, an SQLCA structure is dumped into the db2diag.log file. For details on each of the SQLCA fields, see Appendix C, SQL Communications (SQLCA).
The following diagram provides an example of a db2diag.log file with
an SQLCA dump.
1997-03-16-11.53.18.001160 Instance:payroll Node:000 PID:44829(db2agent (SAMPLE)) Appid:*LOCAL.payroll.970317140834 relation_data_serv sqlrerlg Probe:17 Database:SAMPLE DIA9999E An internal return code occurred. Report the following : "0xFFFFE101". Data Title :SQLCA pid(14358) (1) sqlcaid : SQLCA sqlcabc: 136 sqlcode: -980 (2) sqlerrml: 0 sqlerrmc: (3) sqlerrp : sqlrita sqlerrd (4): (1) 0xFFFFE101 (5) (2) 0x00000000 (3) 0x00000000 (4) 0x00000000 (5) 0x00000000 (6) 0x00000000 sqlwarn : (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) sqlstate: |
Legend:
On OS/2 and Windows systems, some db2diag.log file or SQLCA error codes are byte-reversed. If they are in the form ffff nnnn, they can be interpreted as is. If they are in the form nnnn ffff, you must byte-reverse them before they are meaningful.
To do this, switch the first four characters with the last four characters, and then the fifth and sixth characters with the seventh and eighth characters.
For example, the error code "0ae6 ffff" is translated to "ffff e60a".
When you have the error code in a meaningful form:
The following examples illustrate how you can use the db2diag.log file to diagnose problems.
Problem: A client application is executing against the database SAMPLE. During execution, the application always terminates abnormally.
Approach: To find the solution to the problem, first find the location of the error. Because the error occurs on the client, start by looking for the error on the client. To do this, look at the db2diag.log file on the client machine.
Assume that the db2diag.log file on the client machine contains no entries. Look at the db2diag.log file on the DB2 server machine to see if an error has occurred on the server.
Assume that the db2diag.log file on the server contains the following entries:
1997-03-16-20.52.27.001160 Instance:payroll Node:000 PID:44829(db2sysc (SAMPLE)) Appid:*LOCAL.payroll.970317140834 buffer_pool_services sqlbStartPools Probe:0 Database:SAMPLE Starting the database. (1) 1997-03-16-20.52.42.001160 Instance:payroll Node:000 PID:44829(db2sysc (SAMPLE)) Appid:*LOCAL.payroll.970317140834 buffer_pool_services sqlbcres Probe:1100 Database:SAMPLE DIA3726C A invalid page checksum was found for page "". (2) ZRC=FFFFE119 (3) 1997-03-16-20.52.42.001160 Instance:payroll Node:000 PID:44829(db2sysc (SAMPLE)) Appid:*LOCAL.payroll.970317140834 buffer_pool_services sqlbcres Probe:1100 Database:SAMPLE Obj={pool:2;obj:10;type:0} State=x27 (4) Data Title :SQLB_OBJECT_DESC pid(104) tid(109) 0200 0a00 0200 0a00 0000 0000 0000 0000 ................ 0000 002e e00c 0000 0000 0000 0000 0000 ................ 0000 0000 0100 0000 2700 0000 0000 0000 ................ 0000 0000 0000 0000 ........ Dump File : C:\SQLLIB\DB2\104109.dmp Data : SQLB_PAGE |
Interpretation:
Solution: Restore and roll forward the database. If this is not possible, contact DB2 Customer Service.
Note: This example has shown that an error with symptoms only on the client machine may be caused by an error occurring on the DB2 server machine.
Problem: A DB2 client application receives the SQL1042C error message when connecting to the database SAMPLE.
Approach: To find the solution to the problem, first find the location of the error. Because the error occurs on the client, start by looking at the db2diag.log file on the client machine.
Assume the db2diag.log file on the client machine contains no entries. Look at the db2diag.log file on the DB2 server machine to see if an error has occurred on the server.
Assume the db2diag.log file on the server contains the following
entries:
1997-03-16-08.59.34.001160 Instance:payroll Node:000 PID:55543(db2syscs (SAMPLE)) Appid:*LOCAL.payroll.970317140834 buffer_pool_services sqlbStartPools Probe:0 Database:SAMPLE Starting the database. (1) 1997-03-16-08.59.35.001160 Instance:payroll Node:000 PID:55543(db2syscs (SAMPLE)) Appid:*LOCAL.payroll.970317140834 data_protection sqlpresr Probe:0 Database:SAMPLE Crash Recovery has been initiated. (2) 1997-03-16-08.59.35.001160 Instance:payroll Node:000 PID:55543(db2syscs (SAMPLE)) Appid:*LOCAL.payroll.970317140834 data_protection sqlpgole Probe:30 Database:SAMPLE A problem occurred while verifying a database log file S0000000.LOG RC=0ae6 ffff (3) 1997-03-16-08.59.35.001160 Instance:payroll Node:000 PID:55543(db2syscs (SAMPLE)) Appid:*LOCAL.payroll.970317140834 data_protection sqlpgilt Probe:101 Database:SAMPLE DiagData 0ae6 ffff 1997-03-16-08.59.36.001160 Instance:payroll Node:000 PID:55543(db2syscs (SAMPLE)) Appid:*LOCAL.payroll.970317140834 data_protection sqlpgilt Probe:60 Database:SAMPLE DiagData 0ae6 ffff 1997-03-16-08.59.36.001160 Instance:payroll Node:000 PID:55543(db2syscs (SAMPLE)) Appid:*LOCAL.payroll.970317140834 data_protection sqlpgasn Probe:915 Database:SAMPLE Marked the database log as bad. 0000 0000 (4) |
Interpretation:
Error codes should be in the format ffff nnnn. However, OS/2 and Windows architecture may byte-reverse integers. Because the error code in this example is in the form nnnn ffff, you must byte-reverse it before it is meaningful. For more information, see Interpreting Hexadecimal Codes.
The error code in this example translates to ffff e60a. When translated to decimal form (-6646), it is not a valid SQL code, indicating that it is a return code rather than an SQL code. Looking up return code E60A in Appendix D, DB2 Internal Return Codes, we see that the file does not exist.
Database restart and recovery requires all log files that were in use at the time the database went down. This db2diag.log file entry indicates that the log file S0000000.LOG cannot be found in the expected location. Restart and recovery cannot proceed.
Solution: The best option to resolve this problem is to restore from a backup. Because the log file is S0000000.LOG (rather than S0001005.LOG or some other value), the database has not been log-retain enabled (or may be new). Therefore, restoring from backup is the only method of recovery.
Problem: During a database connection, the SQL1004C message is received. This message indicates that a file system is out of storage. How do we determine which file system is involved?
Approach: First examine the text of the error message itself. (Issue db2 ? sql1004c or refer to the error in the Message Reference.) The message indicates that there is insufficient storage on a file system to process the command.
Next examine the db2diag.log file on the server to find out exactly which file system is full, and to check if there is additional information.
Assume that the db2diag.log file on the server contains the
following entries:
1997-03-16-08.40.42.001160 Instance:payroll Node:000 PID:66847(db2syscs (SAMPLE)) Appid:*LOCAL.payroll.970317140834 data_protection sqlpgifl Probe:105 Database:SAMPLE DiagData 0cd6 ffff (1) 1997-03-16-08.40.43.001160 Instance:payroll Node:000 PID:66847(db2syscs (SAMPLE)) Appid:*LOCAL.payroll.970317140834 data_protection sqlpgifl (2) Probe:540 Database:SAMPLE 0cd6 ffff 1997-03-16-08.42.55.001160 Instance:payroll Node:000 PID:66847(db2syscs (SAMPLE)) Appid:*LOCAL.payroll.970317140834 data_protection sqlpgifl Probe:105 Database:SAMPLE DiagData 0cd6 ffff |
Interpretation:
Solution:
(logprimary * (logfilsiz * 4096) + 8192
to
((logprimary + logsecond) * (logfilsiz + 2) * 4096) + 8192
This calculation shows the range of space that may be required by the logs, assuming log retain is not enabled.
If log retain is enabled, the logs will continue to grow unless user exits are enabled. With log retain, ensure that the log path has as much space available as possible.
When the db2diag.log file does not contain enough information to solve a problem, you will need to perform a trace. For more information, see Example of Using db2diag.log file and the DB2 Trace.