SQL Agent Jobs: Creating A Scheduled Database Backup Plan: Prerequisites
SQL Agent Jobs: Creating A Scheduled Database Backup Plan: Prerequisites
Prerequisites
Procedure
2. Connect to the SQL server using SQL Server Management Studio. You need administrative access so use Windows credentials or the SA account
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
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
17. On the folder section, select the folder where you are backing up the files
For file extension, select *.*
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!