Screenshots

Instance Level

The following SQL job ensures the SQL Server Agent logs and SQL Server Error logs are recycled on a daily basis. This will help ensure that neither log grows too large in size, and can therefore easily be accessed for troubleshooting purposes.

Supporting screenshots have been added below this section, using the “Cycle error logs” plan as an example.

Start > Microsoft SQL Server > SQL Server Management Studio > SQL Server Agent > Jobs > New Job

Name: Cycle error logs

Category: Database Maintenance

Steps:

ü Step 1

o Step Name: Cycle agent log

o Type: T-SQL

o Database: msdb

o Command:

exec sp_cycle_agent_errorlog

o On success action: Go to the next step

ü Step 2

o Step Name: Cycle error log

o Type: T-SQL

o Database: msdb

o Command:

exec sp_cycle_errorlog

o On success action: Quit the job reporting success

Schedule Name: Daily at midnight

Schedule: Daily at 00:00