注意权限:SQLServer备到FileServer上,或从FileServer恢复到SQLServer,
都要求SQLServer的启动用户必须在FileServer上有足够的权限!
(1)备份
EXEC sp_addumpdevice 'disk', 'TestDev', '对应的FileServer共享文件夹地址\Test.Bak'
USE Test (备份数据库名)
BACKUP DATABASE Test TO TestDev
exec sp_dropdevice 'TestDev'
(2)恢复
exec sp_addumpdevice 'disk','FRDBDev','\\192.168.60.**\backup\FRDB_db_**.BAK',null,null
restore database FRDB
from FRDBDev
with move 'FRDB' to 'E:\sql2005_data\FRDBD.mdf',
move 'FRDB_log' to 'E:\sql2005_data\FRDBD_log.ldf'
exec sp_dropdevice 'FRDBDev'