SQL transaction

xiaoxiao2021-03-05  27

the reason

This is the design makes it. This error occurs if you run "Distributed Transaction Coordinator" under the Local System account.

Back to top

solution

Recently, MSDTC is run as "NT Authority / NetworkService" to improve the RPC security to improve the DTC. This is the default option of .NET Server. In Windows NT and Windows 2000, the MSDTC service is running under the Local System account by default.

WARNING: "Registry Editor" can cause serious problems, these issues may need to reinstall the operating system. Microsoft does not guarantee the problem that the "Registry Editor" uses improper use. Use Registry Editor at your own risk.

To change the MSDTC Service Account from "NT Authority / NetworkService", perform the following steps:

1. Run the regedt32, browse to HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft / MSDTC. Add a DWORD value TurnOffrPCSecurity, value data is 1.2. Open a command prompt, run "Net Stop MSDTC" and run "Net Start MSDTC". 3. Go to "Component Service Management Tools".

a. Browse to the "Startup Management Tool". b. Select "Component Services". c. Expand the Component Service tree and expand "My Computer". d. Right-click My Computer, then select Properties. e. In the MSDTC tab, make sure the following options are selected: Network DTC Access

Network management

Network transaction

XA transaction additionally, "DTC Login Account" must be set to "NT Authority / NetworkService". f. Click OK. This will prompt you "MS DTC will stop and restart. All dependencies will be stopped. Please press 'Yes' Continue". Click Yes to continue. g. Click "OK" to close the "My Computer" property window. 4. Run the regedt32 again, browse to HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft / MSDTC, then delete the TurnOffrPCSecurity item. Now your MSDTC service should run under the NT Authority / NetworkService account and will not appear again.

Back to top

More information

When "Network DTC Access" under "MSDTC Security" is disabled, if you run a link server query, you will return the following error:

Server: Msg 7391, Level 16, State 1, Line 2 The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction [OLE / DB provider returned message:. New transaction can not enlist in the specified Transaction coordinator.

Track mark 7300 is turned on:

Server: Msg 7391, Level 16, State 1, Line 2 The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction [OLE / DB provider returned message:. New transaction can not enlist in the specified TRANSACTION COORDINATOR.] OLE DB ERROR TRACE [OLE DB ERROR TRACE [OLE / DB Provider 'SQLOLEDB' ITRANSACTIONJOIN: :: JointRansaction Returned 0x8004D00A]. MSDTC Service Be sure to set up in the "Solution" section above to prevent this error.

Steps to reproduce the phenomenon

1. Go to "Startup Management Tools Service". 2. Right-click the Distributed Transaction Coordinator service to go to the Login tab, select the Local System account under Login Identity. 3. Stop then restart the service. 4. From the query analyzer, run the following script: exec sp_addlinkedServer Remote1

EXEC SP_SETNAME Remote1,

Go

EXEC Remote1.pubs.dbo.sp_executesql n'create table t (c1 int) "

Go

SET XACT_ABORT ON

Go

Begin TRAN

INSERT INTO Remote1.pubs.dbo.t Values ​​(1)

Commit TRAN

Go

Back to top

转载请注明原文地址:https://www.9cbs.com/read-34441.html

New Post(0)