Sie sind auf Seite 1von 3

Oracle Database Administration Lab Assignment

Profiles, Users, Roles, and Privileges

Situation: You are continuing to develop your database. You will demonstrate the operation
of Oracle for various classes of users by creating user accounts and roles to match user work
positions within a hypothetical firm. You will allocate system and object privileges to those
users and roles. You may elect to complete the laboratory individually, or you may team up
with 1 to 2 laboratory partners. If you team up with partners, you will select your own
partners and you will be graded as a group, and you will submit a single document as
evidence of your teams work.
Tasks for tis Lab
!" #reate a PRO$%L&
a. !reate a "#O$I%& named 'e()User with the following limits'
(&((IO)(*"&#*+(&# 1
!"+*"&#*(&((IO) unlimited
!"+*"&#*!,%% -...
%O/I!,%*#&,0(*"&#*(&((IO) unlimited
%O/I!,%*#&,0(*"&#*!,%% 1..
I0%&*1I2& 3-
!O))&!1*1I2& 23.

*" #reate database users
a. !reate three new database users named Al, +ill, and Susan,
&ach new user is identified by the password PASS,ORD.
1heir default tablespace is US&RS"
Teir temporary tablespace is T&-P"
1he 4uota is 2.5 on US&RS"
1he profile is the Oracle database default profile. If you encounter any problems
6such as Oracle error messages7 when working with these users, then you are
e8pected to develop solutions to the problems.
." Alter a user
a. ,lter the user Al to assign him the "#O$I%& named 'e()User.
b. ,lter the user named Al to change the default tablespace to the DATA/! tablespace
with a 4uota of */0.
c. ,lter the user named +ill to assign a 4uota of !/0 on a non9e8istent tablespace named
APPL%#AT%O'S. :hat error code identifier and error description is generated; 0o
not attempt to fi8 the error < go on to the ne8t part of this task.
d. ,lter the user named Susan to assign an unlimited 4uota on the US&RS tablespace.
e. ,ttempt to open a "u11Y session 6use your &I07 and connect to your database using
(=%"lus as the user Al. :hat happens; !orrect the problem, then finish connecting
as Al.
f. 5eeping Al1s first connect session open, attempt to open another "u11Y session 6use
your &I07 and connect to your database using (=%"lus for another session as the user
Al. :hat happens; :hy; &8it the session windows for Al.

2" #onnecting as a user3granting a 4rivilege
a. ,ttempt to connect to the database as user +ill, and Susan, in turn. :hy can>t you
connect; /rant +ill and Susan the privilege needed to connect to the system.
b. !onnect as each user 6Al, +ill, and Susan7 in turn
5" #reate a role
a. !onnect as your D+A user. !reate a role named a44lication)develo4er.
b. ,ssign the system privileges' create session, create table, and select an6 table to the
new role.
c. /rant the roles a44lication)develo4er and connect to the user named Al with the
admin option.
7" #reating a table b6 a user insert ro( data
a. !onnect to the system as the user named Al. !reate a table named T&ST with a single
?,#!@,# column named T&ST)#OLU-' that will hold a ma8imum of 2.
characters. 0o not specify a tablespace or any default storage specifications. Insert a
row of data into the T&ST table. If any error6s7 occur, correct the problem and try
again to insert a row of data into the T&ST table.
c. :hile connected as the user named Al, use the I)(&#1 command to insert two
additional rows of data into the table named T&ST 6you create your own data7.
d. =uery the T&ST table to list the rows you inserted to verify their e8istence.

8" 9ranting S&L&#T 4rivileges
a. !onnect as the user named +ill. ,ttempt to select the rows from the T&ST table that
belongs to Al. :hy can>t you select from this table;
b. )ow connect as Al again and grant the privilege that Aill will need in order to select
rows only from the 1&(1 table
c. !onnect again as the user named Aill. :rite the (&%&!1 4uery needed to select all
rows and columns from the 1&(1 table.

:" 9ranting %'S&RT 4rivileges
a. !onnect as the user +ill.
b. ,ttempt to I)(&#1 a row into the T&ST table. :hat error is generated;
c. !onnect as Al and grant +ill the privilege needed to insert rows only into the 1&(1
d. !onnect as +ill and insert a Brd row into the T&ST table.
e. =uery the T&ST table to display the row values currently stored in the table.
;" #reating additional roles
a. !onnect as the 0A, user account for your database.
b. !reate a new role named data)entr6)clerk.
c. !onnect as the user Al and grant the (&%&!1 and I)(&#1 object privileges for the
T&ST table to the data)entr6)clerk role.
d. !onnect as the 0A, user account for your database and grant the role
data)entr6)clerk to the users named +ill and Susan.
e. !onnect as user Susan and try to I)(&#1 a new row into the T&ST table !ould you
insert the new row 9 :hy or why not;

!/" Dis4la6ing ob<ect 4rivileges
a. !onnect as the 0A, user account for your database.
!!" Revoking 4rivileges
a. :hile connected as the 0A, user account for your database, revoke the I)(&#1
privilege for the 1&(1 table from the user named Susan :hat message was
generated by this command;
b. !onnect as the user named Susan and attempt to insert a row into the T&ST table.
:hat happens;