PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.server > Who's using my database?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Who's using my database?

Réponse
 
LinkBack Outils de la discussion
Vieux 18/06/2008, 17h00   #1
Mufasa
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Who's using my database?

I've got a database that no one is supposed to be using. I would like to
take it offline but I'd like to verify first that noone is actually using
it. Is there any way, other than SQL Profiler, to see who is/has used the
database recently?

TIA - Jeff.


  Réponse avec citation
Vieux 18/06/2008, 17h16   #2
vinu
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Who's using my database?

Mufasa

Using Query analyser/Management Studion

Sp_who2 -- check the dbname column
or
select * from master..sysprocess where dbid=xx -- replace xx with dbid
of your database
or

Enterprise manager/management studio->Management-> Current
Activity(2000)/Activity Monitor(2005)

vinu


"Mufasa" <jb@nowhere.com> wrote in message
news:eMwHaQV0IHA.548@TK2MSFTNGP06.phx.gbl...
> I've got a database that no one is supposed to be using. I would like to
> take it offline but I'd like to verify first that noone is actually using
> it. Is there any way, other than SQL Profiler, to see who is/has used the
> database recently?
>
> TIA - Jeff.
>
>



  Réponse avec citation
Vieux 18/06/2008, 17h35   #3
vinu
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Who's using my database?

above will tell you who is using it.
not sure how you get details on who has used it...


"vinu" <vinu.t.1976@gmail.com> wrote in message
news:OIz5NYV0IHA.4500@TK2MSFTNGP03.phx.gbl...
> Mufasa
>
> Using Query analyser/Management Studion
>
> Sp_who2 -- check the dbname column
> or
> select * from master..sysprocess where dbid=xx -- replace xx with dbid
> of your database
> or
>
> Enterprise manager/management studio->Management-> Current
> Activity(2000)/Activity Monitor(2005)
>
> vinu
>
>
> "Mufasa" <jb@nowhere.com> wrote in message
> news:eMwHaQV0IHA.548@TK2MSFTNGP06.phx.gbl...
>> I've got a database that no one is supposed to be using. I would like to
>> take it offline but I'd like to verify first that noone is actually using
>> it. Is there any way, other than SQL Profiler, to see who is/has used the
>> database recently?
>>
>> TIA - Jeff.
>>
>>

>
>



  Réponse avec citation
Vieux 18/06/2008, 18h19   #4
Linchi Shea
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut RE: Who's using my database?

If it's SQL2005, there is a default trace that should have been running
(unless it's disabled). You look up its generated trace files. But I'm not
sure if you can rely on it. For decommissioned servers, we typically run SQL
trace for a period of time to capture all the SQL statements. Since the
server is not supposed to be used, there shouldn't be a lot of trace data.

Linchi

"Mufasa" wrote:

> I've got a database that no one is supposed to be using. I would like to
> take it offline but I'd like to verify first that noone is actually using
> it. Is there any way, other than SQL Profiler, to see who is/has used the
> database recently?
>
> TIA - Jeff.
>
>
>

  Réponse avec citation
Vieux 18/06/2008, 18h26   #5
Maninder
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Who's using my database?

Try this:
I have been asked to document who is using which Database, as we are
moving Datacenters, so i have to build a inventory for databases and
figure out who is and has used particular Dbs. thats 350 of them.
I capture the sp_who2 info into a Table and do that every 2 hours for
the past couple of weeks and i am Ready to Query to find out whos been
using the Database(s).
I also used server side Traces running on those DB's. And at the end
of the day Dump them into a SQl table to analyze.
  Réponse avec citation
Vieux 19/06/2008, 23h53   #6
Eric Russell
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut RE: Who's using my database?

There are many ways to list what connections (if not specific users) are
active on a server. One way is to use sp_who2.
However, if there are hundreds of potential users, many of them in remote
locations, then just knowing who is connected will not be very useful,
especially if it's late on a Friday afternoon, and you need to perform a
maintenace operations that was clearly scheduled and announced ahead of time,
but some late working people with no life obviously didn't get the memo. ;-)
Well, there is an option, but don't share this little secret with too many
people...
It is possible to set a database to RESTRICTED_USER mode while
simultaneously disconnecting all connections and aborting any active
transactions. The following will disconnect all connections without active
transactions and allow 2 minutes for any currently active transactions to
complete. Once done, the database will be in RESTRICTED_USER mode, meaning
that only the sysadmin or members of the DBO group can access it. Once the
maintenace operation has completed, restore the database to MULTI_USER mode.

ALTER DATABASE database-name SET RESTRICTED_USER WITH ROLLBACK AFTER 120
SECONDS

http://www.blackwasp.co.uk/SQLRestrictedUser.aspx


"Mufasa" wrote:

> I've got a database that no one is supposed to be using. I would like to
> take it offline but I'd like to verify first that noone is actually using
> it. Is there any way, other than SQL Profiler, to see who is/has used the
> database recently?
>
> TIA - Jeff.
>
>
>

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 04h02.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12930 seconds with 14 queries