Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

unable to remove database or create it

598 views
Skip to first unread message

darren gover

unread,
Jul 31, 2000, 3:00:00 AM7/31/00
to
Hello,

I am running db2 v6.1 on a sun solaris and cannot create a database with the
name savy, when I issue: create database savy it response with:

db2 => create database savy
SQL1005N The database alias "savy" already exists in either the local
database directory or system database directory.
db2 =>


When I try to remove this database via the, drop database savy, it response
with:

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

Any thoughts on this, sorry but i am very new to this stuff. Any help would
be appreciated.

Thanks!

Darren Gover
CheckFree i-Solutions
Waterloo, Ont.
Canada

Larry Menard

unread,
Jul 31, 2000, 3:00:00 AM7/31/00
to
Database cataloging in DB2 is a 2-staged animal.

One is called the "System" database directory. It resides in your DB2
product directory, in a subdirectory called "sqldbdir". The file in that
directory is also called "sqldbdir". The System database directory contains a
list of databases that are cataloged in DB2, and for each one, which Local
database directory (see next paragraph) it really resides in.

The other is called a "Local" database directory. This resides in the
location where a given database exists. It is also in a subdirectory called
"sqldbdir", and a file in that directory called "sqldbdir". This directory
contains a list of databases in that location, and the location of the actual
database files within it.

When DB2 looks up a database, it first checks the System database directory
to find out which Local database directory it should look for the database in.

In your case, it sounds like the "System" database directory disagrees with
the "Local" database directory. Either the database is listed in the System
database directory and is not in the Local database directory, or vice-versa.
To determine which is the case, do the following:

If you do "db2 list database directory", this lists the contents of the
System database directory. If you do "db2 list database directory on <some
path>", it will list the contents of the Local database directory at that
location (assuming you know the path your databases are being created on... if
you don't already know this, check the DFTDBPATH setting in your database
manager configuration).

If the database does exist in the Local database directory but not in the
System database directory, you can simply do "db2 catalog database savvy on
<path>". That will make the System database directory aware that the database
does exist in the Local database directory. You should then be able to either
use or drop & recreate the database.

If the database is cataloged in the System catalog but there is no
correcsponding Local database directory entry for it, you can simply do: "db2
uncatalog savvy", then you should be able to recreate it.

Hope this helps...

darren gover wrote:

--
Larry Menard
IBM Workstation Database (DB2) Performance Team
Defender of Geese and of all things Natural

ro...@my-deja.com

unread,
Aug 1, 2000, 3:00:00 AM8/1/00
to
Verify the database is not cataloged
==> list db directory

If it is and you do not need it, uncatalog the database and then recreate it.

In article <9Zih5.28541$227.5...@nnrp1.uunet.ca>,


"darren gover" <darren...@bluegill.com> wrote:
> Hello,
>
> I am running db2 v6.1 on a sun solaris and cannot create a database with the
> name savy, when I issue: create database savy it response with:
>
> db2 => create database savy
> SQL1005N The database alias "savy" already exists in either the local
> database directory or system database directory.
> db2 =>
>
> When I try to remove this database via the, drop database savy, it response
> with:
>
> db2 => drop database savy
> SQL1031N The database directory cannot be found on the indicated file
> system.
> SQLSTATE=58031
> db2 =>
>
> Any thoughts on this, sorry but i am very new to this stuff. Any help would
> be appreciated.
>
> Thanks!
>
> Darren Gover
> CheckFree i-Solutions
> Waterloo, Ont.
> Canada
>
>

Sent via Deja.com http://www.deja.com/
Before you buy.

0 new messages