<?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: How to find locks preventing a specific version from being deleted within SDE tab in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/how-to-find-locks-preventing-a-specific-version/m-p/1053021#M43298</link>
    <description>&lt;P&gt;Hi Jake, I have a Python script that for years worked fine in SDE 10.0. It deletes a version owned by SDE if it exists and then re-creates it (it's a child of another user's version). It then posts it to SDE.DEFAULT. Now we are at 10.8.1 for the enterprise GDB (Oracle 19c). The Python script now fails on the delete version step, saying there is a lock by user SDE. How do I get past this? Interestingly, I CAN delete the SDE-owned version from the Administer GDB GUI, but not using ArcPy either in a script or in the Python window in ArcCatalog. I clicked on your link above for the script for reconciling/posting versions but it just goes to &lt;A href="https://community.esri.com/" target="_blank"&gt;https://community.esri.com/&lt;/A&gt;. Is the one at &lt;A href="https://community.esri.com/t5/python-questions/using-a-python-script-to-reconcile-and-post/td-p/352748/page/2" target="_blank"&gt;https://community.esri.com/t5/python-questions/using-a-python-script-to-reconcile-and-post/td-p/352748/page/2&lt;/A&gt; applicable? Any help would be appreciated. Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Apr 2021 23:37:02 GMT</pubDate>
    <dc:creator>MichaelTrust</dc:creator>
    <dc:date>2021-04-29T23:37:02Z</dc:date>
    <item>
      <title>How to find locks preventing a specific version from being deleted within SDE tables?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-locks-preventing-a-specific-version/m-p/480129#M27354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If a specific version cannot be deleted because it has locks on it, Is there a way to identify the sde process that is causing the lock using PL/SQL to inspect the table_locks, object_locks, and process_information tables within SDE?&amp;nbsp; I can't seem to find the right joins to tie a specific version to a lock.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I often ask this question of our DB admin's and their response is usually to just to kill all the connections or restart SDE.&amp;nbsp; I'd rather prevent kicking everyone off if I can.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think the sde demon tools have something like this, but I am not the server administrator and don't have access to the box.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 00:16:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-locks-preventing-a-specific-version/m-p/480129#M27354</guid>
      <dc:creator>AndrewRudin</dc:creator>
      <dc:date>2011-07-29T00:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to find locks preventing a specific version from being deleted within SDE tab</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-locks-preventing-a-specific-version/m-p/480130#M27355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;forgot to mention, our SDE is 9.3.1 SP2, Oracle11g&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 00:17:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-locks-preventing-a-specific-version/m-p/480130#M27355</guid>
      <dc:creator>AndrewRudin</dc:creator>
      <dc:date>2011-07-29T00:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to find locks preventing a specific version from being deleted within SDE tab</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-locks-preventing-a-specific-version/m-p/480131#M27356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If a user is accessing a version there should be a state lock.&amp;nbsp; You can query the version table for the version that is locked:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SQL&amp;gt; select state_id from sde.versions where name = 'Child_Version'

1864&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you can query the state locks table to get to the sde_id of the user:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SQL&amp;gt; select sde_id from sde.state_locks where state_id = '1864'

4371&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Next, you can query the process information table to get the user's name:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SQL&amp;gt; select owner from sde.process_information where sde_id = '4371'

VECTOR&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can request this user to disconnect, or you can use the 'sdemon -o kill' command to kill this specific user:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;C:\&amp;gt; sdemon -o kill -t 4371 -i sde:oracle11g&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:11:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-locks-preventing-a-specific-version/m-p/480131#M27356</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T21:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to find locks preventing a specific version from being deleted within SDE tab</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-locks-preventing-a-specific-version/m-p/480132#M27357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks.&amp;nbsp; I guess there isn't a special lock for when someone is editing versus just viewing a version.&amp;nbsp; So if anyone is viewing data in a version, it can't be deleted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also run a python script every night to reconcile all our editing versions with DEFAULT.&amp;nbsp; Sometimes people leave their edit sessions open and the reconcile tool returns an error about the edit session being open.&amp;nbsp; This prevents us from getting a good compress, so I need to figure out how to identify these sessions and kill them before I run my script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 14:29:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-locks-preventing-a-specific-version/m-p/480132#M27357</guid>
      <dc:creator>AndrewRudin</dc:creator>
      <dc:date>2011-08-05T14:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to find locks preventing a specific version from being deleted within SDE tab</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-locks-preventing-a-specific-version/m-p/480133#M27358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you are running a python script to perform the reconcile/post/compress you will want to make sure no users are connected to the database.&amp;nbsp; A connection acquires a state lock and a locked state cannot be compressed.&amp;nbsp; You may want to consider using the 'sdemon -o kill -t all' command to kill all connected users so you can perform the compress successfully.&amp;nbsp; Also, there is a great script &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/26052-Reconcile-and-Post-script-for-ArcGIS10-ArcGIS-server-10?highlight=python+reconcile+post"&gt;here&lt;/A&gt;&lt;SPAN&gt; for reconciling/posting versions.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2011 13:15:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-locks-preventing-a-specific-version/m-p/480133#M27358</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2011-08-08T13:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to find locks preventing a specific version from being deleted within SDE tab</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-locks-preventing-a-specific-version/m-p/1053021#M43298</link>
      <description>&lt;P&gt;Hi Jake, I have a Python script that for years worked fine in SDE 10.0. It deletes a version owned by SDE if it exists and then re-creates it (it's a child of another user's version). It then posts it to SDE.DEFAULT. Now we are at 10.8.1 for the enterprise GDB (Oracle 19c). The Python script now fails on the delete version step, saying there is a lock by user SDE. How do I get past this? Interestingly, I CAN delete the SDE-owned version from the Administer GDB GUI, but not using ArcPy either in a script or in the Python window in ArcCatalog. I clicked on your link above for the script for reconciling/posting versions but it just goes to &lt;A href="https://community.esri.com/" target="_blank"&gt;https://community.esri.com/&lt;/A&gt;. Is the one at &lt;A href="https://community.esri.com/t5/python-questions/using-a-python-script-to-reconcile-and-post/td-p/352748/page/2" target="_blank"&gt;https://community.esri.com/t5/python-questions/using-a-python-script-to-reconcile-and-post/td-p/352748/page/2&lt;/A&gt; applicable? Any help would be appreciated. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 23:37:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-locks-preventing-a-specific-version/m-p/1053021#M43298</guid>
      <dc:creator>MichaelTrust</dc:creator>
      <dc:date>2021-04-29T23:37:02Z</dc:date>
    </item>
  </channel>
</rss>

