Beruflich Dokumente
Kultur Dokumente
User is basically used to connect to database. All db objects like table,index,view etc can be
created under that user.In Oracle, users and schemas are essentially the same thing. You can
consider that a user is the account you use to connect to a database, and a schema is the
set of objects (tables, views, etc.) that belong to that account.
1. Create a user:
1
2
3 create user DEV_CLASS identified by DEV_CLASS#1234
4 PROFILE DEFAULT
5 DEFAULT TABLESPACE USERS
6 TEMPORARY TABLESPACE TEMP;
7
1
2
3 grant create session to DEV_CLASS;
4
3. Lock/unlock a user
1
2
3 alter user dev_class account lock;
4
5 alter user dev_class account unlock;
6
1
2
3 alter user dev_class account expire;
4
PROFILE:
A profile enforces set of password security rules and resource usage limit.
While creating a user if no profile is mentioned, then DEFAULT profile will be assigned.
9. Alter a profile:
1
2
3 ALTER PROFILE APP_PROFILE LIMIT FAILED_LOGIN_ATTEMPS UNLIMITED;
4
1
2
3 SQL> select username,profile,EXPIRY_DATE from dba_users where username='DEV_CLASS';
4 USERNAME PROFILE EXPIRY_DATE
5 ----------------------- ----------------------- ---------
6 DEV_CLASS APP_PROFILE 16-AUG-17
7
8 ALTER PROFILE APP_PROFILE LIMIT PASSWORD_LIFE_TIME UNLIMITED;
9
10 SQL> select username,profile,EXPIRY_DATE from dba_users where username='DEV_CLASS';
11
12 USERNAME PROFILE EXPIRY_DATE
13 ----------------------- ----------------------- ---------
14 DEV_CLASS APP_PROFILE
15
PRIVILEGES:
A privilege is a permission to execute either a particular type of sql statements or to perform
particular action on database objects.
SYSTEM PRIVILEGE
A system privilege is the right to perform a particular action or to perform an action on any
object of a particular type.
OBJECT PRIVILEGE:
An object privilege is the right to perform a particular action on an object or to access
another user’s object.
ROLE:
A role is a collection of privileges. It allows easier management of privileges.
17.Create a role:
1
2
3 create role DEV_ROLE;
4
1
2
3 drop user DEV_CLASS cascade;
4