Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 9th, 2006, 07:35 PM
lxw176 via DBMonster.com
Guest
 
Posts: n/a
Default SQL1031N error help

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
  #2  
Old March 9th, 2006, 07:45 PM
Shashi Mannepalli
Guest
 
Posts: n/a
Default Re: SQL1031N error help

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

  #3  
Old March 9th, 2006, 08:45 PM
lxw176 via DBMonster.com
Guest
 
Posts: n/a
Default Re: SQL1031N error help

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:[color=blue]
>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[/color]

--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums....m-db2/200603/1
  #4  
Old March 10th, 2006, 01:35 AM
Zoroaster
Guest
 
Posts: n/a
Default Re: SQL1031N error help

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

  #5  
Old March 10th, 2006, 03:05 PM
lxw176 via DBMonster.com
Guest
 
Posts: n/a
Default Re: SQL1031N error help

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:[color=blue]
>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[/color]

--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums....m-db2/200603/1
  #6  
Old March 10th, 2006, 03:15 PM
Gert van der Kooij
Guest
 
Posts: n/a
Default Re: SQL1031N error help



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
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles