1. 启动XP_cmdshell
方法1: SQL Server右键-方面-方面:外围应用配置器-XPXMDSHELLENABLE:true-确定保存
方法2: 新建查询
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'xp_cmdshell', 1;
RECONFIGURE;
2. 创建映射
新建查询:
exec master.sys.xp_cmdshell 'net use Z: \\192.168.0.8\SQLBacK password /user:192.168.0.8\administrator';
3. 备份数据库
方法1:
backup database testxx to disk='\\192.168.0.8\SQLBacK' with init
方法2:
维护计划选择需要修改的备份计划,备份路径可以选择共享盘
文章评论