Exercise 9: Compress the Osokopf geodatabase, rebuild indexes, and shrink the geodatabase while logged in as a geodatabase administrator

This topic applies to ArcEditor and ArcInfo only.

Complexity: Beginner Data Requirement: ArcGIS Tutorial Data Setup Goal: Log in as a geodatabase administrator, compress a geodatabase, rebuild indexes on the data, and shrink the geodatabase.

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 only has to look at 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, so you should rebuild indexes after a large amount of editing is done and after you compress the geodatabase.

Adding and deleting data from a database can also cause some fragmentation. On rare occasions, you might need to shrink a geodatabase to eliminate some of this fragmentation and reclaim unused space in the database.

In this exercise, you will log in as the Osokopf geodatabase administrator, manager1, delete the unneeded version, compress the geodatabase, and rebuild its indexes. Finally, you will shrink the geodatabase to see if it yields any additional free space on disk.

Connecting as a geodatabase administrator

Log off the computer and log back in using the manager1 login.

Steps:
  1. Click the Start button on the Windows task bar and click Log off.
  2. If prompted, confirm you want to log off by clicking Log Off on the Log Off Windows dialog box.
  3. When the login dialog box appears, change the user name to manager1.
  4. Type manager.1 in the Password text box.
  5. Choose your computer name (if connecting as a local user) or your domain name from the Log on to drop-down list.

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.

Steps:
  1. Start ArcMap, open the Catalog window, then expand the Database Servers node in the Catalog tree.
  2. Right-click the Osokopf geodatabase and click Versions.
  3. Right-click the railroadv1 version and click Delete.
  4. Close the Version Manager 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.

Steps:
  1. Right-click the Osokopf geodatabase, point to Administration, then click Compress Database.
  2. When prompted to confirm the compress operation, click Yes.

Making sure the compress operation was successful

You can find out if the compress operation was successful and see the last time a compress operation was performed on a geodatabase by checking the geodatabase properties.

Steps:
  1. Right-click the Osokopf geodatabase and click Properties.
  2. Click the Administration tab.
  3. Review the last compress date/time and status in the Compress section. Be sure the date/time corresponds to when you performed the compress and that the status is successful.
  4. Click OK.

Rebuilding indexes

Editing the data and compressing the geodatabase can cause indexes to be fragmented and database statistics to be out-of-date. After edits are performed and the geodatabase is compressed, you should rebuild the indexes.

TipTip:

When you use the Rebuild all indexes option on the Geodatabase Maintenance dialog box, database statistics also are updated.

Steps:
  1. Right-click the Osokopf geodatabase, point to Administration, then click Geodatabase Maintenance.
  2. Choose Rebuild all indexes.
  3. Click OK.

Shrinking a geodatabase

As data is deleted from or added to the geodatabase, data files in the database may break into smaller, discontinuous fragments. In larger databases, this can lead to query performance degradation. This is not as much of an issue in SQL Server Express databases because of their smaller size, but shrinking a SQL Server Express database can gain you a small amount of extra storage space. For example, if you find your geodatabase is nearing its maximum size of 4 GB, you could shrink the database and possibly gain some extra storage space. Be aware, though, that shrinking the geodatabase could actually increase index fragmentation in the database. 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.

For this example, you will shrink the Osokopf geodatabase. Before doing that, however, check the current size of the geodatabase.

Checking the size of the geodatabase

Steps:
  1. Right-click the Osokopf geodatabase and click Properties.
  2. Click the Administration tab.
  3. Note the size of the database shown in the General section of the Administration tab.
  4. Click OK to close the Geodatabase Properties dialog box.

Shrinking the geodatabase

Now, shrink the Osokopf geodatabase.

Steps:
  1. Right-click the Osokopf geodatabase, point to Administration, then click Geodatabase Maintenance.
  2. Click Shrink geodatabase.
  3. Click OK.

To see if the shrink operation gained you any space in the database, check the size again. Follow steps 1 through 4 under “Checking the size of the geodatabase."


11/18/2013