IBM Support

75 ways to demystify DB2: #24: Techtip: SQL10004C An I/O error occurred while accessing the database directory. SQLSTATE=58031

Technical Blog Post


Abstract

75 ways to demystify DB2: #24: Techtip: SQL10004C An I/O error occurred while accessing the database directory. SQLSTATE=58031

Body

Getting SQL10004C  An I/O error occurred while accessing the database directory?

The reason for SQL10004C may vary. Possible reasons are:

- sqldbdir being corrupted

- incorrect permission or access issues to the sqldbdir file under database directory

 

Another possible cause is that the system may have been maxed out of available file handles.  If you scan the /var/log/messages, you may see an error during the same time frame you got SQL10004C error.

kernel: VFS: file-max limit ### reached , where the ### is the fs-max set on the system.

How to confirm and fix it? 

To determine the maximum number of file handles for the entire system, run:
 
cat /proc/sys/fs/file-max

If the # reported in /var/log/messages is same as this number, then we know the system has reached the maximum number of file handles and we need to increase it.

 

From DB2 side, If you come across the following in db2diag.log:

MESSAGE : ZRC=0xFFFFFBF6=-1034 
SQL1034C The database was damaged, so all applications processing 
the database were stopped

Check for VFS: file-max limit error in /var/log/messages as well. If it matches the timestamp of the diag then the reason why db2 reported this error is due to the fact it didn't have enough file handlers.

[{"Business Unit":{"code":"BU029","label":"Data and AI"}, "Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":""}]

UID

ibm11141150