Dropping direct connections to the geodatabase
Sometimes, a connection may hang and a record become orphaned in one or more geodatabase repository tables. When that happens, you may need to forcibly end the connection. To do this, use the sdemon administration command.
Executing the sdemon command with the kill operation removes the connection to the geodatabase and cleans up any records in the sde_process_information and locks tables.
This is not currently supported for ArcSDE geodatabases in PostgreSQL.
The syntax for the sdemon command with the kill operation is as follows:
sdemon –o kill –t {all | <pid>} [–D <database_name>] [-s <datasource>] -i <direct_connect_string> –u <user_name> –p <password>
The –t option specifies whether all the connections should be removed from the geodatabase (all) or only a specific connection (<pid>). In most cases, type the process identifier (pid) for a specific connection that has been left in the geodatabase repository.
The -i option specifies the direct connect syntax used to connect to the geodatabase.
Database | Syntax |
---|---|
DB2 on Linux, UNIX, or Windows | sde:db2 |
DB2 on z/OS | sde:db2zos |
Informix | sde:informix |
Oracle (client) | sde:oracle<oracle_release_number>:<SQL_Net_alias> for connections to the master sde geodatabase sde:oracle<oracle_release_number>:<SQL_Net_alias>:<schema_name> for connections to a user-schema geodatabase |
SQL Server | sde:sqlserver:<sql_server_instance_name> |
If you are connecting to any database except Oracle, type the name of the database with the –D option. (If connecting to Oracle, do not specify the -D option.)
Use the –u and –p options to specify a user name and password of a database user who has sufficient permissions to kill a direct connection to the database. Permissions for each supported database are as follows:
- For DB2, the user requires SYSMON and DBADM authority.
- In Informix, the user must have permission to CONNECT to sysadmin.
- For Oracle, the user must either be a member of the DBA role or be granted ALTER SYSTEM and SELECT_CATALOG_ROLE permissions.
- In SQL Server, the user must be added to the processadmin or sysadmin fixed server roles.
Killing active (as opposed to orphaned) connections is not advised. This is especially true if the connected user is in the process of editing data. If the user has not saved, all unsaved edits are lost when the connection is dropped, and there is the potential for the data to be corrupted.
- Open an MS-DOS (Windows) or shell (UNIX or Linux) Command Prompt window.
- Use the sdemon command with the info operation to get information about connected users. See Displaying connected sessions for instructions.
- In the information returned, identify the SDE ID of the connection you want to remove. For the users option of sdemon –o info, this is S–ID. For the users_long option, this is Server task ID.
- Type the sdemon command with the kill operation and the appropriate options described earlier in this topic. Use the –t option to specify the value of the SDE ID for the connection to be removed.
For more information on the sdemon command, see the ArcSDE Administration Command Reference provided with the ArcSDE component of ArcGIS Server at the Enterprise level.