3

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.

1

2 Answers 2

0

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?

2
  • Thanks for the answer. I was asked during the setup wizard where I wanted to store the database files. I don't remember the exact screen though. It seems that the effect of the catalog database command only takes effect when DB2 is restarted. After that I could access the default database. Jul 2, 2012 at 17:05
  • @a_horse_with_no_name actually you only need to issue db2 terminate in order to make catalog and uncatalog commands take effect. Jul 2, 2012 at 21:47
0

Similar problem was solved by the following steps:

  1. open DB2 "command window - Administrator"
  2. db2stop
  3. db2set DB2COMM=tcpip

    3.1. optional db2set DB2_CREATE_DB_ON_PATH=YES

  4. db2 CATALOG ADMIN TCPIP NODE {your_node_name} REMOTE {host_name} SYSTEM {system_name} OSTYPE {your_os_type_code}
  5. db2start
1
  • It is an attempt to catalog (ie, recognize) the database by accessing it via TCP/IP rather than local file system. The thought is to get DB2 to call out to the database as if it were remote when it isn't. Upside is it probably works. Downside is you now have to worry about node configurations to get DB2 to see your database. Usually you only do this if the database you are targeting is on separate LPAR or physical box than the instance or client where you are working. Nov 8, 2012 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.