SQL Query - Finding Current log file usage for one database -


i want set monitoring software generate smnp trap if database log file goes beyond 95% usage. can @ first result in first column of sql query, i'm looking sql query return percentage figure in result - eg, 95

i've found several different ways of doing similar things, return table heading etc, whereas want figure. it'll running query every hour nothing intensive. i'm running sql version 8.

thanks, mike

you write query against os dmvs single value you're looking for.

not sure if work sql server 2000, know works far sql server 2005. requires performance counters enabled on host server (i.e. os, not sql server).

this query should trick:

select cntr_value percentused sys.dm_os_performance_counters counter_name = 'percent log used'   , instance_name = 'your_database_name' 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -