Discussion:
system directory and local directory doesn't match for a DB
(too old to reply)
Prince Kumar
2003-10-07 19:49:11 UTC
Permalink
Dear Group,

I recently installed DB2 and created an db "TOOLSDB" for the tools
catalog. during installation, the DB was created at the default
location. But I moved the DB to another location using
"db2relocatedb". Somehow I messed up during the relocate and undid the
relocate.

Now, I have the following situation.

I can do certain tasks on the DB. but when I try to create a tools
catalog on the toolsdb, I get the following error message.

% db2 create tools catalog toolscat USE EXISTING database toolsdb
SQL1031N The database directory cannot be found on the indicated file
system.
SQLSTATE=58031

Note: I probably can drop and recreate the DB. But I want to try other
alternatives first.

% db2 list db directory

System Database Directory

Number of entries in the directory = 2

Database 1 entry:

Database alias = TOOLSDB
Database name = TOOLSDB
Local database directory = /db2home/db2inst1
Database release level = a.00
Comment = Cataloged by db2relocatedb
Directory entry type = Indirect
Catalog database partition number = 0

Database 2 entry:
...


% db2 list db directory on path /db2home/db2inst1

Database 1 entry:

Database alias = TOOLSDB
Database name = TOOLSDB
Database directory = SQL00001
Database release level = a.00
Comment =
Directory entry type = Home
Catalog database partition number = 0
Database partition number = 0
P. Saint-Jacques
2003-10-07 23:35:45 UTC
Permalink
I'd try to uncatalog the TOOLSDB first. I think DB2 is confused at the
system and local database directories. Uncatalog, catalog should fix it.
Then catalog the TOOLSDB on the path indicated.
Then try to create it again.

Worse comes to worst, uncatalog, catalog, drop and recreate even if you
say you don't want to do this.
HTH, Pierre.
Post by Prince Kumar
Dear Group,
I recently installed DB2 and created an db "TOOLSDB" for the tools
catalog. during installation, the DB was created at the default
location. But I moved the DB to another location using
"db2relocatedb". Somehow I messed up during the relocate and undid the
relocate.
Now, I have the following situation.
I can do certain tasks on the DB. but when I try to create a tools
catalog on the toolsdb, I get the following error message.
% db2 create tools catalog toolscat USE EXISTING database toolsdb
SQL1031N The database directory cannot be found on the indicated file
system.
SQLSTATE=58031
Note: I probably can drop and recreate the DB. But I want to try other
alternatives first.
% db2 list db directory
System Database Directory
Number of entries in the directory = 2
Database alias = TOOLSDB
Database name = TOOLSDB
Local database directory = /db2home/db2inst1
Database release level = a.00
Comment = Cataloged by db2relocatedb
Directory entry type = Indirect
Catalog database partition number = 0
...
% db2 list db directory on path /db2home/db2inst1
Database alias = TOOLSDB
Database name = TOOLSDB
Database directory = SQL00001
Database release level = a.00
Comment =
Directory entry type = Home
Catalog database partition number = 0
Database partition number = 0
--
Pierre Saint-Jacques
IBM DB2 Cerified Solutions Expert - Administration
SES Consultants Inc.
Prince Kumar
2003-10-08 18:06:58 UTC
Permalink
Thanks for your Response.

I tried you suggestion. But for somereason, it is not cataoging the DB, now.

$ db2 uncatalog db toolsdb
DB20000I The UNCATALOG DATABASE command completed successfully.
DB21056W Directory changes may not be effective until the directory cache is
refreshed.


$ db2 list db directory on /db2home/db2inst1

Local Database Directory on /db2home/db2inst1

Number of entries in the directory = 1

Database 1 entry:

Database alias = TOOLSDB
Database name = TOOLSDB
Database directory = SQL00001
Database release level = a.00
Comment =
Directory entry type = Home
Catalog database partition number = 0
Database partition number = 0


$ db2 catalog db toolsdb on /db2home/db2inst1
SQL6028N Catalog database failed because database "toolsdb" was not found in
the local database directory.


$ db2 catalog db toolsdb
SQL6028N Catalog database failed because database "toolsdb" was not found in
the local database directory.

How do I get rid of this db?

Thanks,
Prince.
Post by P. Saint-Jacques
I'd try to uncatalog the TOOLSDB first. I think DB2 is confused at the
system and local database directories. Uncatalog, catalog should fix it.
Then catalog the TOOLSDB on the path indicated.
Then try to create it again.
Worse comes to worst, uncatalog, catalog, drop and recreate even if you
say you don't want to do this.
HTH, Pierre.
Post by Prince Kumar
Dear Group,
I recently installed DB2 and created an db "TOOLSDB" for the tools
catalog. during installation, the DB was created at the default
location. But I moved the DB to another location using
"db2relocatedb". Somehow I messed up during the relocate and undid the
relocate.
Now, I have the following situation.
I can do certain tasks on the DB. but when I try to create a tools
catalog on the toolsdb, I get the following error message.
% db2 create tools catalog toolscat USE EXISTING database toolsdb
SQL1031N The database directory cannot be found on the indicated file
system.
SQLSTATE=58031
Note: I probably can drop and recreate the DB. But I want to try other
alternatives first.
% db2 list db directory
System Database Directory
Number of entries in the directory = 2
Database alias = TOOLSDB
Database name = TOOLSDB
Local database directory = /db2home/db2inst1
Database release level = a.00
Comment = Cataloged by db2relocatedb
Directory entry type = Indirect
Catalog database partition number = 0
...
% db2 list db directory on path /db2home/db2inst1
Database alias = TOOLSDB
Database name = TOOLSDB
Database directory = SQL00001
Database release level = a.00
Comment =
Directory entry type = Home
Catalog database partition number = 0
Database partition number = 0
Lloyd D Budd
2003-10-09 19:44:17 UTC
Permalink
Hi Prince,

Something seems wrong -- and it is not you ;-). I would try "db2 catalog
db TOOLSDB". I do not think that will make any difference, but worth a
try. If that is not successful, then I would suggest opening a PMR with
DB2 Support -- they will likely what to know the exact steps of your
aborted/failed db move, and request that you try db2trc'ing the catalog
statement.

If that does not interest you, to manually clean up the files, that db
must be the only "local" db. You can then remove all the files under
/db2home/db2inst1/db2inst1/

HTH,
Lloyd
PM (pm3iinc-nospam)
2003-10-10 06:01:19 UTC
Permalink
DB21056W Directory changes may not be effective until the directory cache
is
refreshed.
=
db2 terminate

Try it after your catalog operations.

PM
Post by Prince Kumar
Thanks for your Response.
I tried you suggestion. But for somereason, it is not cataoging the DB, now.
$ db2 uncatalog db toolsdb
DB20000I The UNCATALOG DATABASE command completed successfully.
DB21056W Directory changes may not be effective until the directory cache is
refreshed.
$ db2 list db directory on /db2home/db2inst1
Local Database Directory on /db2home/db2inst1
Number of entries in the directory = 1
Database alias = TOOLSDB
Database name = TOOLSDB
Database directory = SQL00001
Database release level = a.00
Comment =
Directory entry type = Home
Catalog database partition number = 0
Database partition number = 0
$ db2 catalog db toolsdb on /db2home/db2inst1
SQL6028N Catalog database failed because database "toolsdb" was not found in
the local database directory.
$ db2 catalog db toolsdb
SQL6028N Catalog database failed because database "toolsdb" was not found in
the local database directory.
How do I get rid of this db?
Thanks,
Prince.
Post by P. Saint-Jacques
I'd try to uncatalog the TOOLSDB first. I think DB2 is confused at the
system and local database directories. Uncatalog, catalog should fix it.
Then catalog the TOOLSDB on the path indicated.
Then try to create it again.
Worse comes to worst, uncatalog, catalog, drop and recreate even if you
say you don't want to do this.
HTH, Pierre.
Post by Prince Kumar
Dear Group,
I recently installed DB2 and created an db "TOOLSDB" for the tools
catalog. during installation, the DB was created at the default
location. But I moved the DB to another location using
"db2relocatedb". Somehow I messed up during the relocate and undid the
relocate.
Now, I have the following situation.
I can do certain tasks on the DB. but when I try to create a tools
catalog on the toolsdb, I get the following error message.
% db2 create tools catalog toolscat USE EXISTING database toolsdb
SQL1031N The database directory cannot be found on the indicated file
system.
SQLSTATE=58031
Note: I probably can drop and recreate the DB. But I want to try other
alternatives first.
% db2 list db directory
System Database Directory
Number of entries in the directory = 2
Database alias = TOOLSDB
Database name = TOOLSDB
Local database directory = /db2home/db2inst1
Database release level = a.00
Comment = Cataloged by db2relocatedb
Directory entry type = Indirect
Catalog database partition number = 0
...
% db2 list db directory on path /db2home/db2inst1
Database alias = TOOLSDB
Database name = TOOLSDB
Database directory = SQL00001
Database release level = a.00
Comment =
Directory entry type = Home
Catalog database partition number = 0
Database partition number = 0
Continue reading on narkive:
Loading...