<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Kill only old connections in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516404#M29279</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The second one.&amp;nbsp; It would be nice if I could give a list of PID's instead of having to do each one one at a time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Apr 2012 16:02:42 GMT</pubDate>
    <dc:creator>BrentHoskisson</dc:creator>
    <dc:date>2012-04-02T16:02:42Z</dc:date>
    <item>
      <title>Kill only old connections</title>
      <link>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516402#M29277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a way to kill only the SDE connections that are over 24 hours old?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2012 14:52:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516402#M29277</guid>
      <dc:creator>BrentHoskisson</dc:creator>
      <dc:date>2012-04-02T14:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Kill only old connections</title>
      <link>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516403#M29278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Brent,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use the 'sdemon -o kill' command and specify the PID for the connection that is greater than 24 hours.&amp;nbsp; The 'sdemon -o info -I users' command will list each user connected, the PID, and the start time of the connection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or, are you looking for a more automated approach to do this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2012 15:59:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516403#M29278</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-04-02T15:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Kill only old connections</title>
      <link>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516404#M29279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The second one.&amp;nbsp; It would be nice if I could give a list of PID's instead of having to do each one one at a time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2012 16:02:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516404#M29279</guid>
      <dc:creator>BrentHoskisson</dc:creator>
      <dc:date>2012-04-02T16:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Kill only old connections</title>
      <link>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516405#M29280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It may be best to delete the entries from the 'sde.sde_process_information' table.&amp;nbsp; What database are using (Oracle, SQL Server, PostgreSQL,...)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's an example query on how to do this using SQL Server:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;delete from sde.SDE_process_information where start_time &amp;lt; (select getdate() - 1)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2012 17:45:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516405#M29280</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-04-02T17:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Kill only old connections</title>
      <link>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516406#M29281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That's what I was looking for.&amp;nbsp; I didn't know it was stored in an sde table.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2012 17:52:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516406#M29281</guid>
      <dc:creator>BrentHoskisson</dc:creator>
      <dc:date>2012-04-02T17:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Kill only old connections</title>
      <link>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516407#M29282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;It may be best to delete the entries from the 'sde.sde_process_information' table.&amp;nbsp; What database are using (Oracle, SQL Server, PostgreSQL,...)?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the tip, Jake.&amp;nbsp; I've been familiar with this table but didn't know if it was safe/acceptable to just delete rows for old connections or if I needed to go the sdemon -o kill route.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 11:15:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516407#M29282</guid>
      <dc:creator>MatthewRantala</dc:creator>
      <dc:date>2012-04-03T11:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: Kill only old connections</title>
      <link>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516408#M29283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks for the tip, Jake.&amp;nbsp; I've been familiar with this table but didn't know if it was safe/acceptable to just delete rows for old connections or if I needed to go the sdemon -o kill route.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What will happen if we delete an orphaned Direct Connect record in SDE.PROCESS_INFORMATION (Oracle 11gR2, ArcSDE 9.3.1 SP2)? Standard methods following an SDE_ID to a SERVER_ID to an OS process (RHEL 5) won't work because the server process is long gone. Various SDE lock tables reference the old SDE_ID. We don't have an ArcSDE application service so "sdemon" isn't likely to help. Again, there is no associated Oracle process running on the OS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a delete trigger for SDE.PROCESS_INFORMATION that will gracefully clean-up child records in various lock tables? Don't want to corrupt the ArcSDE repository. Or is bouncing the database a safe way to prune SDE.PROCESS_INFORMATION of orphaned connections when one's not running "sdemon."?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or would the following code, posted in 2005, still be valid and safe to run against an active ArcSDE 9.3.1 SP2 Oracle instance. Code taken from the following post:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=2&amp;amp;f=59&amp;amp;t=174046" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.esri.com/Thread.asp?c=2&amp;amp;f=59&amp;amp;t=174046&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;You can execute the following cleanup procedure to purge those rows if it is a concern (but the software will do it when it needs to anyhow) so you do NOT need to shutdown your ArcSDE instance - 

set SERVEROUTPUT ON 

DECLARE 

CURSOR process_list IS 
SELECT sde_id, owner, nodename FROM sde.process_information; 

lock_name VARCHAR2(30); 
lock_handle VARCHAR2(128); 
lock_status INTEGER; 
cnt INTEGER DEFAULT 0; 

BEGIN 

FOR check_locks IN process_list LOOP 

lock_name := 'SDE_Connection_ID#' || TO_CHAR (check_locks.sde_id); 
DBMS_LOCK.ALLOCATE_UNIQUE (lock_name,lock_handle); 
lock_status := DBMS_LOCK.REQUEST (lock_handle,DBMS_LOCK.X_MODE,0,TRUE); 

IF lock_status = 0 THEN 
DELETE FROM sde.process_information WHERE sde_id = check_locks.sde_id; 
DELETE FROM sde.state_locks WHERE sde_id = check_locks.sde_id; 
DELETE FROM sde.table_locks WHERE sde_id = check_locks.sde_id; 
DELETE FROM sde.object_locks WHERE sde_id = check_locks.sde_id; 
DELETE FROM sde.layer_locks WHERE sde_id = check_locks.sde_id; 
cnt := cnt + 1; 
dbms_output.put_line('Removed entry ('||check_locks.sde_id||'): '||check_locks.owner||'/'||check_locks.nodename||''); 
END IF; 

END LOOP; 

DELETE FROM sde.process_information WHERE sde_id NOT IN (SELECT sde_id FROM sde.process_information); 
DELETE FROM sde.state_locks WHERE sde_id NOT IN (SELECT sde_id FROM sde.process_information); 
DELETE FROM sde.table_locks WHERE sde_id NOT IN (SELECT sde_id FROM sde.process_information); 
DELETE FROM sde.object_locks WHERE sde_id NOT IN (SELECT sde_id FROM sde.process_information); 
DELETE FROM sde.layer_locks WHERE sde_id NOT IN (SELECT sde_id FROM sde.process_information); 

COMMIT; 

dbms_output.put_line('Removed '||cnt||' entries.'); 

END; 
/ 

This script is also beneficial for cleaning out the process_inforamation table.&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:32:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516408#M29283</guid>
      <dc:creator>danan</dc:creator>
      <dc:date>2021-12-11T22:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Kill only old connections</title>
      <link>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516409#M29284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've found that many of these orphans are created due to an ungraceful exit (bugs, application errors, ArcMap, ArcCatalog, ArcObjects, geoprocessor, network/power outage, etc).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I've found, first in personal geodatabases and later in SDE, is that the lock cannot be released until the owner (user on same machine) goes into the object and cleanly exits.&amp;nbsp;&amp;nbsp; (I'm not saying the other methods suggested don't work... trying to shed some light on cause and effect).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Performed the same workaround for SDE with such an orphaned lock.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, logged in via the same citrix virtual machine (took a while to get the correct one, as they are randomly selected!), connected as the appropriate user, then drilled down to one of the locked FCs in the dataset (all FCs within that DS were locked).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Exited ArcCatalog (this is the 'clean' or 'graceful' exit).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lock was released.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure this helps shed some light on how and what is actually being cleaned up (rows, sid/session/serial ids, etc).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Look forward to trying the sdemon kills and/or the appropriate row removal next time around.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 15:18:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516409#M29284</guid>
      <dc:creator>RayChilcote</dc:creator>
      <dc:date>2012-04-03T15:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Kill only old connections</title>
      <link>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516410#M29285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Unfortunately I had to remove the "answered".&amp;nbsp; While you can remove the database reference to the user and remove him from the list of "Sdemon -o info -I users".&amp;nbsp; Deleting the line from the database does NOT remove the GSRVR.EXE that the user is using.&amp;nbsp; Eventually you get enough of them and SDE refuses any more connections -- Even if it says you only have 12 users on the instance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry Jake, but your solution doesn't work.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Brent&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 11:39:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516410#M29285</guid>
      <dc:creator>BrentHoskisson</dc:creator>
      <dc:date>2012-04-11T11:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Kill only old connections</title>
      <link>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516411#M29286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Unfortunately I had to remove the "answered".&amp;nbsp; While you can remove the database reference to the user and remove him from the list of "Sdemon -o info -I users".&amp;nbsp; Deleting the line from the database does NOT remove the GSRVR.EXE that the user is using.&amp;nbsp; Eventually you get enough of them and SDE refuses any more connections -- Even if it says you only have 12 users on the instance.&lt;BR /&gt;&lt;BR /&gt;Sorry Jake, but your solution doesn't work.&amp;nbsp; &lt;BR /&gt;Brent&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Brent,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks like you are connecting to you SDE geodatabase using an ArcSDE service.&amp;nbsp; Have you considered using a &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/What_is_a_direct_connection_to_a_geodatabase_in_SQL_Server/002q00000035000000/"&gt;direct connection&lt;/A&gt;&lt;SPAN&gt;?&amp;nbsp; This is usually the recommended way to connect an SDE geodatabase.&amp;nbsp; Advantage:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;The direct-connect architecture moves ArcSDE functionality to the&amp;nbsp; desktop. This removes the ArcSDE load from the server and allows&amp;nbsp; additional resources to be freed up for the DBMS, which means you get&amp;nbsp; better scalability on the database server.&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Direct&amp;nbsp; connections can be faster if the server is heavily used, because&amp;nbsp; processing takes place on the client machine. Rather than having to&amp;nbsp; process the information on the server, which may be responding to&amp;nbsp; requests from numerous other users at the same time, and send the&amp;nbsp; information back to the client across the network, the client computer&amp;nbsp; is typically only processing a few tasks at a time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Direct Connections will also not spawn any GSRVRs.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you must use an ArcSDE service to connect to the geodatabase you should set the TCPKEEPALIVE parameter to TRUE.&amp;nbsp; Doing so will clean up any orphaned GSRVR processes.&amp;nbsp; Please see the following &lt;/SPAN&gt;&lt;A href="http://support.esri.com/en/knowledgebase/techarticles/detail/34233"&gt;KB article&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 10:02:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516411#M29286</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-04-16T10:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Kill only old connections</title>
      <link>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516412#M29287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Brent,&lt;BR /&gt;&lt;BR /&gt;It looks like you are connecting to you SDE geodatabase using an ArcSDE service.&amp;nbsp; Have you considered using a &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/What_is_a_direct_connection_to_a_geodatabase_in_SQL_Server/002q00000035000000/"&gt;direct connection&lt;/A&gt;?&amp;nbsp; This is usually the recommended way to connect an SDE geodatabase.&amp;nbsp; &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is an entirely different complaint.&amp;nbsp; But my users are only using ArcEngine Runtime.&amp;nbsp; Direct Connect doesn't work (apparently) except with ArcView or better.&amp;nbsp; So yes, I have tried it - doesn't work - oh well, I'm dealing with it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 12:51:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516412#M29287</guid>
      <dc:creator>BrentHoskisson</dc:creator>
      <dc:date>2012-04-16T12:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Kill only old connections</title>
      <link>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516413#M29288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would follow the KB article then, and set your TCPKEEPALIVE to TRUE.&amp;nbsp; Remember to restart the ArcSDE service for the changes to take affect.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 13:10:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516413#M29288</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-04-17T13:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Kill only old connections</title>
      <link>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516414#M29289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jake, does this mean that if we are using direct connects that your method of deleting old/orphan SID/SPID's at the SQL level is okay? We stop and restart our services every night and from what I can see of the processes, we have a bunch of orphans from yesterday out there in addition to the ones that started this morning. Will running this command clear those out? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2014 15:01:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/kill-only-old-connections/m-p/516414#M29289</guid>
      <dc:creator>JamesLandwehr</dc:creator>
      <dc:date>2014-10-31T15:01:27Z</dc:date>
    </item>
  </channel>
</rss>

