August 27, 2015 at 5:01 am
Hi Team,
I'm tasked with the process to setup database mail which generate space threshold alerts.
A script will run at periodic intervals, once the threshold is breached an alert ( email will be generated to the recepients mail id)
The question, is there any other way this alert (email) can be generated.
Regards
Atulyan
August 27, 2015 at 12:45 pm
Exercise your Google-fu. Found a bunch of hits in less than a second.
sys.dm_os_volume_stats - see example A.
An example from SQLMag...
Sounds like you might need a report or something that tracks free space over time so that you know roughly when the drive will run out of space given the current growth rate(s). You could just write the results of dm_os_volume_stats to a table with a date. Then you could just show that as a graph...
August 27, 2015 at 1:26 pm
Continuing on pietlinden's approach, first determine your minimum threshold per volume and your tracking requirements - once a day, once every 6 hours, once an hour, etc.
Your checker procedure fires periodically (as a database job) and determines drive, capacity and free space. If free space is below the threshold, use database mail to fire off an email to yourself. Depending on your tracking requirements, the procedure might also write the data to a table for tracking. Once you have some data in there, you can graph it by drive and hopefully have a good idea when you're going to run out of space. This moves you from being reactive to planning ahead of time.
August 27, 2015 at 8:12 pm
Don't do this in SQL Server. Do it in Windows. Please see the following KB.
https://support.microsoft.com/en-us/kb/324796
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply