简体   繁体   English

SQL Server维护向导备份计划

[英]SQL Server Maintenance Wizard Backup Plans

I used the SQL Server Maintenance wizard (along with a book) to generate both Full and Differentail backups. 我使用SQL Server维护向导(以及一本书)来生成Full和Differentail备份。 The Full backup runs on Monday morning and the Differentials run Tuesday through Saturday. 完整备份在星期一早上运行,差异在星期二到星期六运行。 The Full backup runs fine and generates the following email report... 完整备份运行正常并生成以下电子邮件报告...

Microsoft(R) Server Maintenance Utility (Unicode) Version 10.0.2531 Report was generated on "WIN-F9U4VJXGWF5".
Maintenance Plan: FIREDataFB
Duration: 00:31:31
Status: Succeeded.
Details:
Clean Up History (WIN-F9U4VJXGWF5)
Cleanup history on Local server connection History type: Backup,Job,Maintenance Plan
Age: Older than 1 Weeks
Task start: 2010-10-11T03:30:03.
Task end: 2010-10-11T03:30:03.
Success
Command:declare @dt datetime select @dt = cast(N''2010-10-04T03:30:02'' as datetime) exec msdb.dbo.sp_delete_backuphistory @dt GO EXEC msdb.dbo.sp_purge_jobhistory  @oldest_date=''2010-10-04T03:30:02''
GO
EXECUTE msdb..sp_maintplan_delete_log null,null,''2010-10-04T03:30:02''
GO

Back Up Database (Full) (WIN-F9U4VJXGWF5) Backup Database on Local server connection
Databases: FIREData
Type: Full
Append existing
Task start: 2010-10-11T03:30:03.
Task end: 2010-10-11T04:01:33.
Success
Command:EXECUTE master.dbo.xp_create_subdir N''F:\SQL Backups\FIREData''

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

GO

The Differential backups do not run. 差异备份不会运行。 They fail with an error indicating that the Differential jobs cannot find the Full backup result. 它们失败并显示错误,指示差异作业无法找到完整备份结果。 The following email report is sent when a Differential job fails... 差异作业失败时发送以下电子邮件报告...

Microsoft(R) Server Maintenance Utility (Unicode) Version 10.0.2531 Report was generated on "WIN-F9U4VJXGWF5".
Maintenance Plan: FIREDataDB
Duration: 00:00:01
Status: Warning: One or more tasks failed.
Details:
Back Up Database (Differential) (WIN-F9U4VJXGWF5) Backup Database on Local server connection
Databases: FIREData
Type: Differential
Append existing
Task start: 2010-10-12T03:30:03.
Task end: 2010-10-12T03:30:03.
Failed:(-1073548784) Executing the query "BACKUP DATABASE [FIREData] TO  DISK = N'F:\\SQL Bac..." failed with the following error: "Cannot perform a differential backup for database "FIREData", 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''F:\SQL Backups\FIREData''

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

GO

I must be missing something obvious because I would not expect the wizard to yield unusable scripts but I cannot find the problem. 我必须遗漏一些明显的东西,因为我不希望向导产生无法使用的脚本,但我找不到问题。 I have repeated the creation process twice now with book in hand and the Wizard at the ready, but no joy. 我现在已经重复了两次创作过程,手里拿着书,准备好了向导,但没有快乐。 Any help would be appreciated. 任何帮助,将不胜感激。 I am using SQL Server 2008 Management Studio version 10.0.2531.0 on Windows 7. 我在Windows 7上使用SQL Server 2008 Management Studio版本10.0.2531.0。

I notice that your DIFFERENTIAL backup is being executed 24 hours after your FULL backup has completed. 我注意到您的DIFFERENTIAL备份在完成备份后24小时内执行。 Are you absolutely certain that the FULL backup file exists at the time of the DIFFERENTIAL backup job execution? 您是否完全确定在执行DIFFERENTIAL备份作业时是否存在FULL备份文件? For example, do you have any clean-up jobs or processes that could have removed the backup file? 例如,您是否有任何可能已删除备份文件的清理作业或进程?

I suggest that you attempt to validate that you can indeed perform a FULL backup, followed by a DIFFERENTIAL backup, within your environment by completing the appropriate steps manually using T-SQL. 我建议您尝试通过使用T-SQL手动完成相应的步骤来验证您是否确实可以在您的环境中执行FULL备份,然后执行DIFFERENTIAL备份。 If successful, you can then be sure that the issue exists solely somehow with your Maintenance plan implementation. 如果成功,您可以确保该问题仅以某种方式存在于维护计划实施中。

To further assist you with your own troubleshooting efforts you may also find the following thread from the MSDN forums to be interesting reading. 为了进一步帮助您进行自己的故障排除工作,您还可以从MSDN论坛中找到以下主题,以便进行有趣的阅读。

Cannot perform a differential backup for database 无法为数据库执行差异备份

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM