The sdemon command

The sdemon command primarily allows you to manage and monitor ArcSDE services; however, several of the operations also allow you to manage or monitor direct connections to the geodatabase.

The start, shutdown, pause, and resume operations normally manage ArcSDE services installed on UNIX systems. ArcSDE services installed on Microsoft Windows systems are usually managed via the Windows Services dialog box.

The ArcSDE service may be managed remotely by including the server (-s) and service (-i) options on the command line. UNIX operating system ArcSDE services can be remotely managed by an sdemon operation executed on a Windows operating system. However, Windows operating system ArcSDE services can only be remotely managed by an sdemon operation executed from another Windows operating system. To remotely manage an ArcSDE service installed on a UNIX system, additional steps are required. See Starting a remote ArcSDE service on Linux or UNIX and Stopping a remote ArcSDE service for more information.

The geodatabase administrator has the required permissions to disconnect (kill) ArcSDE service connections to the geodatabase. However, to disconnect direct connections to the geodatabase, additional permissions must be granted to the geodatabase administrator in most cases. What permissions are needed depends on the database management system (DBMS) being used to store the geodatabase. These permissions are as follows:

Database management system

Required privileges/authority

DB2

The user must have DBADM authority. The sde user normally has this, but if it has been revoked, it must be regranted to kill direct connections to the geodatabase.

The kill operation cannot be used with sdemon if you are using DB2 on a z operating system (z/OS).

Informix

The user must be the informix user.

You must have Informix IDS 11 or a later release to use the kill operation with the sdemon command to disconnect direct connections to the geodatabase.

Oracle

The sde user must have either the DBA role or be granted ALTER SYSTEM and SELECT_CATALOG_ROLE.

SQL Server

If you are using a dbo-schema geodatabase, the geodatabase administrator is already a member of sysadmin and has the ability to kill database connections. If you are using an sde-schema geodatabase, the user must be added to the processadmin fixed server role (not the sysadmin role).

NoteNote:

You cannot use the kill operation to drop direct connections to geodatabases in PostgreSQL.

Usage syntax

The ArcSDE administration command line tools use UNIX-style command syntax and notation according to the following conventions:

sdemon -o start {[-i {<service> | <port#>}] {[-s <server_name>] | [-H <sde_directory>]}
 [-p <GDB_admin_password>]

sdemon -o pause {[-i {<service> | <port#>}]
 [-s <server_name>] | [-H <sde_directory>]}

sdemon -o resume {[-i {<service> | <port#>}] 
{[-s <server_name>] | [-H <sde_directory>]} [-p <GDB_admin_password>]

sdemon -o shutdown {[-i <service>] {[-s <server_name>] | [-H <sde_directory>]} 
[-p <GDB_admin_password>] [-N]

sdemon -o status {[-i {<service> | <port#>}] 
{[-s <server_name>] | [-H <sde_directory>]} [-q] [-u <user_name>] 
[-p <user_password>] [-D <database_name>]

sdemon -o info -I <{users | users_long | config | stats | locks |vars | instances}> 
[-q] {[-i {<service> | <port#>}] {[-s <server_name>] | [-H <sde_directory>]} 
[-u <user_name>] [-p <user_password>] [-D <database_name>]

sdemon -o kill -t <{ all | pid }> [-p <GDB_admin_password>] [-N] 
{[-i {<service> | <port#>}] {[-s <server_name>] | [-H <sde_directory>]} 
[-u <user_name>] [-p <user_password>] [-D <database_name>]

sdemon -h

sdemon -?

Operations

An operation performs a specific task related to the command and is specified with the -o option. The following operations are available with the sdeservice command:

Operation

Description

start

Start the specified ArcSDE service.

Only the geodatabase administrator can use this operation.

pause

Disallow new client connections to the geodatabase, both ArcSDE service and direct connections.

Existing connections remain.

resume

Allow new client connections to the geodatabase.

shutdown

Shut down the ArcSDE service immediately if no server tasks are running.

status

Report the service status and connection information.

info

Display information about users, configuration, statistics, locks, or environment variables.

Any database user can execute this operation.

kill

Terminate all connections or a specified connection to the geodatabase.

Options

Each operation has a set of options. Because options are prefaced with a specific letter, you can pass them in any order. Options are case sensitive, so be sure to use the correct case.

Depending on the operation, some options are required and some are not, as indicated with the square brackets ([ ]). The following options are available with the sdeservice command:

Option

Description

-D

Database name; not supported on Oracle

-h or -?

Use either of these options to see the syntax of a command.

If you are running the command from a C shell, use -h or -\?.

-H

The ArcSDE home directory (SDEHOME); only needed if the SDEHOME variable isn't set or multiple services are in use

-i

The ArcSDE service name or port number; required if the default value, esri_sde, is not used.

-I

Only used with the info operation, this operation inquires about configuration, locks, statistics, users, environment variables, or users-schema geodatabases (Oracle).

  • config: Displays the current configuration variables
  • locks: Displays information about processes holding locks
  • stats: Displays process statistics for each ArcSDE client/server connection; only works for ArcSDE services and only if you have the SERVER_CONFIG parameter, PROCSTATS, set to a value other than -1
  • users: Lists user connections to the geodatabase, the type of connection, and associated process identifiers; each connection = one record
  • users_long: Lists user connections to the geodatabase, the type of connection, and associated process identifiers; information returned in a list of properties for each connection
  • vars: Displays ArcSDE service environment variables
  • instances: Returns all instances in the Oracle database

-N

No verification is performed; the operation begins immediately after being invoked.

-o

Specify an operation.

-p

For the start, pause, resume, shutdown, and kill operations, this option is used to specify the password of the geodatabase administrator. For status and info operations, this can be any database user's password.

-q

All titles and warnings are suppressed.

-s

The ArcSDE server host name (default: localhost)

-t

Used with the kill operation to specify one of the following:

  • all: All connections to the geodatabase forcibly removed
  • A pid: Removes only the connection identified by the process identifier passed with the option

-u

This is the database user name.

When used with the kill operation, the -u option allows you to specify a database user who has the requisite permissions in the database to kill a connection. Since the geodatabase administrator may not have the required permissions, this user is not always the geodatabase administrator.

When used with the info or status operations, this is the user name of any user who has access to the geodatabase.

Examples

Start an ArcSDE service

This example creates a new ArcSDE service for Informix:

sdeservice -o create -d INFORMIX -p sde.space -i esri_inf 
-u informix -P sde.inf

The geodatabase administrator can use the start operation to start an ArcSDE service that is not running. The administrator can start the service locally (execute the command on the machine on which the service will be running) or remotely. If starting a service locally on a Windows machine, you can do this through the Windows Services menu instead of using the sdemon command with the start operation. If starting a Windows service remotely, it must be performed from another Windows machine that can access the host computer through the network, and the command must include the host computer and service name. For example:

sdemon -o start -s banana -i arcsde -p spatial.data

NoteNote:

The service name (in this case, arcsde) must be used, not the port number. Using the port number results in an error.

You can start a service from the command line on a local Windows server. If you only have one ArcSDE service, you do not need to specify the service name. If you do not specify the administrator password, you will be prompted for it.

sdemon -o start

Please enter ArcSDE DBA password:

ArcSDE instance esri_sde started Tues May 03 10:40:09 2011

To remotely start a service on a UNIX or Linux server, you can work from either a Windows or another UNIX or Linux machine. Before you can do this, though, there is some configuration you must perform. See Setting variables for the sde OS user on Linux or UNIX.

Once configuration steps are complete, you can remotely start the service using the start operation.

sdemon -o start -s bluebeard -i sde -p spatial.data

This example shows starting a local service on a UNIX server:

sdemon -o start -i arcsde -p mineallmine

NoteNote:

The start operation does not use the service specified in the SDEINSTANCE variable, even if it is defined.

Pause an enterprise geodatabase

Using the pause operation prevents any additional client connection requests from being processed. No client tasks can connect directly or with an ArcSDE service to the geodatabase until the geodatabase is resumed.

sdemon –o pause –i sde_service

Please enter ArcSDE DBA password:

ArcSDE instance sde_service on tool is Paused, no further connections will be allowed.

The pause operation changes a value in the SERVER_CONFIG table, which also blocks users from connecting directly to the geodatabase.

Resume a paused geodatabase

Use the resume operation to allow client connection requests to be processed again. Client tasks can connect to the geodatabase once this command is executed.

sdemon -o resume -i sde_service

Please enter ArcSDE DBA password:

ArcSDE instance sde_service on tool is Resuming, new connections will now be allowed.

Stop an ArcSDE service

Use the shutdown operation to immediately stop an ArcSDE service if no server tasks are running. If server tasks are running, you will be prompted to remove the running tasks before the shutdown takes place. If you use the -N option when shutting down, all server tasks stop and the system shuts down immediately. Note that the -i option is not specified in this example; since the default service name is used, it does not need to be explicitly stated.

sdemon -o shutdown

Please enter ArcSDE dba password:

ArcSDE instance esri_sde on juke is shutdown

Discover the status of an ArcSDE service

The status operation reports whether an ArcSDE service is running, paused, or stopped and how many connections are currently being made to the geodatabase. The example below is reporting on the status of the esri_sde instance. It shows the service is running (not stopped or paused) and currently has two connections.

sdemon -o status

ArcSDE instance esri_sde Status on juke at Mon May 02 08:09:10 2011
----------------------------------------------------------
Server Connection Mode:              Accepting Connections
Active Server Processes:             6

The geodatabase is paused when an upgrade is performed. If you check the status at that time, the following message is returned:

ArcSDE instance is currently paused for upgrade, no new connections allowed now

Obtain information about an enterprise geodatabase

To display information about users, configuration, statistics, locks, or environment variables for an enterprise geodatabase, use the info operation. This example requests information about the ArcSDE service's configuration (only partial results are shown). Since the -i option is not specified, it is assumed the service is the default value (5151).

sdemon -o info -I config

ArcSDE I/O Manager Configuration Parameters
-------------------------------------------
ArcSDE Version               10.1
ArcSDE Server Build          123456
Underlying DBMS              PostgreSQL
Max. Server Connections      52
Root Path                    C:\arcgis
Temp Path                    C:\Temp
...

This example returns information about locks in a geodatabase:

sdemon -o info -I locks -i 99887 -u auser -p dpwd -D gis

ArcSDE Instance 99887 Lock Table Information on server1

No ArcSDE Layer Locks registered.

1 SDE Id:  12, State:  9, Lock Type: Shared State
1 ArcSDE State Lock(s) currently in use.

1 SDE Id:  12, table:  62, Lock Type: Shared Table
1 ArcSDE Table Lock(s) currently in use  

No ArcSDE Object Locks registered.

In this example, information is requested for the sde and user-schema geodatabases in an Oracle database:

sdemon -o info -I instances

ArcSDE Instance sdeora's instances on blue at Wed May 04 11:45:33 2011
----------------------------------------------------------------
Instance    Type      Created                       Id
---------   ------    --------------------------    --------
SDE         MASTER    Wed Oct 27 09:35:02 2005      0
SDE2        PROJECT   Tues Apr 12 08:12:09 2011     1

TipTip:

Alternatively, you can use SQL to query the INSTANCES system table to obtain information about user-schema geodatabases in Oracle.

The following example shows which users are connected to the geodatabase. In the returned information, S-ID is the server's SDE-ID, S-PID is the server's OS-level process ID, User is the name of the user under which the connection was made, Conn is the type of connection (AS = ArcSDE service/application server or DC = direct connection), ClientMachine:OS is the name of the connecting client machine and the operating system it is running, and Started is the date and time the connection was initiated.

sdemon -o info -I users -i 8874 -s myserver

ArcSDE Instance 8874 Registered Server Tasks on myserver at Wed Jun 01 08:33:55 2011
---------------------------------------------------------------
S-ID   S-PID  User       Conn    ClientMachine:OS      Started
-----  ------ ---------- ------  --------------------  ----------
123    558899 JAKE       AS      dcli:Win32            Wed Jun 01 06:30:00 2011
124    558900 MOLLY      DC      flying:Win32:XDR      Wed Jun 01 07:00:00 2011

The same information returned with the users_long option would appear as follows:

sdemon -o info -I users_long -i 8874 -s myserver

ArcSDE Instance 8874 Registered Server Tasks on myserver at Wed Jun 01 08:34:26 2011
---------------------------------------------------------------
Server task ID: 123
Server task PID: 558899
Connection type: AppSrvr
User name: JAKE 
Client machine: dcli
Client OS: Win32  
XDR: no
Start time: Wed Jun 01 06:30:00 2011

Server task ID:  124  
Server task PID: 558900 
Connection type: Direct
User name: MOLLY
Client machine: flying
Ciient OS: Win32
XDR: yes
Start time: Wed Jun 01 07:00:00 2011

Remove connections from a geodatabase

The kill operation disconnects all connections or a specified connection to the ArcSDE service or it can be used to kill all or a specified direct connection to the geodatabase.

Kill should only be used if a user process has shut down incorrectly or hung. However, there may be a time when you have to disconnect all users, such as if a few stragglers remained logged in after you asked them to disconnect before an upgrade.

In this example, all connections to the geodatabase are being disconnected:

sdemon -o kill -t all -i 4664 -p zeus

In this example, a specific connection is being killed. The connection is using process ID (S-ID) 400.

sdemon -o kill -t 400 -i 50999 -p nolooking

12/17/2013