教您如何Sql Server備份到遠程服務器
Sql Server備份是眾多DBA關注的話題,下面就將為您介紹一種Sql Server備份到遠程服務器的方法,供您參考,希望讓您對Sql Server備份有更深的認識。
需要在SQL Server 2005 里用xp_cmdshell運行net use,創建主服務器和遠程共享文件夾之間的連接。
首先在外圍應用配置器里,啟動xp_cmdshell。
然后在SQL Server Management Studio里新建查詢,輸入:
master..xp_cmdshell 'net use \\<remotecomputer>\<sharefolder> <password> /user:<remotecomputername\loginname>'
這樣就可以了,記得運行此語句后要去外圍應用配置器里關閉xp_cmdshell。
如果想要關閉這個連接的話,重新啟動xp_cmdshell,在SQL Server Management Studio里新建查詢,輸入:
master..xp_cmdshell 'net use \\<remotecomputer>\<sharefolder> /delete'
再次關閉xp_cmdshell。
以上就是Sql Server備份到遠程服務器的方法。
【編輯推薦】