Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL1039C

Status
Not open for further replies.

lucky888

Programmer
Jul 26, 2005
6
US
Hi there,

I got following error when i ran create database with any dbname. This is due to i used to drop a database called "abc".
SQL1039C An I/O error occurred while accessing the database directory. SQLSTATE=58031

I tried to list database directory and the database "abc" was not on the list.
i tried to uncatalog it but got following errmsg:
SQL1013N The database alias name or database name "abc" could not be found. SQLSTATE=42705

Does anybody has any ideas?

Thanks,
 
Do a "DROP database" again followed by UNCATALOG and then try to create the database.
 
I got following error when i uncatalog and drop database again.

SQL1013N The database alias name or database name "abc" could not be found. SQLSTATE=42705
 
Did you try to create the database, after that?
 
I tried those 3 steps but still got:
SQL1039C An I/O error occurred while accessing the database directory. SQLSTATE=58031
 
probably not good news.

SQL1039C An I/O error occurred while accessing the database directory.
Explanation:
Either the system database directory or the local database directory cannot be accessed. This error may occur not only when the system is cataloging or uncataloging a database but also when the system is accessing a database that is cataloged in the directory.

The command cannot be processed.

User Response:
Possible solutions include:
-If the error occurred on a diskette system, verify that the correct diskette is in the drive and ready to use. Verify that it is not write-protected.
-If the database directory is damaged, restore the databases that were cataloged there from backup versions and catalog them.
If installing the sample database, drop it and install the sample database again.

sqlcode: -1039
sqlstate: 58031
 
Thanks rbod for the quick response.

The database 'abc' I mentioned in this thread is on my local laptop hard disk.
The solution you mentioned:
1. my hard-disk is impossible write-protected.
2. Assume the database directory is damaged. Fortunately I have backup of database 'abc'. I tried restore it but still got:
SQL1039C An I/O error occurred while accessing the database directory. SQLSTATE=58031

I am in urgent to figure this out. I don't want to reinstall db2 which i can do as the final choice.

Thanks a lot,
 
on windows the lokal db directory is by default in c:\DB2.

Did you fool around there deleting files or so ??

I suppose listing the local db directory
> db2 list db directory on c:
is not working either ??

I suppose a db2ilist is working and showing your instance?

Before reinstalling I'd probably go and try dropping and creating the instance (db2idrop / db2icrt or using the Control Center).

Good luck !


Juliane
 
There is a file "SQLDBDIR" under C:\DB2\NODE0000\SQLDBDIR, that lists the databases. It is a binary file. See if you can find the name of the database in there and get the associated SQL0000n. [n is a number]

Then check if SQL0000n directory got deleted under C:\DB2\NODE0000.
When you drop the database, the SQL0000n directory on file system gets deleted.

 
I didn't find the db 'abc' in file SQLDBDIR but find it from file SQLDBINS. What is SQLDBINS used for?
SQLDBINS shows the dbname 'abc' and directory like c:\DB2\NODE0000\SQL00012 but i have no this directory any more. Can I delete SQLDBINS?

Waiting your response, rbod ...

juliane,
db2 list directory didn't show db 'abc'.
db2ilist shows me 'DB2'
i am afaid of trying db2idrop/db2icrt at this moment. What these two guys really do?

Thanks,
 
sqldbdir is the System database directory file.
sqldbins is the System intension file. It ensures that the database partitions remain synchronized.
db2idrop - drops the instance.
db2icrt - creates a new instance.


Try the restore with REPLACE EXISTING option.
 
it seems your database is definitely not there.

i am not sure what happened to your db directory.
i suppose you can't create any other database ?

well, I guess trying to restore a backup is an idea, even so I expect you getting the same error, since when restoring you also catalog the database and that will cause again SQL1039.

Hmmm. did you check whether for some reason the SQLDBDIR directory or file are locked for some reason ?

Otherwise I'd probably reinstall, it is rather difficult to debug such things via newsgroups ...
On Windows the reinstall is not difficult, since the fixpaks include the complete install images.

Good luck,
Juliane


Juliane
 
Good news:

I tried to drop another db in my list of db directory. After that i did recreate db 'abc' and it successed.

Cheers,


 
Only one notices:
This type of error occures, when there is not enough space to create some necessary system files of database (regurally in sqllib directory) or write permission are not okay.

Greetings
Vladimir
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top