We want the user intrauser to have the ability to perform SELECT
, UPDATE
, INSERT
, and DELETE
capabilities on the table students_tbl
in the ```intra_schema`` schema, we might execute the following GRANT statement:
GRANT SELECT, INSERT, UPDATE, DELETE ON intra_schema.students_tbl TO intrauser;
WITH ADMIN OPTION
vs WITH GRANT OPTION
Usage:
GRANT CREATE INDEX TO intrauser WITH ADMIN OPTION;
GRANT CREATE INDEX TO intrauser WITH GRANT OPTION;
These options hand over the control of the privileges from a single owner to multiple users.
WITH GRANT OPTION
:WITH ADMIN OPTION
:Only for system privileges, not object privileges.
System privileges allow the user to perform functions that deal with managing the database and the server. Most of the different types of permissions supported by the database vendors fall under the system privilege category, for example:
CREATE USER
permission, when granted to a database user, allows that database user to create new users in the database.CREATE TABLE
permission, allows the database user to create tables in their own schema.
This type of privilege is also available for other object types – like stored procedures and indexes.CREATE SESSION
permission, allows the user to connect to the database.Object privileges are privileges given to users so that they can perform certain actions upon certain database objects.Eexamples of object privileges: Grant DELETE and/or SELECT from a particular table. This is done using the GRANT clause as seen above.