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.
How to confirm and fix it?
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.
UID
ibm11141150