DROP DATABASE statement

Description

Drops a database and its associated dbspace segment files.

Syntax

DROP DATABASE db-filename [ KEY key-spec ] 

Parameters

key-spec:

A string, including mixed cases, numbers, letters, and special characters. It might be necessary to protect the key from interpretation or alteration by the command shell.

Examples

Example 1

Usage

DROP DATABASE drops all the database segment files associated with the IQ Store and Temporary Store before it drops the Catalog store files.

The database must be stopped before you can drop it. If the connection parameter AUTOSTOP=no is used, you might need to issue a STOP DATABASE statement.

The db-filename you specify corresponds to the database filename you defined for the database using CREATE DATABASE. If you specified a directory path for this value in the CREATE DATABASE command, you must also specify the directory path for DROP DATABASE. Otherwise, Sybase IQ looks for the database files in the default directory where the server files reside.

If you use Interactive SQL instead of Sybase Central to drop databases, always provide an explicit path. For example, if you drop the write server’s database before dropping the query servers on the same machine, the following might return an error:

DROP DATABASE 'mydbname'

To avoid the error, specify the full database path, for example:

DROP DATABASE '/s1/mpx/wsrvr/mydbname.db'

You cannot execute a DROP DATABASE statement to drop an IQ database that has a DatabaseStart event defined for it.


Side effects

None.

Standards

Permissions

Required permissions are set using the database server -gu command line option. The default setting is to require DBA authority.

See also

CREATE DATABASE statement