Updated on 2022-06-11 GMT+08:00

DROP TABLESPACE

Function

The feature of deleting an OBS tablespace in a database is supported only by 8.1.1 or later.

Precautions

  • Only a tablespace owner or a system administrator can run the DROP TABLESPACE command.
  • The tablespace to be deleted should not contain any database objects. Otherwise, an error occurs.
  • DROP TABLESPACE cannot be rolled back and therefore cannot be run inside a transaction block.
  • During execution of the DROP TABLESPACE command, database query by other sessions using \db may fail and can be reattempted after command execution.
  • If DROP TABLESPACE fails to be run, run DROP TABLESPACE IF EXISTS.

Syntax

DROP TABLESPACE [ IF EXISTS ] tablespace_name;

Parameter Description

  • IF EXISTS

    Sends a notice instead of an error if the specified tablespace does not exist.

  • tablespace_name

    Specifies the name of a tablespace.

    Value range: an existing tablespace name

Examples

Delete a tablespace.

1
DROP TABLESPACE ds_location1;

Helpful Links

CREATE TABLESPACE