Friday , January 3 2025

Roles In Oracle Database

In today’s article, we will explain concepts such as defining roles in Oracle and which users have which roles.

When you want to grant the privileges in the role to all users, they are granted as PUBLIC.

As a result of this process, all users can now select the hr.employees table.

Role Definition

1. We create a role.

2. Rights are granted to the role.

3. The role is assigned to the user.

NOTES: After the role is created, there is no need for COMMIT operation. Because COMMIT command is only required after DML operations. GRANT is a DCL operation.

4. After the role is created, it is checked whether it has been created in the following places.

a. From Sqlplus;

b. From TOAD; it is checked whether the Role came from Users and whether the Object Grants are correct from Roles.

Which Users Have Which Roles?

There are 2 ways to find out which users have which roles.

1. SQL Plus and the other is TOAD.

It can be seen in the interface in TOAD.

It can be seen in SqlPlus with the following command.

The columns of the table from which the information will be taken are seen.

2. The following command is run and all users are seen.

Loading

About Onur ARDAHANLI

Leave a Reply

Your email address will not be published. Required fields are marked *