Hi Guys today i will show you how to restrict users sessions and idle time limit.
- This is my Clinical Production database which have more than 700+ users And among 700+ users we have 200+ RN Users (registered nurses)
- I got the task to restrict the RN users Sessions limit.
SQL>
alter system set resource_limit=true scope=both;
SQL>
show parameter resource_
NAME TYPE VALUE
------------------------------------
----------- ------------
resource_limit boolean TRUE
resource_manager_cpu_allocation integer 24 resource_manager_plan string
SQL>
create profile pro1
limit
sessions_per_user 1
idle_time
5;
Profile created.
SQL>
set echo off
SQL>
set verify off
SQL>
set head off
SQL>
set term off
SQL>
set feekback off
SQL>
spool set_pro.sql
SQL>
select 'alter user '|| username || '
profile pro1' || ';' from dba_users where
username LIKE ('RN%');
SQL>
spool off
SQL>
@set_pro
SQL>
set head on
SQL>
select resource_name,limit from dba_profiles where profile='pro1';
RESOURCE_NAME LIMIT
--------------------------------------------------------
COMPOSITE_LIMIT DEFAULT
SESSIONS_PER_USER 1
CPU_PER_SESSION DEFAULT
CPU_PER_CALL DEFAULT
LOGICAL_READS_PER_SESSION DEFAULT
LOGICAL_READS_PER_CALL DEFAULT
IDLE_TIME 5
CONNECT_TIME DEFAULT
PRIVATE_SGA DEFAULT
FAILED_LOGIN_ATTEMPTS DEFAULT
PASSWORD_LIFE_TIME DEFAULT
PASSWORD_REUSE_TIME DEFAULT
PASSWORD_REUSE_MAX DEFAULT
PASSWORD_VERIFY_FUNCTION DEFAULT
PASSWORD_LOCK_TIME DEFAULT
PASSWORD_GRACE_TIME DEFAULT
16
rows selected.
Happy Learning....
No comments:
Post a Comment