Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Analyzing Dangerous Settings in SQL Server Expand / Collapse
Author
Message
Posted Thursday, September 12, 2013 3:35 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, April 17, 2014 12:04 PM
Points: 311, Visits: 1,080
Comments posted to this topic are about the item Analyzing Dangerous Settings in SQL Server


Post #1494072
Posted Thursday, September 12, 2013 5:40 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Today @ 3:58 PM
Points: 13, Visits: 68
What is meant by "dangerous" settings? Are the security issues, loss of data issues? Please explain.
Post #1494100
Posted Thursday, September 12, 2013 6:35 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 8:44 AM
Points: 1,629, Visits: 2,038
This would had been a lot better if you had provided short explanations of the setting, and why there could be problems.

Please don't go. The drones need you. They look up to you.
Connect to me on LinkedIn
Post #1494134
Posted Thursday, September 12, 2013 6:57 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 8:14 AM
Points: 9, Visits: 282
I have modified the script to avoid sp_configure and cursors.

;
WITH cteConfigValues AS
(
SELECT
ConfigurationName = [name]
,[Description]
,CurrentValue =
CASE [value_in_use]
WHEN 0 THEN 0
ELSE 1
END
,[value_in_use]
FROM
[master].sys.configurations
WHERE
[name] IN
(
'affinity64 mask'
,'affinity I/O mask'
,'affinity64 I/O mask'
,'lightweight pooling'
,'priority boost'
,'max worker threads'
,'show advanced options'
)
)
,cteWarnings AS
(
SELECT
ConfigurationName = 'maxworkerthreads'
,CurrentValue = 1
,Warning =
'Max Work Threads setting my cause blocking and thread pool issues/errors.
When all worker threads are active with long running queries, SQL Server may appear unresponsive until
a worker thread completes and becomes available. Though not a defect, this can sometimes be undesirable.
If a process appears to be unresponsive and no new queries can be processed, then connect to SQL Server
using the dedicated administrator connection (DAC), and kill the process.
** Only use if requested by Microsoft Support **
The default value for this option in sp_configure is 0.'
UNION
SELECT
ConfigurationName = 'priorityboost'
,CurrentValue = 1
,Warning =
'"Boost SQL Server priority" setting will drain OS and network functions and causes issues/errors.
Raising the priority too high may drain resources from essential operating system and network functions,
resulting in problems shutting down SQL Server or using other operating system tasks on the server.
** Only use if requested by Microsoft Support **
The default value for this option in sp_configure is 0.'
UNION
SELECT
ConfigurationName = 'lightweightpooling'
,CurrentValue = 1
,Warning =
'"Use Windows fibers (lightweight pooling)". By setting lightweight pooling to 1 causes SQL Server to switch
to fiber mode scheduling. Common language runtime (CLR) execution is not supported under lightweight pooling.
Disable one of two options: "clr enabled" or "lightweight pooling". Features that rely upon CLR and that do
not work properly in fiber mode include the hierarchy data type, replication, and Policy-Based Management.
CLR, replication and extended stored procedures will fail and/or not work.
** Only use if requested by Microsoft Support **
The default value for this option in sp_configure is 0.'
UNION
SELECT
ConfigurationName = 'affinitymask'
,CurrentValue = 1
,Warning =
'I/O and processor affinity changes will cause strange issues/errors and is not necessary on and 64 bit server.
Do not configure CPU affinity in the Windows operating system and also configure the affinity mask in SQL Server.
These settings are attempting to achieve the same result, and if the configurations are inconsistent, you may have
unpredictable results. SQL Server CPU affinity is best configured using the sp_configure option in SQL Server.
Using the GUI, under server properties select the "Automatically set processor affinity mask for all processors" and
select the "Automatically set I/O affinity mask for all processors". This will correct the issues.
** Only use if requested by Microsoft Support **
The default value for this option in sp_configure is 0.'
)
SELECT
A.ConfigurationName
,A.[Description]
,CurrentValue = A.[value_in_use]
,Warning = CAST(ISNULL(B.Warning,'No warning necessary. The value for this configuration option is the default.') AS xml)
FROM
cteConfigValues A
INNER JOIN
cteWarnings B
ON REPLACE(REPLACE(REPLACE(A.ConfigurationName,' ',''),'I/O',''),'64','') = B.ConfigurationName
AND A.CurrentValue = B.CurrentValue
;

Post #1494146
Posted Thursday, September 12, 2013 7:32 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, April 17, 2014 12:04 PM
Points: 311, Visits: 1,080
bgrossnickle (9/12/2013)
What is meant by "dangerous" settings? Are the security issues, loss of data issues? Please explain.


Hello,

"Dangerous setting" doesn't mean that your SQL Server will die or become unsecure. In this case it means that these setting, if not set/used properly then your SQL Server will not perform to its fullest capacity.

A lot of people change and play with these setting thinking that it will increase performance and it could if you really understand what they do and how your SQL Server is setup. It is recommended by Microsoft to leave these setting to default unless you are instructed by Microsoft support.

I wrote this script because I see that people play with these settings all the time and then ask me why the SQL Server is having performance issues.

Hope this explanation helps,

Rudy



Post #1494173
Posted Thursday, September 12, 2013 11:53 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 6:43 PM
Points: 3,157, Visits: 1,901
I think adding the list of dangerous settings with short explanations to the text of your post would make this a better article. While that information does reside in the SQL code, you either have to run the code or scroll through the code to see those explanations. A good idea that just needs a little re-formatting.

Thanks for posting it!
Post #1494305
Posted Thursday, September 12, 2013 2:06 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, April 17, 2014 12:04 PM
Points: 311, Visits: 1,080
KWymore (9/12/2013)
I think adding the list of dangerous settings with short explanations to the text of your post would make this a better article. While that information does reside in the SQL code, you either have to run the code or scroll through the code to see those explanations. A good idea that just needs a little re-formatting.

Thanks for posting it!


Thanks for you comment. Yes, I could have place the explanations in the post however people won't remember the post so I thought it would be better in the script since it is quite small. Also, as good DBA you should be reading over any code before executing it. I will keep that in mind the next time I submit some script.

Thanks.

Rudy



Post #1494352
Posted Wednesday, November 06, 2013 7:31 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, April 10, 2014 3:16 PM
Points: 85, Visits: 185
Thanks to all the folks who made comments and helped clear up the same questions I had. And thanks Rudy - good to know that mucking about with these settings could cause problems!


Mike



Post #1512056
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse