AnsweredAssumed Answered

arcpy.DisconnectUser() run from WinServer to SDE on Linux w/ Oracle does not kill associated OS process

Question asked by blake.terhune on Jan 23, 2015
Latest reply on Feb 9, 2015 by blake.terhune

We have a database maintenance Python script (very similar to this one Esri recommends) and it kills all users with arcpy.DisconnectUser() before performing maintenance operations. This script is executed by Task Scheduler on Windows Server 2012 r2. Our ArcSDE 10.0 run on Oracle 11g on a Linux server. Here is an older, similar discussion that ended in a suggestion to enable TCPKEEPALIVE.

 

What we've found is that when the script kills all users, all connections in the SDE.Process_Information table go away (as expected) but the associated database/os  process for each connection (gsrvr) remains. This is a problem because they build up and eventually hit the limit set in the Oracle initialization parameters. With further testing, we found that running the kill all users SDEMON command locally on the Linux server would kill the connections and clean up all associated gsrvr processes and sessions.

 

We are currently testing two possible solutions:

  1. Enable the TCPKEEPALIVE setting to hopefully find and kill the orphaned processes.
  2. Instead of using arcpy.DisconnectUser(), run the SDEMON command through Plink in Python using subprocess.Popen()

 

My questions are:

  1. Is this possibly a bug with SDE/Python?
  2. Is TCPKEEPALIVE a sensible option to solve this problem?
  3. With SDEMON depreciation, will the Python Plink command option be a good long-term solution?

Outcomes