Pr.Pg Next Pg

Creating Roles and Granting Privileges to Users tutorials

 

  • Using Oracle SQL Developer, you can manage privileges. Privileges enable users to have access to the database and the database objects. In Oracle SQL Developer, you can:

    • Create users

    • Grant and revoke system privileges to users and roles

    • Create roles

    • Grant role

  • In this topic, you create a user, then grant the user privileges. You create a role and grant the role to users.

1) To create a user, right-click Other Users and select Create User.


2) In the Create User window, enter HRAdmin for the User Name field and <password> for the New Password and Confirm Password fields. Set the Default Tablespace to USERS and the Temporary Tablespace to TEMP.

 

 

3). Click the System Privileges tab. and Select these system privileges: CHANGE NOTIFICATION, CREATE SEQUENCE, CREATE SESSION, CREATE SYNONYM, CREATE VIEW, UNLIMITED TABLESPACE, CREATE TABLE, CREATE TRIGGER, , DEBUG ANY PROCEDURE..

 


 

4). Now click the Roles tab, Select these system privileges for the role: CONNECT, DBA, RESOURCE.

 

 

5). Click the SQL tab to view the SQL statement generated by your choices.

 

 

Click Apply

6). Click to Close button. Now the HRAdmin user is created with roles and system privileges.

7). You can find out what privileges a user currently has by running a query in SQL Worksheet.

Type the statement in the SQL Worksheet :

SELECT username, privilege FROM USER_SYS_PRIVS;

The output will be.

 


Pr.Pg border                                              Next Pg