<?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: ArcSDESQLExecute to delete sde.sde_versions table orphaned records in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483411#M45227</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/386769"&gt;@vijaybadugu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My apologies as I did not see previous post from Marcelo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will not see any SYNC versions using Pro GUI. These versions will not show. Expected behavior.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;As Marcelo stated, these versions should not be deleted until further investigation and confirmed that they can be deleted. Prior to deletion of any of these SYNC versions, take a backup.&lt;/STRONG&gt; These version will not appear in drop down using Delete Version GP tool, but the name can be typed in and will be deleted if conducted by the version owner.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Marlon&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jun 2024 18:22:30 GMT</pubDate>
    <dc:creator>MarlonAmaya</dc:creator>
    <dc:date>2024-06-03T18:22:30Z</dc:date>
    <item>
      <title>ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483238#M45214</link>
      <description>&lt;P&gt;I have already created few read-only offline maps for just read only purpose. When we create a offline maps, it does create replications in geodatabase. when users download the offline maps from devices, it does create a replica and few orphaned records got inserted in sde.sde_versions&amp;nbsp; table. the records are not being deleted even though we unregistered the replicas and deleted offline maps from the devices. in order to compress the database, we should delete orphaned records and unregister the replicas. I have already written a python job to automate this process.&amp;nbsp; I am able to unregister the replicas successfully without any issue, the problem is with deleting records from sde_versions table,&lt;/P&gt;&lt;P&gt;sde_conn = arcpy.ArcSDESQLExecute(gdb_conn)&lt;BR /&gt;sql_query = "DELETE FROM sde.sde_versions WHERE name LIKE 'SYNC_%'"&lt;BR /&gt;sde_conn.execute(sql_query)&lt;/P&gt;&lt;P&gt;even though the statement executed successfully, the records are still exists in the table. Please suggest on this to proceed further.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 14:30:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483238#M45214</guid>
      <dc:creator>vijaybadugu</dc:creator>
      <dc:date>2024-06-03T14:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483296#M45215</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/386769"&gt;@vijaybadugu&lt;/a&gt;&amp;nbsp;- you cannot delete records from the sde.sde_versions table directly because you will corrupt your geodatabase, a traditional version in the geodatabase is not just a record in the sde.sde_versions table, there are many other tables in the sde repository and the data that reference the version, to delete versions use&amp;nbsp;the GP Tool Delete Version.&lt;BR /&gt;&lt;BR /&gt;You can call the GP Tools from an arcpy python script.&lt;BR /&gt;&lt;BR /&gt;1.&amp;nbsp;GP Tool Unregister Replica.&lt;BR /&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/unregister-replica.htm" target="_blank"&gt;Unregister Replica (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;2. GP Tool Delete Version.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/delete-version.htm" target="_blank"&gt;Delete Version (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;3. After the versions are deleted, run the GP Tool Compress.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/compress.htm" target="_blank"&gt;Compress (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 15:58:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483296#M45215</guid>
      <dc:creator>MarceloMarques</dc:creator>
      <dc:date>2024-06-03T15:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483298#M45216</link>
      <description>&lt;P&gt;I tried delete version tool to remove the orphaned versions . It did not delete the orphaned records . It deletes only visible versions not hidden ones . I have no clue on this . I have been deleting records from sde_versions as suggested by esri technical team using delete sql statement using sql server . &amp;nbsp;now , I decided to automate the process&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 16:02:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483298#M45216</guid>
      <dc:creator>vijaybadugu</dc:creator>
      <dc:date>2024-06-03T16:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483305#M45217</link>
      <description>&lt;P&gt;It surprises me that Esri Technical Support suggested to delete records directly in the sde.sde_versions table, because is well known that any attempt to make changes directly in the arcsde repository tables can corrupt the geodatabase, I believe Esri Support should have diagnosed your workflow differently and perhaps logged a bug or asked for enhancement request if a solution could not be found using arcpy python scripts and GP tools.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 16:09:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483305#M45217</guid>
      <dc:creator>MarceloMarques</dc:creator>
      <dc:date>2024-06-03T16:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483306#M45218</link>
      <description>&lt;P&gt;Ok. I am able to unregister the replicas and I could not delete hidden records with delete version tool. Could you please suggest any other solution&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 16:11:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483306#M45218</guid>
      <dc:creator>vijaybadugu</dc:creator>
      <dc:date>2024-06-03T16:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483309#M45219</link>
      <description>&lt;P&gt;This sounds like a bug to me, as I never encountered issues, I was always able to unregister the replicas and delete the versions that were associated with the replicas. You might check if all users and services are disconnected prior to attempt to do these tasks.&lt;BR /&gt;&lt;BR /&gt;On the other hand, if the issue still persists then you will need to work with Esri Support and they will need a copy of your enterprise geodatabase to diagnose the problem, and try to reproduce the issue, then Esri Support can try to find a workaround and/or log a new bug and/or request an enhancement request.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 16:16:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483309#M45219</guid>
      <dc:creator>MarceloMarques</dc:creator>
      <dc:date>2024-06-03T16:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483313#M45220</link>
      <description>&lt;P&gt;I will try again using your suggestion before going to the support team. How to delete hidden SYNC versions associated with replica?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 16:22:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483313#M45220</guid>
      <dc:creator>vijaybadugu</dc:creator>
      <dc:date>2024-06-03T16:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483321#M45221</link>
      <description>&lt;P&gt;I connect with the sde user and I am able to see all the versions, then I am able to unregister the replicas, and then delete the versions that were associated with the replicas.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 16:24:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483321#M45221</guid>
      <dc:creator>MarceloMarques</dc:creator>
      <dc:date>2024-06-03T16:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483337#M45222</link>
      <description>&lt;P&gt;When i see in SQL Server sde_versions table ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vijaybadugu_0-1717432114270.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106011i654FB31F51439DC1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vijaybadugu_0-1717432114270.png" alt="vijaybadugu_0-1717432114270.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at the same time, I logged in as a SA user,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could not see any versions&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vijaybadugu_1-1717432165417.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106012i3A7FF7EF4139CBC1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vijaybadugu_1-1717432165417.png" alt="vijaybadugu_1-1717432165417.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 16:29:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483337#M45222</guid>
      <dc:creator>vijaybadugu</dc:creator>
      <dc:date>2024-06-03T16:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483341#M45223</link>
      <description>&lt;P&gt;If you logged as SA user, then this is the SQL Server Instance System Administrator, the SQL Server Geodatabase is not designed to work with the SA user.&lt;BR /&gt;&lt;BR /&gt;You must use ArcGIS to connect to the SQL Server Geodatabase using the SDE user, the owner of the ArcSDE Repository, which will be able to see all the versions and delete any versions, if you connect with the data owner user, then you will still see all versions but the data owner user will be able to delete only the versions that the data owner user created.&lt;BR /&gt;&lt;BR /&gt;You will not be able to delete a version if there are other users connected that might be using that version, hence make sure you disconnect all users and stop all ArcGIS Server services, then you can perform the unregister replica, and delete the versions associated with the replica, but you need to connect with the SDE user.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 16:40:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483341#M45223</guid>
      <dc:creator>MarceloMarques</dc:creator>
      <dc:date>2024-06-03T16:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483347#M45224</link>
      <description>&lt;P&gt;Although, I Connected with sde user , could not see those SYNC versions&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vijaybadugu_3-1717433308433.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106014iF3363CD224E1B8E9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vijaybadugu_3-1717433308433.png" alt="vijaybadugu_3-1717433308433.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 16:48:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483347#M45224</guid>
      <dc:creator>vijaybadugu</dc:creator>
      <dc:date>2024-06-03T16:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483403#M45226</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/386769"&gt;@vijaybadugu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Before we delete any SYNC version we have to make sure we confirm these are in fact orphaned to avoid any potential issues. Additionally, I would like to know why your sync versions are not being deleted even with unregistering the replicas.&lt;/P&gt;&lt;P&gt;How are you conducting the unregistering of replicas? Pro? Deletion of offline map?&lt;/P&gt;&lt;P&gt;You mention read only offline maps - are you indicating that the service is published with Query and SYNC only to support non editing desire in offline workflow?&amp;nbsp; Read-Only services do not create replica versions.&lt;/P&gt;&lt;P&gt;&lt;A href="https://enterprise.arcgis.com/en/server/latest/publish-services/windows/prepare-data-for-offline-use.htm" target="_blank" rel="noopener"&gt;https://enterprise.arcgis.com/en/server/latest/publish-services/windows/prepare-data-for-offline-use.htm#:~:text=When%20a%20read%2Donly%20ArcGIS%20Server%20feature%20service%20(only%20query%20and%20sync%20are%20enabled)%20contains%20versioned%20data%2C%20no%20replica%20version%20is%20created%20when%20you%20take%20the%20data%20offline.https://enterprise.arcgis.com/en/server/latest/publish-services/windows/prepare-data-for-offline-use.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Marlon&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 18:14:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483403#M45226</guid>
      <dc:creator>MarlonAmaya</dc:creator>
      <dc:date>2024-06-03T18:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483411#M45227</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/386769"&gt;@vijaybadugu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My apologies as I did not see previous post from Marcelo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will not see any SYNC versions using Pro GUI. These versions will not show. Expected behavior.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;As Marcelo stated, these versions should not be deleted until further investigation and confirmed that they can be deleted. Prior to deletion of any of these SYNC versions, take a backup.&lt;/STRONG&gt; These version will not appear in drop down using Delete Version GP tool, but the name can be typed in and will be deleted if conducted by the version owner.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Marlon&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 18:22:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483411#M45227</guid>
      <dc:creator>MarlonAmaya</dc:creator>
      <dc:date>2024-06-03T18:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483435#M45228</link>
      <description>&lt;P&gt;It is READ-ONLY with Query and Sync enabled feature service. Edits are being updated on daily basis at back office using pro. and to get the latest edits, field users must update the offline maps to sync with server data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 18:55:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483435#M45228</guid>
      <dc:creator>vijaybadugu</dc:creator>
      <dc:date>2024-06-03T18:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483436#M45229</link>
      <description>&lt;P&gt;In order to automate the process, I have to use&amp;nbsp;&lt;SPAN&gt;ArcSDESQLExecute to access sde.sde_versions table for owner and version name, then use&amp;nbsp; Delete Version tool to delete orphaned versions. Can I proceed with this approach ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 18:51:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483436#M45229</guid>
      <dc:creator>vijaybadugu</dc:creator>
      <dc:date>2024-06-03T18:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483451#M45231</link>
      <description>&lt;P&gt;I believe you can, that seems a feasible alternative, hope the Delete Version tool will remove those versions properly.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 18:59:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483451#M45231</guid>
      <dc:creator>MarceloMarques</dc:creator>
      <dc:date>2024-06-03T18:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute to delete sde.sde_versions table orphaned records</title>
      <link>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483454#M45232</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 19:00:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcsdesqlexecute-to-delete-sde-sde-versions-table/m-p/1483454#M45232</guid>
      <dc:creator>vijaybadugu</dc:creator>
      <dc:date>2024-06-03T19:00:02Z</dc:date>
    </item>
  </channel>
</rss>

