Exercise 10: Compress a geodatabase and rebuild indexes and statistics
This topic applies to ArcGIS for Desktop Standard and ArcGIS for Desktop Advanced only.
Compressing the geodatabase removes the states that are no longer referenced by a version and moves rows in the delta tables to the business table. Moving the edits from the delta to the business table means queries on the dataset will take less time because the query has to look at only one table instead of querying three tables. The more records there are in the delta tables, the more important it becomes to move the records from the delta tables to the business table.
Both editing and compressing the geodatabase can fragment indexes and cause database statistics to become stale, so you should rebuild indexes and update statistics after a large amount of editing is done and after you compress the geodatabase.
In this exercise, you will log in as the Osokopf geodatabase administrator, manager1; delete the unneeded version; compress the geodatabase; and rebuild its indexes and statistics.
Connecting as a geodatabase administrator
Log into the computer using the manager1 login.
As mentioned previously in this tutorial, how you do this depends on your operating system. On most Windows operating systems, you can switch users. On Windows XP, log off then log in again as manager1.
Deleting the railroadv1 version
Since all edits were reconciled and posted back to the DEFAULT version, the railroadv1 version is no longer needed. Therefore, you can delete it, allowing the geodatabase to fully compress.
- Start ArcMap, open the Catalog window, then expand the Database Servers folder in the Catalog tree.
- Double-click the database server to connect to it and double-click the Osokopf geodatabase to connect to the geodatabase.
Right-click the Osokopf geodatabase, point to Administration, then click Administer Geodatabase.
The Geodatabase Administration dialog box opens.
- On the Versions tab, right-click the railroadv1 version and click Delete Version.
- When prompted to confirm that you want to delete the railroadv1 version, click OK.
- Close the Geodatabase Administration dialog box.
Compressing the geodatabase
Compress the Osokopf geodatabase to move the edits made to the railroads feature class from the delta tables to the business table and remove unnecessary states from the lineage.
- Right-click the Osokopf geodatabase, point to Administration, then click Compress Database.
- When prompted to confirm the compress operation, click Yes.
Making sure the compress operation was successful
You can find out whether the compress operation was successful and see the last time a compress operation was performed on a geodatabase by checking the geodatabase properties.
- Right-click the Osokopf geodatabase and click Properties.
- Click the Administration tab.
- Review the last compress date/time and status in the Compress section. Be sure the date and time correspond to when you performed the compress and that the status is SUCCESS.
- Click OK.
Rebuilding indexes and updating database statistics
Editing the data and compressing the geodatabase can cause indexes to be fragmented and database statistics to be out-of-date. The owners of the datasets could rebuild indexes and update database statistics for each individual dataset using the Rebuild Indexes and Analyze Datasets geoprocessing tools, respectively. When using geodatabases on database servers, though, you can also rebuild all indexes and update database statistics in the geodatabase using the Rebuild all indexes option on the Geodatabase Maintenance dialog box. (This option also updates database statistics.)
After edits are performed and the geodatabase is compressed, you should rebuild indexes and update database statistics. The following steps do this for the Osokopf geodatabase:
- Right-click the Osokopf geodatabase, point to Administration, then click Geodatabase Maintenance.
- Choose Rebuild all indexes.
- Click OK.
You logged in as a geodatabase administrator, deleted the railroadv1 version, compressed the Osokopf geodatabase, and rebuilt indexes and statistics in the geodatabase.