Geodatabase connections in ArcGIS Desktop
A spatial database connection creates a file on the client computer that contains the connection information to an ArcSDE geodatabase. You create the connection file under the Database Connections node in the Catalog tree by providing specific connection information in the Spatial Database Connection dialog box.
If you use the data from this connection as the source for a service, such as a geoprocessing or geocoding service, you may need to place the connection file in a shared location on your network. See the topics Preparing resources for publishing as services and Geoprocessing Considerations for ArcSDE data for more information about sharing a connection file.
Some of the information you provide through the Spatial Database Connection dialog box is mandatory; other information is optional, depending on the requirements at your site. For instance, you can choose to save or not save version and database user name and password information as part of the connection file.
You specify information pertinent to the database connection in the first three text boxes on the Spatial Database Connection dialog box.
Type the name of the server on which the database you're connecting to resides in the Server text box.
If you are making a direct connection, this information is not required, but it is recommended you provide it anyway. If you do not provide the server name, the server name will not appear on the Source tab of the table of contents in ArcMap.
Type either the port number for the ArcSDE service, the name of the ArcSDE service, or the direct connection string specific to the type of database management system (DBMS) to which you are connecting in the Service text box.
Direct connection syntax is described in Making a direct connection from ArcGIS Desktop to a geodatabase in DB2.
If you make a connection using an ArcSDE service, it is simpler to specify the port number. If you use the service name instead, there must be an entry in the services file on the client machine that contains the service name and its corresponding port number. If you have many clients connecting through an ArcSDE service, keeping these files up-to-date on every client machine would be more time consuming than simply specifying the port number for the service in the Spatial Database Connection dialog box.
Type the name of the database to which you are connecting in the Database text box. If you are connecting to an Oracle database, leave this text box blank.
There are two login options for creating a connection to a spatial database: database authentication and operating system authentication.
User names can be a maximum of 30 characters.
When you use operating system authentication in SQL Server, the operating system login is mapped to a database user; in Oracle, the operating system login is prefixed with an os_authent_prefix string (by default, OPS$) and stored in the USERNAME table. The maximum number of characters allowed for the user name when connecting to the geodatabase is 30. If your user name contains special characters or escape characters, such as a dollar sign or backslash, ArcGIS must place quotes around the user name. Those quotes count toward the 30 character total.
If you click Database authentication to enable it in the Spatial Database Connection dialog box, you must provide a valid database user name and password in the Username and Password text boxes, respectively.
You are not required to type your user name and password to create a connection; however, if you do not, you will be prompted to enter them when a connection is established.
Uncheck Save username and password if you prefer not to save your login information as part of the connection; doing this can help maintain the security of the database. However, if you do this, you must provide a user name and password every time you connect.
Operating system authentication
If you click Operating system authentication to enable it, you do not need to type a user name and password in the connection dialog box—the connection is made using the login name and password used to log into the operating system. If the login used for the operating system is not a valid geodatabase login, the connection fails.
If you are creating a connection to a geodatabase stored in Oracle, DB2, Informix, or PostgreSQL using operating system authentication, you must use a direct connection to the database. For information on direct connections, see What is a direct connection to a geodatabase in DB2?.
Specify the geodatabase version to which you want to connect in the Connection details section of the Spatial Database Connection dialog box. The default connection is to a version named sde.DEFAULT. If you want to connect to a different version, click Change. This opens the Connection Details dialog box. From here, choose either a transactional version or a historical version to which to connect.
To read what versions are available, ArcGIS Desktop must be able to make a connection to the geodatabase. Therefore, if the server or login information you provided is incorrect, you cannot change versions.
If you leave the Save the transactional version name with the connection file box checked, the user always connects to the specified transactional version using this connection file. If unchecked, the user will be prompted to choose a version to connect to every time he or she reconnects using this connection file. Note that if you have chosen a historical version to connect to, this check box is labeled Save the historical details with the connection file. If left checked, the user always connects to the specified historical marker or date and time when using this connection file.
Situations for which you would want to save the version are if you are using SQL Server and created your system tables in the dbo schema, you want to create a specific connection file for a user-schema geodatabase in Oracle, or you need to connect to the same transactional or historical version the majority of the time.
If you often need to connect to different transactional or historical versions of the geodatabase, you should uncheck the option to save the version with the connection file. Doing so means you will be prompted to enter the missing connection properties every time the connection file is used.
Making sure it works
After you specify all the information needed for the spatial database connection, it is recommended that you click Test Connection at the bottom of the Spatial Database Connection dialog box. If the connection test fails, contact the database administrator to ensure the database is operational and all the information you provided in the dialog box is correct. You can still add this connection by clicking OK, but you cannot retrieve data until the problem is resolved.