Exercise 2: Load data into a geodatabase and update statistics

This topic applies to ArcGIS for Desktop Standard and ArcGIS for Desktop Advanced only.

Complexity: Beginner Data Requirement: ArcGIS Tutorial Data for Desktop Goal: Create a feature dataset and import feature classes to it. Copy data from one geodatabase and paste it into another. Update the database statistics on newly imported data.

When you create a geodatabase, as you did in Exercise 1, there is no data in it. You must add data to new geodatabases either by creating new datasets, importing data, or copying data from one geodatabase and pasting it into another.

In this exercise, you will create a feature dataset, then import data from a personal geodatabase to populate it. You will also copy data from a file geodatabase and paste it into your new geodatabase. After the data is loaded, you will update the database statistics.

You are currently a server administrator in the database server you are using for these exercises. Observe that data you create when you are logged in as a server administrator is owned by dbo.

The dbo group in SQL Server is basically equivalent to a sysadmin user, which confers the highest level of control over the SQL Server instance and its contents.

Being part of the dbo group also means that all the data you create is stored in the dbo schema in the database. As a result, all users who connect as a database server administrator own and can modify the data in the dbo schema. Keep this in mind when deciding to grant server-level administrative access to other logins.

Creating a feature dataset

First, create an empty feature dataset to store data.

Steps:
  1. In the Catalog tree, right-click the Osokopf geodatabase, point to New, then click Feature Dataset.
  2. Type parks in the Name text box.
  3. Click Next.
  4. The geographic coordinate system of your feature dataset must match that of the data you are going to import. For that reason, import the coordinate system from the source data. To do this, click the Add Coordinate System button Add Coordinate System drop-down and click Import.
  5. Browse to the community.mdb file in the ArcTutor DatabaseServers folder on your hard drive. The default location for the ArcTutor data is C:\ArcGIS\ArcTutor\DatabaseServers. If the ArcTutor data was installed or copied to a different location, navigate there.

    If you do not have a connection to the ArcTutor directory in your Catalog tree, click the Connect To Folder button Connect To Folder in the Catalog window, browse to the DatabaseServers folder in the ArcTutor folder, and click OK.

  6. Click the park_areas feature class and click Add.

    This adds the coordinate system to your feature dataset.

  7. Click Next.
  8. Make sure there is no coordinate system selected for the vertical coordinate system and click Next.
  9. Accept the default tolerance settings and click Finish.

    There is now a feature dataset named parks in your Osokopf geodatabase.

Adding data to a feature dataset

You will now add data to the parks feature dataset.

Steps:
  1. Right-click the parks feature dataset in the Catalog tree, point to Import, then click Feature Class (multiple).

    The Feature Class to Geodatabases (multiple) geoprocessing tool opens.

  2. For Input Features, click the open folder button and browse to the community.mdb personal geodatabase.

    The community geodatabase was installed with the tutorial data; therefore, browse to the location where you installed the database server tutorial data.

  3. While holding down the SHIFT key, click the first feature class in the geodatabase and the last feature class in the geodatabase.
  4. Click Add.
  5. All the feature classes—park_areas, trees, and water_bodies—are now listed in the Input Features list on the Feature Class To Geodatabase (multiple) tool.
    The Output Geodatabase is already populated with the parks feature dataset in the Osokopf geodatabase.
  6. Click OK.
  7. A progress bar appears at the bottom of the ArcMap interface. When the tool finishes running, a pop-up message appears in the lower right corner of your screen. Click it to open the Results window and confirm the data was loaded successfully.

    If you do not see the pop-up message, you can open the Results window from the Geoprocessing menu: Geoprocessing > Results.

  8. Close the Results window when you have confirmed that the script ran successfully.

The parks feature dataset should now contain the feature classes park_areas, trees, and water_bodies.

Copying data from another geodatabase

Instead of using the import tool, you could copy and paste data from one geodatabase to another.

Steps:
  1. In the Catalog window, navigate to the DatabaseServers folder in the ArcTutor directory.

    C:\ArcGIS\ArcTutor\DatabaseServers

  2. Expand the file geodatabase areas.gdb.
  3. Open the boundaries feature dataset and examine which feature classes are present.
  4. Right-click the boundaries feature dataset and click Copy.
  5. Right-click the Osokopf geodatabase and click Paste.

    The Data Transfer dialog box opens.

  6. Be sure both the feature classes in the boundaries feature dataset are present in the Data Transfer dialog box and click OK.

Your Osokopf geodatabase now contains the boundaries and parks feature datasets.

Examining the properties of the new data

You can discover information about your data by opening the Properties dialog box. There are properties that can be viewed from the feature dataset level and properties for each feature class inside the feature dataset.

Examine some of the properties of the park_areas feature class.

Steps:
  1. Expand the parks feature dataset.
  2. Right-click the park_areas feature class and click Properties.

    The Feature Class Properties dialog box opens.

  3. If it is not already active, click the General tab.
  4. The General tab contains information on miscellaneous properties of the feature class. The only value on this tab that you can change is the feature class Alias.
  5. Type Parks in the Alias text box.

    The alias is what appears in the ArcMap table of contents when you add the feature class to it. You set aliases to more user-friendly names. In this case, rather than have Osokopf.DBO.park_areas appear in the table of contents, users will see Parks.

    The General tab for the park_areas feature class should look as follows:

    General properties of the park_areas feature class

  6. You can see that the park_areas feature class contains polygon features, does not contain measure (m) or z values, is stored in high precision, and is using the SQL Server Geometry spatial type for the spatial column (which is the default spatial storage type for geodatabases in SQL Server beginning with ArcGIS 10.1). Since you just imported the data and have not done anything with it, there are no attachments, the feature class has not been registered as versioned, nor has it been enabled for archiving. Because you are logged in to the geodatabase as the data owner, you automatically have SELECT, INSERT, UPDATE, and DELETE privileges on the feature class.
  7. Click the Fields tab.
  8. The Fields tab lists all the fields in the feature class and the data type for each field. You can choose a field from the list to see its properties.
  9. Choose the park_name field.

    In the Field Properties, you will see that the alias for the park_name field is set to Name. This is the field name users see when they open the attribute table in ArcMap. Your site might have a specific naming convention for table names in a database. To be descriptive, these names are often long. You would use field aliases so users see a shorter or more user-friendly name.

  10. Click the XY Coordinate System tab.

    You'll see that the coordinate system is the same one you imported for the parks feature dataset when you created it.

  11. If you want to, click the other tabs to see what information is available. Click OK to close the Feature Class Properties dialog box when you are done.

Updating database statistics for the new data

After changes are made in the geodatabase, database statistics should be updated to ensure the query optimizer has the most up-to-date statistics. You should update database statistics after new data is loaded or a large number of edits are made to existing datasets.

Statistics on individual datasets can be updated by the data owner. Since you are logged in as the data owner, you can update the statistics on the data you just added to the geodatabase.

Use the Analyze Datasets geoprocessing tool to update statistics for the new feature datasets.

Steps:
  1. Click the Search button Search on the Standard toolbar.
  2. Click Tools in the Search window.
  3. Type analyze datasets in the search text box.

    A list of possible matches appears as you type. Choose analyze datasets (data management) from the list.

  4. Click the Analyze Datasets (Data Management) link to open the tool.

    The Analyze Datasets geoprocessing tool opens.

  5. Browse to your Osokopf geodatabase for the Input Database.
  6. Click Select All.

    All datasets are chosen.

  7. Uncheck Analyze Delta Tables and Analyze Archive Tables.

    Your new datasets have not been registered as versioned nor enabled for archiving, so there is no need to analyze delta or archive tables.

  8. Click OK to run the tool.
  9. When analysis is complete, close the Analyze Datasets dialog box.

You have added data to your geodatabase by creating a feature dataset and importing feature classes to it. You have also added data by copying a feature dataset from another geodatabase and looked at the properties of a feature class. You then updated the database statistics to reflect the existence of this new data.

Related Topics

4/22/2015