Monday, 9 January 2017

System Privileges

A system privilege allows a user to perform certain actions within the database, such as executing DDL statements.
The privileges can be grouped together into roles. Two useful roles to grant to a user are CONNECT and RESOURCECONNECT allows a user to connect to the database. RESOURCE allows a user to create various database objects like tables.
Commonly Used System Privileges:
System PrivilegeAllows You to
CREATE SESSIONConnect to a database.
CREATE SEQUENCECreate a sequence
CREATE SYNONYMCreate a synonym.
CREATE TABLECreate a table in the user's schema.
CREATE ANY TABLECreate a table in any schema.
DROP TABLEDrop a table from the user's schema.
DROP ANY TABLEDrop a table from any schema.
CREATE PROCEDURECreate a stored procedure.
EXECUTE ANY PROCEDUREExecute a procedure in any schema.
CREATE USERCreate a user.
DROP USERDrop a user.
CREATE VIEWCreate a view.

Granting System Privileges to a User

You use GRANT to grant a system privilege to a user.

GRANT CREATE SESSION, CREATE USER, CREATE TABLE TO tom;