|
| 1 | +--- |
| 2 | +title: Error 3853 when using incremental statistics and resumable index operations |
| 3 | +description: This article helps you resolve SQL Server error 3853 that occurs when you use incremental statistics and resumable index operations concurrently. |
| 4 | +ms.date: 03/19/2025 |
| 5 | +ms.custom: sap:File, Filegroup, Database Operations or Corruption |
| 6 | +ms.reviewer: |
| 7 | +--- |
| 8 | + |
| 9 | +# SQL Server error 3853 when using incremental statistics and resumable index operations concurrently |
| 10 | + |
| 11 | +## Applies to |
| 12 | + |
| 13 | +- Microsoft SQL Server 2019 |
| 14 | +- Microsoft SQL Server 2017 |
| 15 | +- Microsoft SQL Server 2016 |
| 16 | + |
| 17 | +## Symptoms |
| 18 | + |
| 19 | +When running a [DBCC CHECKDB](/sql/t-sql/database-console-commands/dbcc-checkdb-transact-sql) command, the following output might be generated: |
| 20 | + |
| 21 | +```output |
| 22 | +Corruption in database ID %I64d, object ID %ld possibly due to schema or catalog inconsistency. Run DBCC CHECKCATALOG. |
| 23 | +``` |
| 24 | + |
| 25 | +You might also see the following error message in the SQL Server error log: |
| 26 | + |
| 27 | +```output |
| 28 | +Attribute (%ls) of row (%ls) in sys.%ls%ls does not have a matching row (%ls) in sys.%ls%ls. |
| 29 | +Msg 3853, Level 16, State 1, Line 10 |
| 30 | +``` |
| 31 | + |
| 32 | +## Cause |
| 33 | + |
| 34 | +The 3853 error is caused by orphaned records under the `sys.syssingleobjrefs` system table. The `stats_id` in `sys.stats` is still `2`, while it's `896002` in `syssingleobjrefs`. The issue occurs under the following scenarios: |
| 35 | + |
| 36 | +- The source `object_id` is a partitioned table or index. |
| 37 | +- Incremental statistics are in use for table or index. |
| 38 | +- Index create or rebuild is performed using the **RESUMABLE** option. |
| 39 | +- Incremental statistics are updated or the index is rebuilt online. |
| 40 | + |
| 41 | +## Status |
| 42 | + |
| 43 | +Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the [Applies to](#applies-to) section. Microsoft has also confirmed that the issue is fixed in [Microsoft SQL Server 2022](https://www.microsoft.com/sql-server/sql-server-downloads). |
| 44 | + |
| 45 | +## Resolution |
| 46 | + |
| 47 | +If the issue occurs, try the following options: |
| 48 | + |
| 49 | +- Contact the Microsoft Customer Support team to request assistance with correcting the metadata. |
| 50 | +- Restore the database from the most recent valid backup. |
| 51 | +- Create a new database and import the data from the corrupted database using data import or export tools or manual export-import methods. |
| 52 | +- Upgrade to SQL Server 2022 where the issue has been fixed. |
| 53 | + |
| 54 | +## Workaround |
| 55 | + |
| 56 | +To avoid this issue, don't use incremental statistics and resumable index operations simultaneously. |
0 commit comments