IS221: Database Management Lab 5 Information Systems Department TA. Rawan Alayed
Outline : Privilege Definition . System Privileges . Granting System Privileges . Grant ANY Privilege . Revoking System Privileges . Information Systems Department TA. Rawan Alayed
Privilege Definition A privilege is a right to execute a particular type of SQL statement or to access another user's object. There are two types of privileges : System Privileges : allow user to CREATE, ALTER or DROP database objects. Object Privileges : allow user to INSERT, UPDATE or DELETE data from database objects to which the privileges apply. Information Systems Department TA. Rawan Alayed
System Privileges System Privilege Description ALTER DATABASE Alter the database. CREATE/DROP/ALTER USER Create/Drop/Alter any user. CREATE/ALTER/DROP/ TABLESPACE Create/Alter/Drop tablespaces in any schema. MANAGE TABLESPACE Take tablespaces OFFLINE and ONLINE and Begin and End tablespace BACKUP. CREATE/ALTER/DROP ANY TABLE Create/Alter/Drop tables in any schema. CREATE/DROP ANY VIEW Create/Drop views in any schema. INSERT/UPDATE/SELECT/ DELETE ANY TABLE Insert/Update/Query/Delete rows from tables in any schema. EXECUTE ANY PROCEDURE Execute procedures or functions, either standalone or packaged. GRANT ANY PRIVILEGE Grant any system privilege (not object privileges). Information Systems Department TA. Rawan Alayed
System Privileges Grant system privileges to particular user : “ Grant privilege_name to user_name ; “ For example : ALTER DATABASE privilege : “ Grant ALTER DATABASE to user_name; “ Information Systems Department TA. Rawan Alayed
System Privileges CREATE TABLE privilege : “ Grant Create Table to user_name “ DROP TABLE privilege : “ Grant Drop Any Table to user_name “ Information Systems Department TA. Rawan Alayed
“ Grant Create View to user_name “ CREATE VIEW privilege : “ Grant Create View to user_name “ Information Systems Department TA. Rawan Alayed
Granting System Privileges Grant system privileges to all users at once : “ Grant system_privilege to PUBLIC ; “ For example : Create Table privilege : “ Grant create_table to PUBLIC ; “ Information Systems Department TA. Rawan Alayed
ANY Privilege System privileges that use the ANY keyword enable you to set privileges for an entire category of objects in the database. For example, the CREATE ANY TABLE system privilege permits a user to create a table anywhere in the database. Information Systems Department TA. Rawan Alayed
Revoking System Privilege Using REVOKE command, cancel the privileges to particular user . “ Revoke privilege_name from user_name “ For example : ALTER DATABASE privilege : “ Revoke DROP ANY TABLE from Rawan; “ Information Systems Department TA. Rawan Alayed
Visit the link for more System Privileges : https://docs.oracle.com/cd/B19306_01/server.102/b14200 /statements_9013.htm Information Systems Department TA. Rawan Alayed
Information Systems Department TA. Rawan Alayed