Results 1 to 9 of 9

Thread: can't connect

  1. #1
    Join Date
    Sep 2010
    Posts
    36

    can't connect

    We're getting error sql10004c and can't connect to database. LIST DB DIRECTORY ON <path> gave us the same error. User response tells us to restore database. This is a very large database. Can we fix this error without restore. Please help.

  2. #2
    Join Date
    Oct 2009
    Location
    221B Baker St.
    Posts
    487
    What had been done to the database immediately before this started?

    If the documentation says to restore, you probably should be get ready to do so.

    Before restoring over the problem, i would back up what you have and then restore. If you cannot run a "real" backup due to the corruption, i'd suggest a physical copy of the dasd. Might be useful for diagnosing after the system is back up and running.
    Last edited by papadi; 12-14-12 at 13:19.

  3. #3
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,361
    What DB2 version and OS are you using? How many local databases do you have on the same <path>? Can you connect to them? Please provide "db2 list db directory" output. If you can't restore, it's best to open a pmr to address this error.

  4. #4
    Join Date
    Sep 2010
    Posts
    36
    We didn't do anything to this database. This is DB2 9.1 running on AIX 6. We're going to migrate to DB2 9.7 but can't connect. One database exists

    System Database Directory

    Number of entries in the directory = 1

    Database 1 entry:

    Database alias = WAREHOUS
    Database name = WAREHOUS
    Local database directory = /db/dba
    Database release level = b.00
    Comment =
    Directory entry type = Indirect
    Catalog database partition number = 0
    Alternate server hostname =
    Alternate server port number =

  5. #5
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,361
    I'll show you what you can try, but if this is not clear, it's best to restore or try to get support from IBM. Please be careful when renaming/copying files.

    There are 2 database directories: system and local. It looks like your local db directory has a problem.

    Local db dir is stored in /db/dba/<instance name>/NODE0000/sqldbdir (if this is a DPF env, then NODE00## where ## is the node #)
    System db dir is stored in $HOME/sqllib/sqldbdir


    Here is what you can try:

    - Check permissions on /db/dba/<instance name>/NODE0000/sqldbdir, sqldbdir should have 755 and owned by the instance owner.
    - If permissions are ok, copy sqldbdir from $HOME/sqllib to /db/dba/<instance name>/NODE0000 and try to connect (rename the original sqldbdir in /db/dba/<instance name>/NODE0000 prior to copying).
    - If this doesn't work, then you need to rebuild sqldbdir as follows:

    db2 uncatalog db warehous
    cd /db/dba/<instance name>
    mv NODE0000 NODE0000.old
    db2 create db warehous on /db/dba
    cd /db/dba/<instance name>/NODE0000 (this is a newly created dir - got created during the previous step)
    rename all dir except for sqldbdir [ rename SQL00001, WAREHOUS (if it exists) ]
    copy [ SQL00001, WAREHOUS (if it exists) ] from /db/dba/<instance name>/NODE0000.old to /db/dba/<instance name>/NODE0000

    Now, you should have the following in /db/dba/<instance name>/NODE0000
    - original [ SQL00001, WAREHOUS (if it exists) ]
    - new sqldbdir

    Try to connect to db.

    If this DPF, you have to repeat the same steps for all NODE00## (uncatalog db once, mv NODE00## for each node, create db once, rename/copy for all NODE00##).

  6. #6
    Join Date
    Sep 2010
    Posts
    36
    We can connect, rebuild sqldbdir. We migrated to 9.7 ok, Can we delete renamed directories?

    Another question is how to migrate back to 9.1?

  7. #7
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,261
    before migration you should have taken offline backup
    drop 9.7 instance - create 9.1 instance if code still present
    restore db
    all changes executed in 9.7 are lost !!
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  8. #8
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,361
    Quote Originally Posted by shamikp View Post
    Can we delete renamed directories?
    Please provide ls -l output of what you have in /db/dba/<instance name> and /db/dba/<instance name>/NODE0000

  9. #9
    Join Date
    Jun 2012
    Posts
    12
    Quote Originally Posted by db2girl View Post
    I'll show you what you can try, but if this is not clear, it's best to restore or try to get support from IBM. Please be careful when renaming/copying files.

    There are 2 database directories: system and local. It looks like your local db directory has a problem.

    Local db dir is stored in /db/dba/<instance name>/NODE0000/sqldbdir (if this is a DPF env, then NODE00## where ## is the node #)
    System db dir is stored in $HOME/sqllib/sqldbdir


    Here is what you can try:

    - Check permissions on /db/dba/<instance name>/NODE0000/sqldbdir, sqldbdir should have 755 and owned by the instance owner.
    - If permissions are ok, copy sqldbdir from $HOME/sqllib to /db/dba/<instance name>/NODE0000 and try to connect (rename the original sqldbdir in /db/dba/<instance name>/NODE0000 prior to copying).
    - If this doesn't work, then you need to rebuild sqldbdir as follows:

    db2 uncatalog db warehous
    cd /db/dba/<instance name>
    mv NODE0000 NODE0000.old
    db2 create db warehous on /db/dba
    cd /db/dba/<instance name>/NODE0000 (this is a newly created dir - got created during the previous step)
    rename all dir except for sqldbdir [ rename SQL00001, WAREHOUS (if it exists) ]
    copy [ SQL00001, WAREHOUS (if it exists) ] from /db/dba/<instance name>/NODE0000.old to /db/dba/<instance name>/NODE0000

    Now, you should have the following in /db/dba/<instance name>/NODE0000
    - original [ SQL00001, WAREHOUS (if it exists) ]
    - new sqldbdir

    Try to connect to db.

    If this DPF, you have to repeat the same steps for all NODE00## (uncatalog db once, mv NODE00## for each node, create db once, rename/copy for all NODE00##).

    db2girl!!!!!

    THANK YOU!!!!!!!!!!!!!!!!!!!! This has saved me from a bunch of work I did not want to do. It is much appreciated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •