<?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 Any problems with shrinking enterprise geodatabase in SQL Server? in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/69572#M2677</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm getting charged per GB for SQL Server storage, so I have an incentive to use just as much storage as I need and no more.&amp;nbsp; There are enough GB involved to create an attractive benefit to using less storage.&amp;nbsp; I immediately think, "shrink the database."&amp;nbsp; Then I think, "uh oh."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I notice that the Esri help is silent on the subject:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ArcGIS Pro:&amp;nbsp;&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/help/data/geodatabases/manage-sql-server/enterprise-geodatabase-maintenance.htm" title="https://pro.arcgis.com/en/pro-app/help/data/geodatabases/manage-sql-server/enterprise-geodatabase-maintenance.htm"&gt;Enterprise geodatabase maintenance tasks—Manage geodatabases in SQL Server | Documentation&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;ArcMap:&amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/gdbs-in-sql-server/overview-maintenance.htm" title="https://desktop.arcgis.com/en/arcmap/latest/manage-data/gdbs-in-sql-server/overview-maintenance.htm"&gt;Geodatabase maintenance—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While the Microsoft help is not:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;SQL Server 2016:&amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="https://docs.microsoft.com/en-us/sql/relational-databases/databases/shrink-a-database?view=sql-server-2016" title="https://docs.microsoft.com/en-us/sql/relational-databases/databases/shrink-a-database?view=sql-server-2016"&gt;Shrink a Database - SQL Server | Microsoft Docs&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So...&amp;nbsp; have you ever done this successfully with an enterprise geodatabase in SQL Server?&amp;nbsp; Any gotchas, hints, suggestions, soothing sounds, pointing and laughing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Feb 2020 23:17:35 GMT</pubDate>
    <dc:creator>TimMinter</dc:creator>
    <dc:date>2020-02-06T23:17:35Z</dc:date>
    <item>
      <title>Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/69572#M2677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm getting charged per GB for SQL Server storage, so I have an incentive to use just as much storage as I need and no more.&amp;nbsp; There are enough GB involved to create an attractive benefit to using less storage.&amp;nbsp; I immediately think, "shrink the database."&amp;nbsp; Then I think, "uh oh."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I notice that the Esri help is silent on the subject:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ArcGIS Pro:&amp;nbsp;&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/help/data/geodatabases/manage-sql-server/enterprise-geodatabase-maintenance.htm" title="https://pro.arcgis.com/en/pro-app/help/data/geodatabases/manage-sql-server/enterprise-geodatabase-maintenance.htm"&gt;Enterprise geodatabase maintenance tasks—Manage geodatabases in SQL Server | Documentation&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;ArcMap:&amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/gdbs-in-sql-server/overview-maintenance.htm" title="https://desktop.arcgis.com/en/arcmap/latest/manage-data/gdbs-in-sql-server/overview-maintenance.htm"&gt;Geodatabase maintenance—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While the Microsoft help is not:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;SQL Server 2016:&amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="https://docs.microsoft.com/en-us/sql/relational-databases/databases/shrink-a-database?view=sql-server-2016" title="https://docs.microsoft.com/en-us/sql/relational-databases/databases/shrink-a-database?view=sql-server-2016"&gt;Shrink a Database - SQL Server | Microsoft Docs&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So...&amp;nbsp; have you ever done this successfully with an enterprise geodatabase in SQL Server?&amp;nbsp; Any gotchas, hints, suggestions, soothing sounds, pointing and laughing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2020 23:17:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/69572#M2677</guid>
      <dc:creator>TimMinter</dc:creator>
      <dc:date>2020-02-06T23:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/69573#M2678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello - I also have this same question. Wondering if you might have given it a try in SQL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a database with a large amount of imagery, and I noticed that when I deleted an image file from the GDB that the size of the Database did not change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am guessing there must be a way to shrink the size after deleting images...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any input!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2020 15:15:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/69573#M2678</guid>
      <dc:creator>LisaCasey</dc:creator>
      <dc:date>2020-09-03T15:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/69574#M2679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lisa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nope, no progress.&amp;nbsp; I got all tangled up in COVID-19 support for our agency, and am only fully back to my day job now.&amp;nbsp; Actually, this item dropped through the cracks, and I need to get back around to it.&amp;nbsp; I think I have some kind of trashy databases lying around that I can test on without concern.&amp;nbsp; Thanks for the reminder &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;.&amp;nbsp; I'll post my results here when I have some.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 22:46:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/69574#M2679</guid>
      <dc:creator>TimMinter</dc:creator>
      <dc:date>2020-09-04T22:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1011597#M29171</link>
      <description>&lt;P&gt;Ok, I got back around to it.&amp;nbsp; I made a backup of an example database in my sandbox environment, then followed the guidance in the linked SQL Server documentation above to shrink it.&amp;nbsp; It dropped from ~188 GB to ~10 GB instantly.&amp;nbsp; It's a 10.8.1.2.6 enterprise geodatabase schema, so I added all content to an ArcGIS Pro 2.6.3 map and rendered it.&amp;nbsp; Some spot checks suggest it's working fine.&amp;nbsp; I did not get into any deeper testing that might reveal subtle problems, but I kind of don't expect any.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;tim, OCIII&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 22:11:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1011597#M29171</guid>
      <dc:creator>TimMinter</dc:creator>
      <dc:date>2020-12-21T22:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1129296#M32141</link>
      <description>&lt;P&gt;How long did it take to run the database shrink?&amp;nbsp; Did you also rebuild the index on the file after the shrink?&amp;nbsp; Thanks for this post!!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 22:24:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1129296#M32141</guid>
      <dc:creator>jsarthur</dc:creator>
      <dc:date>2021-12-28T22:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1129300#M32142</link>
      <description>&lt;P&gt;Generally speaking, doing this with an Enterprise database is a huge no-no.&amp;nbsp; While the process used does accomplish what you are looking to achieve, you're going to cause performance issues with larger and more heavily used databases by doing this.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 22:33:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1129300#M32142</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2021-12-28T22:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1137396#M32286</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/224308"&gt;@John_Spence&lt;/a&gt;&amp;nbsp;- Are there any other ways around this problem that you may know of?&amp;nbsp; Our database is similar to&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/44001"&gt;@TimMinter&lt;/a&gt;&amp;nbsp;'s in size and we are up against the same problem.&amp;nbsp; I'm having other database maintenance tasks issues come up that are a result of the size issue.&amp;nbsp; I'm tempted to go ahead with a shrink since it worked for Tim.&amp;nbsp; Tim, did you end up ever seeing any problems arise from the shrink process?&amp;nbsp; And did you end up rebuilding the index?&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 15:08:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1137396#M32286</guid>
      <dc:creator>jsarthur</dc:creator>
      <dc:date>2022-01-26T15:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1137406#M32287</link>
      <description>&lt;P&gt;There could be other reasons for the issue you are seeing, such as the metadata from geoprocessing. Have you cleared that up?&amp;nbsp;&lt;A href="https://support.esri.com/en/technical-article/000011751" target="_blank"&gt;https://support.esri.com/en/technical-article/000011751&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Are you sure it is the size of the database that is the problem vs. the log file size? Log files can be shrunk without significant concern, but you'll need to switch the database to simple first.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you really really have no other option, you can shrink by releasing unused space after you compress the database (via catalog DB Admin tools). At that point, you have done all you can short of doing the unthinkable.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 15:21:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1137406#M32287</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2022-01-26T15:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1137412#M32288</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/224308"&gt;@John_Spence&lt;/a&gt;!! That's very helpful info.&amp;nbsp; I'll check those things out first.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 15:26:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1137412#M32288</guid>
      <dc:creator>jsarthur</dc:creator>
      <dc:date>2022-01-26T15:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1137419#M32289</link>
      <description>&lt;P&gt;w/ the log file look at releasing the space from the file .&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 15:30:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1137419#M32289</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2022-01-26T15:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1140823#M32349</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/224308"&gt;@John_Spence&lt;/a&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/443882"&gt;@jsarthur&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Good discussion above.&amp;nbsp; Under my standing "I really don't know anything" principle, I'd like to know more about the hugeness of the shrinking eGDB no-no.&amp;nbsp; If you can point me at some help documentation, technical articles, blogs, etc. that might be easiest.&amp;nbsp;&amp;nbsp;Just chiming in with a few items:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Usage - Vector feature classes, tables, relationship classes, feature datasets, time-enabled data, that sort of thing.&amp;nbsp; No or nearly no raster or other data types in the big (-ish) databases.&amp;nbsp; Relative to other data collections I've helped manage during my career, I don't consider these databases to be "heavily used" from the perspective of total number of requests over time and concurrent connections.&amp;nbsp; They are used enough that performance problems are noticed and communicated.&lt;/LI&gt;&lt;LI&gt;Recovery model - 'Simple' for the databases we need to shrink.&amp;nbsp; We mostly use these as OLAP databases and just don't care about the logs much at all.&lt;/LI&gt;&lt;LI&gt;Performance - ArcGIS Pro PerfTools suggests that things are going about as well as can be expected for object-relational handling of the data given our computing environment resources (storage, db servers, network, etc.).&amp;nbsp; We haven't noticed any unexpected negative performance effects related to shrinking the database.&amp;nbsp; During larger data loading activities, we expect and experience some performance hit as auto-grow does its thing.&amp;nbsp; This touches on why we shrink - one update we do loads ~600 million records as 'new' tables and feature classes, builds indexes, statistics, etc. over a fairly long time stretch.&amp;nbsp; In order to minimize availability impact to staff and systems, we switch out the 'old' with 'new' during a brief maintenance window, ensure everything is working as expected, then delete the 'old' object.&amp;nbsp; That leaves a bunch of unused storage that unnecessarily costs us money until the next update.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Maintenance - Yes, we regularly rebuild indexes, analyze, compress, etc. as needed.&amp;nbsp; We have a lot of truncate/append or simply append ETL activity as we move record updates into static schema in the eGDB.&lt;/LI&gt;&lt;LI&gt;Metadata - Nice.&amp;nbsp; We've started to configure ArcGIS to not store GP processing history in the metadata, but not consistently across all machines that do the work.&amp;nbsp; Thanks for the link to that article.&amp;nbsp; We'll investigate to see about a cleanup and keep getting our house in order.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;tim&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 16:53:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1140823#M32349</guid>
      <dc:creator>TimMinter</dc:creator>
      <dc:date>2022-02-04T16:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1140852#M32350</link>
      <description>&lt;P&gt;Good morning Tim,&lt;/P&gt;&lt;P&gt;Caught me at a good time lamenting my choice of which Crypto asset to get into. LOL.&lt;/P&gt;&lt;P&gt;Give me a call when you get a sec (noticed you are local). Details are in your LinkedIn messaging.&lt;/P&gt;&lt;P&gt;Well the scale and scope of what you are dealing with does change the discussion a bit. From the sounds of it, you are working in a cloud situation too which makes things all that much more fun.&lt;/P&gt;&lt;P&gt;600M record changeouts, YES, please by all means shrink that database. You really cannot afford to do otherwise due to the volume of data movement. Take care to rebuild all indexes when you are complete though as that volume of movement and shrinkage will have a impact on the indexes. The below query will rebuild the indexes for the entire database for you afterwards without having to go one or using the standard tools for Esri (python or toolbox).&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;DECLARE @Database NVARCHAR(255)&lt;BR /&gt;DECLARE @Table NVARCHAR(255)&lt;BR /&gt;DECLARE @cmd NVARCHAR(1000)&lt;/P&gt;&lt;P&gt;DECLARE DatabaseCursor CURSOR READ_ONLY FOR&lt;BR /&gt;SELECT name FROM master.sys.databases&lt;BR /&gt;--WHERE name NOT IN ('master','msdb','tempdb','model','distribution') -- databases to exclude&lt;BR /&gt;WHERE name IN ('Carta') -- use this to select specific databases and comment out line above&lt;BR /&gt;AND state = 0 -- database is online&lt;BR /&gt;AND is_in_standby = 0 -- database is not read only for log shipping&lt;BR /&gt;ORDER BY 1&lt;/P&gt;&lt;P&gt;OPEN DatabaseCursor&lt;/P&gt;&lt;P&gt;FETCH NEXT FROM DatabaseCursor INTO @Database&lt;BR /&gt;WHILE @@FETCH_STATUS = 0&lt;BR /&gt;BEGIN&lt;/P&gt;&lt;P&gt;SET @cmd = 'DECLARE TableCursor CURSOR READ_ONLY FOR SELECT ''['' + table_catalog + ''].['' + table_schema + ''].['' +&lt;BR /&gt;table_name + '']'' as tableName FROM [' + @Database + '].INFORMATION_SCHEMA.TABLES WHERE table_type = ''BASE TABLE'''&lt;/P&gt;&lt;P&gt;-- create table cursor&lt;BR /&gt;EXEC (@cmd)&lt;BR /&gt;OPEN TableCursor&lt;/P&gt;&lt;P&gt;FETCH NEXT FROM TableCursor INTO @Table&lt;BR /&gt;WHILE @@FETCH_STATUS = 0&lt;BR /&gt;BEGIN&lt;BR /&gt;BEGIN TRY&lt;BR /&gt;SET @cmd = 'ALTER INDEX ALL ON ' + @Table + ' REBUILD'&lt;BR /&gt;--PRINT @cmd -- uncomment if you want to see commands&lt;BR /&gt;EXEC (@cmd)&lt;BR /&gt;END TRY&lt;BR /&gt;BEGIN CATCH&lt;BR /&gt;PRINT '---'&lt;BR /&gt;PRINT @cmd&lt;BR /&gt;PRINT ERROR_MESSAGE()&lt;BR /&gt;PRINT '---'&lt;BR /&gt;END CATCH&lt;/P&gt;&lt;P&gt;FETCH NEXT FROM TableCursor INTO @Table&lt;BR /&gt;END&lt;/P&gt;&lt;P&gt;CLOSE TableCursor&lt;BR /&gt;DEALLOCATE TableCursor&lt;/P&gt;&lt;P&gt;FETCH NEXT FROM DatabaseCursor INTO @Database&lt;BR /&gt;END&lt;BR /&gt;CLOSE DatabaseCursor&lt;BR /&gt;DEALLOCATE DatabaseCursor&lt;/P&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Shrinking that database, here is the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/database-servers/maintain-geodatabase-performance.htm#ESRI_SECTION1_25D462D207AA42EFB3DAFD403B4387A6" target="_blank" rel="noopener"&gt;right spot&lt;/A&gt;&lt;/STRONG&gt;&lt;/EM&gt; to read about it though it does only speak to SQL Server Express, the rules apply.&lt;/P&gt;&lt;P&gt;As your databases are for OLAP typically, have you considered using data warehousing options like Snowflake, etc? Pro has some options for that now and you would get a significant performance improvement from making that switchover.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="John_Spence_0-1643996202010.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33161iAA87E319E6EBA61C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="John_Spence_0-1643996202010.png" alt="John_Spence_0-1643996202010.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 17:38:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1140852#M32350</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2022-02-04T17:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1256482#M35090</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/224308"&gt;@John_Spence&lt;/a&gt;, are you saying there's a geoprocessing tool to release unused space from within the Esri ecosystem, or are you saying to compress the DB and immediately shrink using the tools in SQL Server administrator?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 14:22:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1256482#M35090</guid>
      <dc:creator>JCGuarneri</dc:creator>
      <dc:date>2023-02-09T14:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1256490#M35092</link>
      <description>&lt;P&gt;Do not shrink the DB using the SQL Server admin tools or commands. You will cause yourself more headache than it is worth. Performance problems with your DB is usually due bad indexes &amp;amp; stats or garbage in the metadata or configuration issues or not using best practices in some form or shape. Obviously, all things we all (generally) deal with on a day to day basis.&lt;/P&gt;&lt;P&gt;If you are running into issues, I would...&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Check your how versioning&amp;nbsp;is working for you. Make sure you are at state 0 if possible, that is if you are using traditional versioning. Branched versioning adds its own special flavor to the sauce which makes it more difficult to unravel (it essentially acts like archiving, but different).&lt;/LI&gt;&lt;LI&gt;Rebuild your stats and indexes.&lt;/LI&gt;&lt;LI&gt;Delete geoprocessing history (&lt;A href="https://support.esri.com/en/technical-article/000027149" target="_blank" rel="noopener"&gt;https://support.esri.com/en/technical-article/000027149&lt;/A&gt;). You would be surprised how much this can gunk up operations.&lt;/LI&gt;&lt;LI&gt;If you are SQL Server, check if you are on full or simple recovery model. If full, you may need to check your log file size and handle that.&lt;/LI&gt;&lt;LI&gt;Shrink your database -&amp;nbsp;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/database-servers/maintain-geodatabase-performance.htm#ESRI_SECTION1_25D462D207AA42EFB3DAFD403B4387A6" target="_self"&gt;Use this&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;And then there are other database configuration options, etc.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 14:38:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1256490#M35092</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2023-02-09T14:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1256503#M35093</link>
      <description>&lt;P&gt;Thank you for clarifying.&lt;/P&gt;&lt;P&gt;It sounds like I might have to contact Esri tech support to find a path forward. The DB gets compressed and reindexed every morning, I don't record GP history on all my regular scripts (and I delete it periodically just to be sure), and the log file isn't too scary. My big culprit is an archive class that I don't need (but exists anyway because the table is related to a FC that does need archiving). That archive class had ballooned to 140 GB. I deleted it the other day, but the DB is still tying up all that space. The Shrink workflow you link to seems to only apply to SQL Server Express, as I can't find equivalent tools for my SQL Server data connnections.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 14:51:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1256503#M35093</guid>
      <dc:creator>JCGuarneri</dc:creator>
      <dc:date>2023-02-09T14:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1256519#M35095</link>
      <description>&lt;P&gt;Oh geez! You're right on the nose there. My bad.&lt;/P&gt;&lt;P&gt;I have a similar situation on my end with regards to archiving. I just dealt with it by disabling the relate (during maintenance) and dropping the archiving and then turning it back on followed by a rebuild of the relationship. Cleans it up, keeps it smaller (long term).&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 15:34:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1256519#M35095</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2023-02-09T15:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1256570#M35097</link>
      <description>&lt;P&gt;We have had no problems using native sql shrink (if needed).&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 17:03:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1256570#M35097</guid>
      <dc:creator>BillFox</dc:creator>
      <dc:date>2023-02-09T17:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Any problems with shrinking enterprise geodatabase in SQL Server?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1256595#M35099</link>
      <description>&lt;P&gt;No worries! If I'm understanding correctly you do the following:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;remove relationship class and archiving&lt;/LI&gt;&lt;LI&gt;compress/index db&lt;/LI&gt;&lt;LI&gt;set the relationship class back up&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;and this gets rid of the unused space?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 17:40:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/any-problems-with-shrinking-enterprise-geodatabase/m-p/1256595#M35099</guid>
      <dc:creator>JCGuarneri</dc:creator>
      <dc:date>2023-02-09T17:40:54Z</dc:date>
    </item>
  </channel>
</rss>

