DCL statements are used to control access to data stored in a database. You can use DCL statements to control the access of a specific account to specific database resources.
By default, some users can access specific data. For example, for OceanBase Database’s Oracle mode, a schema is created for a user and named after the user. The user is the owner of the same-name schema. All schema owners can directly access data in their schemas. However, they cannot access data in other schemas if they are not granted the required privileges. For OceanBase Database’s MySQL mode, users can access data only if they are granted the required privileges.
Example 1: Grant the SELECT privilege on the ta table in Schema a to User b.
GRANT SELECT ON a.ta TO b;
Example 2: Revoke the SELECT privilege on the ta table in Schema a from User b.
REVOKE SELECT ON a.ta FROM b;