-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql-checks.json
More file actions
12202 lines (12202 loc) · 752 KB
/
sql-checks.json
File metadata and controls
12202 lines (12202 loc) · 752 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[
{
"Id": "TRIAGE_002",
"Name": "Review Log Space",
"Description": "Review Log Space (sp_triage CheckID 2, Priority 100)",
"Category": "Backup",
"Severity": "Warning",
"SqlQuery": "SELECT CASE WHEN EXISTS (SELECT 1 FROM sys.databases d WHERE d.database_id \u003E 4 AND d.recovery_model = 1 AND d.state = 0 AND NOT EXISTS (SELECT 1 FROM msdb.dbo.backupset b WHERE b.database_name = d.name AND b.type = \u0027L\u0027 AND b.backup_finish_date \u003E DATEADD(HOUR, -2, GETDATE()))) THEN 1 ELSE 0 END",
"ExpectedValue": 0,
"Enabled": false,
"RecommendedAction": "Review finding: Review Log Space. More info: https://github.com/SQLDBA-ORG/sqldba/",
"Source": "sp_triage",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "TRIAGE_012",
"Name": "Review Dbccloginfo",
"Description": "Review Dbccloginfo (sp_triage CheckID 12, Priority 100)",
"Category": "Backup",
"Severity": "Warning",
"SqlQuery": "SELECT 0 AS Result -- sp_triage CheckID 12: Review Dbccloginfo (query not yet implemented - see sp_triage.sql for original query)",
"ExpectedValue": 0,
"Enabled": false,
"RecommendedAction": "Review finding: Review Dbccloginfo. More info: https://github.com/SQLDBA-ORG/sqldba/",
"Source": "sp_triage",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "TRIAGE_016",
"Name": "Review Invalid Logins",
"Description": "Review Invalid Logins (sp_triage CheckID 16, Priority 100)",
"Category": "Backup",
"Severity": "Warning",
"SqlQuery": "SELECT 0 AS Result -- sp_triage CheckID 16: Review Invalid Logins (query not yet implemented - see sp_triage.sql for original query)",
"ExpectedValue": 0,
"Enabled": false,
"RecommendedAction": "Review finding: Review Invalid Logins. More info: https://github.com/SQLDBA-ORG/sqldba/",
"Source": "sp_triage",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "TRIAGE_020",
"Name": "Review Log Info2012",
"Description": "Review Log Info2012 (sp_triage CheckID 20, Priority 100)",
"Category": "Backup",
"Severity": "Warning",
"SqlQuery": "SELECT 0 AS Result -- sp_triage CheckID 20: Review Log Info2012 (query not yet implemented - see sp_triage.sql for original query)",
"ExpectedValue": 0,
"Enabled": false,
"RecommendedAction": "Review finding: Review Log Info2012. More info: https://github.com/SQLDBA-ORG/sqldba/",
"Source": "sp_triage",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "TRIAGE_021",
"Name": "Database Auto-shrink",
"Description": "Review Log Info (sp_triage CheckID 21, Priority 100)",
"Category": "Backup",
"Severity": "Critical",
"SqlQuery": "SELECT CASE WHEN EXISTS (SELECT 1 FROM sys.databases WHERE is_auto_shrink_on = 1 AND database_id \u003E 4) THEN 1 ELSE 0 END",
"ExpectedValue": 0,
"Enabled": false,
"RecommendedAction": "Review finding: Review Log Info. More info: https://github.com/SQLDBA-ORG/sqldba/",
"Source": "sp_triage",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "TRIAGE_028",
"Name": "Database Recovery Model",
"Description": "Review Error Log (sp_triage CheckID 28, Priority 100)",
"Category": "Backup",
"Severity": "Warning",
"SqlQuery": "SELECT CASE WHEN EXISTS (SELECT 1 FROM sys.databases WHERE recovery_model = 3 AND database_id \u003E 4) THEN 1 ELSE 0 END",
"ExpectedValue": 0,
"Enabled": false,
"RecommendedAction": "Review finding: Review Error Log. More info: https://github.com/SQLDBA-ORG/sqldba/",
"Source": "sp_triage",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_001",
"Name": "Backups happening in the last 7 days",
"Description": "Checks if any database hasn\u0027t had a full backup in the last 7 days",
"Category": "Backup",
"Severity": "Critical",
"SqlQuery": "SELECT CASE \n WHEN EXISTS (\n SELECT 1 AS CheckID ,\r\n d.[name] AS DatabaseName ,\r\n 1 AS Priority ,\r\n \u0027Backup\u0027 AS FindingsGroup ,\r\n \u0027Backups Not Performed Recently\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/nobak\u0027 AS URL ,\r\n \u0027Last backed up: \u0027\r\n \u002B COALESCE(CAST(MAX(b.backup_finish_date) AS VARCHAR(25)),\u0027never\u0027) AS Details\r\nFROM master.sys.databases d\r\n LEFT OUTER JOIN msdb.dbo.backupset b ON d.name COLLATE SQL_Latin1_General_CP1_CI_AS = b.database_name COLLATE SQL_Latin1_General_CP1_CI_AS\r\n AND b.type = \u0027D\u0027\r\n AND b.server_name = SERVERPROPERTY(\u0027ServerName\u0027) /*Backupset ran on current server */\r\nWHERE d.database_id \u003C\u003E 2 /* Bonus points if you know what that means */\r\n AND d.state NOT IN(1, 6, 10) /* Not currently offline or restoring, like log shipping databases */\r\n AND d.is_in_standby = 0 /* Not a log shipping target database */\r\n AND d.source_database_id IS NULL /* Excludes database snapshots */\r\n -- AND d.name NOT IN ( SELECT DISTINCT\r\n -- DatabaseName\r\n --FROM #SkipChecks\r\n -- WHERE CheckID IS NULL OR CheckID = 1)\r\n /*\r\n The above NOT IN filters out the databases we\u0027re not supposed to check.\r\n */\r\nGROUP BY d.name\r\nHAVING MAX(b.backup_finish_date) \u003C= DATEADD(dd,\r\n -7, GETDATE())\r\n OR MAX(b.backup_finish_date) IS NULL\n ) THEN 1\n ELSE 0\n END",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Schedule full backups for databases that haven\u0027t been backed up in 7\u002B days",
"Source": "Custom",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_002",
"Name": "Transaction Log Backup taking place",
"Description": "Checks if any database in FULL recovery hasn\u0027t had a log backup in 2 hours",
"Category": "Backup",
"Severity": "Critical",
"SqlQuery": "SELECT CASE \n WHEN EXISTS (\n SELECT DISTINCT\r\n 2 AS CheckID ,\r\n d.name AS DatabaseName ,\r\n 1 AS Priority ,\r\n \u0027Backup\u0027 AS FindingsGroup ,\r\n \u0027Full Recovery Model w/o Log Backups\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/biglogs\u0027 AS URL ,\r\n ( \u0027The \u0027 \u002B CAST(CAST((SELECT ((SUM([mf].[size]) * 8.) / 1024.) FROM sys.[master_files] AS [mf] WHERE [mf].[database_id] = d.[database_id] AND [mf].[type_desc] = \u0027LOG\u0027) AS DECIMAL(18,2)) AS VARCHAR(30)) \u002B \u0027MB log file has not been backed up in the last week.\u0027 ) AS Details\r\nFROM master.sys.databases d\r\n--LEFT JOIN #DBCCs ll On ll.DbName = d.name And ll.Field = \u0027dbi_LastLogBackupTime\u0027\r\nWHERE d.recovery_model IN ( 1, 2 )\r\n AND d.database_id NOT IN ( 2, 3 )\r\n AND d.source_database_id IS NULL\r\n AND d.state NOT IN(1, 6, 10) /* Not currently offline or restoring, like log shipping databases */\r\n AND d.is_in_standby = 0 /* Not a log shipping target database */\r\n AND d.source_database_id IS NULL /* Excludes database snapshots */\r\n AND (\r\n (\r\n /* We couldn\u0027t get a value from the DBCC DBINFO data so let\u0027s check the msdb backup history information */\r\n --[ll].[Value] Is Null\r\n --AND \r\n NOT EXISTS ( SELECT *\r\n FROM msdb.dbo.backupset b\r\n WHERE d.name COLLATE SQL_Latin1_General_CP1_CI_AS = b.database_name COLLATE SQL_Latin1_General_CP1_CI_AS\r\n AND b.type = \u0027L\u0027\r\n AND b.backup_finish_date \u003E= DATEADD(dd,-7, GETDATE())\r\n )\r\n )\r\n \r\n)\n ) THEN 1\n ELSE 0\n END",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Configure transaction log backups for databases in FULL recovery model",
"Source": "Custom",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_003",
"Name": "Check 3",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\nSELECT TOP 1\r\n 3 AS CheckID ,\r\n \u0027msdb\u0027 ,\r\n 200 AS Priority ,\r\n \u0027Backup\u0027 AS FindingsGroup ,\r\n \u0027MSDB Backup History Not Purged\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/history\u0027 AS URL ,\r\n ( \u0027Database backup history retained back to \u0027\r\n \u002B CAST(bs.backup_start_date AS VARCHAR(20)) ) AS Details\r\n FROM msdb.dbo.backupset bs\r\n LEFT OUTER JOIN msdb.dbo.restorehistory rh ON bs.database_name = rh.destination_database_name\r\n WHERE rh.destination_database_name IS NULL\r\n ORDER BY bs.backup_start_date ASC\r\n\r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 3. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_004",
"Name": "Sysadmins on SQL server",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\nSELECT 4 AS CheckID ,\r\n 230 AS Priority ,\r\n \u0027Security\u0027 AS FindingsGroup ,\r\n \u0027Sysadmins\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/sa\u0027 AS URL ,\r\n ( \u0027Login [\u0027 \u002B l.name\r\n \u002B \u0027] is a sysadmin - meaning they can do absolutely anything in SQL Server, including dropping databases or hiding their tracks.\u0027 ) AS Details\r\nFROM master.sys.syslogins l\r\nWHERE l.sysadmin = 1\r\n AND l.name \u003C\u003E SUSER_SNAME(0x01)\r\n AND l.denylogin = 0\r\n AND l.name NOT LIKE \u0027NT SERVICE\\%\u0027\r\n AND l.name \u003C\u003E \u0027l_certSignSmDetach\u0027 /* Added in SQL 2016 */\r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 4. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_005",
"Name": "Security Admins on SQL server",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\nSELECT 5 AS CheckID ,\r\n 230 AS Priority ,\r\n \u0027Security\u0027 AS FindingsGroup ,\r\n \u0027Security Admins\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/sa\u0027 AS URL ,\r\n ( \u0027Login [\u0027 \u002B l.name\r\n \u002B \u0027] is a security admin - meaning they can give themselves permission to do absolutely anything in SQL Server, including dropping databases or hiding their tracks.\u0027 ) AS Details\r\nFROM master.sys.syslogins l\r\nWHERE l.securityadmin = 1\r\n AND l.name \u003C\u003E SUSER_SNAME(0x01)\r\n AND l.denylogin = 0\r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 5. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_006",
"Name": "Jobs owned by users",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\nSELECT 6 AS CheckID ,\r\n 230 AS Priority ,\r\n \u0027Security\u0027 AS FindingsGroup ,\r\n \u0027Jobs Owned By Users\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/owners\u0027 AS URL ,\r\n ( \u0027Job [\u0027 \u002B j.name \u002B \u0027] is owned by [\u0027\r\n \u002B SUSER_SNAME(j.owner_sid)\r\n \u002B \u0027] - meaning if their login is disabled or not available due to Active Directory problems, the job will stop working.\u0027 ) AS Details\r\nFROM msdb.dbo.sysjobs j\r\nWHERE j.enabled = 1\r\n AND SUSER_SNAME(j.owner_sid) \u003C\u003E SUSER_SNAME(0x01)\r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 6. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_007",
"Name": "Stored Procedures running at startup",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\nSELECT 7 AS CheckID ,\r\n 230 AS Priority ,\r\n \u0027Security\u0027 AS FindingsGroup ,\r\n \u0027Stored Procedure Runs at Startup\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/startup\u0027 AS URL ,\r\n ( \u0027Stored procedure [master].[\u0027\r\n \u002B r.SPECIFIC_SCHEMA \u002B \u0027].[\u0027\r\n \u002B r.SPECIFIC_NAME\r\n \u002B \u0027] runs automatically when SQL Server starts up. Make sure you know exactly what this stored procedure is doing, because it could pose a security risk.\u0027 ) AS Details\r\nFROM master.INFORMATION_SCHEMA.ROUTINES r\r\nWHERE OBJECTPROPERTY(OBJECT_ID(ROUTINE_NAME),\r\n \u0027ExecIsStartup\u0027) = 1\r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 7. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_008",
"Name": "Server Audits running",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n SELECT 8 AS CheckID,\r\n 230 AS Priority,\r\n \u0027Security\u0027 AS FindingsGroup,\r\n \u0027Server Audits Running\u0027 AS Finding,\r\n \u0027https://www.brentozar.com/go/audits\u0027 AS URL,\r\n (\u0027SQL Server built-in audit functionality is being used by server audit: \u0027 \u002B [name]) AS Details \r\n FROM sys.dm_server_audit_status --OPTION (RECOMPILE)\r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 8. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_010",
"Name": "Resource Governor Enabled",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\nSELECT 10 AS CheckID,\r\n 100 AS Priority,\r\n \u0027Performance\u0027 AS FindingsGroup,\r\n \u0027Resource Governor Enabled\u0027 AS Finding,\r\n \u0027https://www.brentozar.com/go/rg\u0027 AS URL,\r\n (\u0027Resource Governor is enabled. Queries may be throttled. Make sure you understand how the Classifier Function is configured.\u0027) AS Details FROM sys.resource_governor_configuration WHERE is_enabled = 1 \r\n \r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 10. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_011",
"Name": "Server triggers enabled",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\nSELECT 11 AS CheckID,\r\n 100 AS Priority,\r\n \u0027Performance\u0027 AS FindingsGroup,\r\n \u0027Server Triggers Enabled\u0027 AS Finding,\r\n \u0027https://www.brentozar.com/go/logontriggers/\u0027 AS URL,\r\n (\u0027Server Trigger [\u0027 \u002B [name] \u002B\u002B \u0027] is enabled. Make sure you understand what that trigger is doing - the less work it does, the better.\u0027) AS Details\r\n FROM sys.server_triggers\r\n WHERE is_disabled = 0 AND is_ms_shipped = 0 AND name NOT LIKE \u0027rds^_%\u0027 ESCAPE \u0027^\u0027\r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 11. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_012",
"Name": "Database Auto-Close enabled",
"Description": "",
"Category": "Configuration",
"Severity": "Critical",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\nSELECT 12 AS CheckID ,\r\n [name] AS DatabaseName ,\r\n 10 AS Priority ,\r\n \u0027Performance\u0027 AS FindingsGroup ,\r\n \u0027Auto-Close Enabled\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/autoclose\u0027 AS URL ,\r\n ( \u0027Database [\u0027 \u002B [name]\r\n \u002B \u0027] has auto-close enabled. This setting can dramatically decrease performance.\u0027 ) AS Details\r\nFROM sys.databases\r\nWHERE is_auto_close_on = 1\r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 12. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_013",
"Name": "Database Auto-Shrink enabled",
"Description": "",
"Category": "Configuration",
"Severity": "Critical",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\nSELECT 13 AS CheckID ,\r\n [name] AS DatabaseName ,\r\n 10 AS Priority ,\r\n \u0027Performance\u0027 AS FindingsGroup ,\r\n \u0027Auto-Shrink Enabled\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/autoshrink\u0027 AS URL ,\r\n ( \u0027Database [\u0027 \u002B [name]\r\n \u002B \u0027] has auto-shrink enabled. This setting can dramatically decrease performance.\u0027 ) AS Details\r\nFROM sys.databases\r\nWHERE is_auto_shrink_on = 1\r\n AND state \u003C\u003E 6 /* Offline */\r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 13. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_014",
"Name": "Corruption checks not optimal",
"Description": "",
"Category": "Configuration",
"Severity": "Critical",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\n SELECT 14 AS CheckID,\r\n [name] as DatabaseName,\r\n 50 AS Priority,\r\n \u0027Reliability\u0027 AS FindingsGroup,\r\n \u0027Page Verification Not Optimal\u0027 AS Finding,\r\n \u0027https://www.brentozar.com/go/torn\u0027 AS URL,\r\n (\u0027Database [\u0027 \u002B [name] \u002B \u0027] has \u0027 \u002B [page_verify_option_desc] \u002B \u0027 for page verification. SQL Server may have a harder time recognizing and recovering from storage corruption. Consider using CHECKSUM instead.\u0027) COLLATE database_default AS Details\r\n FROM sys.databases\r\n WHERE page_verify_option \u003C 2\r\n AND name \u003C\u003E \u0027tempdb\u0027\r\n AND state NOT IN (1, 6) /* Restoring, Offline */\r\n \r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 14. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_015",
"Name": "Auto-Create Statistics Disabled",
"Description": "",
"Category": "Configuration",
"Severity": "Critical",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\nSELECT 15 AS CheckID ,\r\n [name] AS DatabaseName ,\r\n 110 AS Priority ,\r\n \u0027Performance\u0027 AS FindingsGroup ,\r\n \u0027Auto-Create Stats Disabled\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/acs\u0027 AS URL ,\r\n ( \u0027Database [\u0027 \u002B [name]\r\n \u002B \u0027] has auto-create-stats disabled. SQL Server uses statistics to build better execution plans, and without the ability to automatically create more, performance may suffer.\u0027 ) AS Details\r\n FROM sys.databases\r\n WHERE is_auto_create_stats_on = 0\r\n \r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 15. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_016",
"Name": "Auto-Update Stats Disabled",
"Description": "",
"Category": "Configuration",
"Severity": "Critical",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\nSELECT 16 AS CheckID ,\r\n [name] AS DatabaseName ,\r\n 110 AS Priority ,\r\n \u0027Performance\u0027 AS FindingsGroup ,\r\n \u0027Auto-Update Stats Disabled\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/aus\u0027 AS URL ,\r\n ( \u0027Database [\u0027 \u002B [name]\r\n \u002B \u0027] has auto-update-stats disabled. SQL Server uses statistics to build better execution plans, and without the ability to automatically update them, performance may suffer.\u0027 ) AS Details\r\nFROM sys.databases\r\nWHERE is_auto_update_stats_on = 0 \r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 16. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_017",
"Name": "Stats Updated Asynchronously",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\nSELECT 17 AS CheckID ,\r\n [name] AS DatabaseName ,\r\n 150 AS Priority ,\r\n \u0027Performance\u0027 AS FindingsGroup ,\r\n \u0027Stats Updated Asynchronously\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/asyncstats\u0027 AS URL ,\r\n ( \u0027Database [\u0027 \u002B [name]\r\n \u002B \u0027] has auto-update-stats-async enabled. When SQL Server gets a query for a table with out-of-date statistics, it will run the query with the stats it has - while updating stats to make later queries better. The initial run of the query may suffer, though.\u0027 ) AS Details\r\nFROM sys.databases\r\nWHERE is_auto_update_stats_async_on = 1 \r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 17. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_019",
"Name": "Replication in use",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE WHEN\r\n EXISTS ( \r\nSELECT 19 AS CheckID ,\r\n [name] AS DatabaseName ,\r\n 200 AS Priority ,\r\n \u0027Informational\u0027 AS FindingsGroup ,\r\n \u0027Replication In Use\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/repl\u0027 AS URL ,\r\n ( \u0027Database [\u0027 \u002B [name]\r\n \u002B \u0027] is a replication publisher, subscriber, or distributor.\u0027 ) AS Details\r\nFROM sys.databases\r\nWHERE (is_published = 1\r\n OR is_subscribed = 1\r\n OR is_merge_published = 1\r\n OR is_distributor = 1) \r\n ) \r\n THEN 1\r\n ELSE 0\r\n END",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 19. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_020",
"Name": "Date correlation",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\n SELECT 20 AS CheckID ,\r\n [name] AS DatabaseName ,\r\n 200 AS Priority ,\r\n \u0027Informational\u0027 AS FindingsGroup ,\r\n \u0027Date Correlation On\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/corr\u0027 AS URL ,\r\n ( \u0027Database [\u0027 \u002B [name]\r\n \u002B \u0027] has date correlation enabled. This is not a default setting, and it has some performance overhead. It tells SQL Server that date fields in two tables are related, and SQL Server maintains statistics showing that relation.\u0027 ) AS Details\r\n FROM sys.databases\r\n WHERE is_date_correlation_on = 1 \r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 20. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_021",
"Name": "Database Encrypted",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\nSELECT 21 AS CheckID,\r\n [name] as DatabaseName,\r\n 200 AS Priority,\r\n \u0027Informational\u0027 AS FindingsGroup,\r\n \u0027Database Encrypted\u0027 AS Finding,\r\n \u0027https://www.brentozar.com/go/tde\u0027 AS URL,\r\n (\u0027Database [\u0027 \u002B [name] \u002B \u0027] has Transparent Data Encryption enabled. Make absolutely sure you have backed up the certificate and private key, or else you will not be able to restore this database.\u0027) AS Details\r\n FROM sys.databases\r\n WHERE is_encrypted = 1 \r\n ) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 21. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.00,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_022",
"Name": "Check 22",
"Description": "Check 22 (sp_Blitz CheckID 22, Priority 100)",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT 0 AS Result -- sp_Blitz CheckID 22: Check 22 (query not yet implemented - see sp_Blitz.sql for original query)",
"ExpectedValue": 0,
"Enabled": false,
"RecommendedAction": "Review finding: Check 22. More info: https://aws.amazon.com/rds/sqlserver/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_024",
"Name": "System Database on C Drive",
"Description": "System Database on C Drive - File Configuration (sp_Blitz CheckID 24)",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\nSELECT DISTINCT\r\n 24 AS CheckID ,\r\n DB_NAME(database_id) AS DatabaseName ,\r\n 170 AS Priority ,\r\n \u0027File Configuration\u0027 AS FindingsGroup ,\r\n \u0027System Database on C Drive\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/cdrive\u0027 AS URL ,\r\n ( \u0027The \u0027 \u002B DB_NAME(database_id)\r\n \u002B \u0027 database has a file on the C drive. Putting system databases on the C drive runs the risk of crashing the server when it runs out of space.\u0027 ) AS Details\r\nFROM sys.master_files\r\nWHERE UPPER(LEFT(physical_name, 1)) = \u0027C\u0027\r\n AND DB_NAME(database_id) IN ( \u0027master\u0027,\r\n \u0027model\u0027, \u0027msdb\u0027 )\r\n) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 24. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_025",
"Name": "TempDB on C Drive",
"Description": "TempDB on C Drive - File Configuration (sp_Blitz CheckID 25)",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\nSELECT TOP 1\r\n 25 AS CheckID ,\r\n \u0027tempdb\u0027 ,\r\n 20 AS Priority ,\r\n \u0027File Configuration\u0027 AS FindingsGroup ,\r\n \u0027TempDB on C Drive\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/cdrive\u0027 AS URL ,\r\n CASE WHEN growth \u003E 0\r\n THEN ( \u0027The tempdb database has files on the C drive. TempDB frequently grows unpredictably, putting your server at risk of running out of C drive space and crashing hard. C is also often much slower than other drives, so performance may be suffering.\u0027 )\r\n ELSE ( \u0027The tempdb database has files on the C drive. TempDB is not set to Autogrow, hopefully it is big enough. C is also often much slower than other drives, so performance may be suffering.\u0027 )\r\n END AS Details\r\nFROM sys.master_files\r\nWHERE UPPER(LEFT(physical_name, 1)) = \u0027C\u0027\r\n AND DB_NAME(database_id) = \u0027tempdb\u0027\r\n) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": false,
"RecommendedAction": "Review finding: Check 25. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_026",
"Name": "User Database on C Drive",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\nSELECT DISTINCT\r\n 26 AS CheckID ,\r\n DB_NAME(database_id) AS DatabaseName ,\r\n 20 AS Priority ,\r\n \u0027Reliability\u0027 AS FindingsGroup ,\r\n \u0027User Databases on C Drive\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/cdrive\u0027 AS URL ,\r\n ( \u0027The \u0027 \u002B DB_NAME(database_id)\r\n \u002B \u0027 database has a file on the C drive. Putting databases on the C drive runs the risk of crashing the server when it runs out of space.\u0027 ) AS Details\r\nFROM sys.master_files\r\nWHERE UPPER(LEFT(physical_name, 1)) = \u0027C\u0027\r\n AND DB_NAME(database_id) NOT IN ( \u0027master\u0027,\u0027model\u0027, \u0027msdb\u0027, \u0027tempdb\u0027 )\r\n) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 26. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_027",
"Name": "Tables in the Master Database",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\nSELECT 27 AS CheckID ,\r\n \u0027master\u0027 AS DatabaseName ,\r\n 200 AS Priority ,\r\n \u0027Informational\u0027 AS FindingsGroup ,\r\n \u0027Tables in the Master Database\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/mastuser\u0027 AS URL ,\r\n ( \u0027The \u0027 \u002B name\r\n \u002B \u0027 table in the master database was created by end users on \u0027\r\n \u002B CAST(create_date AS VARCHAR(20))\r\n \u002B \u0027. Tables in the master database may not be restored in the event of a disaster.\u0027 ) AS Details\r\nFROM master.sys.tables\r\nWHERE is_ms_shipped = 0\r\n AND name NOT IN (\u0027CommandLog\u0027,\u0027SqlServerVersions\u0027,\u0027$ndo$srvproperty\u0027)\r\n AND name NOT LIKE \u0027rds^_%\u0027 ESCAPE \u0027^\u0027\r\n) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 27. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_028",
"Name": "Tables in the MSDB Database",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\nSELECT 28 AS CheckID ,\r\n \u0027msdb\u0027 AS DatabaseName ,\r\n 200 AS Priority ,\r\n \u0027Informational\u0027 AS FindingsGroup ,\r\n \u0027Tables in the MSDB Database\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/msdbuser\u0027 AS URL ,\r\n ( \u0027The \u0027 \u002B name\r\n \u002B \u0027 table in the msdb database was created by end users on \u0027\r\n \u002B CAST(create_date AS VARCHAR(20))\r\n \u002B \u0027. Tables in the msdb database may not be restored in the event of a disaster.\u0027 ) AS Details\r\nFROM msdb.sys.tables\r\nWHERE is_ms_shipped = 0 AND name NOT LIKE \u0027%DTA_%\u0027\r\n) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 28. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_029",
"Name": "Tables in the Model Database",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\nSELECT 29 AS CheckID ,\r\n \u0027model\u0027 AS DatabaseName ,\r\n 200 AS Priority ,\r\n \u0027Informational\u0027 AS FindingsGroup ,\r\n \u0027Tables in the Model Database\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/model\u0027 AS URL ,\r\n ( \u0027The \u0027 \u002B name\r\n \u002B \u0027 table in the model database was created by end users on \u0027\r\n \u002B CAST(create_date AS VARCHAR(20))\r\n \u002B \u0027. Tables in the model database are automatically copied into all new databases.\u0027 ) AS Details\r\nFROM model.sys.tables\r\nWHERE is_ms_shipped = 0\r\n) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 29. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_030",
"Name": "Not All Alerts Configured",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\nSELECT 30 AS CheckID ,\r\n 200 AS Priority ,\r\n \u0027Monitoring\u0027 AS FindingsGroup ,\r\n \u0027Not All Alerts Configured\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/alert\u0027 AS URL ,\r\n ( \u0027Not all SQL Server Agent alerts have been configured. This is a free, easy way to get notified of corruption, job failures, or major outages even before monitoring systems pick it up.\u0027 ) AS Details\r\n WHERE (\r\n SELECT COUNT(1) FROM msdb.dbo.sysalerts\r\n WHERE severity BETWEEN 19 AND 25) \u003C 7\r\n) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 30. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_031",
"Name": "No Operators Configured/Enabled",
"Description": "No Operators Configured/Enabled - Monitoring (sp_Blitz CheckID 31)",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\nSELECT 31 AS CheckID ,\r\n 200 AS Priority ,\r\n \u0027Monitoring\u0027 AS FindingsGroup ,\r\n \u0027No Operators Configured/Enabled\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/op\u0027 AS URL ,\r\n ( \u0027No SQL Server Agent operators (emails) have been configured. This is a free, easy way to get notified of corruption, job failures, or major outages even before monitoring systems pick it up.\u0027 ) AS Details WHERE NOT EXISTS ( SELECT *\r\nFROM msdb.dbo.sysoperators\r\n WHERE enabled = 1 )\r\n) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 31. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_032",
"Name": "Triggers on Tables",
"Description": "",
"Category": "Configuration",
"Severity": "Info",
"SqlQuery": "IF OBJECT_ID(\u0027tempdb..#BlitzResultstt\u0027) IS NOT NULL\r\n DROP TABLE #BlitzResultstt;\r\n CREATE TABLE #BlitzResultstt\r\n (\r\n ID INT IDENTITY(1, 1) ,\r\n CheckID INT ,\r\n DatabaseName NVARCHAR(128) ,\r\n Priority TINYINT ,\r\n FindingsGroup VARCHAR(50) ,\r\n Finding VARCHAR(200) ,\r\n URL VARCHAR(200) ,\r\n Details NVARCHAR(4000) ,\r\n QueryPlan [XML] NULL ,\r\n QueryPlanFiltered [NVARCHAR](MAX) NULL\r\n );\r\nIF @@VERSION NOT LIKE \u0027%Microsoft SQL Server 2000%\u0027\r\n AND @@VERSION NOT LIKE \u0027%Microsoft SQL Server 2005%\u0027\r\nBEGIN\r\nEXEC dbo.sp_MSforeachdb \u0027USE [?];\r\n SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;\r\n INSERT INTO #BlitzResultstt\r\n (CheckID,\r\n DatabaseName,\r\n Priority,\r\n FindingsGroup,\r\n Finding,\r\n URL,\r\n Details)\r\n SELECT 32,\r\n N\u0027\u0027?\u0027\u0027,\r\n 150,\r\n \u0027\u0027Performance\u0027\u0027,\r\n \u0027\u0027Triggers on Tables\u0027\u0027,\r\n \u0027\u0027https://www.brentozar.com/go/trig\u0027\u0027,\r\n (\u0027\u0027The [\u0027\u0027 \u002B DB_NAME() \u002B \u0027\u0027] database has \u0027\u0027 \u002B CAST(SUM(1) AS NVARCHAR(50)) \u002B \u0027\u0027 triggers.\u0027\u0027)\r\n FROM [?].sys.triggers t INNER JOIN [?].sys.objects o ON t.parent_id = o.object_id\r\n INNER JOIN [?].sys.schemas s ON o.schema_id = s.schema_id\r\n WHERE t.is_ms_shipped = 0\r\n AND \u0027\u0027?\u0027\u0027 NOT IN (\u0027\u0027rdsadmin\u0027\u0027, \u0027\u0027ReportServer\u0027\u0027)\r\n HAVING SUM(1) \u003E 0 OPTION (RECOMPILE)\u0027;\r\nEND\r\n\r\n\r\nSELECT CASE WHEN\r\n EXISTS ( \r\nSELECT 32,\r\n N\u0027?\u0027,\r\n 150,\r\n \u0027Performance\u0027,\r\n \u0027Triggers on Tables\u0027 \r\n FROM #BlitzResultstt\r\n \r\n ) \r\n THEN 1\r\n ELSE 0\r\n END\r\nIF OBJECT_ID(\u0027tempdb..#BlitzResultstt\u0027) IS NOT NULL\r\n DROP TABLE #BlitzResultstt;",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 32. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_033",
"Name": "Enterprise Edition Features In Use",
"Description": "",
"Category": "Configuration",
"Severity": "Warning",
"SqlQuery": "IF OBJECT_ID(\u0027tempdb..#BlitzResultstt\u0027) IS NOT NULL\r\n DROP TABLE #BlitzResultstt;\r\n CREATE TABLE #BlitzResultstt\r\n (\r\n ID INT IDENTITY(1, 1) ,\r\n CheckID INT ,\r\n DatabaseName NVARCHAR(128) ,\r\n Priority TINYINT ,\r\n FindingsGroup VARCHAR(50) ,\r\n Finding VARCHAR(200) ,\r\n URL VARCHAR(200) ,\r\n Details NVARCHAR(4000) ,\r\n QueryPlan [XML] NULL ,\r\n QueryPlanFiltered [NVARCHAR](MAX) NULL\r\n );\r\nIF @@VERSION NOT LIKE \u0027%Microsoft SQL Server 2000%\u0027\r\n AND @@VERSION NOT LIKE \u0027%Microsoft SQL Server 2005%\u0027\r\nBEGIN\r\nEXEC dbo.sp_MSforeachdb \u0027USE [?]; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;\r\n INSERT INTO #BlitzResultstt\r\n (CheckID,\r\n DatabaseName,\r\n Priority,\r\n FindingsGroup,\r\n Finding,\r\n URL,\r\n Details)\r\n SELECT DISTINCT 33,\r\n db_name(),\r\n 200,\r\n \u0027\u0027Licensing\u0027\u0027,\r\n \u0027\u0027Enterprise Edition Features In Use\u0027\u0027,\r\n \u0027\u0027https://www.brentozar.com/go/ee\u0027\u0027,\r\n (\u0027\u0027The [\u0027\u0027 \u002B DB_NAME() \u002B \u0027\u0027] database is using \u0027\u0027 \u002B feature_name \u002B \u0027\u0027. If this database is restored onto a Standard Edition server, the restore will fail on versions prior to 2016 SP1.\u0027\u0027)\r\n FROM [?].sys.dm_db_persisted_sku_features\r\n WHERE \u0027\u0027?\u0027\u0027 != \u0027\u0027rdsadmin\u0027\u0027\r\n OPTION (RECOMPILE);\u0027; \r\nEND\r\nSELECT CASE WHEN\r\n EXISTS ( \r\nSELECT DISTINCT 33,\r\n db_name(),\r\n 200,\r\n \u0027Licensing\u0027,\r\n \u0027Enterprise Edition Features In Use\u0027\r\n FROM #BlitzResultstt \r\n ) \r\n THEN 1\r\n ELSE 0\r\n END\r\nIF OBJECT_ID(\u0027tempdb..#BlitzResultstt\u0027) IS NOT NULL\r\n DROP TABLE #BlitzResultstt;",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 33. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_034",
"Name": "Database Corruption Detected",
"Description": "",
"Category": "Configuration",
"Severity": "Critical",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\nSELECT DISTINCT\r\n 34 AS CheckID ,\r\n db.name ,\r\n 1 AS Priority ,\r\n \u0027Corruption\u0027 AS FindingsGroup ,\r\n \u0027Database Corruption Detected\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/repair\u0027 AS URL ,\r\n ( \u0027Database mirroring has automatically repaired at least one corrupt page in the last 30 days. For more information, query the DMV sys.dm_db_mirroring_auto_page_repair.\u0027 ) AS Details\r\n FROM (SELECT rp2.database_id, rp2.modification_time\r\n FROM sys.dm_db_mirroring_auto_page_repair rp2\r\n WHERE rp2.[database_id] not in (\r\n SELECT db2.[database_id]\r\n FROM sys.databases as db2\r\n WHERE db2.[state] = 1\r\n ) ) as rp\r\n INNER JOIN master.sys.databases db ON rp.database_id = db.database_id\r\n WHERE rp.modification_time \u003E= DATEADD(dd, -30, GETDATE())\r\n) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 34. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_035",
"Name": "Single-Use Plans in Procedure Cache",
"Description": "",
"Category": "Performance",
"Severity": "Warning",
"SqlQuery": "SELECT CASE WHEN\r\n EXISTS ( \r\nSELECT 35 AS CheckID ,\r\n 100 AS Priority ,\r\n \u0027Performance\u0027 AS FindingsGroup ,\r\n \u0027Single-Use Plans in Procedure Cache\u0027 AS Finding ,\r\n \u0027https://www.brentozar.com/go/single\u0027 AS URL ,\r\n ( CAST(COUNT(*) AS VARCHAR(10))\r\n \u002B \u0027 query plans are taking up memory in the procedure cache. This may be wasted memory if we cache plans for queries that never get called again. This may be a good use case for SQL Server 2008\u0027\u0027s Optimize for Ad Hoc or for Forced Parameterization.\u0027 ) AS Details\r\n FROM sys.dm_exec_cached_plans AS cp\r\n WHERE cp.usecounts = 1\r\n AND cp.objtype = \u0027Adhoc\u0027\r\n AND EXISTS ( SELECT\r\n 1\r\n FROM sys.configurations\r\n WHERE\r\n name = \u0027optimize for ad hoc workloads\u0027\r\n AND value_in_use = 0 )\r\n HAVING COUNT(*) \u003E 1\r\n) \r\nTHEN 1\r\n ELSE 0\r\n END",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 35. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_036",
"Name": "Slow Storage Reads on Drive",
"Description": "",
"Category": "Configuration",
"Severity": "Critical",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\nSELECT DISTINCT\r\n 36 AS CheckID ,\r\n 150 AS Priority ,\r\n \u0027Performance\u0027 AS FindingsGroup ,\r\n \u0027Slow Storage Reads on Drive \u0027\r\n \u002B UPPER(LEFT(mf.physical_name, 1)) AS Finding ,\r\n \u0027https://www.brentozar.com/go/slow\u0027 AS URL ,\r\n \u0027Reads are averaging longer than 200ms for at least one database on this drive. For specific database file speeds, run the query from the information link.\u0027 AS Details\r\nFROM sys.dm_io_virtual_file_stats(NULL, NULL)\r\n AS fs\r\n INNER JOIN sys.master_files AS mf ON fs.database_id = mf.database_id\r\n AND fs.[file_id] = mf.[file_id]\r\nWHERE ( io_stall_read_ms / ( 1.0 \u002B num_of_reads ) ) \u003E 200\r\nAND num_of_reads \u003E 100000\r\n) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 36. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""
},
{
"Id": "BLITZ_037",
"Name": "Slow Storage Writes on Drive",
"Description": "",
"Category": "Performance",
"Severity": "Critical",
"SqlQuery": "SELECT CASE \r\nWHEN EXISTS (\r\n\r\n SELECT DISTINCT\r\n 37 AS CheckID ,\r\n 150 AS Priority ,\r\n \u0027Performance\u0027 AS FindingsGroup ,\r\n \u0027Slow Storage Writes on Drive \u0027\r\n \u002B UPPER(LEFT(mf.physical_name, 1)) AS Finding ,\r\n \u0027https://www.brentozar.com/go/slow\u0027 AS URL ,\r\n \u0027Writes are averaging longer than 100ms for at least one database on this drive. For specific database file speeds, run the query from the information link.\u0027 AS Details\r\n FROM sys.dm_io_virtual_file_stats(NULL, NULL)\r\n AS fs\r\n INNER JOIN sys.master_files AS mf ON fs.database_id = mf.database_id\r\n AND fs.[file_id] = mf.[file_id]\r\n WHERE ( io_stall_write_ms / ( 1.0\r\n \u002B num_of_writes ) ) \u003E 100\r\n AND num_of_writes \u003E 100000\r\n) THEN 1\r\n ELSE 0\r\nEND",
"ExpectedValue": 0,
"Enabled": true,
"RecommendedAction": "Review finding: Check 37. More info: https://www.brentozar.com/blitz/",
"Source": "sp_Blitz",
"ExecutionType": "Binary",
"RowCountCondition": "Equals0",
"ResultInterpretation": "PassFail",
"Priority": 1,
"SeverityScore": 1,
"Weight": 0.0,
"ExpectedState": "",
"CheckTriggered": "",
"CheckCleared": "",
"DetailedRemediation": "",
"SupportType": "Reactive, Proactive",
"ImpactScore": 3,
"AdditionalNotes": ""