Oracle session termination

Posted on 2010-11-15
Last Modified: 2012-05-10
Hello experts,
I need your help to fix one issue.  I’m using SQL*plus as oracle client and Oracle as a database. In our organization, we have a separate LINUX box (AEDB01) for batch jobs and which will connect database using TNS name.  
I have a one process which invokes one procedure. Basically procedure contains 3 MERGE statements to insert/update data in 3 target tables based on staging table.  We have seen a couple of instances of the process running from AEDB01 have run for a long time due to the size of the uploads and, after a while, Oracle would report the session as TERMINATED. There was no indication in the job logs or in the database logs (alert.log) that this is a termination instigated by the database such as a transaction rollback or some error in the code. The database session was eventually cleaned up by Oracle but remained on AEDB01 as a shell script, so I had to clean that up manually.
FYI, I had invoked job using NOHUP command in AEDB01 box even though the oracle session will terminate after a while.
I’m suspecting that this is caused by some network timeout parameter which is killing the session after a period of time. I would like to know what parameter do I need to setup to in order to session alive until job completes.  
Any help greatly appreciated.

Question by:KuldeepReddy
  • 2

Expert Comment

ID: 34142335
What was the error returned to the batch job?

What profile associated with the Oracle user (SELECT profile FROM dba_users WHERE username = <<user name>>)?  What resource limits are defined for that profile (SELECT resource_name, limit FROM dba_profiles WHERE profile = <<profile name from dba_users>> AND resource = 'KERNEL' AND LIMIT != 'UNLIMITED')

Oracle cannot time out a session.  It is possible that Oracle has been configured to kill sessions that use too many resources (i.e. via a profile).  It is also possible that some network component is causing the timeout (firewalls are a popular source of unexpected timeouts).  If you do have a network component that is timing out the session, it is unlikely that any Oracle configuration change could resolve the problem.
LVL 48

Expert Comment

ID: 34158305
You are using NOHUP, so possibly the listener is asked to send probes to the client, but it doesn't answer. thisl eads to closing of the session. This is controlled via SQLNET.EXPIRED_TIME parameter in SQLNET.ORA file on the server. If this parameter is not present ignore my posting.

Expert Comment

ID: 34177673
There is no reason Oracle will kill an active session.   If the addition of the SQLNET.EXPIRED_TIME parameter (above comment) has no affect on the problem. Then enable client trace in the client side sqlnet.ora and server trace in the server sqlnet.ora file. Connect using the problem application to produce the error condition.

To enable client side trace:

Add the following to the client sqlnet.ora file

Trace_directory_client=<path_to_the_trace_directory> # use the full path to the trace directory

Upload the resulting trace (.trc) file or files generated in the trace directory. Remember to remove the trace parameters from the sqlnet.ora file after capturing the event.

To enable Server Trace:
add the following to the sqlnet.ora file on the server
NOTE: only enable server trace during periods of low connect activity on the server as all new connections will be traced while trace is enabled. Existing connections are not affected.

trace_directory_server=<O_H/network/trace> # use the full path to the trace directory

Upload the resulting trace (.trc) file or files generated in the trace directory. Remember to remove the trace parameters from the sqlnet.ora file after capturing the event.

LVL 48

Accepted Solution

schwertner earned 500 total points
ID: 34183572
Normally termination of the session is caused by firewalls due timeout setting.
Another investigation you have to do is in profile of the user. Some profiles are limiting the usage of the CPU, have time limits, etc.

But if you find SQLNET.EXPIRED_TIME parameter in SQLNET.ORA file then temporarily remove it and investigate what happens.

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ifconfig 4 69
How to configure this in fortinet firewall 2 62
Fortigate Question 5 23
ORA-02288: invalid OPEN mode 2 56
Introduction A previously published article on Experts Exchange ("Joins in Oracle", makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question