Automate SQL Server Log Monitoring

  • It is good. However, hard-coded WHILE (@no < 7)

    There are times you need more than 7 log files, for example, SOX may require to retain a year data.

    This parameter needs to read all logs or can be overridden by caller.:-P

    http://dbace.us

  • yech61813 (11/24/2015)


    It is good. However, hard-coded WHILE (@no < 7)

    There are times you need more than 7 log files, for example, SOX may require to retain a year data.

    This parameter needs to read all logs or can be overridden by caller.:-P

    http://dbace.us[/quote%5D

    Thank you for your thoughts. This script is intended for daily use / monitoring of the SQL error log(s), not for storing/archiving them. You are right, however, that even within 24 hours, more than 7 error logs could have been created, e.g. through several reboots/restarts of the SQL engine. I have at one time included code to determine the max number of error logs, using master.dbo.xp_instance_regread. That works well on a default instance, but needs additional coding in the case of a named instance. I'll look into it for a future version.

  • I am trying to set this up and am getting the following error.

    USE MonitorDB

    EXEC [Retrieve_LinkedServer_ErrorLog]

    Msg 0, Level 11, State 0, Line 0

    A severe error occurred on the current command. The results, if any, should be discarded.

     

    Running SQL 2019.

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply