Compress Geodatabase

136
0
2 weeks ago

Compress Geodatabase

To maintain optimal performance for a traditionally versioned geodatabase, it's a best practice to compress your geodatabase on a regular basis.  To achieve a full compress to state 0, it's necessary to remove all locks from the geodatabase. Locks can be created from users accessing the geodatabase
in desktop applications, such as ArcGIS Pro, and from ArcGIS Server services that are referencing data from the geodatabase.

This script will stop ArcGIS Server services that are currently running, disconnect all users from the geodatabase, block further connections to the geodatabase, reconcile/post all versions, and compress the geodatabase. After the geodatabase is compressed, the script will rebuild indexes and recalculate stats on versioned feature classes, and then finally restart the previous running services.

Additionally, the script will output a CSV file showing the before and after counts of the A & D tables, also known as the Delta tables. This will allow you to easily see if the versioned feature classes have been compressed. Also, the script will report the before and after state id of the geodatabase.

Some optional parameters within the script include sending e-mail notifications. If the script executes successfully, an e-mail will be sent attaching the CSV file of the delta table counts, and a message of the before and after state id.  If an error occurs, an e-mail will be sent including a log file reporting the error and the line within the script that caused the error.

A quick note, all geodatabase replicas should be synced before this script is executed

Video of workflow:

Attachments
Version history
Last update:
2 weeks ago
Updated by:
Contributors