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: BeginnerData Requirement: ArcGIS Tutorial Data for DesktopGoal: 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:

In the Catalog tree, right-click the Osokopf geodatabase, point to New, then click Feature Dataset.

Type parks in the Name text box.

Click Next.

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 drop-down and click Import.

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 in the Catalog window, browse to the DatabaseServers folder in the ArcTutor folder, and click OK.

Click the park_areas feature class and click Add.

This adds the coordinate system to your feature dataset.

Click Next.

Make sure there is no coordinate system selected for the vertical coordinate system and click Next.

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:

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

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.

While holding down the SHIFT key, click the first feature class in the geodatabase and the last feature class in the geodatabase.

Click Add.

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.

Click OK.

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.

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:

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

C:\ArcGIS\ArcTutor\DatabaseServers

Expand the file geodatabase areas.gdb.

Open the boundaries feature dataset and examine which feature classes are present.

Right-click the boundaries feature dataset and click Copy.

Right-click the Osokopf geodatabase and click Paste.

The Data Transfer dialog box opens.

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

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:

Expand the parks feature dataset.

Right-click the park_areas feature class and click Properties.

The Feature Class Properties dialog box opens.

If it is not already active, click the General tab.

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.

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:

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.

Click the Fields tab.

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.

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.

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.

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:

Click the Search button on the Standard toolbar.

Click Tools in the Search window.

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.

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

The Analyze Datasets geoprocessing tool opens.

Browse to your Osokopf geodatabase for the Input Database.

Click Select All.

All datasets are chosen.

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.

Click OK to run the tool.

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.