Take the 2-minute tour ×
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.)

share|improve this question
    
Please post the output of this command : 'db2 list db directory' and any error messages, if applicable. –  RolandoMySQLDBA Aug 9 '11 at 3:46
2  
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. –  RolandoMySQLDBA Aug 10 '11 at 14:45
add comment

1 Answer

up vote 2 down vote accepted
+100

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.

share|improve this answer
2  
+1 for getting your comment registered as the answer. Again, get the word out for DB2 gurus to join the DBA Stack Exchange –  RolandoMySQLDBA Aug 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! –  Richard Aug 11 '11 at 12:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.