Cannot kill single SDE connections with sdemon -o kill command

5334
6
06-09-2011 02:35 PM
StephanieSnider
Occasional Contributor III
We have a lot of problems with hanging connection in ArcSDE.  I try to remind users to disconnect from their SDE connections before closing ArcGIS, but sometimes they forget (and I do too sometimes).  This causes hanging connections (phantom connections).  Since our site license maxes out at 50 SDE connections (and hanging connections are counted), this is problem.  I have a scheduled process setup to restart the ArcSDE service once a week, which remove these hanging connections.  Unfortunately, a once a week restart may not be enough.

So the point of this post is that I want to be able to kill individual connections.  We are supposed to be able to do this using the sdemon -o kill command.  Unfortunately, whenever I try to do this, I get a message that says, "Operation failed, unable to kill server xxxx".  So the kill command doesn't seem to work.  Arg...  Any suggestions or advice on why I can't kill single connections?

C:\Documents and Settings\ssnider>sdemon -o kill -t 7236 -s NDEP-24 -u SDE -p xxxxx -i 5151

ArcSDE Instance 5151 Process Management on NDEP-24 at Thu Jun 09 15:32:39 2011
-------------------------------------------------------------------------
Kill Server Task 7236?     ARE YOU SURE (Y/N)?: y
Operation Failed, Unable to kill server 7236
0 Kudos
6 Replies
VinceAngelo
Esri Esteemed Contributor
What version of ArcSDE are you using?  Which service pack?  With which RDBMS? 

Are your connections application server or Direct Connect?  Have you tried raising the
number of connections?

- V
0 Kudos
StephanieSnider
Occasional Contributor III
I'm using ArcSDE 10 SP 1 with Oracle 11G on Windows Server 2003.

My map services use direct connection, but all the users use an application connection.

What do you mean by raising the # of connections?  I guess I don't know how to do that.
0 Kudos
VinceAngelo
Esri Esteemed Contributor
The 'sdeconfig' command is used to change the CONNECTIONS parameter, but with on a
Windows server, you probably want to go through the registry changes listed in the final
example in the troubleshooting guide.

I've occassionally seen sites that had problems with stale connections, but have never had
a site that needed weekly reboots -- You should probably take this issue to Tech Support.

- V
0 Kudos
StephanieSnider
Occasional Contributor III
Thanks for this information.  I bumped up the connections to 60, but my understanding is that the ArcGIS Server Standard license only allows 50 concurrent connections to ArcSDE.  Is that right?

Also I tried to do a "kill all" but it said I didn't have the right permission.  Does it need the SDE user or the sysdba user?

C:\>sdemon -o kill -t all -s NDEP-24 -u SDE -p xxxxx -D SDE24 -i 5151

ArcSDE I/O Manager Process Management on Fri Jun 10 14:14:33 2011
-------------------------------------------------------------------------
Kill All Servers?     ARE YOU SURE (Y/N)?: y
Insufficient permissions, Unable to kill servers
0 Kudos
VinceAngelo
Esri Esteemed Contributor
The documentation details the needed privileges (way down at the bottom).

I'm not recommending you violate your license terms (though if you don't have more than
50 *real* users, I don't see an ethical quandry).  I *am* recommending a work-around
until you can get Tech Support in the loop (you really shouldn't need to reboot the server
weekly; quarterly maybe, but that's just good practice on Windows anyway).

- V
0 Kudos
StephanieSnider
Occasional Contributor III
ESRI Tech support recommend that I set the ArcSDE TCPKEEPALIVE parameter to 'true'.  This setting tests the SDE connections every 2 hours to see if they are active.  If they aren't (such as a hanging connection), ArcSDE will kill the connection.  I'm going to see how this goes.

Also, I learned the reason I was not able to kill an individual connection.  The ArcSDE instructions say to use the PID # to kill a connection.  However, for me anyway, I had to use the SID # to kill the connection using SDE command line. 

You can also kill a connection by ending the gsrvr.exe process in the task manager that is associated with the PID.  To see the PID in the task manager under the processes tab, select View > Select Columns, then check PID.