A DB instance exists in two places in the data:
1: Physical Location: On disk, which is the file system.
2: Logical Location: The database system table, which is the configuration information for the disk file.
Procedure for deleting a database:
1: Delete the physical file, 2: Delete the logical information, that is, the configuration information of the physical file.
The above two places are deleted at the same time, the database is really deleted clean.
Two cases can not be deleted: 1: The physical file is deleted, but the logical information is not deleted. (This can also happen with backup failures)
2: The logical message has been deleted, but the physical file is not deleted
Error message: The database alias already exists.
Workaround:
1: If the physical file has been deleted, then just delete the logical information can be
Execute the Uncatalog dbname on the go. The catalog information is deleted.
2: If the logical file has been deleted, then just delete the physical file.
To db2 the appropriate directory, locate the database folder that needs to be deleted and delete it directly. This method may be dangerous: it may be deleted incorrectly.
Another grammar: If the physical file exists, and the logical catalog does not exist, only need to re-catalog, that is, the physical file configuration information appended to the system table, and then execute the drop DB dbname can be. This is also a method that many people offer.
Specific: Catalog dbname. Drop DB dbname.