修正SQL Server事务日志备份/截断的JOB错误

目录

问题描述

通过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

参考资料

  1. 使用事务日志备份(Working with Transaction Log Backups)
    https://msdn.microsoft.com/zh-cn/library/ms190440.aspx
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值