SlideShare a Scribd company logo
5
Most read
6
Most read
11
Most read
Microsoft Confidential
HADR with SQL Server 2016 AlwaysON
Session- 2 AlwaysON Architecture and internals
1
Uday Bhanu Pathaniya
PFE-SQL Server
udpathan@Microsoft.com
Microsoft Confidential
1. How AlwaysON works
2. What's AlwaysON Availability Groups /Replicas/ Listener
3. AlwaysON supportability and pre-requisites
4. Demo of AlwaysON HA Configuration
5. Backups on AlwaysON secondary replica
3
Legacy Architecture: Database Mirroring for local HA, Log
Shipping for DR
Pre-SQL
Server
2012
Challenges
Possible data loss in Log shipping.
Human intervention require in case of failover.
Unavailability of user databases during log restoration.
Can’t easily glue together databases that need to run on the same node
Data Warehouse load restrictions due to limitations in Log Shipping
Maintaining database mirroring connection strings (failover_partner) in all applications
is painful, and in some cases (some 3rd party applications) not even supported
Not easy to access data on mirrored server.
No. of nodes limitations in mirroring.
Interdependency of databases are not address in mirroring as well as in log shipping.
What is AlwaysOn ?
Is a combination of
database mirroring and
windows clustering.
Multiple mirrors with
multiple databases that
can failover together.
Single
gateway(Listener) can
be configure for
automatic failover
Nodes can be used to
offload the select query
workload and database
backup workload.
Single solution which
can address HA & DR
needs.
Primary Data Center
Disaster Recovery
Data Center
SQL Server
Primary
SQL Server
Secondary
Windows Server Failover Cluster (single WSFC crossing two data centers)
Availability Group
Synchronous
Asynchronous
SQL Server
Secondary
Grammar of AlwaysOn…
•Read-write , Online user database from primary Instance of database server.
•Databases added in availability in Availability groups are called availability databases & each Availability Database is a part of only single Availability Group.
•Backup of the primary database has to restore on secondary replica in norecovery state and new secondary database will remain in restoring state until it
is not joined to Availability group
Availability Database
•Logical container which logically binds the user databases which needs to be failover together.
•All the availability databases will failover together on same secondary replica.
•Single Availability Group can hosts multiple Availability Databases.
Availability Groups
•All the possible failover partners(must be a separate instance of SQL Server on other node) are known as Availability Replica.
•Each Availability replica is a copy of Availability database in a Availability Group.
•Each Availability replica is assigned an initial role- Primary or secondary. Primary replica hosts read-write user database & at least one secondary replica
hosts read-only user database.
Availability Replica
•There are two Modes- 1.) Synchronous-Commit mode & 2.) Asynchronous-Commit mode.
•In 1. Synchronous-commit primary replica wait for acknowledgement from synchronous-commit secondary replica that it has commit the transaction
in t-log of secondary database then after primary replica commit transaction.
•In 2. asynchronous-commit primary replica commit the transaction without waiting for acknowledgement from asynchronous-commit secondary
replica that it has commit the transaction.
•Asynchronous-commit mode minimizes transaction latency on the secondary databases but allows them to lag behind the primary databases, making
some data loss possible.
Availability mode
•With SQL Server AlwaysOn no need to have shared storage, but can use SAN, DAS, NAS or Local Disk depending on your budget and requirements.
AlwaysOn Storage
•Active secondary replica supports backup offloading on secondary replica and readable secondary replica.
•In backup offloading we can log backups , full backup of database , file or filegroup. Backup presences can be set on secondary replicas.
•An availability replica can be allow read-only access to its local databases when performing the secondary role.
•If an availability group currently possesses an availability group listener and one or more readable secondary replicas, SQL Server can route read-intent
connection requests to one of them (read-only routing
Active Secondary Replica
•Availability replica property:- How long the connection with another availability replica can remain inactive before the connection is close
Session-timeout period
Grammar of AlwaysOn.
• Availability group listener is a Virtual network name(VNN) to which
clients can connect in order to access a database in primary or
secondary replica.
• The physical instance name of SQL Server is hidden to clients while
accessing availability databases through listener.
• The client connection string does not to modify in order to access
either of Availability database base.
• We need DNS name for listener , a listener port designation one or
more IP address.
• Client use DNS to resolve VNN into multiple IP addresses and then tries
to connect with each IP address until the connection request successes
or timed out.
• If we configure read only routing then all read-intent connections are
redirected to readable secondary replica.
Availability
Group
listener
Connectivity with Availability Group Listener
Connect to the Primary Replica
Server=tcp: AGListener,1433;Database=MyDB;IntegratedSecurity=SSPI
Connect to Read-Only Secondary Replica
Server=tcp:AGListener,1433;Database=AdventureWorks;IntegratedSecurity=SSPI;ApplicationIntent=ReadOnly
Connect to Multisubnet failover
Server=tcp:AGListener,1433;Database=AdventureWorks;IntegratedSecurity=SSPI; MultiSubnetFailover=True
AlwaysON pre-requisites
KB
2654347:Hotfix
for .Net 3.5 SP1
Other Hotfix KB
2494036 for
optimal WSFC
quorum , KB
2687741 for
faster failover to
local relica etc.
Each node must
be configure
under
WSFC(preferably
node-fileshare).
A separate SQL
Server Instance
on each WSFC
node and enable
AlwaysOn feature
for each SQL
Server service.
Enterprise
edition of SQL
Server 2016
All the server
instances that
host availability
replicas for an
availability group
must use the
same SQL Server
collation.
No. of available
worker threads
are very
important.
Create endpoints
or member of
sysadmin
privileges require
DHCP IP can be
used but it is
recommended to
use static IPs.
AlwaysON Restrictions
• Restrictions for SQL Server failover cluster instance(FCI)
• The cluster nodes of an FCI can host only one replica for a given availability group
• FCIs do not support automatic failover by availability groups
• Changing FCI network name
• Restriction for SQL Server Availability Group
• Availability replicas must be hosted by different nodes of one WSFC cluster
• Unique availability group name
• Only 8 secondary replicas are supported. Either all can be configured as async
• commit mode or up to 3 can be configure as sync-commit mode
• Maximum number of availability groups and availability databases per computer depends on Hw
configuration. MS has tested 10AGs with 100 DBs per AG.
• Restriction for SQL Server Availability Databases
• If file path is different then
• New Availability Group Wizard/Add Database to Availability Group Wizard
• the database files must be RESTORED WITH MOVE on each instance of SQL Server that hosts a secondary
replica.
• A later add-file operation on the primary replica might fail on the secondary databases.
Demo-AlwaysON HA Configuration
Backups on AlwaysON secondary replica
• Copy-Only full backup of databases , files & filegroup is supported on secondary replica.
• Differentail backup is not supported on secondary replica.
• Backup log supports only regular backup & log chain remain consistent irrespective of backup log location or
availability mode( Synchronous-commit or Asynchronous-commit)
• Secondary replica must be in SYNCHRONIZED or SYNCHRONIZING state.
• In case of more than two nodes backup preferences(AG property) can be set to ‘Prefer Secondary’ , ‘Secondary
Only’ , ‘Primary’ ,’Any Replica’.
• Additionally Replica backup priorities can be set to ‘Server Instance’, ‘Backup Priory(Lowest=1, Highest=100)’ ,
Exclude Replica.
• It is recommended to configure script based backup jobs on each replica.
• Use the sys.fn_hadr_backup_is_preferred_replica function to determine whether the current replica is the
preferred backup replica or not.
• This function return 1 in case if the current replica is a preferred replica else 0.
AlwaysON Basics

More Related Content

PDF
Always on in sql server 2017
PPTX
Azure kubernetes service (aks)
PPT
Intro to MySQL Master Slave Replication
PDF
Apache Kafka Architecture & Fundamentals Explained
PDF
Ai in Digital Marketing
PPTX
Corporate governance
PPTX
Benefits of the Azure cloud
PPTX
Introduction to ansible
Always on in sql server 2017
Azure kubernetes service (aks)
Intro to MySQL Master Slave Replication
Apache Kafka Architecture & Fundamentals Explained
Ai in Digital Marketing
Corporate governance
Benefits of the Azure cloud
Introduction to ansible

What's hot (20)

PPTX
Sql 2012 always on
PPTX
High Availability & Disaster Recovery with SQL Server 2012 AlwaysOn Availabil...
PDF
SQL Server High Availability Solutions (Pros & Cons)
PPTX
Always on in SQL Server 2012
PDF
Oracle db performance tuning
PPTX
SQL Server High Availability and Disaster Recovery
PDF
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
PPTX
Data Guard Architecture & Setup
PDF
Understanding oracle rac internals part 1 - slides
PDF
Oracle RAC 19c and Later - Best Practices #OOWLON
PPT
Oracle Transparent Data Encryption (TDE) 12c
PPTX
Why oracle data guard new features in oracle 18c, 19c
PPTX
What’s New in Oracle Database 19c - Part 1
PDF
Oracle Active Data Guard: Best Practices and New Features Deep Dive
PPTX
Understand oracle real application cluster
DOCX
Data guard architecture
PDF
Understanding oracle rac internals part 2 - slides
PDF
Nabil Nawaz Oracle Oracle 12c Data Guard Deep Dive Presentation
PPTX
High Availability for Oracle SE2
PDF
NA14G05 - A DB2 DBAs Guide to pureScale.pdf
Sql 2012 always on
High Availability & Disaster Recovery with SQL Server 2012 AlwaysOn Availabil...
SQL Server High Availability Solutions (Pros & Cons)
Always on in SQL Server 2012
Oracle db performance tuning
SQL Server High Availability and Disaster Recovery
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
Data Guard Architecture & Setup
Understanding oracle rac internals part 1 - slides
Oracle RAC 19c and Later - Best Practices #OOWLON
Oracle Transparent Data Encryption (TDE) 12c
Why oracle data guard new features in oracle 18c, 19c
What’s New in Oracle Database 19c - Part 1
Oracle Active Data Guard: Best Practices and New Features Deep Dive
Understand oracle real application cluster
Data guard architecture
Understanding oracle rac internals part 2 - slides
Nabil Nawaz Oracle Oracle 12c Data Guard Deep Dive Presentation
High Availability for Oracle SE2
NA14G05 - A DB2 DBAs Guide to pureScale.pdf
Ad

Viewers also liked (13)

PPTX
Breaking Down and Understanding Office 365 - SPSJHB 2015
PPTX
SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 - AUSPC2012
PPTX
Ultimate SharePoint Infrastructure Best Practises Session - Isle of Man Share...
PPTX
AUDWC 2016 - Using SQL Server 20146 AlwaysOn Availability Groups for SharePoi...
PPTX
SharePoint Disaster Recovery with SQL AlwaysOn
PPTX
Unbreakable SharePoint 2016 with SQL Server 2016 Always On Availability groups
PPTX
SQL 2012 AlwaysOn Availability Groups for SharePoint 2013 - SharePoint Connec...
PDF
Symantec ApplicationHA June 2011
PPTX
Unbreakable SharePoint 2013 with SQL Server Always On Availability Groups (HA...
PDF
SQL Server 2012 High Availability with AlwaysOn Availability Groups
PDF
Tips to install and manage always on availability groups in sql server 2012 &...
PPTX
SQL Server 2016 AlwaysOn Availability Groups New Features
PPT
SharePoint Backup And Disaster Recovery with Joel Oleson
Breaking Down and Understanding Office 365 - SPSJHB 2015
SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 - AUSPC2012
Ultimate SharePoint Infrastructure Best Practises Session - Isle of Man Share...
AUDWC 2016 - Using SQL Server 20146 AlwaysOn Availability Groups for SharePoi...
SharePoint Disaster Recovery with SQL AlwaysOn
Unbreakable SharePoint 2016 with SQL Server 2016 Always On Availability groups
SQL 2012 AlwaysOn Availability Groups for SharePoint 2013 - SharePoint Connec...
Symantec ApplicationHA June 2011
Unbreakable SharePoint 2013 with SQL Server Always On Availability Groups (HA...
SQL Server 2012 High Availability with AlwaysOn Availability Groups
Tips to install and manage always on availability groups in sql server 2012 &...
SQL Server 2016 AlwaysOn Availability Groups New Features
SharePoint Backup And Disaster Recovery with Joel Oleson
Ad

Similar to AlwaysON Basics (20)

PPTX
Drop the Pressure on your Production Server
PPTX
Sql server 2012 ha dr 24_hop_final
PPTX
A Quick Guide to Sql Server Availability Groups
PPTX
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groups
PPTX
MariaDB High Availability
PPT
High availability solutions bakostech
PDF
SQL Server Clustering and High Availability
PPTX
SQL 2014 AlwaysOn Availability Groups for SharePoint Farms - SPS Sydney 2014
ODP
MySQL 5.7 clustering: The developer perspective
PPTX
07_DP_300T00A_HA_Disaster_Recovery.pptx
PPTX
Sql server 2012 ha dr 24_hop_final
PPTX
HA/DR options with SQL Server in Azure and hybrid
PPTX
Cnam azure 2014 storage
PPT
Oracle Dataguard
PDF
MariaDB High Availability Webinar
PPT
High Availbilty In Sql Server
PDF
Hadoop availability
PDF
Best Practice for Achieving High Availability in MariaDB
PDF
SQL Server Alwayson for SharePoint HA/DR Step by Step Guide
PPTX
Sql server 2012 ha dr
Drop the Pressure on your Production Server
Sql server 2012 ha dr 24_hop_final
A Quick Guide to Sql Server Availability Groups
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groups
MariaDB High Availability
High availability solutions bakostech
SQL Server Clustering and High Availability
SQL 2014 AlwaysOn Availability Groups for SharePoint Farms - SPS Sydney 2014
MySQL 5.7 clustering: The developer perspective
07_DP_300T00A_HA_Disaster_Recovery.pptx
Sql server 2012 ha dr 24_hop_final
HA/DR options with SQL Server in Azure and hybrid
Cnam azure 2014 storage
Oracle Dataguard
MariaDB High Availability Webinar
High Availbilty In Sql Server
Hadoop availability
Best Practice for Achieving High Availability in MariaDB
SQL Server Alwayson for SharePoint HA/DR Step by Step Guide
Sql server 2012 ha dr

More from Harsh Chawla (8)

PPTX
Alwayson AG enhancements
PPTX
Windows clustering and quorum basics
PDF
AlwaysON FCI
PPTX
Query tuning optimization
PPTX
Storage spaces - for SQL Server Workloads
PDF
Pssdiag and sql nexus
PPTX
Manage sql server proactively
PPTX
SQL Azure DB - BCDR
Alwayson AG enhancements
Windows clustering and quorum basics
AlwaysON FCI
Query tuning optimization
Storage spaces - for SQL Server Workloads
Pssdiag and sql nexus
Manage sql server proactively
SQL Azure DB - BCDR

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
KodekX | Application Modernization Development
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Modernizing your data center with Dell and AMD
PDF
Encapsulation theory and applications.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Approach and Philosophy of On baking technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Electronic commerce courselecture one. Pdf
PPT
Teaching material agriculture food technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
KodekX | Application Modernization Development
Advanced methodologies resolving dimensionality complications for autism neur...
Modernizing your data center with Dell and AMD
Encapsulation theory and applications.pdf
Understanding_Digital_Forensics_Presentation.pptx
A Presentation on Artificial Intelligence
The Rise and Fall of 3GPP – Time for a Sabbatical?
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Empathic Computing: Creating Shared Understanding
Approach and Philosophy of On baking technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
NewMind AI Weekly Chronicles - August'25 Week I
Dropbox Q2 2025 Financial Results & Investor Presentation
The AUB Centre for AI in Media Proposal.docx
Big Data Technologies - Introduction.pptx
Electronic commerce courselecture one. Pdf
Teaching material agriculture food technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf

AlwaysON Basics

  • 1. Microsoft Confidential HADR with SQL Server 2016 AlwaysON Session- 2 AlwaysON Architecture and internals 1
  • 2. Uday Bhanu Pathaniya PFE-SQL Server udpathan@Microsoft.com
  • 3. Microsoft Confidential 1. How AlwaysON works 2. What's AlwaysON Availability Groups /Replicas/ Listener 3. AlwaysON supportability and pre-requisites 4. Demo of AlwaysON HA Configuration 5. Backups on AlwaysON secondary replica 3
  • 4. Legacy Architecture: Database Mirroring for local HA, Log Shipping for DR
  • 5. Pre-SQL Server 2012 Challenges Possible data loss in Log shipping. Human intervention require in case of failover. Unavailability of user databases during log restoration. Can’t easily glue together databases that need to run on the same node Data Warehouse load restrictions due to limitations in Log Shipping Maintaining database mirroring connection strings (failover_partner) in all applications is painful, and in some cases (some 3rd party applications) not even supported Not easy to access data on mirrored server. No. of nodes limitations in mirroring. Interdependency of databases are not address in mirroring as well as in log shipping.
  • 6. What is AlwaysOn ? Is a combination of database mirroring and windows clustering. Multiple mirrors with multiple databases that can failover together. Single gateway(Listener) can be configure for automatic failover Nodes can be used to offload the select query workload and database backup workload. Single solution which can address HA & DR needs.
  • 7. Primary Data Center Disaster Recovery Data Center SQL Server Primary SQL Server Secondary Windows Server Failover Cluster (single WSFC crossing two data centers) Availability Group Synchronous Asynchronous SQL Server Secondary
  • 8. Grammar of AlwaysOn… •Read-write , Online user database from primary Instance of database server. •Databases added in availability in Availability groups are called availability databases & each Availability Database is a part of only single Availability Group. •Backup of the primary database has to restore on secondary replica in norecovery state and new secondary database will remain in restoring state until it is not joined to Availability group Availability Database •Logical container which logically binds the user databases which needs to be failover together. •All the availability databases will failover together on same secondary replica. •Single Availability Group can hosts multiple Availability Databases. Availability Groups •All the possible failover partners(must be a separate instance of SQL Server on other node) are known as Availability Replica. •Each Availability replica is a copy of Availability database in a Availability Group. •Each Availability replica is assigned an initial role- Primary or secondary. Primary replica hosts read-write user database & at least one secondary replica hosts read-only user database. Availability Replica •There are two Modes- 1.) Synchronous-Commit mode & 2.) Asynchronous-Commit mode. •In 1. Synchronous-commit primary replica wait for acknowledgement from synchronous-commit secondary replica that it has commit the transaction in t-log of secondary database then after primary replica commit transaction. •In 2. asynchronous-commit primary replica commit the transaction without waiting for acknowledgement from asynchronous-commit secondary replica that it has commit the transaction. •Asynchronous-commit mode minimizes transaction latency on the secondary databases but allows them to lag behind the primary databases, making some data loss possible. Availability mode •With SQL Server AlwaysOn no need to have shared storage, but can use SAN, DAS, NAS or Local Disk depending on your budget and requirements. AlwaysOn Storage •Active secondary replica supports backup offloading on secondary replica and readable secondary replica. •In backup offloading we can log backups , full backup of database , file or filegroup. Backup presences can be set on secondary replicas. •An availability replica can be allow read-only access to its local databases when performing the secondary role. •If an availability group currently possesses an availability group listener and one or more readable secondary replicas, SQL Server can route read-intent connection requests to one of them (read-only routing Active Secondary Replica •Availability replica property:- How long the connection with another availability replica can remain inactive before the connection is close Session-timeout period
  • 9. Grammar of AlwaysOn. • Availability group listener is a Virtual network name(VNN) to which clients can connect in order to access a database in primary or secondary replica. • The physical instance name of SQL Server is hidden to clients while accessing availability databases through listener. • The client connection string does not to modify in order to access either of Availability database base. • We need DNS name for listener , a listener port designation one or more IP address. • Client use DNS to resolve VNN into multiple IP addresses and then tries to connect with each IP address until the connection request successes or timed out. • If we configure read only routing then all read-intent connections are redirected to readable secondary replica. Availability Group listener
  • 10. Connectivity with Availability Group Listener Connect to the Primary Replica Server=tcp: AGListener,1433;Database=MyDB;IntegratedSecurity=SSPI Connect to Read-Only Secondary Replica Server=tcp:AGListener,1433;Database=AdventureWorks;IntegratedSecurity=SSPI;ApplicationIntent=ReadOnly Connect to Multisubnet failover Server=tcp:AGListener,1433;Database=AdventureWorks;IntegratedSecurity=SSPI; MultiSubnetFailover=True
  • 11. AlwaysON pre-requisites KB 2654347:Hotfix for .Net 3.5 SP1 Other Hotfix KB 2494036 for optimal WSFC quorum , KB 2687741 for faster failover to local relica etc. Each node must be configure under WSFC(preferably node-fileshare). A separate SQL Server Instance on each WSFC node and enable AlwaysOn feature for each SQL Server service. Enterprise edition of SQL Server 2016 All the server instances that host availability replicas for an availability group must use the same SQL Server collation. No. of available worker threads are very important. Create endpoints or member of sysadmin privileges require DHCP IP can be used but it is recommended to use static IPs.
  • 12. AlwaysON Restrictions • Restrictions for SQL Server failover cluster instance(FCI) • The cluster nodes of an FCI can host only one replica for a given availability group • FCIs do not support automatic failover by availability groups • Changing FCI network name • Restriction for SQL Server Availability Group • Availability replicas must be hosted by different nodes of one WSFC cluster • Unique availability group name • Only 8 secondary replicas are supported. Either all can be configured as async • commit mode or up to 3 can be configure as sync-commit mode • Maximum number of availability groups and availability databases per computer depends on Hw configuration. MS has tested 10AGs with 100 DBs per AG. • Restriction for SQL Server Availability Databases • If file path is different then • New Availability Group Wizard/Add Database to Availability Group Wizard • the database files must be RESTORED WITH MOVE on each instance of SQL Server that hosts a secondary replica. • A later add-file operation on the primary replica might fail on the secondary databases.
  • 14. Backups on AlwaysON secondary replica • Copy-Only full backup of databases , files & filegroup is supported on secondary replica. • Differentail backup is not supported on secondary replica. • Backup log supports only regular backup & log chain remain consistent irrespective of backup log location or availability mode( Synchronous-commit or Asynchronous-commit) • Secondary replica must be in SYNCHRONIZED or SYNCHRONIZING state. • In case of more than two nodes backup preferences(AG property) can be set to ‘Prefer Secondary’ , ‘Secondary Only’ , ‘Primary’ ,’Any Replica’. • Additionally Replica backup priorities can be set to ‘Server Instance’, ‘Backup Priory(Lowest=1, Highest=100)’ , Exclude Replica. • It is recommended to configure script based backup jobs on each replica. • Use the sys.fn_hadr_backup_is_preferred_replica function to determine whether the current replica is the preferred backup replica or not. • This function return 1 in case if the current replica is a preferred replica else 0.

Editor's Notes

  • #2: © 2015 Microsoft Corporation Microsoft Confidential
  • #4: © 2015 Microsoft Corporation Microsoft Confidential
  • #5: To achieve automatic failover, synchronous database mirroring with a witness (a third SQL Server instance) is configured. When zero data loss is required, the database mirroring high-safety mode (synchronous) setting is enabled to help ensure zero data loss between the two servers located in the primary data center. To improve database availability within the primary data center, a third SQL Server instance is configured to act as a witness to enable automatic failover between the database mirroring partners. Log shipping is used for disaster recovery and log shipping involves ongoing transaction log backups of the principal database. These transaction log backups are then copied to a SQL Server instance in the disaster recovery data center. Incoming transaction log backups are restored in sequence on an ongoing basis. You could also choose to configure log shipping for read-only workloads, but with the drawback that read-only connections must be disconnected before incoming transaction log backups are applied.
  • #9: Availability Databases To add a database to an availability group, the database must be an online, read-write database that exists on the server instance that hosts the primary replica. When you add a database, it joins the availability group as a primary database, while remaining available to clients. No corresponding secondary database exists until backups of the new primary database are restored to the server instance that hosts the secondary replica (using RESTORE WITH NORECOVERY). The new secondary database is in the RESTORING state until it is joined to the availability group Session-Timeout Period The session-timeout period is an availability-replica property that determines how long connection with another availability replica can remain inactive before the connection is closed. The primary and secondary replicas ping each other to signal that they are still active. Receiving a ping from the other replica during the timeout period indicates that the connection is still open and that the server instances are communicating. On receiving a ping, an availability replica resets its session-timeout counter on that connection. The session-timeout period prevents either replica from waiting indefinitely to receive a ping from the other replica. If no ping is received from the other replica within the session-timeout period, the replica times out. Its connection is closed, and the timed-out replica enters the DISCONNECTED state. Even if a disconnected replica is configured for synchronous-commit mode, transactions will not wait for that replica to reconnect and resynchronize. The default session-timeout period for each availability replica is 10 seconds. This value is user-configurable, with a minimum of 5 seconds. Generally, we recommend that you keep the time-out period at 10 seconds or greater. Setting the value to less than 10 seconds creates the possibility of a heavily loaded system declaring a false failure.
  • #10: A unique DNS name This is also known as a Virtual Network Name (VNN). Active Directory naming rules for DNS host names apply. One or more Virtual IP addresses (VIPs)VIPs are configured for one or more subnets to which the availability group can failover. IP address configurationFor a given availability group listener, the IP address uses either Dynamic Host Configuration Protocol (DHCP) or one or more static IP addresses. Dynamic Host Configuration Protocol (DHCP) If an availability group resides on a single subnet, you can configure all the availability group listener IP addresses to use DHCP. For pre-production environments, DHCP offers an easy setup for an availability group that does not require disaster recovery to a remote site on a separate subnet. However, you should not use DHCP in conjunction with an availability group listener in a production environment. This is because, in the event of down time, if the DHCP IP lease expires, extra time is required to re-register the new DHCP IP address associated with the listener DNS name. The extra time will cause client-connection failure. Static IP addresses In production environments, we recommend that availability group listeners use static IP addresses. Furthermore, where availability groups extend across subnets in a multi-subnet domain, an availability group listener must use static IP addresses. Port Consideration You can also designate a non-standard listener port; however this means that you will also need to explicitly specify a target port in your connection string whenever connecting to the availability group listener. You will also need to open permission on the firewall for the non-standard port. If you use the default port of 1433 for availability group listener VNNs, you will still need to ensure that no other services on the cluster node are using this port; otherwise this would cause a port conflict. If one of the instances of SQL Server is already listening on TCP port 1433 via the instance listener and there are no other services (including additional instances of SQL Server) on the computer listening on port 1433, this will not cause a port conflict with the availability group listener. This is because the availability group listener can share the same TCP port inside the same service process. However multiple instances of SQL Server (side-by-side)should not be configured to listen on the same port.
  • #11: Using a Listener to Connect to a Read-Only Secondary Replica (Read-Only Routing) Read-only routing refers to the ability of SQL Server to route incoming connections to an availability group listener to a secondary replica that is configured to allow read-only workloads. An incoming connection referencing an availability group listener name can automatically be routed to a read-only replica if the following are true: At least one secondary replica is set to read-only access, and each read-only secondary replica and the primary replica are configured to support read-only routing. The connection string references an availability group listener, and the application intent of the incoming connection is set to read-only (for example, by using the Application Intent=ReadOnly keyword in the ODBC or OLEDB connection strings or connection attributes or properties
  • #12: Thread considerations The maximum number of threads used by availability groups is the configured setting for the maximum number of server threads ('max worker threads') minus 40. he availability replicas hosted on a given server instance share a single thread pool. Threads are shared on an on-demand basis, as follows: Typically, there are 3–10 shared threads, but this number can increase depending on the primary replica workload. If a given thread is idle for a while, it is released back into the general SQL Server thread pool. Normally, an inactive thread is released after ~15 seconds of inactivity. However, depending on the last activity, an idle thread might be retained longer. In addition, availability groups use unshared threads, as follows: Each primary replica uses 1 Log Capture thread for each primary database. In addition, it uses 1 Log Send thread for each secondary database. Log send threads are released after ~15 seconds of inactivity. Each secondary replica uses 1 redo thread for each secondary database. Redo threads are released after ~15 seconds of inactivity. A backup on a secondary replica holds a thread on the primary replica for the duration of the backup operation.
  • #13: Thread considerations The maximum number of threads used by availability groups is the configured setting for the maximum number of server threads ('max worker threads') minus 40. he availability replicas hosted on a given server instance share a single thread pool. Threads are shared on an on-demand basis, as follows: Typically, there are 3–10 shared threads, but this number can increase depending on the primary replica workload. If a given thread is idle for a while, it is released back into the general SQL Server thread pool. Normally, an inactive thread is released after ~15 seconds of inactivity. However, depending on the last activity, an idle thread might be retained longer. In addition, availability groups use unshared threads, as follows: Each primary replica uses 1 Log Capture thread for each primary database. In addition, it uses 1 Log Send thread for each secondary database. Log send threads are released after ~15 seconds of inactivity. Each secondary replica uses 1 redo thread for each secondary database. Redo threads are released after ~15 seconds of inactivity. A backup on a secondary replica holds a thread on the primary replica for the duration of the backup operation.
  • #15: The AlwaysOn Availability Groups active secondary capabilities include support for performing backup operations on secondary replicas. Backup operations can put significant strain on I/O and CPU (with backup compression). Offloading backups to a synchronized or synchronizing secondary replica allows you to use the resources on server instance that hosts the primary replica for your tier-1 workloads. Note that copy-only backups do not impact the log chain or clear the differential bitmap.
  • #16: The AlwaysOn Availability Groups active secondary capabilities include support for performing backup operations on secondary replicas. Backup operations can put significant strain on I/O and CPU (with backup compression). Offloading backups to a synchronized or synchronizing secondary replica allows you to use the resources on server instance that hosts the primary replica for your tier-1 workloads. Note that copy-only backups do not impact the log chain or clear the differential bitmap.