Failed to connect to database. Maximum number of conections to instance exceeded

Source: Internet
Author: User

We generally know that the number of ARCSDE connections is limited by 48, and many people know that this parameter can be modified, and the maximum number of connections that each operating system can support is different. If you apply an error: The maximum number of connections to the system is exceeded.

Two kinds of solutions:

First, determine whether the maximum number of connections must be increased. In our usual applications, especially for multi-user implementation. Sometimes there will be graphics library inexplicable connection, if you use ArcMap or Arccatalog connection will also prompt error message "Failed to connect to database." Maximum number of conections to instance exceeded ". The error message is very clear, but how to solve it? Many times the solution is to restart the SDE service or remove the GSRVR.EXE process on the machine where the SDE service resides. Although this can solve the current problems, but after a while the same situation will be disturbed. The maximum number of connections that the SDE itself defaults to is 48. It is not generally possible to have so many users connected to a graphics database at the same time. And our system, as well as desktop software such as ArcMap or Arccatalog, will also delete the connection to the database when exiting. But why is there a problem that exceeds the maximum number of connections? After several attempts to find out: When the system exits unexpectedly, or connected to the graphics database when forced to unplug the network cable and other unconventional operations. Records such as the connection process on the SDE server and the number of SDE user connections recorded in the database cannot be deleted. resulting in more and more invalid connections, and finally reached his limit, there are inevitable errors. We can look at some of the basic setup parameters for the current SDE by typing the following command: Sdemon–o info–i config. You can also view the current number of user connections by command: Sdemon–o info–i users, plus after the Sdemon command. You can view all parameter information for the command. When setting the maximum number of connections for a user, you need to estimate how many connection processes are likely to occur at the same time. The number of processes opened in the SDE and the number of connected users is calculated with the instance, when a machine opens n ArcMap and connects to the database, there are n connection processes and N connected users ' records. If the maximum number of connections is confirmed, it can be set.

Method one: With Plsql or Toad open SDE under the user's table Sever_config, edit the field connections value for your maximum number of connections. Sets the field Tcpkeepalive value to True.

Method Two: Open the SDE installation directory (general installation path for C:/ARCGIS/ARCSDE/SQLEXE/ETC) giomgr.defs file for editing, set connections parameters for your maximum number of connections. Then set the tcpkeepalive parameter to True. Import through a command to a database: Sdeconfig–o import–f c:/arcgis/arcsde/sqlexe/etc/giomgr.defs–i ESRI_SDE (database instance name) –s (ServerName) –u SDE ( User name) –p sde (password). After setting up, you need to restart the SDE service to take effect. Tcpkeepalive parameter is what to do with it. The biggest contributor to the ability to delete invalid connections is him. When the tcpkeepalive parameter is set to True, the database continuously detects whether all connections are invalid and automatically deletes the connection if the connection is not valid, depending on the response time provided by the registry key KeepAliveTime the SDE service's machine. KeepAliveTime registry entries are not present for machines that default to install the operating system. If there are no words, the server does not actively send KeepAlive packets to verify that the idle connections are still unchanged. The deletion is not done. So the invalid connections mentioned above will be more and more. You can add a DWORD entry in the following path: Local_machine/system/currentcontrolset/services/tcpip/parameters: KeepAliveTime. If you do not set the value, the default is two hours. The specific time can be determined by the situation. Generally recommended for 5 minutes. Then reboot the machine (be sure to reboot and the new addition to the registry will not take effect). The world is quiet, and the mistake of exceeding the maximum number of connections will never bother your scalp.

Second, if the actual number of connection limits, how we modify. On the Windows operating system, the ArcSDE service runs as a "non-interactive desktop program", while a Windows called SharedSection initialization parameter qualifies the maximum stack memory allocated for "non-interactive desktop Programs". We can modify this value through the Windows registry. Click "Start"-> "Run"-> "regedit" to open the registry: Locate the following path: [url=file:////hkey_local_machine/system/currentcontrolset/control/ Session]//hkey_local_machine/system/currentcontrolset/control/session[/url] Manager/subsystems/windows This string example is as follows:%systemroot%/system32/csrss.exe objectdirectory=/windows sharedsection=1024,3072,512 Windows=On Subsystemtype=windows serverdll=basesrv,1 serverdll=winsrv:userserverdllinitialization,3 ServerDll=winsrv: conserverdllinitialization,2 Profilecontrol=off maxrequestthreads=16 This string contains the initialization parameters for Windows. In this string, we can find the SharedSection parameter, the default value is 1024,3072,512. The third value (512KB) is the maximum stack memory allocated for non-interactive desktop programs. Under this value (512KB), the maximum number of connections that ARCSDE can accept is approximately 56. An increase of this value to 2M will enable the maximum number of connections supported by ARCSDE to reach 270. The setting at this point is: 1024,3072,2048 for Windows, all stack memory (non-interactive desktop and interactive desktop) totals 48Mb, so we need to be careful when adjusting sharedsection parameters.

-------------------------------------------------------------

The official default SDE maximum connection number is 48, in the actual application once exceeds this maximum connection number, cannot carry on the connection SDE, the hint: "Failed to connect to the database." Maximum number of conections to instance exceeded ". I often encounter this situation in practical work, each solution is to restart the service. In the Giomgr.defs file in the $sdehome/etc directory, the number of connections connections is modified to 128; or use the command sdeconfig-o alter-v connections=128-u sde-p After all, always restart service is not a long-term solution, I also found some solutions on the Internet, the easiest way is to modify this connection parameter to a larger number. But since the system defaults to 48, it later sees an article that specifically describes why the maximum number of connections to the SDE service in the Windows operating system is 48, and that Windows assigns a fixed size of memory to each service (default 512K). Each SDE process requires approximately 9K of memory, so the default number of connections for SDE is 512/9 equals 48. This memory can be modified to 512k to 1024, if the number of connections over 250, you can change to 2048. Need to modify the registry: Hkey_local_machine/system/currentcontrolset/control/session Manager/subsystems/windows Project SharedSection , and change the third item in the original sharedsection=1024,3072,512 to 1024 or 2048 to modify the default maximum number of connections for the system. But how it works. I have not tried, will not appear unstable situation, after all, the more the number of connections, concurrency operation is more unstable. If you do not modify this parameter, let SDE automatically detect and disconnect a certain amount of time does not operate the SDE connection, that is the best way to solve the problem. I see that the forum is resolved with the "tcpkeepalive" parameter set to True and Local_machine/system/currentcontrolset/services/tcpip/parameters in the registry Add DWORD entry: KeepAliveTime. The KeepAliveTime time value is: The maximum threshold that the SDE server giomgr process does not receive a response from the client, and if the value is exceeded, then the client process and its associated information will be purged. ItIt's on the SDE server machine. The default value for KeepAliveTime is 7200000ms (2 hours), in milliseconds. KeepAliveTime himself did not attempt to use, just modified the number of connections and registry information.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.