Name
DROP USER
Synopsis
DROP USER username [CASCADE]
The DBA’s favorite command, this statement removes a user (username) from the database.
Keyword
- CASCADE
Specifies that all objects in the user’s schema will be dropped before removing the user. This keyword must be specified if the user schema contains any objects.
Notes
You must have the DROP USER privilege to remove a user from the database. Note that if you specify the CASCADE option, any referential integrity constraints on tables in other schemas that refer to primary and unique keys on tables in this schema will also be dropped. If tables or other database objects in this schema are referred to by views, synonyms, or stored procedures, functions, or packages in another schema, those referring objects will be marked invalid but not dropped.
Example
The following example removes the user debby and the contents of her schema from the database:
DROP USER debby CASCADE
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access