ArcGIS Server Banner

ArcSDE connection syntax

ArcSDE connection syntax

Release 9.3 E-mail This TopicPrintable VersionGive Us feedback
Note:This topic was updated for 9.3.1.

When connecting to an ArcSDE geodatabase from a client application or from a command prompt, you need to provide the information necessary for the client to access the server on which the database resides and the database itself.

For most database management systems (DBMSs), you provide the name of the server, the name of the database, and either ArcSDE service information or a direct connection string. For Oracle databases, the database name is not used. Instead, you configure the tnsnames.ora file to create a database service name that is used to identify the database.

Connections made through an ArcSDE service require you provide either the port number used for the service or the name of the ArcSDE service. If you use the name to connect, the name with its corresponding port number must be present in the services.sde file found in the bin directory of SDEHOME. This same information must also be in the operating system's services file of the connecting client. The following is an example entry in the services.sde file:

sde_svc			7000/tcp

To connect directly to an ArcSDE geodatabase, syntax varies depending on the DBMS used.

NOTE: Remember that connections to ArcSDE geodatabases in SQL Server Express are always direct connections to a named instance of SQL Server.


DBMS Connection string Notes
DB2 (Linux/UNIX/Windows) sde:db2

DB2 for z/OS sde:db2zos

Informix sde:informix

Oracle9i using database authentication sde:oracle9i

Oracle9i using operating system (OS) authentication

against a remote Oracle database
sde:oracle9i:/;LOCAL=<SQL_Net_alias> <SQL_Net_alias> is the alias used by the Oracle client to connect to the database.
Oracle9i using operating system authentication

against a local Oracle database
sde:oracle9i:/;ORACLE_SID=<SQL_Net_alias> <SQL_Net_alias> is the alias used by the Oracle client to connect to the database.
Oracle9i user's schema geodatabase sde:oracle9i:/:<schema_name> <schema_name> is the name of the schema that owns the geodatabase.
Oracle 10g using database authentication sde:oracle10g

Oracle 10g using operating system authentication against a remote Oracle database sde:oracle10g:/;LOCAL=<SQL_Net_alias> <SQL_Net_alias> is the alias used by the Oracle client to connect to the database.
Oracle 10g using operating system authentication against a local Oracle database sde:oracle10g:/;ORACLE_SID=<SQL_Net_alias> <SQL_Net_alias> is the alias used by the Oracle client to connect to the database.
Oracle 10g user's schema geodatabase sde:oracle10g:/:<schema_name> <schema_name> is the name of the schema that owns the geodatabase.

Oracle 11g using database authentication sde:oracle11g

Oracle 11g using operating system authentication against a remote Oracle database sde:oracle11g:/;LOCAL=<SQL_Net_alias> <SQL_Net_alias> is the alias used by the Oracle client to connect to the database.
Oracle 11g using operating system authentication against a local Oracle database sde:oracle11g:/;ORACLE_SID=<SQL_Net_alias> <SQL_Net_alias> is the alias used by the Oracle client to connect to the database.
Oracle 11g user's schema geodatabase sde:oracle11g:/:<schema_name> <schema_name> is the name of the schema that owns the geodatabase.

PostgreSQL sde:postgresql:<server_name> <server_name> is the server on which the PostgreSQL database resides.
SQL Server, default instance sde:sqlserver:<server_name>

<server_name> is the name of the server on which the SQL Server database resides.
SQL Server, named instance sde:sqlserver:<server_name>\<instance_name> <server_name> is the name of the server on which the SQL Server database resides; <instance_name> is the name of the SQL Server instance.

If you are making a direct connection from an ArcGIS 9.3 client to an earlier version ArcSDE geodatabase, you can specify the version of the geodatabase with the "sde" portion of the connection string to slightly decrease the amount of time it takes to connect. For example, if you want to use a direct connection from ArcGIS 9.3 to an ArcSDE 9.1 geodatabase stored in Oracle9i, you would use the following syntax:

sde91:oracle9i

By specifying the geodatabase release number, you are directing the client to use the 9.1 connection libraries, thereby eliminating the need for the client to first try the 9.3 libraries.

Connecting from ArcCatalog

When you connect to the geodatabase from ArcCatalog, you use the Spatial Database Connection Properties dialog box. You can get complete details on this from Creating spatial database connections in the "Data management with ArcCatalog" section of the help, but the basics are as follows:

  1. Type the name of the server on which the DBMS resides in the Server field.
  2. Type the connection information, either the ArcSDE service information or the direct connection string, in the Service field.
  3. For SQL Server and PostgreSQL DBMSs, type the database name in the Database field. For Oracle, leave this field blank. For DB2, type the alias of the database. For Informix, type the Open Database Connectivity (ODBC) data source name created on the client machine to connect to the Informix database.
  4. Choose either database authentication or operating system authentication. If you choose database authentication, provide a user name and password.
  5. If making a direct connection to an Oracle database, you must append the at sign (@) followed by the Oracle database service name to the password. For example, if the database user's password is super.secret and the database service name is oracledb1, the user types super.secret@oracledb1 in the password field.

    You can save this information with the connection by checking Save username and password; or uncheck it, in which case you will need to provide the user name and password each time you connect.

  6. Make sure you are connecting to the correct version of the geodatabase. If you are not, change it to the correct one. You can choose to save this version with the connection file by checking Save the transactional version name with the connection file; or uncheck it, in which case you will have to specify a version each time you connect.

Connecting from ArcIMS

To use data from ArcSDE in one of your ArcIMS services, you connect to the database. In this case, you can get more details from the ArcIMS help, but the basic information you provide on the ArcSDE Connection dialog box is as follows:

  1. Type the name of the server on which the DBMS resides in the Server field.
  2. If using an ArcSDE service, type "Port:<port_number>", where <port_number> is the port used for the ArcSDE service.
  3. If using a direct connection, use the syntax indicated in the direct connection table above; except do not include the odbc_dsn for Informix. Therefore, the direct connect syntax for Informix is sde:informix.

  4. For most DBMSs, type the name of the database in the database field. For Informix, type the odbc_dsn. For Oracle, leave the field blank.
  5. Type a database user name in the User name field.
  6. Or, if you are using OS authentication, type a backslash (\).

  7. If connecting with a database user, type the user's password in the password field. As noted in the previous section, if you are making a direct connection to an Oracle database, the password must be appended with "@<database_service_name>".
  8. If connecting with OS authentication, type "password" in the password field.

Connecting using ArcSDE administration commands

Administration commands are used primarily by the ArcSDE administrative user to monitor and alter the ArcSDE geodatabase. You can read the command reference provided with the ArcSDE component of ArcGIS Server Enterprise for complete information on using these commands.

When these commands make connections to the geodatabase, they use the options –s for the server name, –D for the database name, –i for the service or direct connection string, –u for the connecting user's name, and –p for the user's password (if using database authentication).

If you are connecting to a local ArcSDE geodatabase (one that is on the same machine as the client), you don't need to specify the –s option; it is assumed to be the local server. For connections to remote geodatabases, provide the name of the server with the –s option.

The –D option is not used with Oracle databases. For SQL Server and PostgreSQL databases, you provide the database name with this option. For DB2, type the alias of the database. For Informix, type the Open Database Connectivity (ODBC) data source name created on the client machine to connect to the Informix database.

The –i option corresponds to the Service field on the Spatial Database Connection Properties dialog box in ArcCatalog: you provide either the ArcSDE service port or name or the direct connection syntax string for your database with this option.

For the –u option, you should include the database user name, if using database authentication. If using OS authentication on SQL Server, you can provide the fully qualified login name. For example, if connecting to a geodatabase in SQL Server with a network login, you would type the <domain_name>\<login>, such as UNIVERSE\vshue. If connecting to Oracle using OS authentication, do not specify the –u or –p options.

If you use the –p option to specify the password of the user, it shows up in plain text. For most commands, you can omit this option and you will be prompted to type the password. When you do this, the password does not appear on screen. As noted in the previous two sections, if you are making a direct connection to an Oracle database using a database user, the password you provide must be appended with @<database_service_name>.

See Also

  • An overview of ArcSDE geodatabase connections