From d7cc128a2ca8cdf85aae24ff937fec5f2409941d Mon Sep 17 00:00:00 2001 From: hacitandogan Date: Tue, 5 Sep 2023 09:49:11 +0300 Subject: [PATCH] add rule for CCC for #243 added rule "Common Criteria Compliance Enabled" and stored procedure usp_CCC_Enabled for the Rule --- sqlnexus/PerfStatsAnalysis.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sqlnexus/PerfStatsAnalysis.sql b/sqlnexus/PerfStatsAnalysis.sql index 736b612..501bc59 100644 --- a/sqlnexus/PerfStatsAnalysis.sql +++ b/sqlnexus/PerfStatsAnalysis.sql @@ -2143,6 +2143,8 @@ INSERT INTO tbl_Analysissummary (SolutionSourceId,Category, type, typedesc,Name, VALUES ('31E879BE-97A4-413F-880F-29BFC57C099F','AlwaysOn State', 'W','Warning', 'usp_AGHealthState', 'AlwaysOn replica states', 'AG replica(s) is unhealthy or not online', '','', ' ', 1, 100, 0, ' ') INSERT INTO tbl_Analysissummary (SolutionSourceId,Category, type, typedesc,Name, FriendlyName, Description, InternalUrl, ExternalUrl, Author, Priority, SeqNum, Status, Report) VALUES ('476E8B9B-81F7-494C-9039-71CD73EAD719','AlwaysOn State', 'W','Warning', 'usp_DBMEndPointState', 'AlwaysOn endpoint state', 'AG DBM endpoint is not online.', '','https://learn.microsoft.com/sql/database-engine/availability-groups/windows/troubleshoot-always-on-availability-groups-configuration-sql-server#Endpoints', ' ', 1, 100, 0, ' ') +INSERT INTO tbl_Analysissummary (SolutionSourceId,Category, type, typedesc,Name, FriendlyName, Description, InternalUrl, ExternalUrl, Author, Priority, SeqNum, Status, Report) +VALUES ('EC9C67D8-E91A-452E-856C-4B2E5985716A','Server Performance', 'W','Warning', 'usp_CCC_Enabled', 'Common Criteria Compliance Enabled', 'Enabling this can cause performance issues', '','https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/common-criteria-compliance-enabled-server-configuration-option?view=sql-server-ver16', ' ', 1, 100, 0, 'Server Configuration') @@ -3930,6 +3932,20 @@ BEGIN END GO +CREATE PROCEDURE [dbo].[usp_CCC_Enabled] +AS +BEGIN + IF (OBJECT_ID ('tbl_Sys_Configurations') is not null and (OBJECT_ID ('tbl_AnalysisSummary') IS NOT NULL)) + BEGIN + IF ((SELECT [value_in_use] FROM [dbo].[tbl_Sys_Configurations] WHERE name = 'common criteria compliance enabled')>0 ) + BEGIN + UPDATE tbl_analysissummary + SET [status]=1 + WHERE name ='usp_CCC_Enabled' + END + END +END +GO