Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between jobs and maintenance plan in sql server

Tags:

sql

sql-server

What is the difference between jobs and maintenance plan in sql server?

I am confused about where I should use job and where maintenance plan.

like image 531
Ravindra Avatar asked Aug 11 '10 07:08

Ravindra


People also ask

What is a SQL maintenance plan?

A maintenance plan is a set of measures (workflows) taken to ensure that a database is properly maintained and routine backups are scheduled and handled.

What are maintenance jobs in SQL Server?

The Maintenance Plan Wizard creates a maintenance plan that Microsoft SQL Server Agent can run on a regular basis. This allows you to perform various database administration tasks, including backups, database integrity checks, or database statistics updates, at specified intervals.

What is the difference between SQL job and stored procedure?

Jobs can run repetitive or scheduled tasks, and they can automatically notify users of job status. Stored procedureSQL provides the stored procedure mechanism to simplify the database development process by grouping Transact-SQL statements into manageable blocks.

What does job do in SQL Server?

A job is a specified series of operations performed sequentially by SQL Server Agent. A job can perform a wide range of activities, including running Transact-SQL scripts, command prompt applications, Microsoft ActiveX scripts, Integration Services packages, Analysis Services commands and queries, or Replication tasks.


1 Answers

Jobs are user defined scheduled tasks (could be stored procedures, emails and more).

Maintenance plans are used to optimize the database.

From MSDN:

Maintenance plans create a workflow of the tasks required to make sure that your database is optimized, is regularly backed up, and is free of inconsistencies.

A maintenance plan may use jobs as part of the workflow.

A job may be part of a maintenance plan.

like image 117
Oded Avatar answered Sep 19 '22 07:09

Oded