Enable Compatibility Level 120 and Trace Flag 4199
Release Consideration: In myEvolv versions 10.1.0 and later, database compatibility level 120 on SQL Server 2014 Service Pack 1 is now officially supported.
In order to change the database compatibility level to 120, the system must be running SQL Server 2014 with Service Pack 1 installed. Additionally, trace flag 4199, which enables optimizer hotfixes introduced in Service Pack 1, must be enabled for the database.
Enable Compatibility Level 120 and Trace Flag 4199
Setting the compatibility mode and enabling the trace flag should be done during an outage window. Enabling trace flag 4199 requires restarting SQL Server, and changing the database compatibility level to 120 requires setting the database to single user mode, any active users on the system will be disconnected.
Add Trace Flag 4199 as a Startup Parameter
Trace flag 4199 must be enabled each time the server is started, unless it is added as a startup parameter. For self-hosted clients, this can be enabled on startup by adding "-T4199" as a start-up parameter in SQL Server Configuration Manager. Once the startup parameter is added, restart SQL Server to enable trace flag 4199.
- In SQL Server Configuration Manager, in the Configuration manager pane, click SQL Server Services.
- Right-click the server from the list and click Properties.
- In the Properties dialog, select the Startup Parameters tab.
- In the Specify a startup parameter field, enter -T4199 and click Add.
- Click OK.
Note: Trace flag 4199 will be enabled globally (affecting all databases on the instance). Any other user databases on the system at compatibility level 120 will have the query optimizer hotfixes enabled.
For more information refer to: https://support.microsoft.com/en-us/help/974006/sql-server-query-optimizer-hotfix-trace-flag-4199-servicing-model
Set the Database Compatibility Level to 120
To set the database compatibility level to 120 while following best practice guidelines, the database must first be set to single-user mode to disconnect any active sessions before the compatibility level is changed. This process avoids generating incorrect query plans based on multiple compatibility levels. Execute the following query on the database in SQL Server Management Studio:
Note: It does not need to be re-run on startup.
ALTER DATABASE evolv_database_name SET SINGLE_USER WITH ROLLBACK IMMEDIATE; ALTER DATABASE evolv_database_name SET COMPATIBILITY_LEVEL = 120; ALTER DATABASE evolv_database_name SET MULTI_USER;
For more information refer to: https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-database-transact-sql-compatibility-level
Validate
To validate that the database is at compatibility level 120, either check in the Database Properties - Options page in SQL Server Management Studio or run the following query and ensure the result is 120:
SELECT compatibility_level FROM sys.databases WHERE name = 'evolv_database_name'
For optimal performance, you must operate compatibility level 120 with trace flag 4199 enabled. To verify that trace flag 4199 is enabled, run the following query:
DBCC TRACESTATUS(4199)
To determine the version of SQL Server installed, run the following query in SQL Server Management Studio:
SELECT SERVERPROPERTY('productversion')
Evolv is supported at database compatibility level 120 when SQL Server 2014 is at service pack 1 or greater (product version 12.0.4100.1). Refer to https://support.microsoft.com/en-us/help/321185/how-to-determine-the-version--edition-and-update-level-of-sql-server-a#completeversion to determine the version name, service pack, and update level based on the product version number.
