How to fix Error 3465 on Windows Server 2025 / Windows 11

Troubleshooting Guide: Error 3465 – Deferred Transaction Resolution Failure

Why This Error Happens

Error 3465 occurs when SQL Server’s transaction manager attempts to resolve a deferred transaction (typically during crash recovery or a distributed transaction rollback) but cannot locate the corresponding transaction entry in the log or the transaction table. This is most commonly caused by corruption in the transaction log, an abrupt termination of the SQL Server service during an active distributed transaction, or inconsistencies introduced by a failed failover in an Always On Availability Group. In rarer cases, manual intervention with DBCC commands or improper log truncation can strip the metadata needed to resolve the deferred transaction correctly.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Database and Transaction Context

  • Check the SQL Server Error Log (Management > SQL Server Logs in SSMS) for the full error context surrounding Error 3465.
  • Run the following query to identify databases with pending deferred transactions:
  SELECT * FROM sys.dm_tran_database_transactions WHERE database_transaction_begin_time IS NOT NULL;
  • Note the Database ID and Transaction ID referenced in the error text.

Step 2: Check for MSDTC and Distributed Transaction Issues

  • Verify the Microsoft Distributed Transaction Coordinator (MSDTC) service is running on both Windows Server 2025 and Windows 11 clients:
  Get-Service MSDTC | Select-Object Status, StartType
  • If stopped, restart it: Start-Service MSDTC
  • Open dcomcnfg.exe, navigate to Component Services > Computers > My Computer > Distributed Transaction Coordinator > Local DTC, and confirm network DTC access is enabled under the Security tab.

Step 3: Run Database Consistency Checks

  • Execute DBCC CHECKDB against the affected database to identify log or page-level corruption:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is confirmed in the transaction log, take the database offline and restore from the last known good backup.
  • Avoid using REPAIR_ALLOW_DATA_LOSS unless no valid backup exists, as it can permanently discard unresolved transaction data.

Step 4: Force Transaction Resolution Manually (If Safe)

  • If the transaction is orphaned and confirmed non-recoverable, use sp_resolve_tranid or manually resolve it via KILL with the transaction UOW (Unit of Work):
  KILL '0000-00000000-0000000000000000';
  • Restart the SQL Server service afterward to clear any residual in-memory transaction table entries:
  Restart-Service MSSQLSERVER -Force

Step 5: Rebuild the Transaction Log (Last Resort)

  • If the log remains corrupted after recovery attempts, detach the database and rebuild the log file using ALTER DATABASE ... REBUILD LOG.
  • Only perform this step after taking a full file-level backup of the .mdf and .ldf files, as this operation can cause data loss for uncommitted transactions.

Alternative or Verification Steps

  • Verify the fix by querying sys.dm_tran_active_transactions to confirm no stale or orphaned transactions remain, and re-run DBCC CHECKDB to ensure the database reports zero allocation or consistency errors.
  • As an alternative, if the issue persists on Windows Server 2025 specifically, check for pending OS-level Cumulative Updates affecting MSDTC/COM+ components, as a known compatibility issue between SQL Server 2025 and certain Windows Server 2025 builds can intermittently disrupt distributed transaction resolution.