Purpose
This statement is used to drop a role.
Limitations and considerations
- When you delete a role, the system automatically revokes it from all users and roles to which it has been granted and deletes the role from the database.
- Roles in the system variable
mandatory_rolescannot be deleted. - When deleting multiple roles simultaneously, if any one role cannot be deleted successfully, the entire deletion operation will roll back and none of the roles will be deleted.
Privilege requirements
The current user must have the CREATE USER privilege or the DROP ROLE privilege to delete a role. For more information about OceanBase AI Database privileges, see Permission classification.
Syntax
DROP ROLE role_name [, role_name ...];
Parameters
Parameters |
Description |
|---|---|
| role_name | Specify the role name to be deleted. When deleting multiple roles, separate the role names with commas (,) separated. |
Examples
Delete the role role001.
DROP ROLE role001;