Troubleshooting Guide: Error 12141 – Metadata Snapshot Enabled Conflict with Accelerated Database Recovery
Why This Error Happens
This error occurs because Accelerated Database Recovery (ADR) and Metadata Snapshot cannot be enabled simultaneously on the same database in SQL Server 2025, as they both manage versioning of metadata using conflicting internal mechanisms. When Metadata Snapshot is active, SQL Server blocks any attempt to toggle ADR settings until the conflicting feature is explicitly disabled first. This typically happens when a database was migrated or restored from an instance where Metadata Snapshot was manually enabled for DDL concurrency improvements, and an administrator later attempts to enable or disable ADR without first checking the current snapshot state.
Step-by-Step Resolution Guide
Step 1: Verify Current Database Configuration State
- Open SQL Server Management Studio (SSMS) or Azure Data Studio connected to your Windows Server 2025 instance.
- Run the following query to check the current status of both features:
SELECT name, is_accelerated_database_recovery_on, is_metadata_snapshot_on
FROM sys.databases
WHERE name = 'YourDatabaseName';
- Confirm that
is_metadata_snapshot_onreturns1, validating the root cause.
Step 2: Disable Metadata Snapshot
- Set the database to single-user mode or ensure no active sessions are blocking the change by running:
ALTER DATABASE [YourDatabaseName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
- Disable the Metadata Snapshot feature explicitly using:
ALTER DATABASE [YourDatabaseName] SET METADATA_SNAPSHOT = OFF;
- Revert the database back to multi-user mode:
ALTER DATABASE [YourDatabaseName] SET MULTI_USER;
Step 3: Toggle Accelerated Database Recovery
- Once the snapshot conflict is cleared, run your original command to modify ADR:
ALTER DATABASE [YourDatabaseName] SET ACCELERATED_DATABASE_RECOVERY = OFF;
- If you intended to enable ADR instead, swap
OFFwithONin the command above. - Monitor the SQL Server Error Log located in
C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\for confirmation that the change was applied without triggering Error 12141 again.
Step 4: Restart SQL Server Service (If Needed)
- If the setting fails to apply due to cached metadata locks, restart the SQL Server service via Windows Services Manager (
services.msc). - Locate SQL Server (MSSQLSERVER), right-click, and select Restart to clear any lingering schema locks related to the Metadata Snapshot feature.
Alternative or Verification Steps
- Re-run the verification query from Step 1;
is_metadata_snapshot_onshould now show0, andis_accelerated_database_recovery_onshould reflect your desired state (0 or 1). - If the error persists after a service restart, check for active transactions or orphaned sessions using
sys.dm_tran_active_transactions, as a long-running transaction may be preventing the metadata state from updating.