SlideShare a Scribd company logo
 Step­By­Step: Creating a SQL 
Server 2012 AlwaysOn 
Availability Group 
                      source :    https://technet.microsoft.com/en­gb/ 
One of the most talked about (and now frequently requested) feature in SQL Server 2012 
is AlwaysOn Availability Groups. It brings SQL Server high availability and disaster 
recovery to a whole new level by allowing multiple copies of the database be highly 
available and potentially using them for read­only workloads and offloading 
management tasks such as backups. AlwaysOn Availability Groups allow you to fail 
over a group of databases as a single entity, unlike database mirroring where you can 
only do so one database at a time. This is very useful for applications that access 
multiple databases.  
This step­by­step has been created to help you get started in creating a SQL Server 2012 
AlwaysOn Availability Group for your mission­critical databases. 
  
        Prerequisites 
  
● Windows Server Failover Cluster (WSFC)​. AlwaysOn Availability Groups rely on the 
Windows Server Failover Cluster for failure detection and management of the 
Availability Group replicas. This is where a lot of customers get confused because of 
their previous knowledge of Microsoft Cluster Services (MSCS.) In previous versions of 
Windows Server, you need shared storage to create a failover cluster for the quorum 
disk. Windows Server 2008 and higher provided the option to use a file share witness 
as a quorum configuration. Therefore, you ​DO NOT​ need shared storage to create a 
Windows Server Failover Cluster for AlwaysOn Availability Groups. This, of course, 
does not change the requirement if you intend to use a SQL Server Failover Clustered 
Instance (FCI) as a replica in your Availability Group. For this step­by­step, we will only 
be working with standalone SQL Server 2012 default instances. 
● Download SQL Server 2012 Enterprise Edition​. AlwaysOn Availability Group is an 
Enterprise Edition feature. Before deciding to implement this feature, take stock of your 
SQL Server licenses to make sure you have enough to get you covered. If you intend to 
use the other replicas for read­only workloads or offloading your backups, you would 
need licenses for those SQL Server instances as well. This is also another one of those 
items that customers get confused with because in previous versions of SQL Server, 
database mirroring can be configured with Standard Edition.  
● Same SQL Server collation for all replicas​. I usually don’t recommend running 
databases with different collation requirements in the same SQL Server instance due to 
potential issues caused by applications using temporary tables. This is one of the 
reasons for keeping the database collation the same for a single instance (SharePoint 
2013 also requires a specific collation for the content databases.) If you want to 
configure AlwaysOn Availability Groups for your databases, they should all be running 
the same collation on all of the SQL Server instances acting as replicas. 
● Two to Five SQL Server Instances acting as replicas. ​SQL Server instances that will 
be used as a standby for high availability and/or disaster recovery are called ​replicas​. 
Unlike database mirroring where you can only have one extra copy of the database, 
AlwaysOn Availability Groups allow you to have up to five copies of the database 
running on five replicas – three of which can be configured for synchronous­commit 
mode and two in asynchronous­commit mode. 
   
Windows Failover Cluster Feature Installation 
Since AlwaysOn Availability Groups require a Windows Server Failover Cluster, we first need 
to add the Windows Failover Cluster Feature to all the machines running the SQL Server 
instances that we will configure as replicas. For the operating system, we will be using 
Windows Server 2012. To add the Failover Clustering feature: 
● Open the ​Server Manager​ console and select ​Add roles and features​. This will launch 
the ​Add Roles Features Wizard  
● Click ​Next​ until you reach the ​Select Features​ dialog box. Select the ​Failover 
Clustering​ checkbox. When prompted with the ​Add features that are required for 
Failover Clustering​ dialog box, click​Add Features​. Click ​Next​. 
 
1.   
  
2. Click ​Install ​to install the Failover Clustering feature. 
    
Windows Failover Clustering Configuration for SQL Server 2012 AlwaysOn 
Availability Groups 
  
Prior to configuring the Windows Server Failover Cluster, it is assumed that you have the 
appropriate rights in Active Directory. For a complete listing of the different Active Directory 
permissions to create a Windows Server Failover Cluster, see Failover Cluster Step­by­Step 
Guide: Configuring Accounts in Active Directory. To configure Windows Failover Clustering, 
●  ​Launch ​Failover Cluster Manager​ from within the ​Server Manager​ console. 
   
● Within ​Failover Cluster Manager​, click the ​Validate Configuration…​ link. 
● In the ​Validate a Configuration Wizard​ dialog box, click ​Next​. 
 
In the ​Select Servers or a Cluster​ dialog box, add the server hostnames of the SQL Server 
instances that you want to configure as replicas in your Availability Group. Click ​Next​. 
●   
●  
  
● In the ​Testing Options​ dialog box, make sure that the option ​Run all tests 
(recommended)​ is selected. Click ​Next​. 
   
● In the ​Confirmation​ dialog box, click ​Next. 
   
● In the ​Summary​ dialog box, click ​Finish​ to create the Windows Failover Cluster. 
  
● NOTE: ​The Failover Cluster Validation Wizard is expected to return several Warning 
messages, especially if you will not be using shared storage. As we mentioned earlier, 
there is no need to use shared storage to create the Windows Server Failover Cluster 
that we will use for our Availability Group. Just be aware of these Warning messages as 
we will configure a file share witness for our cluster quorum configuration. However, if 
you see any Error messages, you need to fix those first prior to creating the Windows 
Server Failover Cluster. 
   
● In the ​Access Point for Administering the Cluster​ dialog box, enter the virtual server 
name and virtual IP address of your Windows Server Failover Cluster. 
  
●  
   
● In the ​Confirmation​ dialog box, click ​Next​. This will create the Windows Failover 
Cluster using the servers as nodes of the cluster, add DNS and Active Directory entries 
for the cluster hostname. 
   
● In the ​Summary​ dialog box, verify that the configuration is successful. 
  
● To configure the cluster quorum configuration to use a file share, right­click on the 
cluster name, select ​More Actions​ and click ​Configure Cluster Quorum Settings… 
We will be configuring a file share witness for our cluster quorum setting. By default, the 
wizard will configure the cluster to use ​Node Majority​. 
 
●  
   
● Click ​Next​. 
   
● In the ​Select Quorum Configuration​ page, select the ​Add or change the quorum 
witness​ option. Click ​Next​. 
   
● In the ​Select Quorum Witness​ page, select the ​Configure a file share witness 
(recommended for special configuration)​ option. Click ​Next​. 
   
● In the ​Configure File Share Witness​ page, type path of the file share that you want to 
use in the ​File Share Path:​ text box. Click ​Next​. 
   
● In the ​Confirmation​ page, click ​Next​. 
   
● In the ​Summary​ page, click ​Finish​. 
  
   
Enable SQL Server 2012 AlwaysOn Availability Groups Feature 
  
Once the Windows Server Failover Cluster has been created, we can now proceed with 
enabling the AlwaysOn Availability Groups feature in SQL Server 2012.  This needs to be done 
on all of the SQL Server instances that you will configure as replicas in your Availability Group. 
To enable the SQL Server 2012 AlwaysOn Availability Groups feature, 
  
1. Open ​SQL Server Configuration Manager. ​Double­click​ ​the ​SQLServer 
(MSSQLSERVER)​ service to open the ​Properties​ dialog box. 
   
 
    
2. In the ​Properties​ dialog box, select the ​AlwaysOn High Availability​ tab. Check the 
Enable AlwaysOn Availability Groups​ check box. This will prompt you to restart the 
SQL Server service. Click ​OK​. 
    
3. Restart the SQL Server service. 
   
    
 
Create and Configure SQL Server 2012 AlwaysOn Availability Groups 
   
Availability Groups can be created on existing databases or even a temporary one in 
preparation for application installation. If you intend to create an Availability Group for a new 
SharePoint 2013 farm, you will need to create a temporary database. This is so that the 
SharePoint 2013 farm will use the AlwaysOn Availability Group when creating the farm 
configuration and the admin content databases. After the SharePoint 2013 farm has been 
created, this database can be removed from the Availability Group configuration and deleted 
from the instance. 
  
 
 
          To create and configure a SQL Server 2012 AlwaysOn Availability Group, 
  
1. Open ​SQL Server Management Studio. ​Connect to the SQL Server instance 
  
2. In ​Object Exporer​, expand the ​AlwaysOn High Availability​ folder. Right­click on the 
Availability Groups​ folder and select the ​New Availability Group Wizard…​ option. 
This will launch the ​New Availability Group Wizard. 
 
    
3. In the ​Introduction​ page, click ​Next​. 
    
4. In the ​Specify Availability Group Name​ page, enter the name of the Availability Group 
in the​Availability group name:​ field. Click ​Next​. 
    
5. In the ​Select Databases​ page, select the checkbox beside the database that you want 
to include in your Availability Group. The databases have to be in Full recovery model 
prior to joining them in the Availability group. Click ​Next​. 
   
6.  
    
7. In the ​Specify Replicas​ page, under the Replicas tab, click the ​Add Replicas​ button 
and connect to the other SQL Server instances that you joined as nodes in your 
Windows Server Failover Cluster. Configure the following options  
8.   
○ Automatic Failover (Up to 2) :          ​Checked 
○ Synchronous Commit (Up to 3) :      ​Checked 
○ Readable Secondary:                      ​No  
 
9. In the ​Endpoints​ tab, verify that the port number value is ​5022​.  
  
10. In the ​Listener​ tab, select the ​Create an availability group listener​ option. Enter the 
following details. 
11.   
○ Listener DNS name: ​Name that you will use in your application connection 
string 
○ Port: ​1433 
○   
 
12. Click the ​Add…​ button to provide an IP address. In the ​Add IP Address​ dialog box, 
enter your preferred virtual IP address in the ​IPv4 Address​ field. Click ​OK​. Click ​Next​. 
   
13. In the ​Select Initial Data Synchronization​ page, select the ​Full​ option. Provide a 
shared folder that is accessible the replicas and that the SQL Server service account 
used by both replicas has ​Write​permissions to. This is just a temporary file share to 
store the database backups that will be used to initialize the databases in an Availability 
group. If you are dealing with large databases, it is recommended that you manually 
initialize the databases prior to configuring them as your network bandwidth may not be 
able to accommodate the size of the database backups. Click ​Next​. 
14.   
15.  
   
16. In the ​Validation​ page, verify that all validation checks return successful results. Click 
Next​. 
  
17. In the ​Summary​ page, verify all configuration settings and click ​Finish​. This will create 
and configure the AlwaysOn Availability Group and join the databases. 
   
18. In the ​Results​ page, verify that all tasks have been completed successfully. 
   
Congratulations! You have just created a SQL Server 2012 AlwaysOn Availability Groups. You 
can now use the Availability Groups listener name in your application connection string. Keep 
in mind that you need to manually add new databases in the Availability Group even though 
your application has already been using the listener name. So, be sure to monitor the replicas 
in your Availability Groups to be alerted when new databases are created. 
 

More Related Content

PPTX
Alwayson AG enhancements
PPTX
SQL Server 2016 AlwaysOn Availability Groups New Features
PPTX
Windows clustering and quorum basics
PDF
SQL Server 2012 High Availability with AlwaysOn Availability Groups
PDF
Presentation building your cloud with v mware
PPTX
Sql 2012 always on
DOCX
Senior database administrator
PPTX
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groups
Alwayson AG enhancements
SQL Server 2016 AlwaysOn Availability Groups New Features
Windows clustering and quorum basics
SQL Server 2012 High Availability with AlwaysOn Availability Groups
Presentation building your cloud with v mware
Sql 2012 always on
Senior database administrator
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groups

What's hot (18)

PPTX
Sql server 2012 AlwaysOn
PPT
SQL Server Cluster Presentation
PDF
SQL Server High Availability Solutions (Pros & Cons)
PDF
HP PolyServe Software for Microsoft SQL Server
PDF
SQL Server Clustering and High Availability
PDF
Installation Guide
PPT
Lecture 19 dynamic web - java - part 1
PDF
Fundamentals of SQL Server 2012 Availability groups
PDF
SQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
PDF
Weblogic deployment
PDF
SQL Server Clustering for Dummies
PDF
Ibm web sphere_job_interview_preparation_guide
PPTX
AUDWC 2016 - Using SQL Server 20146 AlwaysOn Availability Groups for SharePoi...
PDF
Working with Oracle Queues - Choosing between AQ and JMS
PPTX
Why you should(n't) run your databases in the cloud
DOCX
Vineeth_Vmware_Cisco UCS
PPTX
V cloud director 5.1 what's new overview technical presentation
PPTX
VMware Vsphere Graduation Project Presentation
Sql server 2012 AlwaysOn
SQL Server Cluster Presentation
SQL Server High Availability Solutions (Pros & Cons)
HP PolyServe Software for Microsoft SQL Server
SQL Server Clustering and High Availability
Installation Guide
Lecture 19 dynamic web - java - part 1
Fundamentals of SQL Server 2012 Availability groups
SQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
Weblogic deployment
SQL Server Clustering for Dummies
Ibm web sphere_job_interview_preparation_guide
AUDWC 2016 - Using SQL Server 20146 AlwaysOn Availability Groups for SharePoi...
Working with Oracle Queues - Choosing between AQ and JMS
Why you should(n't) run your databases in the cloud
Vineeth_Vmware_Cisco UCS
V cloud director 5.1 what's new overview technical presentation
VMware Vsphere Graduation Project Presentation
Ad

Viewers also liked (20)

PDF
SQL Server 2014 Installation
PDF
Business Analysis and Reporting
PDF
Developing Business Plan
DOCX
Scorecard & Dashboards
PDF
Youtube analytics SAMPLE PROJECT
PDF
DATABASE MIRRORING SQL SERVER 2014
PPTX
Market Feasibility
PDF
Configuring & Managing Databases
PDF
Wedding invitation
PDF
Market Research Report
PDF
Sql server agent alerts
PDF
Market research on telecom GSM service ppt on
PDF
Business intelligence implementation case study
PPT
Business Intelligence for kids (example project)
PDF
Restoring the database
PDF
Maintanance plan
PDF
database backup
PDF
Project Management
PDF
SSIS VISUAL STUDIO 2013 & SQL SERVER 2014
PDF
Business intelligence project
SQL Server 2014 Installation
Business Analysis and Reporting
Developing Business Plan
Scorecard & Dashboards
Youtube analytics SAMPLE PROJECT
DATABASE MIRRORING SQL SERVER 2014
Market Feasibility
Configuring & Managing Databases
Wedding invitation
Market Research Report
Sql server agent alerts
Market research on telecom GSM service ppt on
Business intelligence implementation case study
Business Intelligence for kids (example project)
Restoring the database
Maintanance plan
database backup
Project Management
SSIS VISUAL STUDIO 2013 & SQL SERVER 2014
Business intelligence project
Ad

Similar to Always on availability group (20)

PDF
SQL High Availability solutions E Book
PDF
High availability solutions
PDF
Tips to install and manage always on availability groups in sql server 2012 &...
PPTX
SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 - AUSPC2012
PDF
SQLDay2013_Denny Cherry - SQLServer2012inaHighlyAvailableWorld
PPTX
SQL 2014 AlwaysOn Availability Groups for SharePoint Farms - SPS Sydney 2014
PPTX
Always on from the front lines1
PPTX
AlwaysON Basics
PDF
Sql server 2012 autoexec event no 39
PPTX
Sql server 2012 ha dr nova
PDF
Implementing sql server always on
PPTX
Sql server 2012 ha dr
PPTX
Availability Considerations for SQL Server
PPTX
Sql server 2012 ha dr 24_hop_final
PPTX
SQL 2012 AlwaysOn Availability Groups for SharePoint 2013 - SharePoint Connec...
PPTX
Share point 2013 and sql server 2012 what to choose
PPTX
Configurando Aplicaciones para Réplicas de Lectura de SQL-Server AlwaysOn - C...
PPTX
Sql server 2012 ha dr 24_hop_final
PPTX
Always on availability groups way too deep
PPTX
SQL 2012 AlwaysOn Availability Groups (AOAGs) for SharePoint Farms - Norcall ...
SQL High Availability solutions E Book
High availability solutions
Tips to install and manage always on availability groups in sql server 2012 &...
SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 - AUSPC2012
SQLDay2013_Denny Cherry - SQLServer2012inaHighlyAvailableWorld
SQL 2014 AlwaysOn Availability Groups for SharePoint Farms - SPS Sydney 2014
Always on from the front lines1
AlwaysON Basics
Sql server 2012 autoexec event no 39
Sql server 2012 ha dr nova
Implementing sql server always on
Sql server 2012 ha dr
Availability Considerations for SQL Server
Sql server 2012 ha dr 24_hop_final
SQL 2012 AlwaysOn Availability Groups for SharePoint 2013 - SharePoint Connec...
Share point 2013 and sql server 2012 what to choose
Configurando Aplicaciones para Réplicas de Lectura de SQL-Server AlwaysOn - C...
Sql server 2012 ha dr 24_hop_final
Always on availability groups way too deep
SQL 2012 AlwaysOn Availability Groups (AOAGs) for SharePoint Farms - Norcall ...

Recently uploaded (20)

PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PDF
[EN] Industrial Machine Downtime Prediction
PPTX
Qualitative Qantitative and Mixed Methods.pptx
PPTX
FMIS 108 and AISlaudon_mis17_ppt_ch11.pptx
PDF
OneRead_20250728_1808.pdfhdhddhshahwhwwjjaaja
PPTX
modul_python (1).pptx for professional and student
PDF
Introduction to Data Science and Data Analysis
PPTX
Pilar Kemerdekaan dan Identi Bangsa.pptx
DOCX
Factor Analysis Word Document Presentation
PDF
Data Engineering Interview Questions & Answers Cloud Data Stacks (AWS, Azure,...
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
PPT
lectureusjsjdhdsjjshdshshddhdhddhhd1.ppt
PDF
Data Engineering Interview Questions & Answers Batch Processing (Spark, Hadoo...
PPT
Predictive modeling basics in data cleaning process
PPTX
A Complete Guide to Streamlining Business Processes
PPTX
STERILIZATION AND DISINFECTION-1.ppthhhbx
PDF
Votre score augmente si vous choisissez une catégorie et que vous rédigez une...
PDF
Tetra Pak Index 2023 - The future of health and nutrition - Full report.pdf
PPTX
(Ali Hamza) Roll No: (F24-BSCS-1103).pptx
PDF
Jean-Georges Perrin - Spark in Action, Second Edition (2020, Manning Publicat...
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
[EN] Industrial Machine Downtime Prediction
Qualitative Qantitative and Mixed Methods.pptx
FMIS 108 and AISlaudon_mis17_ppt_ch11.pptx
OneRead_20250728_1808.pdfhdhddhshahwhwwjjaaja
modul_python (1).pptx for professional and student
Introduction to Data Science and Data Analysis
Pilar Kemerdekaan dan Identi Bangsa.pptx
Factor Analysis Word Document Presentation
Data Engineering Interview Questions & Answers Cloud Data Stacks (AWS, Azure,...
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
lectureusjsjdhdsjjshdshshddhdhddhhd1.ppt
Data Engineering Interview Questions & Answers Batch Processing (Spark, Hadoo...
Predictive modeling basics in data cleaning process
A Complete Guide to Streamlining Business Processes
STERILIZATION AND DISINFECTION-1.ppthhhbx
Votre score augmente si vous choisissez une catégorie et que vous rédigez une...
Tetra Pak Index 2023 - The future of health and nutrition - Full report.pdf
(Ali Hamza) Roll No: (F24-BSCS-1103).pptx
Jean-Georges Perrin - Spark in Action, Second Edition (2020, Manning Publicat...

Always on availability group