Db2 – Problem installing DB2Express

db2windows

I installed DB2 Express 10.1 on my Windows 7 (64bit) notebook. Now after the installation finished I cannot connect to the database. During the installation I specified "C:\Daten\db\db2" as the directory to be used for DB2.

When trying to connect, I get the following error:

SQL1031N The database directory cannot be found on the indicated file system.

However the database seems to be there:

db2 => connect to db2inst
SQL1031N  The database directory cannot be found on the indicated file system.
SQLSTATE=58031

db2 => list database directory

 System Database Directory

 Number of entries in the directory = 1

Database 1 entry:

 Database alias                       = DB2INST
 Database name                        = DB2INST
 Local database directory             = C:\Daten\db\db2\IBM\DB2\DB2INST
 Database release level               = f.00
 Comment                              =
 Directory entry type                 = Indirect
 Catalog database partition number    = -1
 Alternate server hostname            =
 Alternate server port number         =

I verified that the file system privileges are correct for the directory (the user running the DB2 service has full control on that directory and I made him the owner as well).

The content of C:\Daten\db\db2\ looks like this:


\---IBM
    \---DB2
        \---DB2INST
            +---cfg
            +---cfgcache
            +---DB2
            |   +---ctrl
            |   +---hmonCache
            |   |   \---DB2
            |   |       \---0
            |   |           \---ossipcres
            |   +---log
            |   +---security
            |   |   \---auditdata
            |   +---spmlog
            |   |   \---SPMLOGSD
            |   +---SQLDBDIR
            |   +---TMP
            |   \---UIF
            +---DB2DAS00
            |   +---cfg
            |   +---dump
            |   +---log
            |   +---metadata
            |   \---tmp
            |       +---dastmp
            |       \---schedtmp
            +---db2dump
            +---function
            |   \---unfenced
            \---license

I then tried to re-catalog the database:

db2 => uncatalog database db2inst
DB20000I  The UNCATALOG DATABASE command completed successfully.
DB21056W  Directory changes may not be effective until the directory cache is
refreshed.
db2 => catalog database db2inst on "c:\Daten\db\db2\IBM\DB2\DB2INST\"
DB20000I  The CATALOG DATABASE command completed successfully.
DB21056W  Directory changes may not be effective until the directory cache is
refreshed.

But that didn't help either.

For some reason it seems DB2 can't access the (existing) directory:

db2 => list db directory on "c:\Daten\db\db2\IBM\DB2\DB2INST\"
SQL1031N  The database directory cannot be found on the indicated file system.
SQLSTATE=58031
db2 => list database directory

I'm not experience with DB2 and the last time I installed Express everything went smoothly, so I'm a bit lost now.

Best Answer

If you built your database at C:\Daten\db\db2\IBM\DB2, then that should be your path for your database directory. (ie, it should be one higher than where your database resides).

Also, just wondering what command you used when you built your database? Where did you specify that it lives?