Database Reference
In-Depth Information
people, 35 were having SELECT, INSERT, UPDATE, DELETE
privileges on Payroll department tables and we are assuming a
scenario where you have assigned each of these 35 people
privileges not role. After a month change of business rule comes
up and it's described that those 35 HR folks would only be
having SELECT privilege on Payroll tables. Without using role
you have to run REVOKE statement 35 times and if you would
go by “role” technique one statement can implement that change
no matter whether there are 35 people or 3500 people.
Privileges can be granted to users as well as roles.
Example:
CREATE ROLE hr_emps
IDENTIFIED BY evergreen;
A role is created with the password. It is disabled by default and
can be enabled using SET ROLE statement.
SET ROLE hr_emps
IDENTIFIED BY evergreen;
SET ROLE statement can be used to enable or disable a role.
Once we have created the role, next thing is to assign this role.
GRANT SELECT, UPDATE
ON emp_test
TO hr_emps;
There are two kinds of privileges, one is called “Object
Privileges” and the other one is called “System Privileges”. The
complete list of each of these object privileges is given below
along with their application.
Search WWH ::




Custom Search