By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,756 Members | 1,760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,756 IT Pros & Developers. It's quick & easy.

SQL1031N error help

P: n/a
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....m-db2/200603/1
Mar 9 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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

Mar 9 '06 #2

P: n/a
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....m-db2/200603/1
Mar 9 '06 #3

P: n/a
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

Mar 10 '06 #4

P: n/a
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....m-db2/200603/1
Mar 10 '06 #5

P: n/a


Hi,

Do you know where the database files are located. Do you have a
SQL000.. directory somewhere on disc which relates to the JAVAPROD
database?
In your first post you copied the output from the list db directory
command, which shows directory /db2/longspace/db2prod1 being the
database location but can you find the db files within that
directory?
Also, you did a redirected restore. Which commands did you use to
restore the db?

Regards, Gert
Mar 10 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.