MSSQLSERVER_17066

适用于:SQL Server

详细信息

Attribute
产品名称 SQL Server
事件 ID 17066
事件源 MSSQLSERVER
组件 SQLEngine
符号名称 SQLASSERT_ONLY
消息正文 SQL Server断言:文件: <%s>,line=%d 失败断言 = '%s'。 此错误可能与时间有关。 如果重新运行该语句后错误仍然存在,请使用 DBCC CHECKDB 来检查数据库的结构是否完整,或重新启动服务器以确保内存中的数据结构未破坏。

说明

断言是放置在应用程序代码中的语句,以确保满足某些条件。 在这方面,断言的行为类似于错误。 你可以将断言视为强调的、坚定的错误。 必须满足指定的条件,程序才能继续定期执行。 如果未满足条件,则会引发断言。 有关详细信息,请参阅 C/C++ 断言

SQL Server在许多位置使用断言来确保条件正确。 例如,条件“existingState == DB_Unencrypted”断言,在运行代码中的下一个命令之前,数据库状态未加密。 如果不是这样,则会引发断言。 错误 3624 会通知你未满足此类条件,并且引发了断言。

错误 3624 与 MSSQLSERVER_3624 一起引发。 下面是如何在SQL Server错误日志中查看这些错误的示例。 你还将看到在运行时引发的断言条件,并且错误从SQL Server发送到客户端应用程序。

Error: 17066, Severity: 16, State: 1.
SQL Server Assertion: File: <"e:\\b\\s3\\sources\\sql\\ntdbms\\hekaton\\engine\\hadr\\physical\\ckptctrlprocesslogrecord.cpp">, line=1634 Failed Assertion = 'existingState == DB_Unencrypted'. This error may be timing-related. If the error persists after rerunning the statement, use DBCC CHECKDB to check the database for structural integrity, or restart the server to ensure in-memory data structures are not corrupted.

Error: 3624, Severity: 20, State: 1.
A system assertion check has failed. Check the SQL Server error log for details. Typically, an assertion failure is caused by a software bug or data corruption. To check for database corruption, consider running DBCC CHECKDB. If you agreed to send dumps to Microsoft during setup, a mini dump will be sent to Microsoft. An update might be available from Microsoft in the latest Service Pack or in a Hotfix from Technical Support.
Error: 17066, Severity: 16, State: 1.
SQL Server Assertion: File: <"xdes.cpp">, line=4919 Failed Assertion = 'lck_sufficient (lckMode, LCK_M_IX) || lck_sufficient (lckMode, LCK_M_BU)'. This error may be timing-related. If the error persists after rerunning the statement, use DBCC CHECKDB to check the database for structural integrity, or restart the server to ensure in-memory data structures are not corrupted.

Error: 3624, Severity: 20, State: 1.
A system assertion check has failed. Check the SQL Server error log for details. Typically, an assertion failure is caused by a software bug or data corruption. To check for database corruption, consider running DBCC CHECKDB. If you agreed to send dumps to Microsoft during setup, a mini dump will be sent to Microsoft. An update might be available from Microsoft in the latest Service Pack or in a Hotfix from Technical Support.
SQL Server Assertion: File: <diskio.cpp>, line=2902 Failed Assertion = 'filepos + cBytes <= GetMaxOffsetForIO ()'. This error may be timing-related. If the error persists after rerunning the statement, use DBCC CHECKDB to check the database for structural integrity, or restart the server to ensure in-memory data structures are not corrupted.

Error: 3624, Severity: 20, State: 1.
A system assertion check has failed. Check the SQL Server error log for details. Typically, an assertion failure is caused by a software bug or data corruption. To check for database corruption, consider running DBCC CHECKDB. If you agreed to send dumps to Microsoft during setup, a mini dump will be sent to Microsoft. An update might be available from Microsoft in the latest Service Pack or in a Hotfix from Technical Support.

原因

下面是断言失败的一些可能原因:

产品 Bug
断言失败的常见原因是产品中导致条件不真实的问题。 这些问题需要由 Microsoft 调查,在重现和理解时可以修复。

数据库损坏 断言失败的另一个常见原因是数据库中的物理不一致。 在内存中读取损坏的数据结构可能会导致预期条件为 false,从而引发断言。

外部库或筛选器驱动程序发现断言消息的一个常见原因是由SQL Server内存中的外部 DLL 或旨在监视或截获SQL Server活动的筛选器驱动程序引起的。 如果此类外部组件修改SQL Server使用的对象或结构,则可能发生断言失败。 有关详细信息,请参阅 加载某些模块或筛选器驱动程序时的性能和一致性问题

硬件问题 (内存、CPU) 硬件故障可能会导致内存中的数据结构损坏,从而导致断言失败。 此问题不太常见,但它会发生。

用户操作

  1. 检查SQL Server版本,请参阅确定运行SQL Server数据库引擎的版本和版本

  2. 查找可用于SQL Server版本的最新更新,或最好打开 Excel 文件,其中列出了所有内部版本的所有修补程序

  3. 查看文章或 Excel 文件,了解在当前SQL Server生成发布的任何断言修补程序。 如果找到修复断言问题的更高版本,请考虑升级到该版本。

  4. 在某些情况下,可以在 17066 错误的“失败的断言”部分中搜索特定的断言条件。 例如,在上述消息中搜索 lck_sufficient (lckMode, LCK_M_IX)。 此表达式将帮助你更准确地搜索匹配的问题。 此表达式是首先触发断言的条件,并且非常具体。

  5. 在数据库上运行 DBCC CHECKDB。 如果 DBCC CHECKDB 报告数据库损坏错误,请专注于先解决该问题,然后再执行任何其他操作。 还原干净的数据库备份并调查数据库不一致的根本原因。 有关详细信息,请参阅 排查 DBCC CHECKDB 报告的数据库一致性错误

  6. 检查SQL Server内存空间中是否加载了外部模块,以及筛选器驱动程序检查

    SELECT * FROM sys.dm_os_loaded_modules
    WHERE company != 'Microsoft Corporation'
    

    对于筛选器驱动程序,请从命令提示符运行以下命令

    fltmc filters
    

    在加载某些模块或筛选器驱动程序时,请遵循性能和一致性问题中的建议。

  7. 如果已将SQL Server升级到最新的累积更新,并且 DBCC CHECKDB 未报告任何错误,请联系 Microsoft 技术支持并准备好提供以下信息:

    1. 从 \Log 文件夹中SQL Server错误日志
    2. (sqlDump00xx.mdmp) 在 \Log 文件夹中生成的SQL Server内存转储
    3. 在可用时重现断言的步骤。 哪些查询或操作会导致引发断言?
    4. 来自 fltmc filters 和 “sys.dm_os_loaded_modules DMV” 的输出。