Friday, February 24, 2012

db maintenance issues with connection pooling

Hi,
Is there a way to do maintenance like integrity checks if there is still
a (sleeping)connection to a database? My maintenance jobs where you need
to be in single user mode fails. In our multi-tier environment we use an
applicationserver which uses connection pooling and a databaseserver
(SQL2K).
I've looked at dbcc opentran, but that doesn't work for me. The solution
i'm looking for is to check if there are any connections for a
particular database. If so, i want to disconnect it, but leave it in a
state so that the applicationserver doesn't have to restart it's
services (this is a manual proces).You could
SELECT cntr_value AS UsersConnected FROM master..sysperfinfo as p
WHERE p.object_name = 'SQLServer:General Statistics' And p.counter_name =
'User Connections'
this though will not give you the db upon which they are connected.
If you use -- sp_who 'active' this will give a more detailed breakdown of
active users and the db they are connected
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
___________________________________
"Jason" <jasonlewis@.hotmail.com> wrote in message
news:exafy5ujGHA.2200@.TK2MSFTNGP05.phx.gbl...
> Hi,
> Is there a way to do maintenance like integrity checks if there is still
> a (sleeping)connection to a database? My maintenance jobs where you need
> to be in single user mode fails. In our multi-tier environment we use an
> applicationserver which uses connection pooling and a databaseserver
> (SQL2K).
> I've looked at dbcc opentran, but that doesn't work for me. The solution
> i'm looking for is to check if there are any connections for a
> particular database. If so, i want to disconnect it, but leave it in a
> state so that the applicationserver doesn't have to restart it's
> services (this is a manual proces).

No comments:

Post a Comment