Вы находитесь на странице: 1из 3

NAME: COURSE:

TITLE: Manage role and apply privileges ID:


Laboratory Exercises No. 1 DATE:

Directions : Perform the following activity Managing roles by applying different type of privileges.
: Copy and paste the DEPARTMENTS table included in this activity.
: In each number add the PL/SQL used.
: Answer the questions ask in each number.
: Skipping a number would cause different output consider as incorrect answer.
1. What privilege should a user be given to log on to the Oracle server? Is this a system or an object
privilege?
OBJECT – because it is enables users to access and manipulate the object.

2. What privilege should a user be given to create tables?


System – since system is used to perform particular actions in the database such as creating tables.
3. If you create a table, who can pass along privileges to other users on your table?
If the privilege is granted with a WITH GRANT OPTION clause.
4. You are the DBA. You are creating many users who require the same system privileges.
What should you use to make your job easier?
Use the GRANT clause.
5. What command do you use to change your password?
ALTER USER
6. Connect
To iqlplus* using the following session:
Username: SYSTEM
Password: oracle
7. Populate the given DEPARTMENTS table as shown below: Before proceedings to the next number make
sure to double check you should have 8 rows of values.

8. Create 3 different USERS with their corresponding password:


No. User_name Password
1 SUPERVISOR SPVR
2 MANAGER MGR
3 CLERK CLK

ADD THE PL/SQL used here:


9. From the created user grant a different system privilege for each user:
No. User_name Password Privilege
1 SUPERVISOR SPVR CREATE SESSION
2 MANAGER MGR CREATE TABLE

CS352-DBMS2-MAS Page 1
NAME: COURSE:
TITLE: Manage role and apply privileges ID:
Laboratory Exercises No. 1 DATE:

3 CLERK CLK CREATE SESSION and CREATE TABLE

ADD THE PL/SQL used here:


10. Try to connect using the three (3) created users.
 Which of the following user successfully establish a connection to oracle server?
_________________________________________________________________________________
_________________________________________________________________________________
 Which of the following user was not able to connect to oracle server? What is the reason?
_________________________________________________________________________________
11. Establish again a connection using: username: SYSTEM / password: oracle.
After establishing a connection to SYSTEM/oracle. Create a role and grant privilege of creating a table.
Role Privileges
SUP_ADMIN CREATE TABLE

ADD THE PL/SQL used here:


 From the role created in No. 11 SUP_ADMIN grant this said role to all USERS who are able to
establish a session.
ADD THE PL/SQL used here:
12. Log-on as CLERK and change your password to open.
Log-on as SUPERVISOR and change your password to sup
ADD THE PL/SQL used here:
13. Log-on as SYSTEM/oracle
 Grant objects privilege to SUPERVISOR by allowing to use the UPDATE for column
(DEPARTNAME) only, and SELECT statement to the table DEPARTMENTS.
ADD THE PL/SQL used here:
14. After adding object privilege to SUPERVISOR.
 Log-on SUPERVISOR
 Manipulate the DEPARTMENTS table, UPDATE the department_name to IT whose manager_id is
Null.
ADD THE PL/SQL used here:
 Confirm the changes made to DEPARTMENTS table by using the SELECT statement
ADD THE PL/SQL used here:
15. Log-on as SYSTEM then modify the object privilege created to SUPERVISOR to UPDATE , INSERT
and SELECT to all columns,
Note that SUPERVISOR should have the capability to pass the privilege given to them to other USERS.
ADD THE PL/SQL used here:
16. Log-on as SUPERVISOR, then pass the privilege to UPDATE INSERT and use SELECT to user
CLERK.
ADD THE PL/SQL used here:
17. Confirm that the user CLERK can now perform insertion and update.
 Log-on as CLERK
 Insert a new Departments with the following values as shown below:
5 IT_DEPT 10 2500

CS352-DBMS2-MAS Page 2
NAME: COURSE:
TITLE: Manage role and apply privileges ID:
Laboratory Exercises No. 1 DATE:

Is adding the new values when log-on as CLERK is possible? Why and why not?
_________________________________________________________________________________
18. Log-on as System then revoke all the object privilege given to SUPERVISOR.
ADD THE PL/SQL used here:
19. Log-on as Supervisor.
 Create a report that will display all the DEPARTMENT_NAME whose location_id is equal to 1700.
 Is creating a report possible? Why and why not?
Log-on as Clerk.
 Create a report that will display all the manager_id whose location_id is equal to 2500.
 Is creating a report possible? Why and why not?
20. Log-on as SYSTEM then delete all the users created to free-up some memory space.
ADD THE PL/SQL used here:

CS352-DBMS2-MAS Page 3

Вам также может понравиться