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

Troubleshooting Guide: Error 9034 – PERSISTENTLOGBUFFER Option Already Enabled

Why This Error Happens

This error occurs when a user or script attempts to execute an ALTER DATABASE statement to enable PERSISTENT_LOG_BUFFER on a database where this option has already been configured and is active. SQL Server 2025 checks the current state metadata for the database before applying the setting, and since Persistent Log Buffer (PLB) relies on Persistent Memory (PMEM) hardware mapping, the engine blocks a redundant request to prevent conflicts with the existing memory-mapped file path. This is typically a benign state-check error rather than a hardware failure, often triggered by automated deployment scripts or DBA maintenance tasks that do not first verify the current configuration state.

Step-by-Step Resolution Guide

Step 1: Verify the Current Database State

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio connected to your SQL Server 2025 instance.
  • Run the following query to check the specific database’s PLB status:
SELECT name, is_persistent_log_buffer_enabled 
FROM sys.databases 
WHERE name = 'YourDatabaseName';
  • If the result returns 1, the feature is confirmed active, validating the error message.

Step 2: Audit the Deployment or Maintenance Script

  • Locate the .sql script or Agent Job responsible for triggering the ALTER DATABASE command.
  • Look for a missing conditional check (e.g., an IF statement) that should prevent the command from running if the feature is already enabled.
  • Modify the script to include a state check:
IF NOT EXISTS (SELECT 1 FROM sys.databases WHERE name = 'YourDatabaseName' AND is_persistent_log_buffer_enabled = 1)
BEGIN
    ALTER DATABASE [YourDatabaseName] SET PERSISTENT_LOG_BUFFER = ON (FILENAME = 'D:\PMEM\LogBuffer');
END

Step 3: Check the Windows PMEM Hardware Path

  • Navigate to the Persistent Memory storage path configured in Windows Server 2025 (usually found via Server Manager > File and Storage Services > Disks).
  • Ensure the PMEM namespace mapped to the SQL Server instance has not been altered or reset, as this can sometimes cause SQL Server’s metadata to desync from the physical hardware state.
  • Restart the SQL Server (MSSQLSERVER) service via services.msc if a desync is suspected, allowing the engine to re-read the PMEM state correctly.

Step 4: Clear Cached Execution Plans (If Applicable)

  • If the error persists despite the database showing an “OFF” state in rare caching scenarios, clear the procedure cache to force a state refresh.
  • Run: DBCC FREEPROCCACHE;
  • Note: Use this with caution in production environments as it will cause temporary performance overhead while plans recompile.

Alternative or Verification Steps

  • Verification: Re-run the sys.databases query from Step 1 after executing the corrected script; if is_persistent_log_buffer_enabled returns 1 without triggering Error 9034, the configuration is stable.
  • Alternative: If you need to reconfigure the PLB path entirely, first disable the feature using ALTER DATABASE [YourDatabaseName] SET PERSISTENT_LOG_BUFFER = OFF;, then re-enable it with the new path specifications to force a clean state refresh.