15.00 - Dropping a Populated User - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

prodname
Teradata Database
vrm_release
15.00
category
Programming Reference
featnum
B035-1184-015K

Dropping a Populated User

A user must not contain any database objects or you cannot drop it. In other words, you cannot drop a populated user. Pursue the following procedure to ensure that a user 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 user.

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 user.

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

3 Drop any journal tables in the current user.

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

4 Perform either of the following procedures:

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

  • Drop all the objects within the current user.
  • See the appropriate statement set 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
  • 5 Drop the current user.