首頁 >資料庫 >mysql教程 >SQL Server Backup_MySQL

SQL Server Backup_MySQL

WBOY
WBOY原創
2016-05-27 13:46:491411瀏覽

其中的全部的步骤是:

SQL Server Backup_MySQL

 

首先要编辑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' +@strPath + '.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' +@strPath + '.bak'

BACKUP DATABASE IndustryTradeSystem TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT

 

最后一个执行完毕后选择:

quit the job reporting success

 

-----

以上命令搞定后u,需要设置什么时间执行这些命令:

在schedules标签中,
SQL Server Backup_MySQL


陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn