Select to view content in your preferred language

Automate Locks Management

821
4
Jump to solution
09-04-2013 05:16 AM
CraigCarsley
Occasional Contributor II
Does anyone know of any way to automatically break user connections to an enterprise geodatabase?
We are trying to run some scripts overnight, but they need to acquire locks on certain datasets, and we have some users who leave connections open.

I'd like to find a way to break their connections without having to go through the manual process.

Thanks!
1 Solution

Accepted Solutions
VinceAngelo
Esri Esteemed Contributor
Database connection termination is a database feature.  The syntax varies by RDBMS.

The only way Esri code could be involved is if an application server connection is used
(and doing so is discouraged, partially because of this vulnerability).

I expect you could script user session termination in any of the dozen ArcSDE-supported
RDBMSes.

- V

View solution in original post

0 Kudos
4 Replies
VinceAngelo
Esri Esteemed Contributor
Database connection termination is a database feature.  The syntax varies by RDBMS.

The only way Esri code could be involved is if an application server connection is used
(and doing so is discouraged, partially because of this vulnerability).

I expect you could script user session termination in any of the dozen ArcSDE-supported
RDBMSes.

- V
0 Kudos
RussellBrennan
Esri Contributor
The functions you are looking for are arcpy.ListUsers and arcpy.DisconnectUser

List Connected Users
http://resources.arcgis.com/en/help/main/10.2/index.html#//018v00000030000000

Disconnect users:
http://resources.arcgis.com/en/help/main/10.2/index.html#//018v00000061000000

The third example for disconnect users shows how to use the list users function with the disconnect users function to disconnect only specific users based on their names.

This will work for both application server connections (3-tier) as well as direct connections (2-tier).

Russell
ForrestJones
Esri Contributor
Also...to add to Russell's info about the GP tools (which you can script), you can list and disconnect users through the ArcGIS gui. This is from the 10.1 help (similar for 10.2):

Viewing connected users in ArcGIS for Desktop

The above has links to topics for removing connections from different types of databases. You'll have to make sure the sde admin user has the correct privileges (this is discussed in the help topics).
Bud
by
Honored Contributor

This post is quite old. I wonder if anything has changed since then? Any enhancements added to ArcGIS, etc.?

0 Kudos