Compressing the ArcSDE geodatabase

Compressing the ArcSDE geodatabase pushes records from the Adds & Deletes tables to the base table.
Over time, an actively edited geodatabase will accumulate unreferenced rows in its delta tables and a deep state tree, both of which can negatively impact performance. Occasionally, depending on the volume of edits, the ArcSDE administrator must compress the geodatabase to remove the unreferenced rows and reduce the depth of the state tree. Compressing never removes data that can be accessed through any version’s lineage and will not harm your geodatabase; it exclusively cleans up unused data.

If you are finding that there are still records in the A & D tables after running the SDE compress, please try the following steps before performing the compress operation again:
1) Reconcile and Post all outstanding changes in child versions to Default.
2) Sometimes it helps to delete the child versions, and have it re-created after a full compress is achieved.
3) Synchronize all Replicas. Remove (unregister) any replicas that are no longer being used.
4) Ensure no users are connected.
• Stop the SOC and SOM services (which in turn should stop any map services referencing the ArcSDE data).
• Stop the map services via ArcCatalog or ArcGIS Server Manager.
• Check if there are any users still connected by running the sdemon -o info -I users
• Run the sdemon -o kill -t all command to disconnect all connections.

sdemon -o kill -t <{ all | pid }> [-p <ArcSDE_admin_password>] [-N]
{[-i <service> | <port#> | <direct_connect_info>]
{[-s <server_name>] | [-H <sde_directory>]}
[-u <user_name>] [-p <user_password>] [-D <database_name>]

5) Try Compressing again.
• The compress command is best performed at night when there are fewer chances of other users being connected to the ArcSDE.
• Run the sdeversion -o compress command using the ArcSDE administrator user

sdeversion -o compress [-N] -u <ArcSDE_Admin_user_name> [-p <ArcSDE_Admin_user_password>] [-q] [-i <service> | <port#> | <direct connection>] [-s <server_name>] [-D <database_name>]

• Check that the states has been trimmed or check the A and D tables to ensure that there are no entries in there, which should tick all the boxes that the full compress was successful.

Tania T.

2 thoughts on “Compressing the ArcSDE geodatabase

  1. Mary Ann raymundo

    Hi Tania

    What do you mean by A and D tables? Do you mean Aspatial and Direct connections? By checking the tables, do you mean running the sdemon -o info -I users command?

    1. Tania T Post author

      Hi Mary Ann

      The A & D tables refers to the Adds and Deletes tables. These are additional tables that are created in the sde database, when you register a dataset as versioned (Register as Versioned). These tables keep track of any inserts, deletes and update operations performed on the data. In the sde database, these A & D tables are appended with an ID (Eg. A16 & D16), which relates to the RegistrationID for the corresponding layer/dataset in the SDE_TABLE_REGISTRY table.

      By checking the tables, I am referring to manually checking/querying the Adds & Deletes tables in the sde database, via SQL Server or Oracle.
      If you do not have access to your DBMS (SQL server or Oracle), another useful desktop tool that you can use to view the number of rows in the Adds and Deletes tables – is the Geodatabase Toolset for ArcCatalog. This is a tool that is downloadable from the ArcGIS Resources site – I would highly recommend installing this tool.

      Tania T.


Got something to say?

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s