There are a few maintenance tasks that must be performed on a regular basis to help preserve the geodatabase and its existing performance levels. These tasks, which can be performed by either server administrators or geodatabase administrators, are described in the following sections.
Compress versioned geodatabases
The compress operation removes the states that are no longer referenced by a version and can move rows in the delta tables to the base table. For more information on what the compress operation does and why you would use it, see Geodatabase compression.
On database servers, a compress operation can only be performed by a server administrator or geodatabase administrator. You do not have access to the Compress Database function if you do not belong to one of these two roles.
- Log in as a server administrator or geodatabase administrator, start ArcMap, and open the Catalog window.
- Double-click the database server that contains the geodatabase you want to compress.
This connects you to the database server.
- Right-click the geodatabase you want to compress.
- Click Administration on the geodatabase shortcut menu and click Compress Database.
A progress bar appears while the compress operation is running. The bar advances until the operation is complete.
Update statistics
The SQL Server Query Optimizer uses database statistics to determine the distribution of values in an index. Over time, as the data is edited, the statistics no longer represent the true distribution of data in the indexes and tables. Therefore, if your database statistics are out-of-date, query performance can be negatively affected. Updating statistics after the tables and other data objects in the geodatabase have changed helps optimize query performance.
SQL Server Express is set to automatically update statistics by default, so you should only need to manually analyze and update after a large number of changes have been made to the geodatabase, such as after truncating and appending a large amount of data or running a compress operation.
Follow the steps to manually update statistics:
- Log in as a server administrator or geodatabase administrator, start ArcMap, and open the Catalog window.
- Double-click the database server that contains the geodatabase for which you want to update statistics.
This connects you to the database server.
- Right-click the geodatabase, click Administration, and click Geodatabase Maintenance.
- Check Analyze on the Geodatabase Maintenance dialog box.
- Click OK.
Rebuild indexes
After a large number of edits or a geodatabase compress operation, your indexes may become fragmented. This probably will not affect performance to any great extent in a desktop or workgroup geodatabase, but rebuilding indexes may give you a small performance boost.
Follow these steps to rebuild indexes in a desktop or workgroup geodatabase:
- Log in as a server administrator or geodatabase administrator, start ArcMap, and open the Catalog window.
- Double-click the database server that contains the geodatabase with the indexes you want to rebuild.
This connects you to the database server.
- Right-click the geodatabase, click Administration, and click Geodatabase Maintenance.
- Check Rebuild all indexes on the Geodatabase Maintenance dialog box.
- Click OK.
Shrink geodatabases
Over time, as data is deleted and added, the data files within your geodatabases may break into increasingly smaller, scattered fragments. This can cause performance degradation because queries have to scan an increasing number of separate files to access the data the first time it is queried or when it is updated. To correct this, you can shrink geodatabases stored in SQL Server Express. Shrinking the geodatabase rearranges how the database is stored on disk, reducing the size of the data files.
You should not need to shrink your geodatabases very often. In fact, doing so can be detrimental: a shrink operation can increase index fragmentation in the database.
In addition, if you find that the geodatabase size increases to its preshrunk state shortly after you shrink it, it means the space that you shrank is required for regular operations; therefore, the shrink operation was not needed. To determine the size of the database, right-click it, click Properties, and click the Administration tab. The size is shown in the General section.
If you find your geodatabase in SQL Server Express is getting close to its size limit of 10 GB, follow these steps to shrink the database and possibly gain some extra storage space.
- Log in as a server administrator or geodatabase administrator, start ArcMap, and open the Catalog window.
- Double-click the database server that contains the geodatabase you want to shrink.
This connects you to the database server.
- Right-click the geodatabase, click Administration, and click Geodatabase Maintenance.
- Check Shrink geodatabase on the Geodatabase Maintenance dialog box.
- Click OK.