Show TOC

DROP DATABASE StatementLocate this document in the navigation structure

Drops a database and its associated dbspace segment files.

Syntax
DROP DATABASE <db-filename>KEY <key-spec> ] 
Parameters

(back to top)

  • 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.
  • db-filename corresponds to the database file name 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, SAP IQ looks for the database files in the default directory where the server files reside.
Examples

(back to top)

  • Example 1 drops database mydb:
    DROP DATABASE 'mydb.db'
  • Example 2 drops the encrypted database marvin.db, which was created with the key is!seCret:
    DROP DATABASE 'marvin.db' KEY 'is!seCret'
  • Example 3 drops the database temp.db from the /s1/temp directory on a UNIX system:
    DROP DATABASE '/s1/temp/temp.db'
Usage

(back to top)

DROP DATABASE drops all the database segment files associated with the IQ store and temporary store before it drops the catalog store files.

You must stop a database before you can drop it. If the connection parameter AUTOSTOP=no is used, you may need to issue a STOP DATABASE statement.

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

Standards

(back to top)

  • SQL—Vendor extension to ISO/ANSI SQL grammar.
  • SAP Database products—Not supported by SAP ASE.
Permissions

(back to top)

The permissions required to execute this statement are set using the -gu server command line option, as follows:
  • NONE No user can issue this statement.
  • DBA Requires the SERVER OPERATOR system privilege.
  • UTILITY_DB Only those users who can connect to the utility_db database can issue this statement.