You can use Oracle Enterprise Manager Database Express (EM Express) to grant privileges and roles to a user account. For example, suppose you are creating or modifying a user account named NICK
for an application developer named Nick. Because Nick is a database application developer, you will grant NICK
the APPDEV
role, which enables him to create database objects in his own schema (you created the APPDEV
role in "Example: Creating a Role"). You also want him to be able to connect to the database, so you will grant him the CREATE SESSION
system privilege. In addition, because he is developing a human resources application, you want him to be able to view the tables in the hr
sample schema that is provided with Oracle Database, so you will grant him the SELECT
object privilege for all the tables in the hr
sample schema. The sample schemas that are provided by Oracle Database include fictitious data that is intended to be used for example and demonstration purposes, so granting NICK
access to the hr
sample schema provided by Oracle Database does not grant him access to any sensitive data. The following table summarizes the privileges and roles that will be granted to NICK
.
Grant Type | Privilege or Role Name |
---|---|
Role |
|
System privilege |
|
Object privilege |
|
The following example assumes that you are in the process of creating the user account for Nick. The example also assumes that you have not yet granted any privileges or roles to Nick.
To grant privileges and roles to the user Nick:
On the Privilege page in EM Express, find and select the APPDEV
role and the CREATE SESSION
system privilege in the available system privileges and roles table on the left, and use the right arrow button to move them to the selected system privileges and roles table on the right.
Click OK.
A confirmation message appears, and user NICK is created.
Go to the View User page for user NICK, as described in "Viewing User Accounts".
Click the Object Privileges subtab.
The Object Privileges subpage appears.
Click the Grant button.
The Grant Object Privileges wizard appears, with the Select Schema and Object Type page displayed.
In the Schema list, select HR
, and in the Object Type list, select Tables.
In this example, user NICK
is being granted the SELECT
object privilege for all the tables in the hr
sample schema provided by Oracle Database, which contains fictitious data intended for example and demonstration purposes. He is not being granted access to any sensitive data.
Click the right arrow button.
The Select Objects page appears.
Move all the tables from the available objects table on the left to the selected objects table on the right to make those tables available to user NICK.
Click the right arrow button.
The Grant Object Privileges page appears.
Select the SELECT
privilege in the Privilege list to grant NICK
the SELECT
privilege for all of the tables in the hr
sample schema provided by Oracle Database.
Click OK to save the new object privilege grants.
A confirmation message appears.