DROP USER
Use the DROP USER command to delete a user account from the system. If the user owns any database objects, the system returns an error message and does not drop the user. You must drop or change the owner of those objects before you can drop the user.
Syntax
Syntax for dropping
a user:
DROP USER <name>
Input
The DROP USER command
takes the following input:
Input | Description |
---|---|
<name> | The name of the user account that is to be deleted from the system. |
Outputs
The DROP USER command
has the following outputs:
Output | Description |
---|---|
DROP USER | The user account was successfully deleted. |
ERROR: Drop user: user "<name>" does not exist | A user account with the specified name does not exist. |
DROP USER: User "<name>" owns objects, cannot be removed | The user owns one or more objects. You must drop or change the ownership of all such objects before you can drop the user who owns them. |
Privileges
You must be an administrator, or your account must have the Drop privilege for the user to be dropped or for the User object class.
Usage
The following provides
sample usage.
- To drop the user account
jonathan
:MYDB.SCH1(USER)=> DROP USER jonathan; DROP USER