5.2. SQL Server Agent

When a Maintenance Plan does not cover all the automation you require on a SQL Server, or anytime you need to do more than you can with a Maintenance Plan, using SQL Server Agent directly is the way to go.

Figure 5-12. Figure 5-12
Figure 5-13. Figure 5-13

5.2.1. Automation Components

There are four basic components of SQL Server Agent, each of which we discuss in the following sections:

  • Jobs: Defines the work to be done.

  • Schedules: Defines when the job will be executed.

  • Alerts: Enables you to set up an automatic response or notification when an event occurs.

  • Operators: The people who can be notified regarding job status and alerts.

NOTE

By default, the SQL Server Agent service is not running, and the service is set to manual after the install of SQL Server. If you are going to be using this in production, be sure to use SQL Server Configuration Manager to set the Start Mode of this service to Automatic.

You should never use the Services Console in the Administrative Tools folder to manage SQL Server Services. As clearly indicated in SQL Server Books Online, using the Services Console to manage SQL Server services is unsupported.

5.2.1.1. Jobs

As with Maintenance Plans, a basic reason to use SQL Server Agent is to schedule work to be done automatically, ...

Get Professional Microsoft® SQL Server® 2008 Administration now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.