Week11 Priviledges
Week11 Priviledges
1 As user SYSTEM, create user Emi and give her the capability to log on
to the database and
create objects in her schema. Assign her to the default tablespace
DATA01, and the
temporary tablespace TEMP. Make her quota on DATA01 1M.
select username,default_tablespace
from dba_users;
create tablespace:
Grant succeeded.
-----------------------------------------------------------------------------------
---------------
Table created.
Table created.
-----------------------------------------------------------------
create table:
Table created.
---------------------------------------------------------------
2 (c) As user SYSTEM give Bob the ability to select from Emi's CUSTOMERS1 table.
What
happens?
3 Reconnect as Emi and give Bob the ability to select from Emi�s CUSTOMERS1
table.
Also, enable Bob to give the select capability to other users. As user
SYSTEM, examine
the data dictionary views that record these actions.
Hint: Use DBA_TAB_PRIVS to examine.
3.
SQL> CONNECT emi/abcd12
Connected.
SQL> GRANT select ON customer1
TO bob WITH GRANT OPTION;
Grant succeeded.
SQL> CONNECT system/manager
Connected.
SQL> SELECT *
FROM dba_tab_privs
WHERE grantee='bob';
GRANTEE OWNER TABLE_NAME GRANTOR PRIVILEGE GRANT HIERARCH
BOB EMI CUSTOMERS1 EMI SELECT YES NO
-----------------------------------------------------------------------------------
--------------------------
4 Create user Trevor identified by diamond1$ with the capability to log
on to the
database.
4.
SQL> create user trevor
identified by trevor;
User created.
Grant succeeded.
-----------------------------------------------------------------------------------
--------------------------------------
5 (a)
SQL> connect bob/bob;
Connected.
SQL> grant select on emi.customers1 to trevor;
Grant succeeded.
5(b)
SQL> connect emi/emi;
Connected.
SQL> revoke select on customers1 from bob;
Revoke succeeded.
5(c)
SQL> connect trevor/trevor;
Connected.
SQL> select * from emi.customers1;
select * from emi.customers1
*
ERROR at line 1:
ORA-00942: table or view does not exist
-----------------------------------------------------------------------------------
----------------------------------------------
6 Enable Emi to start up and shut down the database without the ability to
create a
new database.
Grant succeeded.