Revoke privileges from a role

2024-06-28 05:30:31  Updated

This topic describes how to revoke privileges from a role.

Prerequisites

You have the privileges to be revoked and the GRANT OPTION privilege. For information about how to view your privileges, see View user privileges.

Examples

  • Revoke the ALTER SYSTEM privilege from the role1 role.

    obclient [oceanbase]> REVOKE ALTER SYSTEM ON *.* FROM role1;
    
  • Revoke the SELECT privilege on all objects in the dbtest database from the role1 role.

    obclient [oceanbase]> REVOKE SELECT ON dbtest.* FROM role1;
    

    Revoke multiple privileges from multiple roles at a time.

    obclient [oceanbase]> REVOKE SELECT,UPDATE ON dbtest.* FROM role1,role2;
    
  • Revoke the SELECT privilege on the test1.tbl1 table from the role1 role.

    obclient [oceanbase]> REVOKE SELECT ON test1.tbl1 FROM role1;
    
  • Revoke the SELECT privilege on the c1 column of the test1.tbl1 table from the role1 role.

    obclient [oceanbase]> REVOKE SELECT(c1) ON test1.tbl1 FROM role1;
    

References

For more information about the REVOKE statement, see REVOKE.

Contact Us