Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers 2

up vote 0 down vote accepted

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?

share|improve this answer
    
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. –  a_horse_with_no_name Jul 2 '12 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. –  Chris Aldrich Jul 2 '12 at 21:47
add comment

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
share|improve this answer
    
it would be great to explain what this does so the OP knows what the side effects might be on his system. –  Max Vernon Nov 6 '12 at 15:36
    
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. –  Chris Aldrich Nov 8 '12 at 16:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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