Help Center/ Data Warehouse Service / Troubleshooting/ Database Use/ Failed to Create or Delete a Database
Updated on 2025-09-19 GMT+08:00

Failed to Create or Delete a Database

Symptom

After CREATE DATABASE or DROP DATABASE fails in a distributed system, file directories or linked files of the database may remain on some nodes, affecting the normal use and rebuilding of the database. The database information of the node is missing. As a result, residual transactions fail to be cleared, blocking the system.

Possible Causes

The network is abnormal or the operation is terminated during the execution.

Handling Procedure

  1. Run the \l command on each CN of the cluster to view the database list and find out the residual databases.

  2. Perform the DROP DATABASE operation to clear residual files. For example:

    1
    DROP DATABASE if exists db333;
    

  3. If DROP DATABASE if exists cannot completely clear the residual files, manually delete the corresponding directories and files.
  4. If residual files still exist on a node, connect to the corresponding CN and clear them. xxx indicates the node name, and A indicates the database name.

    1
    EXECUTE DIRECT ON(xxx)'DROP DATABASE A';