oracle limit a user idle time

alter system set resource_limit = true;

create profile idletime limit idle_time 3;

alter user outln profile idletime;

 

SQL> alter system set resource_limit = true;

The system has changed.

SQL> conn sys/sunsdl as sysdba

connected.

SQL> create profile idletime limit idle_time 1;

Profile has been created

SQL> alter user outln profile idletime;

User changed

 

SQL> conn outln/outln

connected.

SQL>

SQL> set time on

15:14:26 SQL> ... wait a minute

15:17:51 SQL> select sysdate from dual;

select sysdate from dual

*

ERROR at line 1:

ORA-02396: exceeded maximum idle time, reconnect

 

Program does not close the open data connection. And repeatedly open connection. DESCRIPTION no operation is currently inactive, the current does not indicate no connection.

We know that in the Oracle database, you can terminate a process by kill session way, the basic grammatical structure as follows:

alter system kill session 'sid,serial#';

inactive session is normal, each session is active it is not possible

Only those who have abnormal exit, but did not disconnect the client, you need to start DCD, it is clear, to sqlnet.ora file, add sqlnet.timeout = xMin, you can restart the listener

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11113428.html