开发者

SQL Server Backup to a Remote Server

开发者 https://www.devze.com 2023-01-02 08:07 出处:网络
I realise there is a command: BACKUP DATABASE [DB Name] TO DISK [PATH] Is it possible to backup to a remote location? - E.G. the web server rathe开发者_如何学运维r than the database server?Yes.Exa

I realise there is a command:

BACKUP DATABASE [DB Name] TO DISK [PATH]

Is it possible to backup to a remote location? - E.G. the web server rathe开发者_如何学运维r than the database server?


Yes. Exactly the same syntax as the normal backup command, but replace the path as appropriate, eg:

BACKUP DATABASE [DB NAME] TO DISK [\\server\share\path]

There's an example on http://msdn.microsoft.com/en-us/library/ms179313.aspx that shows this.

You will need to make sure that the SQL server account is able to write files to the named path.


i created a remote full/transact backup template which you can try it out, it checks the local disk space and remote disk space before transfering.

git clone https://github.com/jnre/SQL_backupremote.git
0

精彩评论

暂无评论...
验证码 换一张
取 消