--创建备份设备EXEC sp_addumpdevice 'disk', 'MyAdvWorks_1', 'd:\backup\MyAdvWorks_1.bak';EXEC sp_addumpdevice 'disk', 'MyAdvWorks_diff1', 'd:\backup\MyAdvWorks_diff1.bak';EXEC sp_addumpdevice 'disk', 'MyAdvWorks_log1', 'd:\backup\MyAdvWorks_log1.bak';EXEC sp_addumpdevice 'disk', 'MyAdvWorks_log2', 'd:\backup\MyAdvWorks_log2.bak';
--数据库备份阶段-- 创建完整备份BACKUP DATABASE MyAdvWorks TO MyAdvWorks_1 WITH INIT;GO-- 在完整备份之后创建差异备份BACKUP DATABASE MyAdvWorks TO MyAdvWorks_diff1 WITH DIFFERENTIAL;GO
--数据库还原阶段-- 完整还原RESTORE DATABASE MyAdvWorks FROM MyAdvWorks_1 WITH NORECOVERY;GO-- 在完整还原之后差异还原RESTORE DATABASE MyAdvWorks FROM MyAdvWorks_diff1 WITH RECOVERY;GO