SQL Server Backup

來源:互聯網
上載者:User

標籤: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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.