Geodatabase administration with geoprocessing tools

As geographic datasets and versions are edited over time, certain administrative tasks should be performed as regular upkeep for the underlying geodatabase tables. The geoprocessing tools in this topic will help you maintain your geodatabase and increase the general performance of your system.

Grant and revoke dataset privileges

If you want to let other database users view or modify the contents of any data in a database, you must grant them the privileges to do so.

You can use the Change Privileges geoprocessing tool to specify what privileges a user or group has on a specific dataset.

You can grant just select privileges, meaning the user can read and select from but not modify the contents of a dataset. You can also grant update, insert, and delete privileges, which allows the user to modify the contents of a dataset.

  1. Open the Geoprocessing pane by clicking the Tools button on the Analysis tab.
  2. Search for the Change Privileges tool.

    This tool can be found in the Geodatabase Administration toolset of the Data Management toolbox.

  3. In the tool dialog, browse to your database connection and choose the datasets for which you want to change privileges.
  4. Type the name of the user or group whose privileges you want to change.
  5. Use the View and Edit drop-down lists to choose the privileges you want to grant to the specified user of group.

    You must grant view privileges if you want to grant edit privileges.

  6. Click Run to run the tool.

Update statistics on a dataset

The Analyze Datasets geoprocessing tool (located in the Geodatabase Administration toolset of the Data Management toolbox) can be used to update statistics on the business tables, delta tables, and historical archive tables of datasets, along with the statistics on the indexes associated with those tables.

When you update the statistics for a feature dataset, statistics for all the feature classes in that feature dataset are updated.

You should update statistics after a compress operation, and after you have finished importing, loading, or copying data into an enterprise geodatabase.

The Analyze Datasets geoprocessing tool shows a list of the datasets you own and, therefore, can analyze for the database specified as the Input Database.

As the data owner, you have three options to specify for the tables and feature classes that you have chosen from the Datasets to Analyze list on the Analyze Datasets tool:

  • Base tables: The base (or business) table is the table where all of your attributes are stored. Choosing this option updates the statistics on the base tables for each dataset.
  • Delta tables: The delta tables are the adds and deletes tables present on versioned datasets. Choosing this option updates the statistics on the delta tables for versioned datasets.
  • Archive tables: When you enable archiving on a feature class or table an archive table is created to store a timestamp of when changes are saved on that class. Choosing this option updates statistics on the archive class for archive-enabled feature classes or tables.

If you connect to the geodatabase as the geodatabase administrator, you can also update statistics on the geodatabase system tables.

You can also use the Analyze Datasets tool to update statistics on database tables. In that case, geodatabase-specific options on the tool are disabled, and statistics are only updated for the datasets you choose to analyze.

To open the Analyze Datasets tool and update dataset statistics, do the following:

  1. Make a connection to the database as the owner of the data for which you want to update statistics.
  2. Open the Analyze Datasets geoprocessing tool.

    Use the Search window in the Geoprocessing pane to find the tool and open it, or navigate to the tool in the Geodatabase Administration toolset in the Data Management toolbox.

  3. Use the database connection file you created in step 1 as the input workspace.
  4. From the Datasets to Analyze list, choose the tables, feature classes, feature datasets, raster datasets, or mosaic datasets for which you want to update statistics.
  5. Click outside the Datasets to Analyze box to change focus for the tool.
  6. Check which tables' statistics you want to update for this dataset: the base table, delta tables, or archive tables. Uncheck the tables you do not want analyzed at this time.

    If you are unsure which tables to analyze, for example, if you don't know if a feature class is versioned or not or if it is enabled for archiving or not, you can leave all three options checked. The tool will not fail if the tables are not present.

  7. Click Run to run the tool.

Rebuild dataset indexes

An index can exist on a single field or a set of fields. As datasets in a geodatabase are edited over time, the indexes may need to be rebuilt for optimal performance. Rebuilding indexes on these datasets can improve index efficiency.

You can use the Rebuild Indexes geoprocessing tool to rebuild indexes on datasets in a geodatabase. The data owner can use this tool to rebuild both attribute and spatial indexes for one or many different datasets at once.

If the table or feature class is registered as versioned, the data owner can rebuild indexes on the base and delta tables or just the delta tables. You might rebuild indexes on just the delta tables if you have loaded a large amount of data into your table or feature class or deleted or edited a large amount, and the edits are going to remain in the delta tables (not be compressed) for several days.

When you rebuild indexes for a feature dataset, indexes are rebuilt on all the feature classes and other classes in that feature dataset. If the feature dataset contains a topology, the topology tables are also updated.

The tool also has an option to rebuild indexes for the geodatabase system tables, which can be used only by the geodatabase administrator.

To rebuild indexes on your datasets using the Rebuild Indexes tool, do the following:

  1. Make a connection to the enterprise geodatabase that contains the data you own for which you want to rebuild indexes.
  2. Open the Rebuild Indexes geoprocessing tool.

    This tool can be found in the Geodatabase Administration toolset of the Data Management toolbox.

  3. Use the connection you created in step 1 as the Input Database Connection.
  4. Check the boxes next to the datasets for which you want to rebuild indexes.
  5. If you only want to rebuild indexes on the delta tables of the chosen dataset, click outside the datasets list and check Rebuild Delta Tables Only. This is the default option for the tool, checking this will omit the base tables. Uncheck this option if you'd like to rebuild both the base and delta table indexes.
  6. Click Run to run the tool.

Compress a versioned geodatabase

As a versioned geodatabase is edited over time, delta tables increase in size and the number of states increases. The larger the tables and the more states, the more data ArcGIS must process every time you display or query a dataset registered as versioned. The greatest impact on performance, therefore, is not the number of versions but the amount of change contained in the delta tables for each version. As a result, versions can have different query response times.

Note:

This tool is for geodatabases containing traditional versions or datasets registered as versioned with the option to move edits to base. Geodatabases containing only datasets registered as branch versioned do not need to run the compress operation. The branch versioning model does not use delta tables or have version states in the same manner as traditional versioning and therefore has nothing to run compress against.

To maintain database performance, the geodatabase administrator must periodically run the Compress tool to remove unused data and states. Only the geodatabase administrator can run a compression operation. Compressing performs two key tasks:

  • It removes unreferenced states and their associated delta table rows.
  • It moves entries in the delta tables common to all versions into the base tables, reducing the amount of data the database needs to search through for each version query, thereby improving query performance and system response time.

When a large volume of uncompressed changes has accumulated, compressing the database can take hours. To avoid this, compress on a regular basis. It is a good idea to compress at the end of every day or after a period of high database activity such as data loading.

During a compression operation, users can stay connected to the geodatabase. If any user is editing a version, it will create a state lock and that version will not take part in the compression. It's best, therefore, to have all users disconnect before starting to ensure the entire state tree can be compressed.

If you ever need to stop a compression operation before it completes, you can end it at any time. This will not leave the database in an inconsistent state. You can continue compressing at a later time.

It is important to update statistics for every versioned feature class and table in the geodatabase after compressing. After edits and a database compression have taken place, database statistics are no longer accurate. This hurts query performance. Individual data owners can update the statistics on their feature classes and tables using the Analyze Datasets geoprocessing tool.

To run a compression operation using the Compress tool, do the following:

  1. Make a connection to the enterprise geodatabase as the geodatabase administrator.
  2. Open the Compress geoprocessing tool.

    This tool can be found in the Geodatabase Administration toolset of the Data Management toolbox.

  3. Use the connection you created in step 1 as the Input Database Connection.
  4. Click Run to run the tool.