Professional Documents
Culture Documents
Balmukund
As you might be aware that SQL Server Code-Named “Denali” has introduced a new feature called Always ON for
enhancing the availability of user database in an enterprise environment. In simple terms, AlwaysON is a high-
availability and disaster recovery solution, which will enable you maximize availability of your critical user databases
WARNING: The blog-post is based on pre-release software so things could change. For more details on CTP,
Availability groups are set of failover partners (a.k.a availability replicas) to provide high availability to user database
in Denali. Sure, this is lot more in depth and I suggest reading DenaliBooks-on-line for details.
In this blog post, I will guide you on how to configure AlwaysON – STEP-BY-STEP? Lets get going then !
a. For the purpose of testing, I have created a Windows 2008R2 two NODE cluster on virtual machine using Hyper-V
Machine configurations:
If in case you need step-by-step guide on setting up windows cluster using Hyper-V (Guest Clustering), please refer
my team blog:
http://blogs.msdn.com/blakhani/archive/2010/04/01/how-to-install-clustered-sql-server-2008-on-
windows-2008-cluster-using-hyper-v-guest-clustering-part-1.aspx
http://blogs.msdn.com/blakhani/archive/2010/04/28/how-to-install-clustered-sql-server-2008-on-
windows-2008-cluster-using-hyper-v-guest-clustering-part-2.aspx
Yes, you’ve heard it right. AlwaysON is NOT a clustered SQL Server Instance. As such a standalone SQL
INDNUKE-DELHI\MSSQLSERVER
INDNUKE-MUMBAI\MSSQLSERVER
Note: SQL Server service needs to be re-started for changes to take affect
•Expand Management folder
•Specify Replicas – Add the other instances (INDNUKE-MUMBAI\MSSQLSERVER) to assume the role of secondary
•Optionally, you can specify endpoint details (similar to database mirroring) or leave them default
•Summary Screen
•Result Screen
IMP: Once done, you will be able to see the Availability Group as a Cluster Resource in Windows Server
•This step will allow you to synchronize your user PRIMARY and SECONDARY server by taking backup of user
•Specify a shared location, where both SQL Server start-up accounts has read/write access and press OK
•Once synchronization completes, expand the tree and you will be able to see the Availability Replicas (along with
1. Create a simple table (can use below script) on PRIMARY (INDNUKE-DELHI) and insert some rows (can use
below script)
Use AdventureWorks
GO
) ON [PRIMARY]
GO
GO
SELECT * from dbo.New_Table
GO
2. Then, connect to SECONDRY (INDNUKE-MUMBAI) and try selecting the rows. This will work!!
Conclusion,
AlwaysON by design looks similar to database mirroring, but is actually a combination of both databases mirroring
and clustering. The goal is to maximize the database availability and also give benefits of disaster recovery. And we
term this – AlwaysON!!!!
Varun Dhawan
Reviewed by
Leave a Comment
Name
Comment
Post
Comments
HeatherK
20 Dec 2010 7:09 AM
What do you mean "Yes, you’ve heard it right. AlwaysON is NOT a clustered SQL Server Instance. As such a
standalone SQL Server setup is required on both the clustered nodes." The BOL for Denali CTP1 say that you can
either use a clustered instance or a standalone instance. Why would you want to use two standalone SQL Server
instances on 2 nodes in the same cluster? What would happen when there is a failover event within the cluster?
Varun_SQL
22 Dec 2010 3:36 AM
Hi Heather,
Thanks for pointing this out. Seems we missed it at first place....so here’s the updated details:
1. For configuring AlwaysON, we can we can either use a failover cluster instances or stand-alone instances.
2. The "Two" standalone instances mentioned in this post are just an example for an easier demonstration.
So assuming there are 2 standalone instances running on Windows Server Failover Clustering. In the event of cluster
failover, there will be a failover from Primary to Secondary replica.
Regards,
Varun
Uri Dimant
2 Jan 2011 4:41 AM
Hello Varun
To force FAILOVER do you click on the secondary server? Why not on the primary server?
ColinM
11 Mar 2011 3:08 AM
Hi Varun,
Thanks,
Colin.
Pawan
1 Jun 2011 11:09 PM
Hello Varun,
Thanks for a very informative post on AlwaysOn. The setup screen shots are really helpful in understanding the
HARD setup.
Varun_SQL
9 Aug 2011 4:26 AM
Hello Colin
First apologies for a late reply as I've been busy leveling some new assignments.
Answer to your questions is YES, it’s possible to take LOG backups on a secondary replica in an AlwaysOn (HADR)
configuration. A ‘BACKUP LOG’ T-SQL will work as usual on secondary replica/s and all such log backups WILL
TRUNCATE T-LOG file on primary.
Varun
Varun_SQL
9 Aug 2011 4:40 AM
Hi Uri
A force causes the secondary replica to which the availability group was failed over becomes the new primary replica.
This seems purely a by-design thing that such force failover is initiated from a secondary replica of the availability
group.
Varun
mahalingam
1 Jan 2012 10:30 PM
Hi Bala,
Thanks for the innovative information . could you please describe to us to take the backup on secondary
replica.Thanks
Nakul's Blog
11 Feb 2012 9:31 AM
As you know, I am documenting my experience at the Tech Ed 2011 (India) held from March 23-25, 2011 at
JunDba
10 Mar 2012 9:40 PM
Hi,
Is it possible to create alwayson for database in an instance in 3 node cluster with standalone as sceondary server
Balmukund
14 Mar 2012 10:06 PM
JunDba,
riya sharma
17 Apr 2012 7:01 AM
Varun_SQL
5 Jul 2012 4:16 AM
@Riya
Manish
31 Aug 2012 12:55 AM
It will not work on SQL Failover Cluster, Only Windows Failover Cluster is required and both the node should have
same drive later.
reshma
13 Jul 2013 3:14 PM