September 12, 2019 at 6:38 am
hi all
I want to keep 1 month worth of SQL agent Error logs and plan to cycle every week by running : EXEC dbo.sp_cycle_agent_errorlog ( using SQL JOB)
How do I do this ?
Thanks All
September 12, 2019 at 11:16 am
Create a job with a job step in msdb database that executes the command: Exec dbo.sp_cycle_agent_errorlog
And then schedule it to run once a week.
Sue
September 12, 2019 at 2:57 pm
By default, the agent maintains 9 logs. Each time the service starts, it creates a new log and discards the oldest one.
If you recycle manually once a week, you should have nine weeks, but any service restart could change this, so you could potentially have less than a month of logs at any time. You can also set to remove history older than xx weeks in the Agent Properties.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy