SQL Server差异备份失败

时间:2017-07-13 04:23:09

标签: sql-server-2008-r2 database-backups

我注意到维护计划中存在差异备份失败。它似乎是尝试企业保险库副本的结果,但目前无法确认。上一次完整备份是在下午5:00完成的,失败发生在晚上11:30。

enter image description here

日志文件在这里:

Microsoft(R) Server Maintenance Utility (Unicode) Version 10.50.6220
Report was generated on "server_name".
Maintenance Plan: db_name backup Differential
Duration: 00:00:00
Status: Warning: One or more tasks failed.
Details:
Back Up Database Task (server_name)
Backup Database on Local server connection
Databases: DB_NAME
Type: Differential
Append existing
Task start: 2017-07-12T23:30:01.
Task end: 2017-07-12T23:30:02.
Failed:(-1073548784) Executing the query "BACKUP DATABASE [DB_NAME] TO  DISK = N'C:..." failed with the following error: "Cannot perform a differential backup for database "DB_NAME", because a current database backup does not exist. Perform a full database backup by reissuing BACKUP DATABASE, omitting the WITH DIFFERENTIAL option.
BACKUP DATABASE is terminating abnormally.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

Command:EXECUTE master.dbo.xp_create_subdir N''C:\Full Backups\Differentials\DB_NAME''

GO
BACKUP DATABASE [DB_NAME] TO  DISK = N''C:\Full Backups\Differentials\DB_NAME\DB_NAME_backup_2017_07_12_233001_9226889.bak'' WITH  DIFFERENTIAL , NOFORMAT, NOINIT,  NAME = N''DB_NAME_backup_2017_07_12_233001_9070642'', SKIP, REWIND, NOUNLOAD, COMPRESSION,  STATS = 10
GO
declare @backupSetId as int
select @backupSetId = position from msdb..backupset where database_name=N''DB_NAME'' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N''DB_NAME'' )
if @backupSetId is null begin raiserror(N''Verify failed. Backup information for database ''''DB_NAME'''' not found.'', 16, 1) end
RESTORE VERIFYONLY FROM  DISK = N''C:\Full Backups\Differentials\DB_NAME\DB_NAME_backup_2017_07_12_233001_9226889.bak'' WITH  FILE = @backupSetId,  NOUNLOAD,  NOREWIND

GO

问题是我似乎无法找到这个新的完整备份,这个备份是从早上12:30开始的差异备份作为基础创建的?有没有办法找到差异所指向的基本文件?

1 个答案:

答案 0 :(得分:0)

一种方法是通过PowerShell脚本(在各种论坛上轻松提供)自动执行此作业,您可以在其中为增量备份,完整备份和差异备份设置单独的参数。 我更喜欢的另一种方法是使用专用的备份软件设置来完成此任务。 之前我有MS DPM来管理SQL备份,它真的很棒。 我还尝试过针对SQL服务器的Cloudberry备份,它也是一个轻松可靠的基于云的备份工具。