DB2 Delete Database __ Database

Source: Internet
Author: User
Tags db2

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.