Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ranzz
Starting Member
3 Posts |
Posted - 2013-02-18 : 12:54:12
|
HI Frnds, I need help on setting up threshold alerts when the database (files MDF & LDF) reaching the MAX size. I mean when the files are nearing max sizes. how to implement it. If there is any good blog post, how to set up please forward it. Please any help..! Thanks in Advance. |
|
srimami
Posting Yak Master
160 Posts |
Posted - 2013-02-18 : 18:05:39
|
Run the following query to find out the database files size in MB. Create a maintenance plan as per your threshold (if the difference is less than 10%, set up an alarm).SELECT @@SERVERNAME as ServerName, DB_NAME([database_id])AS [DBName],name, physical_name, type_desc, CONVERT( bigint, size/128.0) [SizeinMB],Convert( bigint, max_size/128.0) [MaxSize],Convert( bigint, Growth/128.0) [Growth],(Convert( bigint, max_size/128.0) -Convert( bigint, size/128.0) ) DifferenceFROM sys.master_filesWhere DB_NAME([database_id]) NOT IN ('master','tempdb','model','msdb','ReportServer','ReportServerTempDB') |
|
|
ranzz
Starting Member
3 Posts |
Posted - 2013-02-19 : 12:44:36
|
Thanks Srimami.I am that confident on creating my own. Can one please help me providing some documention how to implement it.Please share the links, If you have any. |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-02-19 : 14:25:04
|
See if this article is useful for you? http://www.mssqltips.com/sqlservertip/1523/how-to-setup-sql-server-alerts-and-email-operator-notifications/ |
|
|
ranzz
Starting Member
3 Posts |
Posted - 2013-02-19 : 17:06:25
|
No James, It didn't help. anyway thanks! |
|
|
|
|
|
|
|