![]() |
|
Use the DROP DATABASE statement to delete an entire database, including all system catalog tables, indexes, and data.
This statement is an extension to ANSI-standard syntax. The ANSI standard does not provide any syntax for the destruction of a database.
You must have the DBA privilege or be user informix to run the DROP DATABASE statement successfully. Otherwise, the database server issues an error message and does not drop the database.
You cannot drop the current database or a database that is being used by another user. All the database users must first execute the CLOSE DATABASE statement.
The DROP DATABASE statement cannot appear in a multistatement PREPARE statement.
During a DROP DATABASE operation, the database server acquires a lock on each table in the database and holds the locks until the entire operation is complete. Configure your database server with enough locks to accommodate this fact. For example, if the database to be dropped has 2500 tables, but less than 2500 locks were configured for your server, your DROP DATABASE statement will fail. For further information on how to configure the number of locks available to the database server, see the discussion of the LOCKS configuration parameter in your Administrator's Reference.
The following statement drops the stores_demo database:
In DB-Access, use this statement with caution. DB-Access does not prompt you to verify that you want to delete the entire database.
You can use a simple database name in a program or host variable, or you can use the full database server and database name. See Database Name for more information.
Related statements: CLOSE DATABASE, CREATE DATABASE, and CONNECT