Sql Server 数据库备份到网络共享文件夹

      1、开启sp_configure 系统存储过程高级选项

exec sp_configure 'show advanced options' ,1;
reconfigure;

 

      2、开启扩展存储过程xp_cmdshell,用于运行cmd 命令

exec sp_configure 'xp_cmdshell',1;
reconfigure;

 

      3、映射网络磁盘Z(指定共享文件夹所在的网络路径以及访问凭证)
exec master.sys.xp_cmdshell 'net use Z: \\ip_addr\shared_folder password  /user:username';

       4、使用sms 建立数据库备份维护计划,指定备份文件存放的文件夹为映射的网盘Z

      image

posted @ 2022-05-24 09:56  踏雪无痕2017  阅读(3024)  评论(0)    收藏  举报