ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Manage connections to a geodatabase in Oracle

Available with Standard or Advanced license.

  • Identify and remove connections from ArcMap
  • Identify and remove connections using Python

As the geodatabase administrator, you occasionally need to see who is connected to the geodatabase and which connections are locking resources. You may even need to remove certain connections if people are not present to log out themselves. For example, an editor may have left an edit session open, locking the data in the edit session and preventing other editors from accessing it. If there are a limited number of connections that can be made to a geodatabase, you might need to disconnect someone who failed to log out to free up a connection. Or you may want to have everyone log out so you can apply a patch to the database, restore the database, or compress the geodatabase.

You can connect to the geodatabase as the geodatabase administrator to view and, if necessary, remove connections.

Caution:

Use caution when disconnecting users. Esri recommends that you avoid disconnecting active sessions, especially if the connected user is in the process of editing. You should only disconnect sessions that were left open but are not being used (for example, if someone left the session open over the weekend), orphaned sessions that are locking an object, or sessions involved in a deadlock situation.

To disconnect users from a geodatabase in Oracle, the geodatabase administrator must either be added to the DBA role or granted ALTER SYSTEM and SELECT_CATALOG_ROLE privileges.

First, determine who is connected to the geodatabase. If necessary, you can then remove connections.

Identify and remove connections from ArcMap

You can connect to the geodatabase as the geodatabase administrator in ArcMap to view and remove connections from within the Geodatabase Administration dialog box.

  1. Start ArcMap or ArcCatalog.
  2. Connect to the geodatabase as the geodatabase administrator.
  3. Right-click the database connection in the Catalog tree, point to Administration, and click Administer Geodatabase.
  4. Click the Connections tab.

    A list is displayed showing all sessions that are currently connected to the geodatabase. Your session is displayed in italic text.

  5. Contact individuals and ask them to close their sessions. If you are unable to contact them and still need to disconnect them from the geodatabase, proceed with the next step.
  6. Right-click the specific user session you want to remove from the geodatabase and click Disconnect.

    The session is immediately dropped from the geodatabase.

Identify and remove connections using Python

You can run Python functions to create a geodatabase connection file for the geodatabase administrator, use that connection file to connect to the geodatabase and get a list of all current geodatabase connections, and remove a connection from the geodatabase if necessary.

  1. Create a database connection file by running the CreateDatabaseConnection_management function in a Python window. Save the user name and password with the file.

    In this example, a connection file (oragdb.sde) is created in the temp folder. It connects to the spora database, logging in as the sde user.

    import arcpy
    arcpy.CreateDatabaseConnection_management ("c:\\temp", "oragdb.sde", "ORACLE", "spora", "DATABASE_AUTH", "sde", "mysdepwd", "SAVE_USERNAME")
    

  2. Run the ListUsers function to get a list of all current connections to the spora geodatabase.

    Specify the connection file you created in the previous step.

    ##No need to import arcpy if you are running functions in the same Python window.
    import arcpy
    
    arcpy.ListUsers("c:\\temp\oragdb.sde")
    

    A list of user connections is returned.

    [user(ClientName=u'PC4', ConnectionTime=datetime.datetime(2018, 10, 18, 8, 30, 19),
     ID=18, IsDirecConnection=True, Name=u'publisher1')]
    [user(ClientName=u'PC25', ConnectionTime=datetime.datetime(2018, 10, 21, 14, 10, 43),
     ID=33, IsDirecConnection=True, Name=u'editor2')]
    [user(ClientName=u'PC11', ConnectionTime=datetime.datetime(2018, 10, 22, 9, 18, 26),
     ID=39, IsDirecConnection=True, Name=u'reader5')]
    [user(ClientName=u'PCA2', ConnectionTime=datetime.datetime(2018, 10, 22, 11, 21, 2),
     ID=41, IsDirecConnection=True, Name=u'sde')]

  3. Contact individuals and ask them to close their sessions. If you are unable to contact them and still need to disconnect them from the geodatabase, proceed with the next step.
  4. Use the information obtained from the ListUsers function to identify which connection to remove using the DisconnectUser function.

    Specify the ID of the connection to remove. Here, the connection with ID 33 is removed:

    ##No need to import arcpy if you are running functions in the same Python window.
    import arcpy
    
    arcpy.DisconnectUser("c:\\temp\oragdb.sde",33)
    

    The session is immediately dropped from the geodatabase.

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal