[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Oracle session termination

Posted on 2010-11-15
4
Medium Priority
?
1,074 Views
Last Modified: 2012-05-10
Hello experts,
I need your help to fix one issue.  I’m using SQL*plus 10.2.0.1.0 as oracle client and Oracle 10.2.0.3.0 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.

0
Comment
Question by:KuldeepReddy
  • 2
4 Comments
 
LVL 7

Expert Comment

by:jocave
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.
0
 
LVL 48

Expert Comment

by:schwertner
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.
0
 
LVL 6

Expert Comment

by:sridharv9
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_level_client=16
Trace_directory_client=<path_to_the_trace_directory> # use the full path to the trace directory
Trace_unique_client=on
Trace_timestamp_client=on
Diag_adr_enabled=off

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_level_server=16
trace_directory_server=<O_H/network/trace> # use the full path to the trace directory
trace_timestamp_server=on
Diag_adr_enabled=off

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.


0
 
LVL 48

Accepted Solution

by:
schwertner earned 2000 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.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Suggested Courses
Course of the Month19 days, 17 hours left to enroll

872 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