In oracle, creating role has its own importance rather than privileges because role helps to reduce repetition of granting privileges for different users

I am being requested by multiple users for access for one of the database and i need to find a way to grant access using role

To create role

SQL> create role my_role;

Role created.

To grant privileges to role

SQL> grant create table,create view,create procedure to my_role;

Grant succeeded.

To grant the role to user

SQL> grant my_role to test;

Grant succeeded.

Test the role by using the privilege

SQL> conn test
Enter password:
SQL> create table t(name varchar2(10),num number(10));

Table created.

You can also create a role with password

SQL> create role your_role identified by password;

Role created.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s