Guidance:
1. Create a profile file.
SQL>Create profile file name limit
Failed_login_attempts: The number of Logon failures of the Locked User
Password_lock_time: Number of days the user is locked
Password_life_time: Password availability days
Password_reuse_time: Specifies how long the password cannot be reused.
Password_reuse_max: Specifies the number of times the password needs to be changed before password reuse.
Sessions_per_user: Limit the number of concurrent sessions of users
Cpu_per_session: Limits the CPU time used by the Session (1% seconds)
Cpu_per_call: Limits the CPU time used by each call (1% seconds)
Connect_time: Limits the total session connection time (minutes)
Idle_time: Limit the idle time of the session (minutes ));
2. Create a user (including creating a role ):
SQL>Create User Username
Identified by password
Default tablespace name
Temporary tablespace temporary tablespace name
Profile profile file name
Quota space limit on tablespace name;
And authorize the user:
SQL>Grant connect, resource to user name
Example:
-- Create a role
Drop role icdyw;
Create role icdyw not identified;
Grant "dba" to "icdyw ";
Grant "exp_full_database" to "icdyw ";
Grant "imp_full_database" to "icdyw ";
-- Create a user
Drop user icdmain cascade;
Create user icdmain identified by ICD
Default tablespace service_rpt_dat
Temporary tablespace service_temp
Profile default;
Grant "icdyw" to "icdmain" with admin option;
Grant unlimited tablespace to "icdmain" with admin option;
Grant select on SYS. V _ $ mystat to icdmain;
Grant select on SYS. V _ $ session to icdmain;
Grant select on SYS. dba_jobs to icdmain;
Alter user icdmain default role all;
3. Change users:
1. Modify user parameters: (all items except the user name can be modified)
SQL>Alter User Username
Identified by password
Default tablespace name
Temporary tablespace temporary tablespace name
Profile profile file name
Quota space limit on tablespace name;
Lock the user:
SQL>Alter User Username account lock;-Lock
SQL>Alter User Username account unlock;--Unlock
Force the user to change the password:
SQL>Alter User Username PasswordExpIre;
4. delete a user:
When there is no entity under a user:
SQL>Drop User Username;
When you have created entities such as tables and data:
SQL>Drop User Username cascade;
Note: The user currently being connected cannot be deleted.
When the cascade option is used, users and entities are immediately deleted, and data files should be physically deleted.
5. Monitor users:
Query user session information: (if two users log on with the same user name, you can dynamically Query
SQL>Select username machine, Sid, serial #
From v $ session;
Delete user sessions:
SQL>Alter system kill session 'sid, serial ';
Display the user's SQL statement:
SQL>Select User _ name, SQL _ text from V $ Open _ cursor;
Tag: Oracle
This article is transferred from
Http://www.cnblogs.com/wllyy189/archive/2008/06/02/1212195.html