0% found this document useful (0 votes)
33 views24 pages

Week 11a Privileges

The document discusses database privileges in Oracle including system privileges which grant access at the database level and object privileges which grant access to specific schema objects. It provides examples of creating a user, granting and revoking various system and object privileges to the user, and creating and granting privileges to a role which is then granted to the user. The document demonstrates how to manage and view privileges for users.

Uploaded by

Kenan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views24 pages

Week 11a Privileges

The document discusses database privileges in Oracle including system privileges which grant access at the database level and object privileges which grant access to specific schema objects. It provides examples of creating a user, granting and revoking various system and object privileges to the user, and creating and granting privileges to a role which is then granted to the user. The document demonstrates how to manage and view privileges for users.

Uploaded by

Kenan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 24

PRIVILEGES

1-SYSTEM PRIVILEGES
2-OBJECT PRIVILEGES

1-SYSTEM PRIVILEGES : More than 100 privileges are available.

To display system privileges on the current schema;

SELECT * FROM USER_SYS_PRIVS;

To display all system privileges.

SELECT * FROM DBA_SYS_PRIVS;


SOME SYSTEM PRIVILEGES SOME OBJECT PRIVILEGES
ALTER ANY TABLE Table Privileges
ALTER ANY TABLE
ALTER
ALTER SESSION
ALTER USER DELETE
CREATE ANY SEQUENCE INSERT
CREATE ANY TABLE
SELECT
CREATE SEQEUNCE
UPDATE
CREATE SESSION
CREATE TABLE
CREATE USER Sequence privileges
DELETE ANY TABLE
ALTER
DROP ANY SEQUENCE
DROP ANY TABLE SELECT
DROP USER
SELECT ANY SEQUENCE
SELECT ANY TABLE
UPDATE ANY TABLE
CREATE USER asel IDENTIFIED BY asel
DEFAULT TABLESPACE users
TEMPORARY TABLESPACE temp
QUOTA UNLIMITED ON users

User created.

SELECT * FROM V$TABLESPACE;


SYSTEM PRIVILEGES

GRANT CREATE SESSION TO ASEL;

GRANT CREATE TABLE TO ASEL;


GRANT CREATE USER TO ASEL; GRANT DROP USER TO ASEL;

GRANT CREATE SEQUENCE TO ASEL;


GRANT SELECT ANY TABLE TO ASEL;

GRANT INSERT ANY TABLE TO ASEL;


GRANT DELETE ANY TABLE TO ASEL;
GRANT UPDATE ANY TABLE TO ASEL;
GRANT DROP ANY TABLE TO ASEL;
GRANT SELECT ANY SEQUENCE TO ASEL;
SELECT * FROM USER_SYS_PRIVS

REVOKE DROP ANY TABLE FROM ASEL;


REVOKE DELETE ANY TABLE FROM ASEL;
REVOKE SELECT ANY TABLE FROM ASEL;
REVOKE UPDATE ANY TABLE FROM ASEL;
REVOKE INSERT ANY TABLE FROM ASEL;
REVOKE DROP USER FROM ASEL;
OBJECT PRIVILEGES

GRANT SELECT ON scott.salgrade TO asel

REVOKE SELECT ON scott.salgrade FROM asel


GRANT UPDATE ON scott.salgrade TO asel

REVOKE UPDATE ON scott.salgrade FROM asel


GRANT DELETE ON scott.salgrade TO asel

REVOKE DELETE ON scott.salgrade FROM asel


GRANT INSERT ON scott.salgrade TO asel

REVOKE INSERT ON scott.salgrade FROM asel


GRANT ALTER ON scott.salgrade TO asel
SELECT * FROM user_tab_privs_recd;
ROLES
CREATE ROLE BASTYK;

GRANT SELECT ANY TABLE, CREATE ANY TABLE TO BASTYK ;

GRANT BASTYK TO ASEL

GRANT BASTYK TO ASEL;

SELECT * FROM
ROLE_SYS_PRIVS
WHERE ROLE = ‘BASTYK';
Viewing Privileges and Role Informations
TASKS
9-

10-

11- Revoke the SELECT privileges on your table from the other user.

You might also like