SQLServer数据库的备份/恢复的3中策略实例
程序员文章站
2024-01-02 14:34:46
...
策略一 直接语句操作 实例: EXECUTE master.dbo.xp_fileexist N'F:\HR-ShiJie\Src\BackUpDevice.BAK' exec sp_addumpdevice N'disk', N'BackUpDevice', N'F:\HR-ShiJie\Src\BackUpDevice.BAK' BACKUP DATABASE [HRDSS] TO [BackUpDevice] WITH INIT , NOUNL
策略一 直接语句操作
实例:
EXECUTE master.dbo.xp_fileexist N'F:\HR-ShiJie\Src\BackUpDevice.BAK'
exec sp_addumpdevice N'disk', N'BackUpDevice', N'F:\HR-ShiJie\Src\BackUpDevice.BAK'
BACKUP DATABASE [HRDSS] TO [BackUpDevice] WITH INIT , NOUNLOAD , NAME = N'HRDSS 备份',
NOSKIP , STATS = 10, NOFORMAT
RESTORE DATABASE [HRDSS] FROM DISK = N'F:\HR-ShiJie\Src\BackUpDevice.BAK' WITH FILE = 1,
NOUNLOAD , STATS = 10, RECOVERY