General Topics in Oracle:
1. How to create a user or schema in Oracle ?
2. How to GRANT permissions to an user ?
3. How to REVOKE permissions to an user ?
2. How to GRANT permissions to an user ?
3. How to REVOKE permissions to an user ?
Only DBA can create an User / Schema.
Syntax:
Create user <username> identified by <password>
Grant has the following perceptions:
- CONNECT Can create tables, views, functions, procedures.
- RESOURCE Can create triggers, clusters etc..
- DBA Can create users, grant permissions etc…
- SELECT Can read the table
- INSERT Can insert data into the table
- UPDATE Can modify the data
- DELETE Can delete the data
- ALTER Can alter the data definition
- REFERENCES Can create constraints
- INDEX Can create Indexes.
Ex:
GRANT CONNECT to XXX;
GRANT RESOURCE to XXX;
GRANT DBA to XXX;
GRANT SELECT,INSERT,UPDATE,DELETE to XXX;
GRANT ALTER to XXX;
GRANT REFERENCES to XXX;
GRANT INDEX to XXX;
Ex:
REVOKE CONNECT to XXX;
REVOKE RESOURCE to XXX;
REVOKE DBA to XXX;
REVOKE SELECT,INSERT,UPDATE,DELETE to XXX;
REVOKE ALTER to XXX;
REVOKE REFERENCES to XXX;
REVOKE INDEX to XXX;
Password can be changed by User and DBA.
ALTER USER XXX IDENTIFIED BY PASSWORD;
ALTER USER XXX ACCOUNT LOCK ;
ALTER USER XXX ACCOUNT UNLOCK
- This permission is given only to DBA.
DROP USER XXX [CASCADE]
Cascade is an Optional, its required when there are any tables/ views/ procedures etc.. created by the user.