问题背景有时候备份在其他机器上面,只能通过远程共享访问,如果要还原这个备份应该怎么做?

 

设 远程机器的IP 为 192.168.51.101

远程共享目录为 \\192.168.51.101\bak\

密码为 password

用户名为 admin

sp_configure 'show advanced options', 1;

GO

RECONFIGURE; --立即生效,否则重启实例生效

GO


sp_configure 'xp_cmdshell', 1;

GO

RECONFIGURE;

GO


exec master..xp_cmdshell 'net use X: \\192.168.51.101\BAK "password" /USER:192.168.51.101\admin'
go

然后再执行还原操作的时候,就看到多出1个X盘,在里面选择bak文件还原即可。

 

posted on 2018-10-29 13:38  zooz  阅读(156)  评论(0)    收藏  举报