609
Chapter 22: Maintaining the Database
22
You know when a task is complete by the appearance of the square in the design area.
Incomplete tasks, those that won’t correctly execute, have a red circle with an X through it
on the right side of the display.
After you defi ne a task, add the next task in your list. You can add the tasks in any order
and place them in any order on screen. Connect the tasks in the order in which you want
SQL Server to execute them. Figure 22-1 showed two tasks with one task connected to the
next task in the list. The example checks the integrity of the AdventureWorks2012 data-
base fi rst and then backs it up.
FIGURE 22-5
View T-SQL button enables you to see the Transact-SQL command.
There is a shrink database task available in the maintenance plan toolbox; however, it is highly recommended you
AVOID using this in any regular maintenance plan. Shrinking databases, as mentioned earlier in this chapter, causes
index and fi le-level fragmentation, which leads to degraded performance. If you currently are using this in your main-
tenance plans, it is highly recommended you re-evaluate your use for it and remove it from your plans if possible. This
task leads to more harm than good.
Defining the Schedule
You can perform tasks on demand or schedule them to automatically run. Generally, it’s a
good idea to set standard tasks such as backup to run automatically. Click the calendar icon
next to the Schedule fi eld to display the Job Schedule Properties dialog box, as shown in
Figure 22-6, when you want to change the task schedule.
c22.indd 609c22.indd 609 7/31/2012 9:24:33 AM7/31/2012 9:24:33 AM
http://www.it-ebooks.info