- Users can schedule the backup to be taken at a particular interval
- Users can schedule the backup copies to be deleted at a particular interval.
Do the following tasks to take a backup of a database:
1. Go to Start –> All Programs –> Microsoft Server 2008 R2 –> SQL Server Management Studio, Click SQL Server Management Studio. Microsoft Server Management Studio window with Connect to Server dialog box appears (see Image-1).
2. Enter the password of the server in Password field.
3. Click Connect. It connects to the database server and the Microsoft Server Management Studio window refreshes (see Image-2).
5. Expand Management subfolder à Maintenance Plans. Right click on Maintenance Plans and select New maintenance plan
6. Enter a relevant maintenance plan name that suits your plan in the popup box. This will identify your backup (see Image-4). Click OK
7. Maintenance plan configuration page opens (see Image-5). Note the marked areas with arrows, these are the two areas that need to be used for setting up the maintenance plan. The marked area in the right top will be used to configure the time at which the plan needs to be executed. The bottom left pane shows the tasks that can be utilized to create a SQL Maintenance plan.
NOTE: In the Maintenance plan configuration page (see Image-5), if Tool Box window (bottom left pane) does not appear go to View –> click on Tool Box.
8. Click on the calendar item shown in the right side top. Job schedule properties window pops up (see Image-6). Configure the execution time/frequency of the tasks in this pop up as per your requirement. Usually database backups are taken on daily/weekly/Monthly basis. Make sure you are selecting proper time so that your databases is least used. Click OK once you finish.
9. From the maintenance plan tasks pane ( Image-5), on the left side, select and double click on the Back Up Database Task, this will be used to select the databases to be backed up and the location where to save the Backup files (see Image-7).
10. Double click on the Back Up Database Task, it will open a new window that allows you to configure the database configuration for the backup. Here you configure the databases that you need to backup, then specify a location for the backup, the extension for the backup files etc. (see Image-8).
From the pop up modal window, by clicking on “Databases” drop down, you will be able to select the required databases and also configure the file location, extension for the backup file etc.
11. Click OK once finished. Now Backup plan configuration is over. The backup files will be created on the scheduled time in the specified folder. The name of the file will be created by appending the date so that you can identify the back up for a particular date.
Since the backup files are created frequently, it is a good practice that you delete backup files after a certain period of time. For this you need to execute clean up task along with the maintenance plan. You can configure the clean-up task as follows.
From the left side pane, drag and drop maintenance clean-up task (see Image-9).
12. Once you click OK, then save the maintenance plan. You can either wait till the next execution time or execute it manually in order to check whether everything is working fine.