The following prerequisites, steps, and verification process are necessary only if you are working with SQL Server 2005 Standard. They are not necessary for SQL Server Express.
Prerequisites:
- Install Microsoft SQL Server Management Studio (not SQL Server Management Studio Express) and Integration Services:
- Run the SQL Server 2005 setup from the SQL Server 2005 installation disk.
- In Feature Selection, click Advanced.
- Click Integration Services and select Will be installed on local hard drive.
- Similarly, under Client Components, click Management Tools and select Will be installed on local hard drive.
- Click Next and finish the setup.
- Make sure SQL Server Agent is running and set to run automatically when Windows starts up:
- Select Start>Programs>Microsoft SQL Server 2005>Configuration Tools>SQL Server Configuration Manager.
- Select SQL Server 2005 Services.
- In the right pane, ensure that SQL Server Agent is running and starts on Windows startup:
- Right-click SQL Server Agent and select Properties.
- On the Service tab, make sure Start Mode is set to Automatic.
- Click OK.
- Right click SQL Server Agent again and select Start. If Start is grayed out but Stop is not, then it is already started.
Steps:
- Open Microsoft SQL Server Management Studio:
- Select Start>Programs>Microsoft SQL Server 2005>SQL Server Management Studio.
- In the Connect to Server dialog, select your SQL Server from the Server name drop-down.
- Click Connect.
- In the Object Explorer, expand Management.
-
Right-click Maintenance Plans and select Maintenance Plan Wizard.
The Maintenance Plan Wizard opens.
- Click Next.
- On the Select a Target Server page, click in the Name field and enter a name for this maintenance plan (e.g., "Feedback Server Maintenance Plan").
- Click Next.
- On the Select Maintenance Tasks page, place a check mark next to:
- Shrink Database
- Back Up Database (Full)
- Back Up Database (Transaction Log)
- Click Next.
- On the Select Maintenance Task Order page, use the Move Up and Move Down buttons to configure the three previous tasks in the following order from top to bottom:
- Back Up Database (Full)
- Back Up Database (Transaction Log)
- Shrink Database
- Click Next.
- On the Define Back Up Database (Full) Task page, click the down arrow next to the Databases field and place a check mark next to the name of the appropriate database (i.e., the same database that is listed on the General tab of the Feedback Server Admin).
- Click OK.
- (Optional) Next to the Folder field, you can select the folder where the backup will be saved.
- Click Next.
- On the Define Back Up Database (Transaction Log) Task page, click the down arrow next to the Databases field and place a check mark next to the name of the appropriate database (i.e., the same database that is listed on the General tab of the Feedback Server Admin).
- Click OK.
- (Optional) Next to the Folder field, you can select the folder where the backup will be saved.
- Click Next.
- On the Define Shrink Database Task page, click the down arrow next to the Databases field and place a check mark next to the name of the appropriate database (i.e., the same database that is listed on the General tab of the Feedback Server Admin).
- Click OK.
- In the field labeled Shrink database when it grows beyond, enter 1 so that the database shrinking occurs when the database is larger than 1 MB.
- Click Next.
-
On the Select Plan Properties page, click Change to define a maintenance schedule.
The New Job Schedule dialog opens.
- In the Name field, type a name for this schedule (e.g., "Feedback Server Maintenance Schedule").
- From the Occurs drop-down menu, select Daily.
- (Optional) In the field labeled Occurs once at, you can select a time you prefer the maintenance plan to be executed or use the default (12:00:00 AM). It is recommended that the maintenance plan run during a time when there is the least amount of traffic using the database.
- Click OK.
- In the Maintenance Plan Wizard, click Next.
- (Optional) On the Select Report Options page, you can select to have a report written to a text file after each time the maintenance plan is executed. To do so, place a check mark next to Write a report to a text file.
- (Optional) Next to Folder location, you can select the folder where the text file will be saved.
- Click Next.
- The Complete the Wizard page shows a summary of the options that you selected. Review them and click Finish.
- The Maintenance Plan Wizard Progress page displays the progress of creating the maintenance plan. After it is completed, click Close.
Verify the maintenance plan:
- Open Microsoft SQL Server Management Studio
- In the Object Explorer, expand Management.
- Expand Maintenance Plans.
- Right-click Maintenance Plans and select Refresh to ensure that all maintenance plans are displayed. The new maintenance plan should appear in the list.
- On the same level as Maintenance Plans, expand SQL Server Agent.
- Expand Jobs.
- Right-click Jobs and select Refresh to ensure that all jobs are displayed. A new job should appear in the list with the same name as the maintenance plan you created.
-
To test executing the maintenance plan, right-click the job and select Start job.
A dialog appears, displaying the progress and status of the job. All statuses should show "Success."
- Using Windows Explorer, browse to the various locations you chose to save the database backup, transaction log backup, and report text file. Verify that each file exists.