Archive | Installation RSS feed for this section

Why To Do Some of the Grunt Work, Even If You Don't Have To

Part of this past week I’ve spent doing a new SQL Server 2008 R2  installation and configuration on a Windows 2008 R2 cluster. I  haven’t done an install end-to-end in quite a while– I have teammates who take care of it while following our installation checklist document.

I started doing the install and configuration myself because I want to create fresh unattended install files, which I will later turn into slipstream drops. (For more on my love of slipstream installs, see the post here.) I will also be branching the install document soon to create a new version for SQL 2008 R2. Although the install for R2 isn’t very different, many of the paths used for copying files and a few scripts change, so  it’s less confusing in a separate document. In preparation for branching the file, I thought it would be good to give the 2008 install document itself a spring cleaning to clear up anything misleading.

Oh, Wouldya Look at That…

Cleanup on Aisle 7

This was an interesting experience. Although everything technically worked, some cleanup was needed on Aisle Seven.

The checklist is in a Word document so it can be filled out and saved in a history folder on SharePoint each time it used. In a recent past life this was all in a wiki, however. The wiki-to-SharePoint conversion was a shared project on a tight timeline and a lot of copy’n'paste was needed, so some of the fOrMatTing waS nOT wHat YoU’D eXpecT  <WEIRD WIKITAG HERE>

Some steps were in a slightly strange order, so you were over here in PowerShell, now over here in SQL, now back to PowerShell, now  reboot! Reboot! Reboot!  Now check out your page file. Run another PowerShell script! Hey did you forget about the other nodes in the cluster, this step finally mentions them– let’s go back and do all those again on the other node, hmm?

I also found that lo and behold, there were some steps I’d kinda forgotten about. Sure, I know this stuff, I’m not a complete goofy panda a trained professional. I have lots of experience!  But that’s sort of the problem. I have lots of experience and while I can synthesize gobs and gobs of it into a cohesive picture, there’s certain details I end up forgetting if I don’t work with them for a very long time.

And yes, GOBS is the technical unit for DBA experience. It’s like how large volumes of data appear in WADS.

What I’m Sayin

I re-learned that it’s important to occasionally revisit and improve things you already know how to do.  Especially if you’ve delegated these tasks to others, you may not understand them as clearly as you’d like to think. Maybe you’ve learned things recently that allow you to streamline the tasks and make them easier, too.

But most importantly, it’s key to understand the full details of your environment’s configuration. Knowing how something is set up will save a ton of time when you need to troubleshoot it. Besides time being money, it’s YOUR time, and that’s what you want more of, right?

Comments { 0 }

Error Configuring DataCollector: A collection set cannot start without a schedule

Data Collection, Puppy Style

Update: Based on Bill Ramos’ comment below and a note on Twitter (thanks!!) I have added some more details which hopefully make the situation clearer.

Summary

When setting up data collection using the GUI, configuration failed halfway through setup. At the point  of failure I found there were SQL Agent jobs for collections visible, but nothing appearing  in Management Studio under Management\Data Collection. The Data Collection icon still had the ‘off’ down red arrow. (I manually refreshed it for good measure to make sure.)

Beware: this isn’t an officially endorsed workaround. It’s just how I found I could make it work. I am testing this on a server which isn’t in production use.

My Setup

I was configuring the data collector on a SQL 2008 R2 instance (clustered), and pointing to a SQL 2008 (NOT R2) Management Data Warehouse. The MDW is on another server of course– that one isn’t clustered (although I don’t think it matters).  Since the MDW server isn’t R2 it  doesn’t (and can’t) have a Utility Control Point installed, but when you set up data collection on an R2 target, it automatically includes some of the collection sets for the UCP. That’s fine, they should just stay off when they don’t communicate with a UCP.

In the past I have successfully configured Data Collection at least 10 times without seeing this issue, however at that point my Data Collection targets and my Management Data Warehouse were all on SQL Server 2008. This is the first time I have configured data collection on a SQL Server 2008 R2 target using a MDW which is SQL Server 2008. Basically, I am bringing this R2  box up for performance testing and burn-in now, and later on will be doing a separate change to bring the MDW up to SQL Server 2008 R2.

The Point of Failure

Setting up data collection with the GUI failed half way through. Everything was fine walking through the GUI, but when I told it to set up collection it failed halfway through the setup process and could not complete.

The failure report showed the following error [excerpted]:

TITLE: Microsoft.SqlServer.Management.Collector
——————————
Unable to start collection set Utility Information.
....
Caught error#: 14693, Level: 16, State: 1, in Procedure: sp_syscollector_start_collection_set, Line: 108, with Message: A collection set cannot start without a schedule. Specify a schedule for the collection set. (Microsoft SQL Server, Error: 14684)

Looking at the system configuration, jobs had been created in the SQL agent for data collection, but no system collections were visible under the Data Collector in management studio.

At this point I was not able to uninstall and reinstall– currently Data Collection can be disabled, but it can’t be uninstalled.

Continue Reading →

Comments { 7 }

Automating SQL Local Security Policy Rights: PoSH and NTRights

The Basics on Local Security Policy Rights and SQL Server…

There are a couple of local security policy rights that are not granted by default in SQL Server setup that I’ve been setting manually for a few years now:

  • Lock Pages In Memory
    • Allows large page allocation
    • Prevents the SQL Server process from being paged out
  • Perform Volume Maintenance Tasks
    • Instant initialization on data files

It’s a fairly click-heavy process to add the permissions for these through the Local Security Policy GUI. I prefer that these permissions be granted to the local security group for sql server that’s created in Windows, and that really requires a lot of clicks, unless you can remember and enter a group name like this without any typos:

SQLServerMSSQLUser$servername$MSSQLSERVER  or SQLServerMSSQLUser$servername$INSTANCENAME

By the way, what is up with using the $ in the group names?  If someone can tell me, I would love to know.

Why Not Just Grant these Rights to the Domain Service Account?

If your SQL Server service is running under a domain account, you can grant these privileges to that account and it will work. However, I prefer to grant it to the local group for SQL Services for two main reasons.

  1. If you change the account for SQL Server services, everything will still work. You can go to another domain account, network service, whatever, you won’t have to remember to check these permissions. (And you won’t remember until you’ve been bitten by it about 5 times.)
  2. It’s consistent with the way SQL Server grants permissions itself. (See the rights granted to the local groups here).

What about Clusters?

Well, so much for consistency– clusters do not use the local groups! For clustered instances, we grant the permission to the domain account.

Still, I prefer to be consistent with the way that the product grants the perms on standalone instances, and I have found instances where the service account was changed and the admins either were not aware they needed to grant these permissions or forgot.

Anyway, it Should be Easy!

I always figured there was an easy way to do this. And lo and behold, there is.

I have a project to build out some new pre-production servers right now, so as I’m walking through the build steps I am looking for ways to further automate our configuration. For these two rights, I did some searching and found that using NtRights.exe seems to be the easiest way to grant these permissions. Whenever people ask about editing local security policy with powershell, the response seems to be, “Why aren’t you using a GPO?”  But that wouldn’t work for this case.

NtRights.exe, which is a W2K3 resource kit utility (available here) was created for just these tasks, and I can call it from a PowerShell script anyhoo.

So here is the super-quick, super-dirty 1.0 version of granting these privileges. This version assumes you only have one sql instance installed on the box (which is how we roll in my current environment– otherwise you could pull them into an array and loop).  You can also use NTRights against remote machines, by the way, but you’d have to get the name of the Sql Server group a bit differently in that case. Or just use your domain account, I’m not going to judge you. ;)

In my case this is designed to be run post-setup when we’re logged into the box anyway, and the operator reviews the output. NTRights prints what it is granting and the outcome.

The Script

#copy ntrights.exe
Robocopy \\deployserver\shareWhereNtRightsLivesl\ d:\installDir ntrights.exe
D:
cd D:\installDir

#get the name of the sql server local group
$sqlgroup= net localgroup|findstr SQLServerMSSQLUser

#if we haven't found a group with this name, default to our service account (should be a cluster)
if (!$sqlgroup) {$sqlgroup=&quot;DOMAIN\SERVICEACCOUNT&quot;}

$sqlgroup=$sqlgroup.Replace(&quot;*&quot;,&quot;&quot;)

.\Ntrights -u $sqlgroup +r SeLockMemoryPrivilege
.\Ntrights -u $sqlgroup +r SeManageVolumePrivilege
Comments { 2 }
Slipstreaming

Are you Slipstreaming? The Very Best Way to Install SQL Server!

Filed under: Awesome things I learned at SQLPASS!

Somehow, I didn’t know about slipstreaming installations of SQL Server until last week. I heard about them at SQLPASS in Allan Hirt’s session on installing SQL Server 2008 on Windows 2008 clusters.

What’s Slipstreaming?

Slipstreaming is creating a single installation directory and process for installing SQL Server along with any Service Packs (SP) and/or Cumulative Update (CU). You can use unattended installation files with a slipstream installation, just like normal.

So in other words, you get a single, smooth, optimized install, completely configurable to run from the command line!

I love imaging, but I like this even better because it’s easy for me to keep different configuration files for standalone vs clustered installs, and the installation works on different hardware profiles. Every time I want to move to a new SP and/or CU, I can quickly and easily create a slipstream drop with that CU. And I can share my slipstream drop and configuration files with my development teams so that labs are built out in the exact same way.  (This last bit is only advisable when you provide your account and password information at the command line at install time, and don’t store it in your config file.)

Slipstreaming

How Do I Slipstream?

For instructions, see these posts on the SQL Server setup blog by Peter Saddow:

Here is a CSS blog post by Bob Ward including information and referencing the two posts above:

Allan Hirt’s great blog is here: http://www.sqlha.com/

And lastly, here is the SQL Server Release Services team blog, which is the best place to keep up on current SP and CU info.

Update 11/10: Added link to Slipstream FAQ Blog post.
Photo attribution: http://www.flickr.com/photos/frank_steele/ / CC BY-ND 2.0

Comments { 3 }