成功运行几次后,日志传送还原作业失败

Log shipping restore job failing after a couple successful runs

提问人:Ed Hall 提问时间:1/25/2021 最后编辑:Ed Hall 更新时间:1/27/2021 访问量:679

问:

我在几个运行良好的数据库上有日志传送,我有三个失败。它们都从同一个小学转到同一个中学。我已经将工作数据库的设置模拟为非工作数据库。

我为失败的数据库重新设置、删除和重新设置日志传送,恢复在前几次应有尽有。但通常在第三个周期,它会在作业历史记录中发布断开连接的用户,然后从那时起它会出错。作业成功完成,但在还原步骤中出现错误。

我在这里错过了什么? 出现错误后,我运行完整备份和还原,使其处于待机模式,然后下一个日志传送周期成功。但第 2 个周期再次失败

我正在使用版本: ---Microsoft SQL Server 2012 (SP4-GDR) (KB4532098) - 11.0.7493.4 (x64) 12月 24, 2019 19:33:24 版权所有 (c) Windows NT 6.3 (Build 9600: ) 上的 Microsoft Corporation Standard Edition (64-bit) (Hypervisor) 作业历史记录日志:

021-01-25 08:17:06.30   *** Error: Could not apply log backup file '\\secondary\SQLLogShip\secondarydb_20210125034500.trn' to secondary database 'secondarydb'.(Microsoft.SqlServer.Management.LogShipping) ***
2021-01-25 08:17:06.30  *** Error: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.(System.Data) ***
2021-01-25 08:17:06.30  *** Error: Could not log history/error message.(Microsoft.SqlServer.Management.LogShipping) ***
2021-01-25 08:17:06.30  *** Error: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.(System.Data) ***
2021-01-25 08:17:06.30  Skipping log backup file '\\secondary\SQLLogShip\secondarydb_20210125034500.trn' for secondary database 'secondarydb' because the file could not be verified.
2021-01-25 08:17:06.30  *** Error: Could not log history/error message.(Microsoft.SqlServer.Management.LogShipping) ***
2021-01-25 08:17:06.30  *** Error: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.(System.Data) ***
2021-01-25 08:17:06.30  *** Error: An error occurred restoring the database access mode.(Microsoft.SqlServer.Management.LogShipping) ***
2021-01-25 08:17:06.30  *** Error: ExecuteScalar requires an open and available Connection. The connection's current state is closed.(System.Data) ***
2021-01-25 08:17:06.30  *** Error: Could not log history/error message.(Microsoft.SqlServer.Management.LogShipping) ***
2021-01-25 08:17:06.30  *** Error: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.(System.Data) ***
2021-01-25 08:17:06.30  *** Error: Could not apply log backup file '\\secondary\SQLLogShip\secondarydb_20210125040001.trn' to secondary database 'secondarydb'.(Microsoft.SqlServer.Management.LogShipping) ***
2021-01-25 08:17:06.30  *** Error: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.(System.Data) ***
2021-01-25 08:17:06.30  *** Error: Could not log history/error message.(Microsoft.SqlServer.Management.LogShipping) ***
2021-01-25 08:17:06.30  *** Error: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.(System.Data) ***
2021-01-25 08:17:06.30  Skipping log backup file '\\secondary\SQLLogShip\secondarydb_20210125040001.trn' for secondary database 'secondarydb' because the file could not be verified.
2021-01-25 08:17:06.30  *** Error: Could not log history/error message.(Microsoft.SqlServer.Management.LogShipping) ***
2021-01-25 08:17:06.30  *** Error: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.(System.Data) ***
2021-01-25 08:17:06.30  *** Error: An error occurred restoring the database access mode.(Microsoft.SqlServer.Management.LogShipping) ***
2021-01-25 08:17:06.30  *** Error: ExecuteScalar requires an open and available Connection. The connection's current state is closed.(System.Data) ***
2021-01-25 08:17:06.30  *** Error: Could not log history/error message.(Microsoft.SqlServer.Management.LogShipping) ***
2021-01-25 08:17:06.30  *** Error: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.(System.Data) ***

我重建了日志传送并禁用了第二个日志备份作业。出现新错误。 2021-01-27 07:18:04.37 *** 错误:无法将日志备份文件“\secondary\SQLLogShip\dbname_20210126204500.trn”应用于辅助数据库“dbname”。(Microsoft.SqlServer.Management.LogShipping) *** 2021-01-27 07:18:04.37 *** 错误:处理数据库“dbname”的日志时出错。如果可能,请从备份还原。如果备份不可用,则可能需要重新生成日志。 恢复过程中发生错误,导致数据库“DP_Rpt”(19:0) 无法重新启动。诊断恢复错误并修复它们,或从已知良好的备份中还原。如果错误未得到纠正或预期,请联系技术支持。 RESTORE LOG 异常终止。 为文件 1 上的数据库“dbname”和文件“dbname”处理了 0 页。 为文件 1 上的数据库“dbname”和文件“dbname”处理了 1 页。(.Net SqlClient 数据提供程序) *** 2021-01-27 07:18:04.39 *** 错误:无法记录历史记录/错误消息。(Microsoft.SqlServer.Management.LogShipping) ***

这是怎么回事?我有几个日志数据库,这很好,但这个有问题。

在主要上运行的每日完整备份作业是否会导致此问题?

sql-server 日志传送

评论

0赞 David Browne - Microsoft 1/25/2021
什么版本?输出什么?select @@version
0赞 Ed Hall 1/25/2021
Microsoft SQL Server 2012 (SP4-GDR) (KB4532098) - 11.0.7493.4 (x64) 12月 24, 2019 19:33:24 版权所有 (c) Windows NT 6.3 <X64> 上的 Microsoft Corporation Standard Edition(64 位)(内部版本 9600:)(虚拟机监控程序)

答: 暂无答案