문제

I have an old test database showing when I run db2 list database directory

Database 8 entry:

 Database alias                       = TEST_AN
 Database name                        = TEST_AN
 Local database directory             = /home/users/db2inst
 Database release level               = d.00
 Comment                              =
 Directory entry type                 = Indirect
 Catalog database partition number    = 0
 Alternate server hostname            =
 Alternate server port number         =

But it is not there when I run db2 list database directory on /home/users/db2inst

I can't connect to it:

> db2 connect to TEST_AN
SQL1013N  The database alias name or database name "TEST_AN" could not be 
found.  SQLSTATE=42705

or drop it:

> db2 drop db TEST_AN
SQL1013N  The database alias name or database name "TEST_AN  " could not be 
found.  SQLSTATE=42705

And I can't create a new DB using that name:

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

Does anyone know what the problem is, how can I get rid of this db that does and does not exist?

도움이 되었습니까?

해결책

It would seem your local catalog is out of sync.

You may want to try UNCATALOG DATABASE TEST_AN, which will manually remove the database registration from the local catalog.

다른 팁

for what its worth I couldn't drop a database no matter what I tried, then I figured out that if I recatalog it I could drop it.

so running

CATALOG DBNAME
DROP DB DBNAME

worked for me

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top