By now, many SharePoint Administrators have heard this â€œbest practice:â€ Use SQL Aliases. Recently, I was surprised to hear that this may not be unanimous â€“ Todd Klindt (@toddklindt) in his weekly netcast argues against it. Todd also pointed out Todd Carterâ€™s (@toddca) blog post where he suggests always using SQL Aliases.
In my work, I always employ SQL Aliases, even on single server farms where SQL and SharePoint are on the same server. Seems like a waste of time, doesnâ€™t it? Well, it takes about half a minute to setup but can save hours if you get into trouble.
Letâ€™s look at a common scenario. Your developers need SharePoint setup quickly so they can create some gee-whiz solutions. So, you quickly create a SharePoint farm accepting all defaults (or use a script mentioned in a previous post) and deliver it to your developer buddies.
Little did you know, only 3 months later, youâ€™re running out of disk space or SQL gets corrupted or you finally get your shiny new blade servers and want to build out a new SQL cluster for your development environment. Anything could happenâ€¦
Enter: SQL Aliases. Without an alias, youâ€™d be setting up a brand new SQL server and SharePoint from scratch. Youâ€™d have to migrate all the developer work, their solutions, their settings and have to deal with whining because someone is â€œdownâ€ until youâ€™re done building the new system.
SQL Aliases are like host names, somewhat. Itâ€™s the name everyone knows and remembers (including SharePoint). In DNS (or host files), the name stays the same, though the IP could change. Aliases are similar, you can change your SQL Servers name, but itâ€™s alias will remain. All youâ€™d have to do is update a â€œpointer.â€ One BIG difference worth mentioning though: DNS is server-side, meaning you go to your DNS server and update a record; SQL Aliases are client-side, like hosts files. Only the computer on which you created it knows about it and will use it. So yes, you have to create this on any client/computer that you want accessed this way. This usually just means, all your SharePoint servers in the farm.
So now, hopefully, you see the benefits of using SQL Aliases. Iâ€™ll show you how to set one up in less than 30 seconds.
These steps are taken from my Wiki http://wiki.wahidsaleemi.com/Pages/SQL_Server_Setting_Alias
- Click Start –> Run –> cliconfg.exe (notice there is no i in confg)
- Select the Alias tab and click Add…
- Specify the Server alias (for example: SharePoint_DB or SQLPoint1 or whatever)
- Select the TCP/IP Network library.
- For Server name, enter the SQL Server Name (if using default instance) or use UNC notation if using non-default instance (e.g., \\servername\instance)
- Uncheck Dynamically determine port and use the default port of 1433.
- Press OK. Repeat this on any client that is part of the SharePoint farm.
If you want to use Aliases on your SQL Server, or if you have an all-in-one box (SQL + SharePoint), follow this procedure instead:
1. By default, Windows comes with a SQL client called â€œcliconfig.exeâ€ but as Iâ€™ll show you later, this doesnâ€™t always work.
2. Next, run SQL Server Configuration Manager and expand the â€œSQL Native Client 10.0 Configurationâ€ nodes (both of them).
Take note that one has (32bit) and the other doesnâ€™t. Depending on the client, one will be used over the other so itâ€™s best to configure both nodes identically.
3. Right-click on â€œAliasesâ€ and select â€œNew Aliasâ€¦â€ A dialog box will open.
a. Use any name for your Alias, for example â€œSharePoint_DBâ€
b. You should specify the port number, SQLâ€™s default is 1433. Leave the protocol at TCP/IP.
c. For Server, enter just the server name if youâ€™re using the default SQL instance (e.g., Server01_Web). If youâ€™re using a named instance, you need to enter the server name and instance using UNC notation (e.g., \\Server01_Web\NewInstance).
d. Click OK and repeat the steps for the other â€œAliasesâ€ node.
Now that your Alias is created, you can try to connect to it using SQL Server Mangaement Studio or another method. So, instead of using the â€œServer Nameâ€ to connect to SQL, use your new Alias, it should work just fine.
When installing SharePoint, and it asks for your SQL Server name, just specify the SQL Alias. This way, if anything ever goes wrong with SQL, you can just change the Alias to a new server and not have to re-configure SharePoint.