Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IS Database in use

Status
Not open for further replies.

niallo32

IS-IT--Management
Apr 29, 2004
404
IE
I have SQL Server running on a Windows 2000 Server. There are two SQL Server files call Productionold.mdf & Productionold_log.ldf - they are 15 & 23 GB respectivly. The log file was modified this morning, while the .mdf file has a mod date of the 4/10/04.

Is there a way I can find out if any transactions are taking place on these Databases? I have already backup up the .mdf file to a .bak file on a different drive.

Thanks
 
execute sp_who or sp_who2 from Query Analyzer and scan the DBName column for this database name.

That will give you an idea who or what is accessing this database.

Is it possible that you are backing up or truncating the log file daily?
 
I'm not really used to SQL Server, so I've never used Query Analyser before. Whats the exact command I would issue?

Thanks!
 
Code:
exec sp_who
-- or
exec sp_who2 -- more detailed view
 
Thanks for that - I ran both commands in Query Analyser and there was only one mention of the Database in question. Is there anyone of selecting the Database in Query Analyser and making sure no-one is using it?

 
To the best of my knowledge, those commands are your best bet in query analyzer. If you look at the "ProgramName" column, you can see what application is using the DB.

If necessary, you can restrict access to the database using Enterprise Manager by selecting properties from the database and then selecting the Options tab.
 
Don't worry about the database file (.mdf) not showing the current date. This is normal. My major database (gets over a hundred thousand new rows daily) has a modify date of 09/18/04 (yes my system clock is correct). I notice the date only seems to change if I restart the services.

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top