DROP DATABASE

DROP DATABASE [IF EXISTS] database_name

Drops a KDB database by removing its entry from kconf.xml, removing its catalogue if it is a KDB database, and removing its permissions file, if one was created. A non-virtual database can only be dropped if all of its tables have already been dropped.

When connected to an SQL database it drops the database entry in SYS.K$DATABASES, the owner and all the tables and other objects in the database. It can only be executed when connected as a DBA privileged user e.g. SYS AS SYSDBA on Oracle or postgres on PostgreSQL.

If the optional IF EXISTS clause is used and the database does not exist then no error is thrown.

See also:

CREATE DATABASE