Unable to connect to a database, connection to a database just hangs.

Technote (troubleshooting)


Problem(Abstract)

When you are trying to connect to or activate a database, nothing happens. It seems like connection just hangs.

Symptom

Nothing happens on attempt to connect to or activate a database. At the same time, instance itself can be restarted without any problems. There are no error messages in the db2diag.log nor administration notification log file at the time when connection got hung. Connections to the databases created within the other instances that running on a same machine are succeeding.


Cause

The database manager is using the lock file to ensure that a database being used by only one instance of database manager. An operating system level process may hold a lock on the database lock file. That is, a database might be locked.

Resolving the problem

To see if database is locked, please perform the following operations:

  1. Log in to the system as database manager instance owner
  2. Stop the database manager using the db2stop command
  3. Use the ipclean command to clean up the IPC resources
  4. Start the database manager back using the db2start command
  5. Enable DB2® tracing using the db2trc command as follow:

    db2trc on -f dump.bin

  6. Try to establish a connection to a database using the CONNECT statement:

    db2 'connect to <database_name>'

  7. Wait some time to ensure that the connection has hung
  8. In another session, login to the system as instance owner and disable and format the traces:

    db2trc off
    db2trc fmt dump.bin dump.fmt
    db2trc flw dump.bin dump.flw



  9. Search for the following pattern in the file dump.flw (or whatever name you've used):
     
      | | | | | | | | | | | | | | sqleFirstConnect entry
      | | | | | | | | | | | | | | | sqle_GetRelDBLockForInstance entry
      | | | | | | | | | | | | | | | sqle_GetRelDBLockForInstance data [probe 2]
      | | | | | | | | | | | | | | | sqle_GetRelDBLockForInstance data [probe 4]
      | | | | | | | | | | | | | | | sqle_GetRelDBLockForInstance data [probe 6]
      | | | | | | | | | | | | | | | | sqloopenp entry
If you see that nothing happens after sqloopenp() call, there is a good chance that the database lock file was already locked at the time when the database manager was attempting to open (and lock) that file. The database manager will use the following file as database lock file:

< database_path>/< database_name>/NODE000X/SQL00001/SQLINSLK

Please consult the operating system documentation to find out which tools can be used to tackle the file locking issues. On UNIX®, it might be helpful to re-mount a directory where the database files are residing.

Rate this page:

(0 users)Average rating

Document information


More support for:

DB2 for Linux, UNIX and Windows

Software version:

9.1, 9.5, 9.7

Operating system(s):

Solaris

Reference #:

1497424

Modified date:

2013-03-28

Translate my page

Machine Translation

Content navigation