Setting environment variables

All ArcSDE Administration Commands are located in the bin directory under $SDEHOME (UNIX) or %SDEHOME% (Windows). Each program within the bin directory administers different parts of the installation. To use the Administration Commands, you can set the $SDEHOME or %SDEHOME% environment variable and include $SDEHOME/bin or %SDEHOME%\bin in your system path variable.

For UNIX, you must also set the $SDEHOME/lib in the library path for some administration commands to function. Once the bin directory is added to the PATH environment variable (and for UNIX, the lib directory is added to the library path), you can execute all the administration commands without the full file specification.

ArcSDE administration commands, such as sdelayer and cov2sde, often require you to specify the server, service, database, user, and password. You can avoid having to type these by defining environment variables.

If you do not provide this information when executing the command or by setting environment variables, the command will use default values if they exist. For example, the default value for the service is esri_sde. If you do not specify the -i option when executing the command and the SDEINSTANCE variable is not set on the client, the command assumes you are using a service named esri_sde and will search for that. Similarly, if you do not specify the -s option when you execute a command and the SDESERVER variable is not set, the command assumes you are connecting to the local server.

Setting UNIX system variables

  1. Using the appropriate UNIX shell syntax, set the SDEHOME variable to reflect the ArcSDE installation directory.

     

    Bourne shell:

    $ SDEHOME=/disk1/sdeexe92
    $ export SDEHOME

    C shell:

    $ setenv SDEHOME /disk1/sdeexe92

  2. Print the current shell environment to confirm settings.

    Bourne shell:

    $ env

    C shell:

    $ printenv

Setting Windows system variables

  1. Click the Start menu, open the Control Panel, and click System. Go to the Advanced tab and click the Environment Variables button.
  2. Click New under system variables. Type "SDEHOME" in the Variable Name text box, and type the path to the ArcSDE installation in the Variable Value text box.
  3. Click OK.
  4. Choose the Path variable and click Edit.
  5. Scroll to the end of the variable value and type ";%SDEHOME%\bin".
  6. Click OK, then OK again.
ArcSDE-specific variables that you can set are as follows:

You can override the environment variables by typing a different value on the command line.

As an example, try using the sdelayer command to describe a feature class:

$ sdelayer -o describe -l cities,shape

If these variables have not been defined, you must use this alternative command syntax:

$ sdelayer -o describe -l cities,shape -s cymru -i arcsde9 -u sdeuser -p sdepswd

Normally, if the password is not specified, the command prompts for it. If the SDEPASSWORD environment variable is set, that value is used and the user will not be prompted. However, storing a password with the SDEPASSWORD environment variable is not secure, is not recommended, and could cause problems if you are trying to use operating system authentication rather than database authentication.

Setting variables on UNIX and Windows (with DOS)

Set each supported variable using the appropriate UNIX shell syntax or use the MS_DOS set command.

UNIX

Bourne shell:

$ SDESERVER=cymru
$ export SDESERVER
$ SDEINSTANCE=arcsde8
$ export SDEINSTANCE
$ SDEUSER=sdeuser
$ export SDEUSER
$ SDEPASSWORD=cymru
$ export SDEPASSWORD

C shell:

$ setenv SDESERVER cymru
$ setenv SDEINSTANCE arcsde8
$ setenv SDEUSER sdeuser
$ setenv SDEPASSWORD sdepswd

 

MS-DOS

C:\ set SDESERVER cymru
C:\ set SDEINSTANCE arcsde8
C:\ set SDEUSER sdeuser
C:\ set SDEPASSWORD sdepswd

Note: The sdemon command does not support the use of these environment variables.

 

Home

Copyright © Environmental Systems Research Institute, Inc. 2004 - 2010.