One of the critical responsibilities of a SQL database administrator is to get a database backed up successfully. However, it is crucial to maintain regular database backups to reduce the chances of data loss while restoring the database from backup. You can accomplish this by scheduling automatic backup of a SQL Server database.
Taking SQL Server database backup automatically also saves time and the manual effort required to run database backup. There are different methods you can use to create a scheduled backup of a SQL database automatically.
Methods to Schedule a Backup
Following are the two methods you can use to schedule an automated backup:
Method 1 – Taking Database Backup Automatically Using Maintenance Plan Wizard
The Maintenance Plan Wizard is an easier and convenient method for creating automated backups with limited options.
You can set a schedule to automatically back up a SQL database using the Maintenance Plan Wizard by following these steps:
- Open SQL Server Management Studio (SSMS), and connect to a server instance.
- Expand the Management folder from the ‘Object Explorer’ pane, right-click on Maintenance Plans, and choose Maintenance Plan Wizard.
- When the ‘SQL Server Maintenance Plan Wizard’ opens, click Next.
- On the ‘Select Plan Properties’ screen, enter name of your maintenance backup plan. In our case, we have specified it as ‘AutomateBackupDatabase’. Next, enter a description for the maintenance plan, and then click Change.
- On the ‘New Job Schedule’ dialog box, specify the frequency of your database backup, the time you want the backup process to run, and then click OK.
- Click Next.
- On the ‘Select one or more maintenance tasks:’ screen, choose the Back Up Database option as you can see in the below screen.
- To execute full database backup,click Next.
- On ‘Define Back Up Database (Full) Task’ screen, under General sectionspecify all or a specific database for backup, and then click OK.
- Click on the Destination tabfrom the ‘Define Back Up Database (Full) Task’ screen. Next, check options by clicking on the Options tab, and then click Next.
- By default, a report of the maintenance plan actions is written to a text file in the specified location. You may choose to change the default location, and then press Next.
- Once you’re satisfied with the backup maintenance plan options, click Finish.
- Success status is displayed once the selected actions for the backup maintenance plan are performed successfully. Click Close.
Now, from the ‘Object Explorer’ pane, right-click on SQL Server Agent, and you will see a job created automatically for the backup maintenance plan.
While the Maintenance Plan Wizard provides a more effortless and hassle-free way of taking database backup, it fails to provide granular control and configuration options for scheduling automated backups. An alternative is to create an automatic backup job using SQL Server Agent.
End Note
This blog discussed the two different methods to take SQL Server database backup automatically. If you need a point-and-click interface to automate backup on a scheduled basis, you can use the Maintenance Plan Wizard to create a backup maintenance plan. Consider using the SQL Server Agent jobs as explained in the blog for more control and configuration options for scheduling automatic backups.