Setting Up a New SQL Maintenance Plan
- Open SQL Server Management Studio
- Connect to the database using [ . ] or server name
Setting up security
- Expand Security in the left hand window
- Expand Logins in the left hand window
- Double-click on BUILTIN\Users
- Click on server roles down the left-hand side window and Clear SETUPADMIN & SYSADMIN
- Click OK
- Click on Management (in the left-hand side list) and expand
- Right-click on Maintenance Plans and select Maintenance Plan Wizard
- Click Next on the first screen
- Select on Separate schedule for each task
- Click next
- Select Back Up Database (Full), Back Up Database (Transaction Log) and Maintenance Cleanup Task then click next, then next again
A Full backup Task
- Select the database you wish to backup (most often this is only Abel) then click OK
- Click on destination (in newer versions of SQL this will be a tab at the top of this dialog window)
- Select Create a sub-directory for each database and add the path where you want this backup to save to (most often it will be C:\ABELDent\Data\Backup but varies depending on the office)
- Click Next when finished
B Transaction Log backup task
- Select the Database you want to backup (Most often this is only Abel) then click OK
- Click on Destination (in newer version of SQL this will be a tab at the top of the window
- Select Create a sub-directory for each database and add the path where you this backup to save to (most often it will be C:\ABELDent\Data\Backup but varies depending on the office
- Click next when finished
C Define Maintenance Cleanup Task (.bak)
- Select Include First Level Subfolders and Select Cleanup Job Path (most often it will be C:\ABELDent\Data\Backup but varies depending on the office)
- Note: File extension on this cleanup job should be BAK
- Change Delete Files Older than the following to: 2 Week(s)
- Click Next
- Click Next again
- Click Finish
Editing times for scheduled jobs / adding second cleanup for TRN files
- Right-click and refresh on maintenance plans
- Double-click to modify newly created Maintenance Plan (The freshly created maintenance plan should open)
- Select subplan_3 (maintenance Cleanup task)
- Select toolbox (top left corner of the window) to expand and Double-click on maintenance plan cleanup task to add to subplan3
- Note: your screen should show:
- Click on the green arrow of this plan and Drag and Drop it over top of the Maintenance Cleanup Task
Define Maintenance Cleanup Task (TRN)
- Double click on Maintenance Cleanup task 1
- Select Include First Level Subfolders and Select Clanup Job Path (most often it will be C:\ABELdent\Data\Backup but varies depending on the office)
- Change Delete files older than the following to: 2 Week(s)
- Note: File extension on this cleanup job should be TRN
- Click OK
Setting Schedules for Plans to run Automatically
- Click on icon as shown below for subplan_1
- Set the job schedule to run (occurs) Daily and set the Frequency to Once at 6 am
- Click OK
- Click on icon for Subplan_2
- Set the job schedule to run (occurs) daily and set the Frequency to every 4 hours
- Click OK
- Click on icon for Subplan_3
- Set the job schedule to run (occurs) Weekly and set the frequency to Weekly on Monday, Wednesday, and Friday
- Click OK
- Upon completion it should appear like:
Running the Jobs
The jobs created appear:
- Right-click on MaintenancePlan.Subplan and select start Job at Step 1
- Repeat for Subplan_2 and Subplan_3
Product (s): ABELDent, ABELMed, Portal
Classification: Internal and External
Date Created: August 1st, 2019
Created by: John Scarlett