SQLSERVER 如何进行差异备份恢复
说明:以下示例首先显示如何使用 BACKUP 语句来创建 AdventureWorks2022 数据库的完整数据库备份和差异数据库备份。 然后按顺序还原这些备份。 将数据库还原到完成差异数据库备份时的状态。
USE master;
--Make sure the database is using the simple recovery model.
ALTER DATABASE AdventureWorks2022 SET RECOVERY SIMPLE;
GO
-- Back up the full AdventureWorks2022 database.
BACKUP DATABASE AdventureWorks2022
TO DISK = 'Z:\SQLServerBackups\AdventureWorks2022.bak'
WITH FORMAT;
GO
--Create a differential database backup.
BACKUP DATABASE AdventureWorks2022
TO DISK = 'Z:\SQLServerBackups\AdventureWorks2022.bak'
WITH DIFFERENTIAL;
GO
--Restore the full database backup (from backup set 1).
RESTORE DATABASE AdventureWorks2022
FROM DISK = 'Z:\SQLServerBackups\AdventureWorks2022.bak'
WITH FILE=1, NORECOVERY;
--Restore the differential backup (from backup set 2).
RESTORE DATABASE AdventureWorks2022
FROM DISK = 'Z:\SQLServerBackups\AdventureWorks2022.bak'
WITH FILE=2, RECOVERY;
GO
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作