Skip to content

Commit 12f23bb

Browse files
authored
Merge pull request #31721 from rwestMSFT/rw-0830-fix-9868
Refresh in-doubt xact resolution article and include PR 9868
2 parents 9a500f8 + 6fa7e4d commit 12f23bb

1 file changed

Lines changed: 76 additions & 78 deletions

File tree

Lines changed: 76 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,76 @@
1-
---
2-
title: "in-doubt xact resolution (server configuration option)"
3-
description: "Become familiar with the in-doubt xact resolution option. See how it determines the default outcome for in-doubt transactions in SQL Server."
4-
author: rwestMSFT
5-
ms.author: randolphwest
6-
ms.date: "03/02/2017"
7-
ms.service: sql
8-
ms.subservice: configuration
9-
ms.topic: conceptual
10-
helpviewer_keywords:
11-
- "distributed transactions [SQL Server], unresolved transactions"
12-
- "unresolved transactions"
13-
- "in-doubt xact resolution option"
14-
---
15-
# in-doubt xact resolution (server configuration option)
16-
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
17-
18-
Use the **in-doubt xact resolution** option to control the default outcome of transactions that the [!INCLUDE[msCoName](../../includes/msconame-md.md)] Distributed Transaction Coordinator (MS DTC) is unable to resolve. Inability to resolve transactions may be related to the MS DTC down time or an unknown transaction outcome at the time of recovery.
19-
20-
The following table lists the possible outcome values for resolving an in-doubt transaction.
21-
22-
|Outcome value|Description|
23-
|-------------------|-----------------|
24-
|0|No presumption. Recovery fails if MS DTC cannot resolve any in-doubt transactions.|
25-
|1|Presume commit. Any MS DTC in-doubt transactions are presumed to have committed.|
26-
|2|Presume abort. Any MS DTC in-doubt transactions are presumed to have aborted.|
27-
28-
To minimize the possibility of extended down time, an administrator might choose to configure this option either to presume commit or presume abort, as shown in the following example.
29-
30-
```
31-
sp_configure 'show advanced options', 1
32-
GO
33-
RECONFIGURE
34-
GO
35-
sp_configure 'in-doubt xact resolution', 2 -- presume abort
36-
GO
37-
RECONFIGURE
38-
GO
39-
sp_configure 'show advanced options', 0
40-
GO
41-
RECONFIGURE
42-
GO
43-
44-
```
45-
46-
Alternatively, the administrator might want to leave the default (no presumption) and allow recovery to fail in order to be made aware of a DTC failure, as shown in the following example.
47-
48-
```
49-
sp_configure 'show advanced options', 1
50-
GO
51-
RECONFIGURE
52-
GO
53-
sp_configure 'in-doubt xact resolution', 1 -- presume commit
54-
GO
55-
reconfigure
56-
GO
57-
ALTER DATABASE pubs SET ONLINE -- run recovery again
58-
GO
59-
sp_configure 'in-doubt xact resolution', 0 -- back to no assumptions
60-
GO
61-
sp_configure 'show advanced options', 0
62-
GO
63-
RECONFIGURE
64-
GO
65-
66-
```
67-
68-
The **in-doubt xact resolution** option is an advanced option. If you are using the **sp_configure** system stored procedure to change the setting, you can change **in-doubt xact resolution** only when **show advanced options** is set to 1. The setting takes effect immediately without a server restart.
69-
70-
> [!NOTE]
71-
> Consistent configuration of this option across all [!INCLUDE[msCoName](../../includes/msconame-md.md)] [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] instances involved in any distributed transactions will help avoid data inconsistencies.
72-
73-
## See Also
74-
[RECONFIGURE (Transact-SQL)](../../t-sql/language-elements/reconfigure-transact-sql.md)
75-
[Server Configuration Options (SQL Server)](../../database-engine/configure-windows/server-configuration-options-sql-server.md)
76-
[sp_configure (Transact-SQL)](../../relational-databases/system-stored-procedures/sp-configure-transact-sql.md)
77-
78-
1+
---
2+
title: "Server configuration: in-doubt xact resolution"
3+
description: Learn about the in-doubt xact resolution option. See how it determines the default outcome for in-doubt transactions in SQL Server.
4+
author: rwestMSFT
5+
ms.author: randolphwest
6+
ms.date: 08/30/2024
7+
ms.service: sql
8+
ms.subservice: configuration
9+
ms.topic: conceptual
10+
helpviewer_keywords:
11+
- "distributed transactions [SQL Server], unresolved transactions"
12+
- "unresolved transactions"
13+
- "in-doubt xact resolution option"
14+
---
15+
# Server configuration: in-doubt xact resolution
16+
17+
[!INCLUDE [appliesto-sqlserver-sqlmi-sqlvm](../../includes/applies-to-version/appliesto-sqlserver-sqlmi-sqlvm.md)]
18+
19+
Use the `in-doubt xact resolution` option to control the default outcome of transactions that the [!INCLUDE [msCoName](../../includes/msconame-md.md)] Distributed Transaction Coordinator (MS DTC) is unable to resolve. Inability to resolve transactions might be related to the MS DTC down time or an unknown transaction outcome at the time of recovery.
20+
21+
The following table lists the possible outcome values for resolving an in-doubt transaction.
22+
23+
| Outcome value | Description |
24+
| --- | --- |
25+
| `0` | No presumption. Recovery fails if MS DTC can't resolve any in-doubt transactions. |
26+
| `1` | Presume commit. Presumes that any MS DTC in-doubt transactions are committed. |
27+
| `2` | Presume abort. Presumes that any MS DTC in-doubt transactions are aborted. |
28+
29+
To minimize the possibility of extended down time, an administrator might choose to configure this option either to presume commit or presume abort, as shown in the following example.
30+
31+
```sql
32+
sp_configure 'show advanced options', 1;
33+
GO
34+
RECONFIGURE;
35+
GO
36+
sp_configure 'in-doubt xact resolution', 2; -- presume abort
37+
GO
38+
RECONFIGURE;
39+
GO
40+
sp_configure 'show advanced options', 0;
41+
GO
42+
RECONFIGURE;
43+
GO
44+
```
45+
46+
Alternatively, the administrator might want to leave the default (no presumption) and allow recovery to fail in order to be made aware of a DTC failure, as shown in the following example.
47+
48+
```sql
49+
sp_configure 'show advanced options', 1;
50+
GO
51+
RECONFIGURE;
52+
GO
53+
sp_configure 'in-doubt xact resolution', 1; -- presume commit
54+
GO
55+
RECONFIGURE
56+
GO
57+
ALTER DATABASE pubs SET ONLINE -- run recovery again
58+
GO
59+
sp_configure 'in-doubt xact resolution', 0 -- back to no assumptions
60+
GO
61+
sp_configure 'show advanced options', 0
62+
GO
63+
RECONFIGURE
64+
GO
65+
```
66+
67+
The `in-doubt xact resolution` option is an advanced option. If you use the `sp_configure` system stored procedure to change the setting, you can change `in-doubt xact resolution` only when `show advanced options` is set to `1`. The setting takes effect immediately without a server restart.
68+
69+
> [!NOTE]
70+
> Consistent configuration of this option across all [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] instances involved in any distributed transactions helps avoid data inconsistencies.
71+
72+
## Related content
73+
74+
- [RECONFIGURE (Transact-SQL)](../../t-sql/language-elements/reconfigure-transact-sql.md)
75+
- [Server configuration options](server-configuration-options-sql-server.md)
76+
- [sp_configure (Transact-SQL)](../../relational-databases/system-stored-procedures/sp-configure-transact-sql.md)

0 commit comments

Comments
 (0)