15.00 - Dropping a Populated Database - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1184-015K
Language
English (United States)

Dropping a Populated Database

A database must be empty before you can drop it: you cannot drop a populated database. Pursue the following procedure to ensure that a database is empty before you attempt to drop it:

1 Drop any hash and join indexes contained within a different database or user that reference a table in the current database.

See “DROP HASH INDEX” on page 801  and “DROP JOIN INDEX” on page 804 for more information about how to do this.

2 Drop any triggers contained within a different database or user that reference a table in the current database.

See “DROP MACRO” on page 805 for more information about how to do this.

3 Drop any journal tables in the current database.

See “MODIFY DATABASE” on page 827 for more information about how to do this.

4 Perform either of the following procedures:

  • Delete the current database.
  • See “DELETE DATABASE” on page 787 for more information about how to do this.

  • Drop all the objects within the current database.
  • See the appropriate statement set or procedure call from the following list for more information about how to do this:

  • “DROP FUNCTION” on page 798
  • “DROP HASH INDEX” on page 801
  • “DROP INDEX” on page 802
  • “DROP JOIN INDEX” on page 804
  • “DROP MACRO” on page 805
  • “DROP PROFILE” on page 808
  • “DROP ROLE” on page 809
  • SQLJ.Remove_Jar under “SQLJ Database” on page 435
  • See SQL External Routine Programming for details on the signature and usage of the SQLJ.Remove_Jar external stored procedure.

    5 Drop the current database.