Friday, October 28, 2016

Solved - java.sql.SQLException: ORA-02396: exceeded maximum idle time, please connect again


This kind of error is usually caused by the IDLE_TIME limit set to database users.

SQL> select * from USER_RESOURCE_LIMITS;

RESOURCE_NAME                    LIMIT
-------------------------------- ----------------------------------------
COMPOSITE_LIMIT                  UNLIMITED
SESSIONS_PER_USER                UNLIMITED
CPU_PER_SESSION                  UNLIMITED
CPU_PER_CALL                     UNLIMITED
LOGICAL_READS_PER_SESSION        UNLIMITED
LOGICAL_READS_PER_CALL           UNLIMITED
IDLE_TIME                        60
CONNECT_TIME                     UNLIMITED
PRIVATE_SGA                      UNLIMITED

9 rows selected.

Set the IDLE_TIME to UNLIMITED shall fix this problem if the user does not have a profile. Note: this will set the default idle_time for all users to UNLIMITED.

Very often, the IDLE_TIME limit for a user is set in a profile assigned to the user. To change the IDLE_TIME in a user's profile, do the following.

1. Find the user's profile

SQL> SELECT USERNAME, PROFILE, ACCOUNT_STATUS FROM DBA_USERS;

USERNAME                                             PROFILE                     ACCOUNT_STATUS
-------------------------------------    ----------------------------------   ---------------------------------
ORAUSER1                                              DEFAULT                                 OPEN

ADMIN1                                                   ADMIN_USER                          OPEN

2. View the profile

SQL> SELECT * FROM DBA_PROFILES where profile = 'ADMIN_USER' and RESOURCE_NAME='IDLE_TIME';

PROFILE                         RESOURCE_NAME        RESOURCE         LIMIT         COM
-------------------------------------------------------------------------------------------------------------
ADMIN_USER                 IDLE_TIME                     KERNEL             60                 NO

3. Change the LIMIT of IDLE_TIME

SQL> Alter profile ADMIN_USER limit IDLE_TIME UNLIMITED;

or

SQL> Update DBA_PROFILES set LIMIT='UNLIMITED' where profile = 'ADMIN_USER' and RESOURCE_NAME='IDLE_TIME';

4. Restart Database


-----------------------------------------------------------------------------------------------------------------
Watch the blessing and loving online channel: SupremeMasterTV live




If you have ever asked yourself these questions, this is the book for you. What is the meaning of life? Why do people suffer? What is in control of my life? Why is life the way it is? How can I stop suffering and be happy? How can I have a successful life? How can I have a life I like to have? How can I be the person I like to be? How can I be wiser and smarter? How can I have good and harmonious relations with others? Why do people meditate to achieve enlightenment? What is the true meaning of spiritual practice? Why all beings are one? Read the book for free here.

No comments:

Post a Comment