Monitoring Databases  «Prev  Next»

Using sqlmaint.exe, Exercise

Using sqlmaint.exe

Objective: Identify the function of various sqlmaint.exe parameters, and recognize a security problem in a sample script. This module's earlier lesson on automating database maintenance covered why sqlmaint.exe itself is deprecated; being able to read an existing script that still uses it, and spot what is wrong with one, remains a useful skill for anyone who inherits an older maintenance job.

Exercise scoring

You will receive 5 points for this exercise. The exercise is auto-scored; when you have completed the exercise, click the Submit button below to receive full credit.

Background and overview

Below are two sqlmaint.exe statements using various parameters. Examine them and describe, in your own words, what you think each one will accomplish based on the syntax it uses. One of the two has a problem worth noticing beyond what it executes.

sqlmaint -S EasternRegion -U "sa" -P "SaPwd"
-PlanName Plan01 -BkUpDB -BkUpMedia DISK -UseDefDir -CrBkSubDir -DelBkUps 4weeks

sqlmaint -S WesternRegion -PlanName Plan02 -BkUpDB
-BkUpMedia DISK -UseDefDir -Rpt r1.rpt -CkDB -BkUpOnlyIfClean -VrfyBackup

Instructions

Write your answers for each statement in the text box below. For each one, cover what it connects to, what plan or database it targets, and what actions it actually performs, in what order they matter. For the first statement specifically, also note anything about how it connects that you would not want to see in a production script. When you are done with both, click the Submit button below and you will receive credit for the exercise.