From: lxw176 via DBMonster.com on 9 Mar 2006 14:21 Hi, I'm working on DB2 UDB 8.1 for AIX 5.3. I tried to do either db2 drop database mydb or connect to mydb command after I restored mydb from an online backup image using redirected restore. I got the following error: SQL1031N The database directory cannot be found on the indicated file system. SQLSTATE=58031 so I list the database directory as following: $ db2 list database directory System Database Directory Number of entries in the directory = 2 Database 1 entry: Database alias = JAVAPROD Database name = JAVAPROD Local database directory = /db2/longspace/db2prod1 Database release level = a.00 Comment = Directory entry type = Indirect Catalog database partition number = 0 Database 2 entry: Database alias = SAMPLE Database name = SAMPLE Local database directory = /home/db2prod1 Database release level = a.00 Comment = Directory entry type = Indirect Catalog database partition number = 0 It seems mydb(javaprod) still exists. Does anyone can tell me on how to drop the javaprod from the db2 command line successfully? Thanks! Lan -- Message posted via DBMonster.com http://www.dbmonster.com/Uwe/Forums.aspx/ibm-db2/200603/1
From: Shashi Mannepalli on 9 Mar 2006 14:30 Is the database path is correct ? If not UNCATALOG the database and catalog it using the correct path. Then DROP the database. cheers.... Shashi Mannepalli
From: lxw176 via DBMonster.com on 9 Mar 2006 15:29 Hi Shashi. I think the database path is correct. Still, I did the uncatalog and catalog database, as following: $ db2 uncatalog database javaprod DB20000I The UNCATALOG DATABASE command completed successfully. DB21056W Directory changes may not be effective until the directory cache is refreshed. $ db2 terminate DB20000I The TERMINATE command completed successfully. $ db2 catalog database javaprod on "/db2/longspace/db2prod1" DB20000I The CATALOG DATABASE command completed successfully. DB21056W Directory changes may not be effective until the directory cache is refreshed. $ db2 terminate $ db2 drop database javaprod SQL1031N The database directory cannot be found on the indicated file system. I got the same error as before. I checked the db2prod1 folder under /db2/longspace/, it seems there is no catalog folder exists as usual. Is it cause the error? Could you tell me how to fix it. Thanks! Lan Shashi Mannepalli wrote: >Is the database path is correct ? If not UNCATALOG the database >and catalog it using the correct path. > >Then DROP the database. > >cheers.... >Shashi Mannepalli -- Message posted via DBMonster.com http://www.dbmonster.com/Uwe/Forums.aspx/ibm-db2/200603/1
From: Zoroaster on 9 Mar 2006 20:21 show the output of db2 "list db directory on /db2/longspace/db2prod1" then, we can know does javaprod exist or not. BTW, if you did not use TO target-directory option in RESTORE command, probably you restored the database to /home/db2prod1
From: lxw176 via DBMonster.com on 10 Mar 2006 09:49 Zoroaster, Thanks for your reply. Yes, I found the DFTDBPATH from the dbm cfg for my database javaprod is /home/db2prod1. I did the following steps: db2 => uncatalog db javaprod db2 => catalog db javaprod on /home/db2prod1 db2 => terminate $ db2 drop db javaprod SQL1013N The database alias name or database name "JAVAPROD" could not be found. SQLSTATE=42705 It still doesn't allow me to drop the javaprod. so I checked and found that the javaprod seems not listed in the /home/db2prod1 as the following: db2 => list db directory on /home/db2prod1 Local Database Directory on /home/db2prod1 Number of entries in the directory = 1 Database 1 entry: Database alias = SAMPLE Database name = SAMPLE Database directory = SQL00001 Database release level = a.00 Comment = Directory entry type = Home Catalog database partition number = 0 Database partition number = 0 Then I did a list db directory , the javaprod seems listed on /home/db2prod1. $ db2 list database directory System Database Directory Number of entries in the directory = 2 Database 1 entry: Database alias = JAVAPROD Database name = JAVAPROD Local database directory = /home/db2prod1 Database release level = a.00 Comment = Directory entry type = Indirect Catalog database partition number = -1 Database 2 entry: Database alias = SAMPLE Database name = SAMPLE Local database directory = /home/db2prod1 Database release level = a.00 Comment = Directory entry type = Indirect Catalog database partition number = 0 Here the catalog database partition number changed to -1 today from 0 as yesterday. Deos it related to the error? Please advice. Thanks! Lan Zoroaster wrote: >show the output of > >db2 "list db directory on /db2/longspace/db2prod1" > >then, we can know does javaprod exist or not. > >BTW, if you did not use TO target-directory option in RESTORE command, >probably you restored the database to /home/db2prod1 -- Message posted via DBMonster.com http://www.dbmonster.com/Uwe/Forums.aspx/ibm-db2/200603/1
|
Next
|
Last
Pages: 1 2 Prev: Convert DECIMAL to DATE Next: DB2 SQL error: SQLCODE: -805, NULLID.SYSLH20A 0X5359534C564C3031 |