Teradata Drop Database

Teradata DROP DATABASE statement is used to drop any empty database from any Teradata system. This removes the structure of the data from the data dictionary(dbc) tables.

Prerequisite for Dropping a Database from Teradata

  1. The user that is using to drop the database must have appropriate privileges (DROP DATABASE) on the database which you are dropping.
  2. The database you are dropping must be empty before issuing the drop database statement. That means the database should not contain any objects like tables, views, macros, stored procedures, triggers, user-defined functions, etc.
  3. In order to make a database empty, you can use the DELETE DATABASE statement.
  4. Once a database is dropped, all the space like PERM and TEMP space of the database returns back to the immediate owner database or user.

Teradata DROP DATABASE syntax

The generic syntax of Teradata DROP DATABASE is as follows.

DROP DATABASE database_name;

Teradata DROP DATABASE example

The following statement drops an empty database names TUTORIALSBOOK from the Teradata system.

DROP DATABASE TUTORIALSBOOK;

Output:

DROP DATABASE TUTORIALSBOOK;

*** Database/User has been dropped.
*** Total elapsed time was 1 second.

Please get connected & share!

Advertisement