Exercise 10: Detach the buildings geodatabase from the database server

This topic applies to ArcEditor and ArcInfo only.

Complexity: Beginner Data Requirement: ArcGIS Tutorial Data Setup Goal: Learn how to detach a geodatabase from a database server.

To move a geodatabase from one database server to another, you can detach it from the database server, copy the database files (the .mdf file if you are using SQL Server 2008 Express or the .mdf and full-text catalog folder if you are using SQL Server 2005 Express) over the network or onto transfer media, such as a thumb drive, then paste it onto the destination server. Once there, you can attach the geodatabase to the database server.

Some examples of situations when you might do this include the following:

NoteNote:

Detaching a geodatabase from the database server does not delete the database files, but it removes references to the database from the SQL Server Express instance.

When sharing geodatabases across database servers, be aware of who owns the data and has permission to work with it. This is important because ArcSDE geodatabases in SQL Server Express use Windows-authenticated logins. If you are using local Windows logins, when you transfer the geodatabase to a new computer, those users won't exist on the new computer. Similarly, if you use network logins, then transfer the geodatabase to a database server outside the network, those logins will not exist.

How you deal with this depends on your workflow. If you know ahead of time that you are going to be moving the geodatabase around a lot, you might want to create all the data in the geodatabase while logged in as the dbo user. The dbo user and schema are always present in database servers; therefore, even if you move the geodatabase to a database server on a different network, you can still log in as dbo, add new users to the database server, and grant them permissions to the data.

If you hadn't anticipated having to move the geodatabase and the data owners don't exist on the destination database server, you could still log in as the dbo user and perform one of the following set of steps:

  1. Add new users to the destination database server.
  2. Grant read/write or higher-level access to the geodatabase to the users to whom you want to transfer ownership of the data. Granting these permissions at the geodatabase level allows the users to access all the data in the geodatabase.
  3. Ask the users to log in to the geodatabase and either copy the data to a new geodatabase to which they also have read/write access or copy and paste the data in place, giving the pasted datasets and columns new names.
  1. Create a second geodatabase on the destination database server.
  2. Copy the data to the new geodatabase.
    NoteNote:

    Dbo is now the owner of all the datasets in the second geodatabase.

  3. Add new users to the destination database server.
  4. Grant these users access to the datasets.

Detaching the buildings geodatabase

Suppose you want to move the buildings geodatabase (named either buildings05 or buildings08, depending on the version of SQL Server Express you are using) from the database server on your personal computer (PC) to a database server on your laptop so you can take it into the field and collect traffic data there. You could use geodatabase replication to replicate the data to a geodatabase in a database server on your laptop, or you could detach the geodatabase from the database server on your PC, move it to your laptop's hard drive, and attach it to the database server there.

To detach the buildings geodatabase from the database server, do the following:

Steps:
  1. Log in to the computer with your own Windows login.
  2. Start ArcCatalog by clicking Start > All Programs > ArcGIS > ArcCatalog 10.
  3. Expand the Database Servers node in the Catalog tree and connect to the database server. However, do not connect to the buildings geodatabase.
  4. Right-click the buildings geodatabase on the Catalog Contents tab, point to Administration, then click Detach.
    CautionCaution:

    It is important that you right-click the geodatabase on the Contents tab, not in the Catalog tree. If you right-click the geodatabase in the Catalog tree, you connect to it. You cannot detach a geodatabase that has any active connections to it; therefore, if you are connected when you try to detach, the detach operation will fail.

  5. When the Confirm Detach dialog box appears, take note of the location of the database file; you will need to know where it is so you can copy it to another location or if you plan to reattach the database in the future.
  6. Click Yes on the Confirm Detach dialog box.

You could now open Windows Explorer, navigate to the location of the buildings05.mdf file and buildings05_CAT folder (SQL Server 2005 Express) or buildings08.mdf file (SQL Server 2008 Express), then copy them to media or over the network to transfer them to another computer.

For instructions on attaching the geodatabase, see Exercise 3: Attach, create a backup of, and upgrade a geodatabase or Attaching a geodatabase to a database server.


9/18/2012