T-SQL for the database family (job and maintenance plan)

Source: Internet
Author: User

What is a job

A job is a schedule that SQL Server executes at timed intervals.

SQL Server Maintenance plan and job relationships

A maintenance plan is a system-predefined job, such as a backup, restore database, and empty log maintenance plans.

General tab
    1. Open the SQL Server database, click the SQL Server Agent, locate the job under the agent, and right-click the job to select new job.

      Steps to read

    2. On the General tab, you need to enter the name, owner, category, and description of the job, and check the enabled status on it: When you're done, click the OK button.

      END

Steps tab
    1. Click the Steps tab and choose the New button here to create the contents of the job.

    2. When you click New, in the pop-up window, enter the step name, execution type, run as, database, and command script. : After entering, click the OK button.

      END

Schedule tab
    1. After you set up the steps, you need to control the steps you have created, which is called executing the commands on time, clicking on the Schedule tab, and tapping the new button.

    2. Click the New button to enter the time, period, etc. to execute the command in the popup window. When you're done, click the OK button.

      END

Alerts tab
    1. After you open the Alerts tab, click the New button, where the action is to set an alert when a problem occurs when the command is executed.

    2. When the Alert Settings window opens, enter a name, type, definition, criteria, and so on. When you're done, click the OK button.

      END

Notification tab
    1. Notification tab, you can configure the actions to be performed when the job finishes, such as sending e-mail, paging, writing to the Windows Application event log, auto-deleting jobs, and so on.

      END

Destination tab
    1. The Target tab can be set to a local server or multiple servers, if more than one is required to configure the appropriate operation.

    2. Once all the operations are complete, click the OK button in the window and the job is created.

T-SQL for the database family (job and maintenance plan)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.