Exercise 2: Load data into a geodatabase and update statistics
This topic applies to ArcEditor and ArcInfo only.
When you create a geodatabase, as you did in Exercise 1: Add a database server to the Catalog tree and create a geodatabase, 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.
- 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 Import on the second dialog box.
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 None is 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.
- Right-click the parks feature dataset in the Catalog tree, point to Import, then click Feature Class (multiple).
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 (park_areas) and the last feature class in the geodatabase (water_bodies).
- Click Add.
- Click OK.
- A progress bar appears at the bottom of the ArcMap interface. When the tool finishes running, a pop-up appears in the lower right corner of your screen. Click it to open the Results window and confirm the tool 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.
In the Catalog window, navigate to the DatabaseServers folder in the ArcTutor directory.
- 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 appears.
- Be sure all 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.
Updating database statistics
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.
Database statistics can be updated by either the geodatabase administrator or the database server administrator. Since you are already logged in as the database server administrator, you can update the statistics.
- Right-click the Osokopf geodatabase, point to Administration, then click Geodatabase Maintenance.
- Choose Analyze to update the database statistics and click OK.
You have added data to your geodatabase by creating a feature dataset and importing feature classes to it and by copying a feature dataset from another geodatabase. You then updated the statistics in the geodatabase to reflect the existence of this new data.