Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

We have a case where we want to try to get rid of a database. The database still exists on disk and when we catalog it, it re-appears in the Database Manager. But when we try to do a DROP on it, it complains that it cannot find the alias. If we do uncatalog it and try to re-create it, it complains that the database name or alias already exists. So, we are stuck where we can't drop it and we can't recreate it.

I believe the SQLDBDIR file is the System Database used by DB2. Is there a way to edit this safely to get the entry out of there? Or is there another file we could edit, or a command we could run (outside of the standard DROP/CATALOG/UNCATALOG commands) that would get us in the clear?

Any help here would be great as we've been coming across this one more and more with our installed apps. (It arises from disk errors on laptops and we go to try to reinstall the database on a different section of disk.)

It sounds like you solved your issue without touching any metadata. That is more of a standard solution using the the DB2 commands only. Hacks into metadata is always risky. You should submit what you just said in your comment as an answer and see how the community would view it. I would be in favor of such an answer. BTW a +1 for responding to requests about your question. Please get the word out to other DB2 experts to ask and answer DB2 questions here in the DBA StackExchange.
–
RolandoMySQLDBAAug 10 '11 at 14:45

1 Answer
1

So far how we have gotten around this: We have uncatalogued the database. Then we rename the node locally (ie, C:\DB2, the default in the windows version). Then we need to uncatalogue the node. Then we can rebuild our databases with no problems.

+1 for getting your comment registered as the answer. Again, get the word out for DB2 gurus to join the DBA Stack Exchange
–
RolandoMySQLDBAAug 10 '11 at 22:23

1

Thanks for posting your workaround. These are, I believe, exactly the type of questions that we need here. Even if this isn't ideal, it at least gets the job done. Many thanks!
–
RichardAug 11 '11 at 12:16