Compact a mobile geodatabase

Compacting a frequently edited mobile geodatabase cleans up storage and unused space while also reducing it in size.

A mobile geodatabase (.geodatabase) is stored in an SQLite relational database and contains multiple tables in a single file on disk.

As you add data to or remove data from a mobile geodatabase over time, unused data blocks develop in the database pages, leading to tables and indexes in the database file becoming fragmented and less efficient. This can result in slower performance when you query the geodatabase.

To correct this, compact the mobile geodatabase using the Compact geoprocessing tool. The ArcGIS Compact tool runs the SQLite vacuum function.

If you frequently add and delete data, you should compact your mobile geodatabase on a monthly basis. You should also compact a geodatabase after any large-scale change. Compacting cleans up storage by reordering records and eliminating unused space. After compacting, the data in the mobile geodatabase can be accessed more efficiently. Compacting also reduces the size of the mobile geodatabase file. Depending on the number of edits made to the data in the mobile geodatabase since it was last compacted, it's possible to reduce the size of a mobile geodatabase file by one-half or more.

To compact a mobile geodatabase, choose one of the following:

  • Run the Compact geoprocessing tool.
  • Enable Compact on the Database Properties dialog box. (See the steps below.)
Note:

A database that is open in ArcGIS AllSource for editing cannot be compacted. To compact the database, remove any layers with a source table or feature class in that database from the Contents pane.

Follow these steps to compact a mobile geodatabase in ArcGIS AllSource on the Database Properties dialog box:

  1. Start ArcGIS AllSource and open the Catalog pane, if necessary.
  2. In the Catalog pane, do one of the following:
    • Expand the Databases folder, and right-click the mobile geodatabase.
    • Expand Folders, navigate to the mobile geodatabase, and right-click the mobile geodatabase.
  3. In the context menu, click Properties.

    The Database Properties dialog box appears.

  4. Click the Manage tab, check the box next to Compact, and click OK.

    The Compact geoprocessing tool runs on the mobile geodatabase.