Wednesday, March 28, 2012

Log full alert

Hi,
I want to create a job that will raise an error case Log is getting almost
full.
Is there a sp (or any other tool) that can assist?
Thanks, Hagay.Hi all,
I've found a way to extract log precentage usage:
master db has a table msysperinfo which holds (among other detail) log
precentage use of each database.
so the following query will give you what you need:
select cntr_value
from msysperfinfo
where counter_name = 'Percent Log Used'
and instance_name = @.databaseName
"Hagay Lupesko" <hagayl@.nice.com> wrote in message
news:emMTx0MkDHA.392@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I want to create a job that will raise an error case Log is getting almost
> full.
> Is there a sp (or any other tool) that can assist?
> Thanks, Hagay.
>
>|||Maybe you have ran a script to create that table as I don't think it is a
standard table, you could do
dbcc sqlperf('logspace')
to get log information and space used/free, from there you could throw that
to a table and check for percentage used to send an alert.
HTH
--
Ray Higdon MCSE, MCDBA, CCNA
--
"Hagay Lupesko" <hagayl@.nice.com> wrote in message
news:ezOTZOOkDHA.2652@.TK2MSFTNGP09.phx.gbl...
> Hi all,
> I've found a way to extract log precentage usage:
> master db has a table msysperinfo which holds (among other detail) log
> precentage use of each database.
> so the following query will give you what you need:
> select cntr_value
> from msysperfinfo
> where counter_name = 'Percent Log Used'
> and instance_name = @.databaseName
> "Hagay Lupesko" <hagayl@.nice.com> wrote in message
> news:emMTx0MkDHA.392@.TK2MSFTNGP11.phx.gbl...
> > Hi,
> >
> > I want to create a job that will raise an error case Log is getting
almost
> > full.
> > Is there a sp (or any other tool) that can assist?
> >
> > Thanks, Hagay.
> >
> >
> >
>|||The counter in the sysperfinfo table and the value from DBCC
SQLPERF(LOGSPACE) are essentially the same. You can use these values to
alert you on a certain log usage threhold (e.g. 85%), if your log files are
not set to autogrow.
However, if one of your log files is set to autogrow, these values will
often give false alarms. For instance, your log might be 90% used, but if
you still have 10GB of free space of the drive on which the log file is set
to autogrow, you may not be too pleased to be paged at 3 AM.
In short, your script needs to consider the autogrow property, and it can
become rather complex if you have multiple log files on different drives.
--
Linchi Shea
linchi_shea@.NOSPAMml.com
"Ray Higdon" <rayhigdon@.higdonconsulting.com> wrote in message
news:uQljKlOkDHA.2416@.TK2MSFTNGP10.phx.gbl...
> Maybe you have ran a script to create that table as I don't think it is a
> standard table, you could do
> dbcc sqlperf('logspace')
> to get log information and space used/free, from there you could throw
that
> to a table and check for percentage used to send an alert.
> HTH
> --
> Ray Higdon MCSE, MCDBA, CCNA
> --
> "Hagay Lupesko" <hagayl@.nice.com> wrote in message
> news:ezOTZOOkDHA.2652@.TK2MSFTNGP09.phx.gbl...
> > Hi all,
> >
> > I've found a way to extract log precentage usage:
> >
> > master db has a table msysperinfo which holds (among other detail) log
> > precentage use of each database.
> >
> > so the following query will give you what you need:
> >
> > select cntr_value
> > from msysperfinfo
> > where counter_name = 'Percent Log Used'
> > and instance_name = @.databaseName
> >
> > "Hagay Lupesko" <hagayl@.nice.com> wrote in message
> > news:emMTx0MkDHA.392@.TK2MSFTNGP11.phx.gbl...
> > > Hi,
> > >
> > > I want to create a job that will raise an error case Log is getting
> almost
> > > full.
> > > Is there a sp (or any other tool) that can assist?
> > >
> > > Thanks, Hagay.
> > >
> > >
> > >
> >
> >
>|||Just let Agent do this using a performance condition alert!
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"Hagay Lupesko" <hagayl@.nice.com> wrote in message news:emMTx0MkDHA.392@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I want to create a job that will raise an error case Log is getting almost
> full.
> Is there a sp (or any other tool) that can assist?
> Thanks, Hagay.
>
>

No comments:

Post a Comment