SQL Server Setup Checklist Part 1
SQL Server Setup Checklist Part 1
SQL Server Setup Checklist Part 1
Written on March 19, 2008 by Brent Ozar in Featured Posts, SQL Server 71 Comments - Read Comments
Over the last few years, Ive put together a list of best practices for installing Microsoft SQL Server 2005 and 2008. Other folks do more, but for small businesses, this is a good start. I dont show the exact point-and-click steps because my target audience (you smart folks) arent complete newbies. I know you folks understand HOW to do most of these things, but you take shortcuts because you dont understand WHY youre doing these things. There are plenty of places on the web where you can find examples of how to execute these steps (if not, email me and Ill post em) instead, this series of articles will explain the reasoning behind the gruntwork.
Create at least one new Active Directory account for this SQL Server.
This is best practices, and a popular shortcut is to run all of the database servers under the same service account. Ive run into two problems with this approach. First, Ive had a sysadmin repeatedly fat-finger the service account password, thereby locking out the service account. When all of the SQL Servers suddenly run into service account problems, thats a really ugly outage. Second, there have been times when Ive needed to give permissions to a specific SQL Server that other servers shouldnt get. If xp_cmdshell is enabled, then DOS commands will be run with the SQL Servers service account permissions. I hate giving any more permissions than necessary, so if a user needs to write to remote locations using xp_cmdshell, its nice to lock down the permissions on that one database servers account instead of enabling every SQL Server to write to that remote location. I say at least one new account because best practices dictates using separate accounts for the database service, fulltext service, agent, etc. Ill slack a little there and share the same account sometimes, especially on development boxes.
Configure local security settings for the SQL Server 2005/2008 service account.
Go into Local Security Settings (click Start, Run, type SECPOL.MSC and hit enter) and click Local Policies, User Rights Assignment.
In the permission Perform Volume Maintenance Tasks, add your SQL Server service account (or a domain group if you use that). This enables SQL 2005s Instant File Initialization, which lets SQL Server instantly grow data files without erasing the physical disk first. This is a huge performance gain for large databases like data warehouses. In the permission Lock pages in memory, add your SQL Server service account or domain group. This lets SQL Server keep all of its data in physical memory instead of swapping it out to disk.
Test the multipathing. In my experience, Ive usually seen active/passive on a per-array basis meaning, if you have two different iSCSI drive letters, then the teaming or multipathing drivers will put each drive on its own network card. The EMC and LeftHand multipathing appears to do this by default. Start multiple simultaneous drive copies and go into Task Manager, in the Network tab. Look at the bandwidth used by each network card. If a network card is sitting idle, then youre leaving performance on the table. Now is the time to tweak the multipathing software and ask questions of the vendor its easier to troubleshoot file copy performance than it is to troubleshoot SQL Server performance. Test the failover. As with the fiber cable testing, start multiple simultaneous file copies to/from the network drives and pull one network cable out. If the file copy fails (if Windows throws an error) then SQL would have crashed. Tweak the teaming software until it can fail over seamlessly, and ideally it should fail over back and forth and go back to higher bandwidth levels as the networks come back online.
4GB RAM: /3GB (AWE support is not used) 8GB RAM: /3GB /PAE 16GB RAM: /3GB /PAE 16GB + RAM: /PAE
You can read more about AWE and PAE at SQL-Server-Performance, who does a better job of explaining this than I ever could.
But you cant just run the setup.exe and go into production oh no. In the next article, Ill cover my non-default installation settings and the things I do after the install to make the server as reliable as possible for the long haul.
Read more: http://www.brentozar.com/archive/2008/03/sql-server-2005-setup-checklist-part-1-before-theinstall/#ixzz1I5r7bMXc Copyright 2011 Brent Ozar. All rights reserved.
Ive covered what needs to happen before you install SQL Server now, lets talk about what to do immediately after the setup finishes.
Install not just the service packs, but also the cumulative updates.
Starting with SQL Server 2005s Service Pack 2, Microsoft releases hotfixes in cumulative packs. These updates do more than just fix bugs: they improve how SQL Server performs. These updates are free performance benefits and who doesnt like that? To find the latest service packs and cumulative updates, check out the SQL Server Release Date Calendar at SQLServerPedia. Its got version numbers, build numbers, and download links for all versions of SQL Server in one place.
thats not a good idea either. Instead, the TempDB data files should be on their own dedicated drive. Fix this by first moving TempDB to its own drive. In this example, I put the data file on the T drive and the log file on the L drive. (Be aware that the directory paths must already exist.) use master go alter database tempdb modify file (name=tempdev, filename=T:\MSSQL\DATA\tempDB.MDF, size = 1mb) go alter database tempdb modify file (name=templog, filename=L:\MSSQL\LOGS\templog.LDF, size = 1mb) go I only set a 1mb file size because SQL Server does something tricky: even though were telling it to use a different drive letter, it will look for this amount of free space on the drive TempDB currently uses! If SQL Server was installed on the servers C drive, for example, and we try to create a 10gb TempDB file on a T: drive, that SQL command will fail if there isnt 10gb of free space on the C drive. Yep, its a bug get over it. After this code runs, restart the SQL Server. That will create the new TempDB file on the new drive. Manually delete the old TempDB file on the original drive, because SQL Server doesnt delete that itself. Now that TempDB is on the right drive, expand it to the full size you want, and then create additional TempDB files. The current guidance from Paul Randal is to make 1/4-1/2 the number of TempDB files that you have processor cores. If youve got a quad-socket, quad-core box, thats 16 cores, so you need 4 to 8 TempDB files. Generally I start on the lower end unless I know the server will be under heavy TempDB pressure from its applications. Heres the code to create one additional TempDB data file you can modify this for more files: USE [master] GO ALTER DATABASE [tempdb] ADD FILE ( NAME = Ntempdev2, FILENAME = NT:\MSSQL\DATA\tempdev2.ndf , SIZE = 10GB , FILEGROWTH = 0) GO
The data file creation should only take a couple of seconds if it takes more than ten seconds, then instant file initialization isnt configured correctly. We talked about this back in the preinstallation checklist, so go back and revisit that before you create the next TempDB file. Fix the security to allow for instant file initialization now it has a huge performance impact on database growth. Assuming that one file growth only took a couple of seconds, then go ahead and create the rest of the TempDB data files. Notice that I dont have filegrowth enabled. You want to proactively create the TempDB files at their full sizes to avoid drive fragmentation. If you have a dual-cpu quad-core server (8 cores total) and an 80-gb array for TempDB data, you would create eight 10gb files for TempDB. That way, each file is contiguous, all laid out in one big chunk. If you create them as smaller files and let them autogrow, then the disk will be fragmented all over the place because the files will be growing at random times. Plus, you could end up with differently sized TempDB files if one of them happened to grow faster than the rest. Thats why I pre-grow all of the TempDB files ahead of time and get them at exactly the right size.
Ideally, no one would ever remote desktop into a SQL Server and run programs. Unfortunately, this happens, and we have to plan for it by leaving enough free memory for people to run things like SQL Server Management Studio. When Im first building a server that isnt running any other applications at all, I like to leave 10% of the memory free, or 2gb, whichever is larger. Then I monitor the free memory over the course of a month or two, and adjust it up or down during the next outage window. If the server does multiple duties like act as a web server or application server, we have to be much more conservative with memory. Application owners never seem to know how much memory theyll really use in production: SAP BWs Netweaver, for example, tends to use anywhere from 10% to 50% of the memory on our production server, and its tough to predict. As a result, we have to leave the SQL Servers memory allocation at just 50% of the available memory on the server. I set the minimum server memory to 50% of the servers total memory. This will let SQL Server release memory if the server comes under memory pressure, like if someone remote desktops in and runs a very poorly written application. The only way to know the right answer long term is to use Perfmon or a performance monitoring utility to watch the servers free memory. Ive written up a separate blog post on using Perfmon for SQL Server monitoring.
Great tip!
forbid, gets fired), its easier to add someone to a single distribution list instead of modifying operators on dozens or hundreds of servers. Then right-click on the SQL Server Agent, configure the alerting system to use Database Mail, and set up that DBA group as the failsafe operator. That way if anything happens and SQL Server doesnt know who to alert, it can alert the group.
Download the SQL Server 2005 Performance Dashboard Reports Read about them on SQL-Server-Performance
You run the setup.exe on your personal workstation, and then you have to execute the setup.sql script on each server that you want to monitor. It only takes a few minutes, but the information that it gathers will help you manage your server better throughout its lifetime.
Read more: http://www.brentozar.com/archive/2008/03/sql-server-2005-setup-checklist-part-2-after-theinstall/#ixzz1I5rJYjQA Copyright 2011 Brent Ozar. All rights reserved.
Heres my dream team of people who can give the real low-down on it from every angle:
Kevin Kline this guys written more SQL Server books than Ive read, and I read a lot. Hes a former PASS President and a Microsoft MVP. Hilary Cotter author of a book on SQL replication. Hes a Microsoft MVP who specializes in replication and text mining. Geoff Hiten author of the blog With CLUE as (Select * from Random_Thought ORDER BY Common_Sense DESC). Hes a Microsoft MVP who focuses on high performance and high availability.
Read more: http://www.brentozar.com/archive/2008/03/upcoming-webcast-on-sql-2008/#ixzz1I5rcrcZ6 Copyright 2011 Brent Ozar. All rights reserved.