Drop a database in DB2

在 DB2 中删除 database 时可能出现未“完全”删除的情况,特别是有时候在 db2cc 的 GUI 上操作时,会发生这种情况。

比如,我删除了一个本地数据库 mytestdb , 然后我再创建一个新库也用这个名字时,DB2 可能提示说 alias mytestdb 依旧存在,所以无法完成创建。这就是未完全删除的情况。

解决方法:

1, 将 alias mytestdb 再加载到数据库列表中来
$ db2 catalog database mytestdb
$ db2 terminate

2, 再次删除
$ db2 drop database mytestdb

END. 

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">