In today’s article, we will explain using Grant to authorize the user or roles and Revoke to revoke authorizations.
System and Object privileges cannot be used in the same GRANT statement.
More than one user can be authorized in the same statement.
For example,
1 2 3 4 5 6 7 | SQL> grant select on iptvmwc.account to alihamza,alihamza2; Grant succeeded. SQL> grant create table to alihamza,alihamza2,alihamza3; Grant succeeded. |
System and object privileges cannot be given to everyone in the form of ALL statements.
For example,
1 2 3 4 5 6 7 8 9 10 11 12 | SQL> grant select on webtelmwcore.account to all; grant select on webtelmwcore.account to all * ERROR at line 1: ORA-00987: missing or invalid username(s) SQL> grant create session to all; grant create session to all * ERROR at line 1: ORA-00987: missing or invalid username(s) |
Everyone can be given ALL permission on an object.
For example,
1 2 3 4 5 6 7 8 9 | SQL> grant all on webtelqsdp.customer_account to public; Grant succeeded. SQL> select count(*) from webtelqsdp.customer_account; COUNT(*) ---------- 5018347 |
NOTE: More than one object cannot be authorized with a single GRANT.
1 2 3 4 5 | SQL> grant all on webtelmwcore.account,webtelqsdp.customer_account to public; grant all on webtelmwcore.account,webtelqsdp.customer_account to public * ERROR at line 1: ORA-00905: missing keyword |