Skip to content

Commit a78b71b

Browse files
authored
Merge pull request #8507 from sevend2/Error3853
AB#4639: SQL Server error 3853 when using incremental statistics and …
2 parents e5a8a19 + 6b16e78 commit a78b71b

2 files changed

Lines changed: 55 additions & 1 deletion

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: Error 3853 When Using Incremental Statistics and Resumable Index Operations
3+
description: Resolves SQL Server error 3853 that occurs when you use incremental statistics and resumable index operations concurrently.
4+
ms.date: 04/03/2025
5+
ms.custom: sap:File, Filegroup, Database Operations or Corruption
6+
ms.reviewer: rtownsend, jopilov, jaferebe, atsingh, ditikman
7+
---
8+
9+
# SQL Server error 3853 when using incremental statistics and resumable index operations concurrently
10+
11+
_Applies to:_   SQL Server 2019, SQL Server 2017, SQL Server 2016
12+
13+
## Symptoms
14+
15+
When you run a [DBCC CHECKDB](/sql/t-sql/database-console-commands/dbcc-checkdb-transact-sql) command, the following output might be generated:
16+
17+
```output
18+
Corruption in database ID %I64d, object ID %Id possibly due to schema or catalog inconsistency. Run DBCC CHECKCATALOG.
19+
```
20+
21+
You might also see the following error message in the SQL Server error log:
22+
23+
```output
24+
Attribute (%ls) of row (%ls) in sys.%ls%ls does not have a matching row (%ls) in sys.%ls%ls.
25+
Msg 3853, Level 16, State 1, Line 10
26+
```
27+
28+
## Cause
29+
30+
The 3853 error is caused by orphaned records in the `sys.syssingleobjrefs` system table. The `stats_id` in `sys.stats` remains as `2`, while the corresponding `stats_id` in `syssingleobjrefs` is `896002`, indicating a mismatch. The issue happens when all of the following conditions are met:
31+
32+
- The source `object_id` is a partitioned table or index.
33+
- Incremental statistics are in use for a table or index.
34+
- Index creation or rebuild is performed using the `RESUMABLE` option.
35+
- Incremental statistics are updated, or the index is rebuilt using the `ONLINE = ON` option.
36+
37+
## Status
38+
39+
Microsoft has confirmed that this is a known issue in the versions of SQL Server listed in the "Applies to" section at the top of the article. Microsoft has also confirmed that the issue has been fixed in [Microsoft SQL Server 2022](https://www.microsoft.com/sql-server/sql-server-downloads).
40+
41+
## Workaround
42+
43+
To avoid this issue, don't use incremental statistics and resumable index operations on the same table or index simultaneously.
44+
45+
## Resolution
46+
47+
If the issue occurs, try the following options:
48+
49+
- Restore the database from the most recent valid backup.
50+
- Create a new database and import the data from the corrupted database using the SQL Server Import and Export Wizard, Bulk Copy Program (BCP) utility, or manual export-import method.
51+
- Upgrade to SQL Server 2022, where the issue has been fixed.
52+
- Contact the Microsoft Customer Support team to request assistance with correcting the metadata.

support/sql/database-engine/database-file-operations/toc.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ items:
1919
href: troubleshoot-dbcc-checkdb-errors.md
2020
- name: Defragmenting database disk drives
2121
href: defragmenting-database-disk-drives.md
22+
- name: Error 3853 with incremental statistics and resumable index operations
23+
href: error-3853-use-incremental-statistics-resumable-index-operations.md
2224
- name: I/O subsystem requirements for the tempdb
2325
href: io-subsystem-requirements-tempdb.md
2426
- name: Logging and data storage algorithms
@@ -40,4 +42,4 @@ items:
4042
- name: Troubleshoot errors related to system disk sector size greater than 4 KB
4143
href: troubleshoot-os-4kb-disk-sector-size.md
4244
- name: Virtual host drivers lead to data consistency problems
43-
href: virtual-host-driver-lead-data-consistency.md
45+
href: virtual-host-driver-lead-data-consistency.md

0 commit comments

Comments
 (0)