標籤:sql server backup management studio
首先我們可以參考:
http://blog.sina.com.cn/s/blog_816780b40101m4jb.html
再次, 其中有些錯誤 需要更正,具體的命令請參考:
其中的全部的步驟是:
650) this.width=650;" title="sql server 1.png" src="http://s3.51cto.com/wyfs02/M01/75/44/wKioL1Y0XOqxF3tKAAKxq_8NYTI926.jpg" alt="wKioL1Y0XOqxF3tKAAKxq_8NYTI926.jpg" />
首先要編輯backup_YESHARE:
DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ‘:‘ , ‘-‘)
set @strPath = ‘D:\DB_BACKUP_AUTO\YESHARE\‘ +‘DB_Bak‘ [email protected] + ‘.bak‘
BACKUP DATABASE YESHARE TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT
刪除舊有備份5day ago:
DECLARE @OLDDATE DATETIME
SELECT @OLDDATE = GETDATE()-5
EXECUTE master.dbo.xp_delete_file 0,N‘D:\DB_BACKUP_AUTO\YESHARE\‘,N‘BAK‘,@OLDDATE
在advanced標籤中,設定為:
Go to the next step
另外一個為:
DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ‘:‘ , ‘-‘)
set @strPath = ‘D:\DB_BACKUP_AUTO\IndustryTradeSystem\‘ +‘DB_Bak‘ [email protected] + ‘.bak‘
BACKUP DATABASE IndustryTradeSystem TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT
最後一個執行完畢後選擇:
quit the job reporting success
-----
以上命令搞定後u,需要設定什麼時間執行這些命令:
在schedules標籤中,
650) this.width=650;" title="sql server 2.png" src="http://s3.51cto.com/wyfs02/M02/75/44/wKioL1Y0X6DxQFjuAAOxS_wejXo984.jpg" alt="wKioL1Y0X6DxQFjuAAOxS_wejXo984.jpg" />
本文出自 “蘇蘭網路” 部落格,請務必保留此出處http://zhangfang526.blog.51cto.com/8588740/1708336
SQL Server Backup