Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

So I screwed up. I was trying to free up some disk space and accidentally deleted logs DB2 needed to connect to/start my database. I'd run into this before, so I uncataloged the database and deleted the files on disk so I could recreate it. However, when I go to recreate the database, I get:

SQL1005N The database alias "BGTRUNK" already exists in either the local database directory or system database directory.

db2 list database directory shows that it's gone. Everything else I saw searching around suggests recatalogging and dropping the db, but that's obviously not an option at this stage.

How can I free this alias up for reuse?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
317 views
Welcome To Ask or Share your Answers For Others

1 Answer

I see two possible reasons:

1) The alias already exists in the system database directory but not in the local database directory -

To solve it using DB2 CLI run

db2 uncatalog database BGTRUNK

2) The alias already exists in the local database directory but not in the system database directory.

To solve it using DB2 CLI run

db2 catalog database BGTRUNK

db2 drop database BGTRUNK


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...