---
slug: /delete-a-role
---

# Delete a role

You can use the `DROP ROLE` statement to delete a role that is no longer needed.

## Prerequisites

To delete a role, you must have the `CREATE USER` or `DROP ROLE` privilege. For information about how to view the privileges of the current user, see [View user privileges](../400.view-user-permissions.md). If you do not have the required privileges, contact the administrator to grant you the privileges. For information about how to grant privileges to a user, see [Grant privileges directly](../200.direct-authority.md).

## Considerations

When you delete a role, the system automatically revokes the role from all users and roles that have been granted the role and then removes the role from the database.

## Examples

* Delete the `role1` role.

  ```sql
  DROP ROLE role1;
  ```

* Delete the `role1` and `role2` roles.

  ```sql
  DROP ROLE role1,role2;
  ```

## References

For more information about the `DROP ROLE` statement, see [DROP ROLE](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000002017007).