问题
Please advice how can i setup automated database backup in my SQL Server 2012.
I need to take all databases (currently it contains only 3 ) in SQL server an automated weekly backup which runs on Every Friday at 0100 h (1 AM). These back up files (*.bak) should be placed in E:\Backups folder.
回答1:
In Microsoft SQL Server Management Studio, open the Object Explorer and then:
- Right-clic on
Management > Maintenance Plans - Clic on
New Maintenance Plan... - Give a name to your plan
- Create as many subplans as you need for your strategy
- Select a subplan and drag'n'drop the appropriate tasks from the
Toolboxpanel - To backup a database, the appropriate task is
Back Up Database Task
For the configuration of the backup schedule, you just need to follow the wizard and define what you want. If you need more information, i suggest you to go on the official website of Microsoft: Create a Full Database Backup
Hope this will help you
回答2:
You can either create a SQL Server agent job or maintenance plan in ssms as mentioned, or use a 3rd party application. I use ApexSQL Backup at the moment, as it offers in depth schedule for any created job. You can specify if you want to create daily, weekly or monthly schedule. Besides, you can always pause, or delete these schedules if you don’t want to use them for some reason.
回答3:
Go to MS SQL Server Management studio→SQL Server Agent→New Job
Under General tab enter Backup name
Under Steps tab:
- Type Step name
- Select database you want to backup
- Enter backup query
Note: Sample backup query here with backup name date and time (e.g.
TestBackup_Apr 4 2017 6,00PM.bak)DECLARE @MyFileName nvarchar(max) SELECT @MyFileName = (SELECT N'E:\TestbackupFolder\TestBackup_' +replace(rtrim(convert(char,getdate())), ':',',')+ '.bak') BACKUP DATABASE [yourdatabasename] TO DISK=@MyFileName WITH INIT;In Schedules→New, go to new schedule and set date times as required
回答4:
I can advice you to try the software Cloudberry as a backup agent to backup the data you wish. It sets the automated backup in the way you want to do it and place the backups where you want.
回答5:
Check this opensource backup windows service MFSQLBackupService, it did a great job for me.
来源:https://stackoverflow.com/questions/25860914/how-to-setup-weekly-auto-backup-in-sql-server-2012