Looking for a stored procedure to monitor size of Transaction Log file

Tags:
SQL Server availability
SQL Server stored procedures
SQL Server transaction logs
Is there any way I can create a stored procedure which will check for the Transaction Log file size - where we have a specified limit to grow - and if the Log file reached 80 percent of total size, email alerts can be sent to DBAs?
ASKED: April 18, 2008  1:11 PM
UPDATED: April 18, 2008  6:23 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Yes you can monitor this by looking at the size column in the sysfiles table (SQL 7/2000) or the sys.database_files DMV (SQL 2005+). This column is in pages, so take this number and multiply by 8 to get the file size in Kb. Then divide by 1024 to get Megs. Then if the value is over the preset value use xp_Sendmail of sp_send_dbmail to email the alert.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following