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