0% found this document useful (0 votes)
47 views

SQL Agent Jobs: Creating A Scheduled Database Backup Plan: Prerequisites

This document provides steps to create a scheduled SQL Server database backup plan using SQL Server Management Studio. The plan includes: 1) Backing up all user databases or selected databases to a specified folder location on a scheduled frequency. 2) Creating a sub-folder for each database and a backup file for every database. 3) Adding a maintenance cleanup task to delete backup files older than a specified time frame, such as 20 hours, to ensure the prior day's backup is removed.

Uploaded by

zainol hafiz
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

SQL Agent Jobs: Creating A Scheduled Database Backup Plan: Prerequisites

This document provides steps to create a scheduled SQL Server database backup plan using SQL Server Management Studio. The plan includes: 1) Backing up all user databases or selected databases to a specified folder location on a scheduled frequency. 2) Creating a sub-folder for each database and a backup file for every database. 3) Adding a maintenance cleanup task to delete backup files older than a specified time frame, such as 20 hours, to ensure the prior day's backup is removed.

Uploaded by

zainol hafiz
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

SQL Agent Jobs: Creating a Scheduled Database Backup Plan

Prerequisites

Microsoft SQL Server (Any edition but Express)

Procedure

1. RDP onto the server

2. Connect to the SQL server using SQL Server Management Studio. You need administrative access so use Windows credentials or the SA account

3. Expand the Management section

4. Right-click on Maintenance Plans and choose New Maintenance Plan

5. Choose a name, E.G. Daily Backup


6. Double click on Subplan_1

Name: A simple name for the section of the plan (e.g. Backup)
Description: Provide some more detail explanation (e.g. Takes a daily backup and deletes the one created the previous day)
Click on the calendar icon next to the Schedule field. Change the frequency according to customers specifications
On the left-hand side there will be a toolbox containing call the available tasks

7. Add a Back Up Database Task. You can either double click it, or drag and drop it into the beige filed

A new item will appear in the design area


8. Double click on the Icon to set up the backup specifications

9. Specify the databases to back up. You can click on All user databases, or select specific ones using the These Databases option
10. Click OK

11. Select the Create a backup file for every database option

12. Check the box that says Create a sub-directory for each database

13. Select a location for the backup files (Usually something along the lines of C:\SQL Backups)

14. Hit OK

You are done setting the backup part of the plan, now we need to make it remove the old files

15. Add a Maintenance Cleanup Task from the toolbox. Make sure to connect it by dragging the arrow from the backup task onto it

Ensure the first task and second task are linked

16. Double-click on the Icon for the new task

17. On the folder section, select the folder where you are backing up the files
For file extension, select *.*

Check the Include first-level sub-folders box

Choose the time frame for file deletion. If its a daily backup task, set the time to 20 hours, not 1 day, so we ensure the prior days backup is
removed

18. Save the plan by clicking on the Save icon or hitting Ctrl + S and youre done!

You might also like