Three amigos joined me for a cluster installation the other day. Neither of them was very friendly, so I decided to call them all out in one place in order for others to steer clear. The opinionated folder Using mount point folders is a great idea for neatness and to avoid having a gazillion drive letters in play. It is also a great idea to review the best practices for SQL Server clusters on mount point folders, as there are a few gotchas. This blog post lays it all out. If you fail to set up the correct permissions, funky stuff will ensue.
I had a case the other day where the customer called and told me that he had a bit of a performance problem. Well, I’ve heard that a few times over the years, and asked him to elaborate. He sent me a screenshot of SolarWinds Database Performance Analyzer and, well, it kind of points the finger to one thing: Um. Yeah. The ASYNC_NETWORK_IO thing. It kind of … sticks out. Okay, so how to tackle this then? We know what waits are happening, but where do we go from here? Well, It’s time to find out exactly what is generating said waits.
PASS Summit 2015 is winding down and I am strolling through increasingly deserted hallways. This was my second PASS Summit, and I already know it will not be my last. I’ve been to Oracle OpenWorld in San Francisco six times and compared to that conference this one is downright tiny. But the thing with the PASS community in relation to the Oracle community is like night and day. A quick background: I started out with Oracle back in ‘97 and SQL Server shortly thereafter, and let’s face it - SQL Server was not a serious contender back then. Both SQL Server and Oracle has come a good ways since then, and Oracle is ahead in many respects.
I decided to write up a blog post about index maintenance in SQL Azure databases (yes, I’m gravitating towards Azure just like everyone else these days). I had everything planned, what research to do, the case I was going to use, the whole nine yards. It would have been epic, had it not been for Pieter Vanhove, who’s already done it. Worse still, he did it way better than what I had planned. http://pietervanhove.azurewebsites.net/?p=14137 Somewhat miffed, I decided to play with it anyway (just not write a blog post about it, no, I’m not bitter :P ). Turns out there’s quite a gotcha with this:
Well, I’m back in the saddle. Four weeks of vacation, of which three resembled some kind of monsoon. The last was great, and ofcourse the weather became great as soon as I returned to work. I decided to get me a new script to show me unused indexes, and started looking at Stack Overflow to see if someone already had taken care of it (someone usually has). Turns out that there was a blog post by John Pasquet of folioTek here, and a very interesting addition to said blog post (and scripts) by user HAL9000 of Stack Overflow here. It just became my go to script for finding unused indexes.
The blog has been slow lately due to the impending vacation. I’ll toss in a few things I stumbled on the last week though: When dealing with a cluster, chances are that some of the disks just won’t be returned to the fold when deleted from available storage. For some reason, the cluster sometimes keeps the reservations on some disks, leading to some rather weird error messages. The solution is to us powershell to give said reservations the boot like this: Clear-ClusterDiskReservation -disk X -force Speaking of clusters; trying to find which node the SQL Server is running from can be a bit of a challenge from within SQL Server.
Part 4 - scripts for the previous parts Below are scripts for most of the SQL Server specific settings I discussed in the previous three parts. Please note that not quite everything is included (trace flags, instant file instantiation, etc.). -- Set memory amount sp_configure'show advanced options',1;GORECONFIGURE;GOsp_configure'max server memory',40000;GORECONFIGURE;GO-- Turn on optimize for adhoc workloads EXECUTEsp_configure'show advanced options',1;GORECONFIGURE;GOEXECUTEsp_configure'optimize for ad hoc workloads',1;GORECONFIGURE-- Turn on DAC EXECUTEsp_configure'remote admin connections',1;GORECONFIGURE;GO-- Adjusting TEMPDB ALTERDATABASE[tempdb]MODIFYFILE(NAME=N'tempdev',SIZE=100MB,FILEGROWTH=50MB);GO-- Script to create TEMPDB files like the one existing USE[master]goDECLARE@cpu_countINT,@file_countINT,@logical_nameSYSNAME,@file_nameNVARCHAR(520),@physical_nameNVARCHAR(520),@alter_commandNVARCHAR(max)SELECT@physical_name=physical_nameFROMtempdb.sys.database_filesWHERENAME='tempdev'SELECT@file_count=Count(*)FROMtempdb.sys.database_filesWHEREtype_desc='ROWS'SELECT@cpu_count=8WHILE@file_count<@cpu_countBEGINSELECT@logical_name='tempdev'+Cast(@file_count+1ASNVARCHAR)SELECT@file_name=Replace(@physical_name,'tempdb.mdf',@logical_name+'.ndf')SELECT@alter_command='ALTER DATABASE [tempdb] ADD FILE ( NAME =N'''+@logical_name+''', FILENAME =N'''+@file_name+''', SIZE = 100MB, FILEGROWTH = 50MB )'PRINT@alter_commandEXECSp_executesql@alter_commandSELECT@file_count=@file_count+1END;--Create operator DBATeam USE[msdb]GOEXECmsdb.dbo.sp_add_operator@name=N'DBATeam',@enabled=1,@pager_days=0,@email_address=Nfirstname.lastname@example.org; gazonk@bar.