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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Alert of database space

Author  Topic 

gercr
Yak Posting Veteran

53 Posts

Posted - 2003-02-13 : 18:05:53
Hi all, I want to use the Alerts of SQL server to monitor my Databases, so I want to make a Alert to raise went my database have 90% of space busy and the same with the log.

thanks for the help.

Gerardo G.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-02-13 : 18:28:17
You could set up the performance condition alerts. Try the SQL Server:Databases object. The counters would be Data File(s) Size (KB) and Log File(s) Size (KB). Have it alert if the counters are above a certain threshold. For instance, if your data file was 1024MB, then setup the alert so that if the data file grows over 900MB in size, then alert. I don't think that you can do a percentage here, so you will have to type in the size of the files.

Go to Top of Page

gercr
Yak Posting Veteran

53 Posts

Posted - 2003-02-21 : 11:36:32
HI, a condition of percentage used can be set, just have to find it at the Counter items, on the Objecto DataBases.

the counter call Percent Log Used.

thanks to all for your help.

Gerardo G.

Go to Top of Page

JeffK95z
Starting Member

19 Posts

Posted - 2006-03-13 : 21:17:13
sorry to bring such an old thread back, but i'm hoping someone can shed a little more light on this.

I would like to have an alert sent when either the log or data devices have less then 25% free space remaining.

The log is super easy, as the Counter item has the 'Percent Log Used' item. I have this working beautifully.

The data however, doesn't seem to be near as easy. The only counter it has is 'Data File(s) Size(KB)'.

Having any value hard-coded kills me, so something like the percent used is wonderful.

Has anyone dealt with this before and successfully implemented some sort of dynamic percentage magic?

thanks everyone!!

Jeff
Go to Top of Page

kpsreenath
Yak Posting Veteran

52 Posts

Posted - 2006-03-14 : 09:37:28
for datafile (% used), i am not sure whether you have a direct alert.
A round about way which i know is sp_spaceused.
you will have to add more script to find the % free space from the sp_spaceused output and then get an alert or mail by scheduling a job.
Let me know, incase there are better ways of doing it


Thanks
Sree
Go to Top of Page

kpsreenath
Yak Posting Veteran

52 Posts

Posted - 2006-03-14 : 09:45:45
incase you havent seen, take a look at this thread.There is a script to identify the allocated space and the utilized space in a database
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=5&messageid=261080

Thanks
Sree
Go to Top of Page

JeffK95z
Starting Member

19 Posts

Posted - 2006-03-14 : 14:52:56
Thanks for the reply's Sree!

That script works great! I'm in the process of trying to make it work how i want... Just like the Percent Log Space Used.

Not exactly sure how I'll do that yet though.

Here's what i'm thinking:


  • Have that script run every hour, inserting new records into a table.

  • Each hour, have another process that reviews the latest records, if any show less then 25% space free, send an alert/email



The only problem with this, is that there is no instant notifation once the space crosses the threshold. It will have to wait until the set update-period. Unlike the Percent Log Space used, which will report as soon as it hits the set indicator

OR

Perhaps something like, use this script to pull the space allocated. Based on that, have another script that would dynamically create an alert based on size.

so, the first script says, DB1 has 100 gigs space allocated

script 2 says, create an alert that triggers an email when DB1 Space grows greater then 75 gigs

This new auto alert generater could run each hour (or day even) to ensure it has the latest size allocated...

hmm, i think i like the second method more now that I think about it. At least we would get warnings as soon as it occurs.

any thoughts?

thx!!!

jeff
Go to Top of Page
   

- Advertisement -