Thursday, February 17, 2005

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

If there were no changes made to the Hardware. Then its most likely that the database directory file sqldbdir is corrupted.

You will not be able to create new databases, connect to or drop existing databases.

Solution:

  • Move all the files found in “sqllib/sqldbdir” to a different location.
  • Now catalog all the databases. For Local databases use: db2 catalog db “dbname”.
  • This should get ride of the error.

Causes:

I received this error after *successful* installation of DB2 8.1 fixpak 7a on DB2 8.1 Fixpak 2 OS AIX 5.3.

Monday, February 14, 2005

Include logs in online backup (As of DB2 8.2)

db2 BACKUP DB “dbname” ONLINE TO “backupdir” INCLUDE LOGS

Above command includes the logs required to restore the database and bring back the database to a consistent point.

And to restore

db2 RESTORE DB “dbname” FROM “backupdir” LOGTARGET “logdir”

ROLLFORWARD DB “dbname” TO END OF LOGS AND STOP OVERFLOW LOG PATH “logdir”

To restore just the logs from the backup image

db2 restore db “dbname” logs from “backupdir” logtarget ‘logdir”