Environment
Oracle 12.1.0.2
SDE 10.4.1
Connection Methods
Direct connects using tnsnames.ora are used from desktop and servers.
Kill connections method
Construct an ALTER SYSTEM KILL SESSION (‘SID’,’SERIAL#’) dynamic sql statement from joining V$SESSION and V$PROCESS with SDE.PROCESS_INFORMATION. This is how we gather information, there is a next step of constructing and executing the ALTER SYSTEM that is not shown here.
<SPAN class="keyword token">WITH</SPAN>
sp <SPAN class="keyword token">AS</SPAN> <SPAN class="punctuation token">(</SPAN>
<SPAN class="keyword token">SELECT</SPAN> s<SPAN class="punctuation token">.</SPAN>audsid<SPAN class="punctuation token">,</SPAN> s<SPAN class="punctuation token">.</SPAN>LOGON_TIME<SPAN class="punctuation token">,</SPAN> s<SPAN class="punctuation token">.</SPAN>MACHINE<SPAN class="punctuation token">,</SPAN> s<SPAN class="punctuation token">.</SPAN>MODULE<SPAN class="punctuation token">,</SPAN> s<SPAN class="punctuation token">.</SPAN>OSUSER<SPAN class="punctuation token">,</SPAN> s<SPAN class="punctuation token">.</SPAN>PROCESS<SPAN class="punctuation token">,</SPAN> s<SPAN class="punctuation token">.</SPAN>PROGRAM<SPAN class="punctuation token">,</SPAN> s<SPAN class="punctuation token">.</SPAN><SPAN class="keyword token">SERIAL</SPAN><SPAN class="comment token">#, s.SID, s.TERMINAL, s.USERNAME,</SPAN>
p<SPAN class="punctuation token">.</SPAN>PID<SPAN class="punctuation token">,</SPAN> p<SPAN class="punctuation token">.</SPAN>PNAME<SPAN class="punctuation token">,</SPAN> p<SPAN class="punctuation token">.</SPAN>SPID
<SPAN class="keyword token">FROM</SPAN> v$<SPAN class="keyword token">session</SPAN> s<SPAN class="punctuation token">,</SPAN> v$process p
<SPAN class="keyword token">WHERE</SPAN> s<SPAN class="punctuation token">.</SPAN>paddr <SPAN class="operator token">=</SPAN> p<SPAN class="punctuation token">.</SPAN>addr
<SPAN class="operator token">AND</SPAN> s<SPAN class="punctuation token">.</SPAN><SPAN class="keyword token">TYPE</SPAN> <SPAN class="operator token">!=</SPAN> <SPAN class="string token">'BACKGROUND'</SPAN>
<SPAN class="operator token">AND</SPAN> s<SPAN class="punctuation token">.</SPAN>program <SPAN class="operator token">IS</SPAN> <SPAN class="operator token">NOT</SPAN> <SPAN class="token boolean">NULL</SPAN>
<SPAN class="operator token">AND</SPAN> s<SPAN class="punctuation token">.</SPAN>username <SPAN class="operator token">NOT</SPAN> <SPAN class="operator token">IN</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="string token">'SYS'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'SYSTEM'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'DBSNMP'</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN>
pi <SPAN class="keyword token">AS</SPAN> <SPAN class="punctuation token">(</SPAN>
<SPAN class="keyword token">SELECT</SPAN> p<SPAN class="punctuation token">.</SPAN>audsid<SPAN class="punctuation token">,</SPAN> p<SPAN class="punctuation token">.</SPAN>sde_id<SPAN class="punctuation token">,</SPAN> p<SPAN class="punctuation token">.</SPAN>server_id<SPAN class="punctuation token">,</SPAN> p<SPAN class="punctuation token">.</SPAN>start_time<SPAN class="punctuation token">,</SPAN> p<SPAN class="punctuation token">.</SPAN>owner<SPAN class="punctuation token">,</SPAN> p<SPAN class="punctuation token">.</SPAN>nodename
<SPAN class="keyword token">FROM</SPAN> sde<SPAN class="punctuation token">.</SPAN>process_information p <SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">select</SPAN> sp<SPAN class="punctuation token">.</SPAN>LOGON_TIME<SPAN class="punctuation token">,</SPAN> sp<SPAN class="punctuation token">.</SPAN>MACHINE<SPAN class="punctuation token">,</SPAN> sp<SPAN class="punctuation token">.</SPAN>MODULE<SPAN class="punctuation token">,</SPAN> sp<SPAN class="punctuation token">.</SPAN>OSUSER<SPAN class="punctuation token">,</SPAN> sp<SPAN class="punctuation token">.</SPAN>PROCESS<SPAN class="punctuation token">,</SPAN> sp<SPAN class="punctuation token">.</SPAN>PROGRAM<SPAN class="punctuation token">,</SPAN> sp<SPAN class="punctuation token">.</SPAN><SPAN class="keyword token">SERIAL</SPAN><SPAN class="comment token">#, sp.SID, sp.TERMINAL, sp.USERNAME,</SPAN>
sp<SPAN class="punctuation token">.</SPAN>PID<SPAN class="punctuation token">,</SPAN> sp<SPAN class="punctuation token">.</SPAN>PNAME<SPAN class="punctuation token">,</SPAN> sp<SPAN class="punctuation token">.</SPAN>SPID<SPAN class="punctuation token">,</SPAN> pi<SPAN class="punctuation token">.</SPAN>owner<SPAN class="punctuation token">,</SPAN> pi<SPAN class="punctuation token">.</SPAN>server_id
<SPAN class="keyword token">from</SPAN> pi<SPAN class="punctuation token">,</SPAN> sp
<SPAN class="keyword token">where</SPAN> pi<SPAN class="punctuation token">.</SPAN>owner <SPAN class="operator token">=</SPAN> sp<SPAN class="punctuation token">.</SPAN>username
<SPAN class="operator token">and</SPAN> pi<SPAN class="punctuation token">.</SPAN>server_id <SPAN class="operator token">=</SPAN> SUBSTR <SPAN class="punctuation token">(</SPAN>sp<SPAN class="punctuation token">.</SPAN>process<SPAN class="punctuation token">,</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> INSTR <SPAN class="punctuation token">(</SPAN>sp<SPAN class="punctuation token">.</SPAN>process<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">':'</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">-</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="operator token">and</SPAN> pi<SPAN class="punctuation token">.</SPAN>audsid <SPAN class="operator token">=</SPAN> sp<SPAN class="punctuation token">.</SPAN>audsid
<SPAN class="keyword token">order</SPAN> <SPAN class="keyword token">by</SPAN> sp<SPAN class="punctuation token">.</SPAN>logon_time<SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Scenario 1
We periodically need to update data during our maintenance window requiring all connections to be disconnected. After all sessions were disconnected, the V$SESSION and V$PROCESS tables showed no connections for SDE. But SDE.PROCESS_INFORMATION had 196 rows, and SDE.TABLE_LOCKS had over 3000 rows.
We bounced the database, but SDE.PROCESS_INFORMATION and SDE.TABLE_LOCKS returned the same.
Ultimately from SQL we deleted all rows in SDE.PROCESS_INFORMATION and SDE.TABLE_LOCKS, and update work progressed. After the maintenance window, desktop ArcMap, ARCSOC sessions came in, everything seems to be working fine.
Scenario 2
I believe that SDE.PROCESS_INFORMATION should always have an entry for an SDE connection. Right now if I pick a USERNAME/OWNER and compare V$SESSION has 9 rows, but there are 11 rows in SDE.PROCESS_INFORMATION. I’ve also seen cases where there are entries in SDE.PROCESS_INFORMATION that don’t exist in V$SESSION.
ISSUE
Prior to ArcGIS 10.5 sdemon was used to clear and rectify SDE process entries with Oracle sessions, even with direct connections. There isn’t an sdemon now, or a method (that I know of) to manage connections. There is something for locks, but not connections. This is why we resort to the brute force ALTER SYSTEM KILL SESSION method.
Something is not quite right, but I don’t know why. It’s hard to test because this is production.
Why do entries persist in SDE.PROCESS_INFORMATION?
Why do sessions show in V$SESSION that are not in SDE.PROCESS_INFORMATION?
It feels dangerous to manually monkey with SDE metadata tables. I see many posts about using the ALTER SYSTEM KILL method, so it seems widely accepted and recommended by ESRI.
At this point, things are working okay, but it’s uncomfortable not to have processes and connections matched up. And I can’t guarantee this won’t happen again during the next maintenance update.
Any insights or suggestions are welcome.
Sherrie