You can use Data Control Language (DCL) to control data access permissions. DCL can manage access permissions for specific accounts to specific database resources.
Default permission models
Different database systems have different default permission models:
Oracle-compatible mode: In Oracle, when a user is created, the system automatically creates a Schema with the same name as the user. For example, user
SCOTTowns SchemaSCOTT, and this user automatically becomes the owner of all objects in this Schema. Schema owners can access objects in their own Schema without additional authorization, while other users need to be granted privileges.MySQL-compatible mode: Data does not have an Owner concept. Authorization is required to access data.
Common DCL commands
DCL mainly includes two operations: granting permissions (GRANT) and revoking permissions (REVOKE).
Privilege grant example
Grant the query privilege on table ta in Schema A to user B:
GRANT SELECT ON a.ta TO b;
Revoke the query privilege on table ta in Schema A from user B:
REVOKE SELECT ON a.ta FROM b;