Results 1 to 11 of 11
  1. #1
    Join Date
    Jan 2013
    Posts
    12

    Unanswered: Db2 database directory got deleted

    I've created a database testdb on path /dbtest, by mistake the contents under /dbtest got deleted. Eventhough database directory got deleted, that "testdb" is getting listed under "db2 list db directory".

    When I try to create again the testdb it is showing the error,

    SQL1005N The database alias "testdb" already exists in either the local
    database directory or system database directory.

    If I try to drop it, is showing the error,

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

    Why it is getting listed, eventhough everything got deleted?

    I want to use the same db name, what is the action to be performed to do so?

    Anyone please clarify me.


    Note: I'm using db2 v10.1, with Fixpack '0'.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    local and system directory are available
    if /dbtest deleted : db is unavailable
    you can uncatalog the db
    the cleanup of datafiles....has to be done manually
    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

  3. #3
    Join Date
    Jan 2013
    Posts
    12
    " the cleanup of datafiles....has to be done manually. "

    The database directory completely got deleted, where else the data files will reside?

  4. #4
    Join Date
    Jul 2011
    Location
    USA
    Posts
    80
    db2 "uncatalog database testdb"

  5. #5
    Join Date
    Jan 2013
    Posts
    12
    I did uncatalog database, and tried to catalog on different path, on which db files reside. Catalog command was successful.
    But when I tried to connect to db, it is still searching for the directory on which it was initially created and which was deleted.

    Getting the this error while connecting

    SQL0969N There is no message text corresponding to SQL error "-2045837302" in
    the message file on this workstation. The error was returned from module
    "SQLELOST" with original tokens "".

    What I shall need to do?

  6. #6
    Join Date
    Jul 2011
    Location
    USA
    Posts
    80
    Anyways you dont require that database so please try to drop it :
    drop database <dbname>

  7. #7
    Join Date
    Jan 2013
    Posts
    12
    When I tried to drop the database getting the error

    "SQL1031N The database directory cannot be found on the indicated file system.
    SQLSTATE=58031"

  8. #8
    Join Date
    Sep 2012
    Posts
    177
    Chinni, It's a partitioned database??

  9. #9
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    as there is a problem - do not use drop - uncatalog .... it will give errors
    try todo a manual cleanup
    datafiles.. config on dbpath and below sqllib/sqldbdir.....
    if this is the only db in the instance .. nop..
    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

  10. #10
    Join Date
    Jan 2013
    Posts
    12
    Laxman, its not a partitioned database.

    przytula, I've deleted the files under sqllib/sqldbdir....., but after that I did db2stop and db2start then only it took affect.
    After cleaning the db files, I could able to connect to the database.

    Thank you very much for the help !

  11. #11
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    any answer for a coffee....(the next time we meet)
    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

Posting Permissions

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