Lab 11: Privileges; Commit/Rollback Commands
Privileges:
- What system privileges and/or roles have you been granted?
Use
the
data dictionary tables USER_SYS_PRIVS and USER_ROLE_PRIVS.
- Create a view on the MANAGER table called MGRPUB consisting of
the manager
number and manager name columns.
- Grant read access on this view to the public.
- Grant read access on the MANAGER table to user DAT2355D_010A.
- Grant update privileges on the salary column in the MANAGER table
to user DAT2355D_010B.
- Log on as user DAT2355D_010A (password is DAT2355D_010A).
Which of the following
SQL statements execute successfully? Why? Substitute your
userid
where indicated; change the column names to the ones you have
used
in your table.
select * from userid.manager
select * from userid.mgrpub
update userid.manager set managername = 'Black' where
managerno
= 'M2';
update userid.mgrpub set managername = 'Black' where
managerno
= 'M2';
update userid.manager set salary = salary + 1000 where
managerno
= 'M2';
- Log on as user DAT2355D_010B (password is DAT2355D_010B).
Which of the following
SQL statements execute successfully? Why? Substitute your
userid
where indicated; change the column names to the ones you have
used
in your table.
select * from userid.manager
select * from userid.mgrpub
update userid.manager set managername = 'Black' where
managerno
= 'M2';
update userid.mgrpub set managername = 'Black' where
managerno
= 'M2';
update userid.manager set salary = salary + 1000 where
managerno
= 'M2';
- Log back on using your own userid. Revoke the privileges
granted
in Steps 3 - 5.
Commit/Rollback:
Delete the stock symbol foreign key on the HOLDING table before doing
the
following exercises.
- Enter the command: select * from
stock;
to see the current entries in the STOCK table.
- Enter the commands:
delete from stock where stocksymbol = 'JDS';
commit;
- Enter the command: select * from
stock;
Has the row for JDS been deleted?
- Enter the command: rollback;
- Enter the command: select * from
stock;
Has the delete been rolled back? Why or why not?
- Enter the command: delete from stock
where stocksymbol
= 'NTL';
- Enter the command: select * from
stock;
Has the row for NTL been deleted?
- Enter the command: rollback;
- Enter the command: select * from
stock;
Has the delete been rolled back? Why or why not?