目录
问题描述
通过SSMS中的维护计划配置了事务日志(Transaction Log)备份的Job,但测试执行后出现如下报错信息:
Date 2/4/2016 8:00:00 AM
Log Job History (backup_log.sub)
Step ID 1
Server MAXIMO75
Job Name backup_log.sub
Step Name sub
Duration 00:00:02
Sql Severity 0
Sql Message ID 0
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0
Message
Executed as user: WORKGROUP\MAXIMO75$. Microsoft (R) SQL Server Execute Package Utility Version 10.50.4000.0 for 64-bit Copyright (C) Microsoft Corporation 2010. All rights reserved. Started: 8:00:00 AM Progress: 2016-02-04 08:00:01.74 Source: {3EC7849D-C143-4091-99DB-8AADBABF5164} Executing query "DECLARE @Guid UNIQUEIDENTIFIER EXECUTE msdb..sp...".: 100% complete End Progress Progress: 2016-02-04 08:00:01.82 Source: Maintenance Cleanup Task Executing query "EXECUTE master.dbo.xp_delete_file 0,N'D:\backup\lo...".: 100% complete End Progress Error: 2016-02-04 08:00:02.35 Code: 0xC002F210 Source: Back Up Database Task Execute SQL Task Description: Executing the query "BACKUP LOG [maxdb75] TO DISK = N'D:\backup\log\ma..." failed with the following error: "BACKUP LOG cannot be performed because there is no current database backup. BACKUP LOG is terminating abnormally.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 8:00:00 AM Finished: 8:00:02 AM Elapsed: 1.531 seconds. The package execution failed. The step failed.
问题分析
仔细查看上述报错信息中的提示:
“BACKUP LOG cannot be performed because there is no current database backup. BACKUP LOG is terminating abnormally.”. Possible failure reasons: Problems with the query, “ResultSet” property not set correctly, parameters not set correctly, or connection not established correctly.
即中文如下:
无法执行 BACKUP LOG,因为当前没有数据库备份。 BACKUP LOG 正在异常终止。”。失败的原因可能有: 查询本身有问题、未正确设置 “ResultSet” 属性、未正确设置参数或未正确建立连接。
这是由于此DB库从未执行过数据库完整备份或刚将数据库的日志级别从简单模式切换到完整模式。
见MSDN中(Working with Transaction Log Backups)的描述
Before you can create the first log backup, you must create a full backup
解决办法
执行一次完整的数据备份,然后再执行事务日志备份的Job
参考资料
- 使用事务日志备份(Working with Transaction Log Backups)
https://msdn.microsoft.com/zh-cn/library/ms190440.aspx