欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

SQLServer数据库的备份/恢复的3中策略实例

程序员文章站 2022-06-06 22:40:18
...

策略一 直接语句操作 实例: 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