Showing posts with label SQL Transaction. Show all posts
Showing posts with label SQL Transaction. Show all posts

Tuesday, October 21, 2008

Percentage of Logspace Used

You can use this SQL below to check the percentage of logspace currently used by your database.



dbcc sqlperf(logspace)

Apart from setting up alert to tell you when your database is running out of logspace, the above query does the same as well. However, you actually have to manually run the query to view the database logspace usage.

Current Active Transactions

To find how many active transactions are currently running, use the SQL below.



select * from sys.dm_tran_session_transactions

Monday, October 6, 2008

Oldest Active Transaction

The following code displays the oldest active transaction on a Database.

USE Mydb
Go
DBCC OPENTRAN
Go