sql server 12 alwayson - passshanghai.pass.org/portals/94/sharedppt/alwayson.pdf · alwayson...
TRANSCRIPT
![Page 1: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/1.jpg)
SQL Server® AlwaysOn (HADRON)
朱桦
Technical Leader, Microsoft Database Support Team
Microsoft Public - See Terms of Use
![Page 2: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/2.jpg)
Windows Server ® Failover Clustering (WSFC)
2
Multi-node w/Shared Data Storage
SQL Binaries on each node
Client Connections via Virtual Server Name
Manual or Automatic Instance Failover
Stretch Cluster via VLAN
AlwaysOn Failover Cluster Instances (FCI)
Flexible Failover Policy
sp_server_diagnostics logging
Multi-Subnet Failover Cluster
Faster Recovery with Indirect Checkpoints
Shared Data Disk
![Page 3: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/3.jpg)
Log Shipping
3
Provides Remote Disaster Recovery Site
Database Level Protection
Based on Transaction Log Backup\Restore
Easy to setup
No Automatic Failover
No Client Redirection
![Page 4: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/4.jpg)
Database Mirroring
4
Hot Disaster Recovery Site for Single Database
Easy setup using Wizard per Database
Synchronous Mirroring
Automatic Failover via 3rd Witness Server
Client Redirection
Asynchronous Mirror
Automatic Page Repair (2008)
Log Stream Compression (2008)
Mirror Backups (2008)
![Page 5: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/5.jpg)
New for SQL Server 2012
5
Primary ReplicaData Changes
SynchronousHot DRStandby
AsynchronousWarm StandbyReadableReports
AsynchronousWarm StandbyReadableBackups
Log Shipping + Database Mirroring
+ Windows Clustering =
AlwaysOnAvailability Group
for Database Protection
![Page 6: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/6.jpg)
from Windows Server Failover Cluster (WSFC)
6
Automatic Failover via Windows Server Failover Cluster (WSFC)
Flexible Failover Policy using sp_server_diagnostics
Multisite Clustering using disbursed servers
Multiple Secondary Nodes (up to four)
Virtual Server Name for Client Redirection (availability group listener)
Enhanced
No shared disk storage used in Windows Clustering
No restart of SQL resulting in faster failover
Failover single, or group of databases instead of entire SQL Server
6
![Page 7: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/7.jpg)
from Database Mirroring
7
Two Synchronous Secondary Servers for high availability
Backup Asynchronous Secondary Servers (total 4)
Automatic Bi-Directional Page Repair
Secondary Backup (SQL 2008 EE)
Enhanced
Log Backup maintains backup chain allowing restore to Primary
Maintenance Plans “preferred backup” based on “priority”
Bi-directional automatic page repair
7
![Page 8: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/8.jpg)
SQL Server 2012 Management Studio
8
Availability GroupParticipating SQL instances, their roles and corresponding properties
8
Availability Replica Unit of failover.
Single database or group of databases
Group ListenersSingle Name Connection
![Page 9: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/9.jpg)
AlwaysOn Architecture
Windows Server Failover Clustering (WSFC) Cluster
Network Subnet
NodeNode
SQL Server Instance
Storage
Node
Network Subnet
Node
SQL Server Instance
Storage
Node
SQL Server Instance
Storage
SQL Server Failover Cluster Instance
Shared Storage
AlwaysOn Availability Group
Instance Network Name
Instance Network Name
Instance Network Name
Instance Network Name
Secondary Replica
Secondary Replica
Secondary Replica
Primary Replica
AG Listener Virtual Network Name
WSFC Quorum Witness Remote File Share
WSFC Configuration
WSFC Configuration
WSFC Configuration
WSFC Configuration
WSFC Configuration
9
![Page 10: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/10.jpg)
Availability Group Configuration• Up to 5 replicas (including primary)
• Availability Mode• Asynchronous
• Synchronous• Up to 3 replica per availability group including primary
• Failover mode• Manual
• Automatic• Up to 2 per availability group
• Requires synchronous availability mode
• Readable Secondary• No
• Yes
• Read Intent
10
![Page 11: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/11.jpg)
AVAILABILITY GROUP AVAILABILITY MODE
•Asynchronous• Primary replica doesn’t wait for secondary replicas to harden log
records.
• Performance over data protection
• Secondary never synchronized / can lag behind
• Reports ‘synchronizing’, never ‘synchronized’
• Useful• When availability replicas are distributed
• Transaction performance is priority
• Synchronous• Primary commit waits for secondary log harden
• Synchronized data protection over performance
• High availability over performance
• Reports ‘synchronizing’ or ‘synchronized’
11
![Page 12: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/12.jpg)
AVAILABILITY GROUP FAILOVER MODE
• AUTOMATIC• Requires synchronous availability mode
• Up to two availability replica
• Additional configuration options• HEALTH_CHECK_TIMEOUT
• FAILURE_CONDITION_LEVEL
• MANUAL• Asynchronous or synchronous availability mode
12
![Page 13: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/13.jpg)
Types of Failover
Three Types of Failover
• Automatic• Synchronous Commit
• Automatic Failover
• Replica in SYNCHRONIZED state
• Planned manual failover (without data oss)• No data loss - supported when synchronous commit and secondary is
‘synchronized’
• alter availability group agtest1 failover
Forced manual failover (with possible data loss)• Supported with asynchronous commit
• Secondary is synchronizing or not_synchronized
• alter availability group agtest1 force_failover_allow_data_loss
13
![Page 14: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/14.jpg)
AlwaysOn Readable Secondaries
•Secondary Replica is ‘Active’
•Offload Read Only activity• Backups• DBCC CHECKDB• Read Only querying, reporting
• How do you re-direct read-only activity?
14
![Page 15: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/15.jpg)
15
AlwaysOn Readable Secondaries
Configure secondary for read access
CREATE AVAILABILITY GROUP REPLICA ON
‘SQL01' WITH
(…SECONDARY_ROLE=…)
- NO
- ALL
- READ_ONLY
![Page 16: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/16.jpg)
16
AlwaysOn Readable Secondaries
• Read-Only client connection behavior determined by Availability Replica Option+ ApplicationIntent Property
• READ ONLY ROUTING1. Secondary replica read access
• SECONDARY_ROLE
2. Set replica’s URL for secondary routing• READ_ONLY_ROUTING_URL
3. When primary, replica routing list• READ_ONLY_ROUTING_LIST
4. Application connects using listener
5. Application use ReadOnly to connect
![Page 17: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/17.jpg)
17
AlwaysOn Backup on Secondary
• Why backup on secondary?• Backup is resource intensive
• Offload job from Tier-1 application
• What is supported:• BACKUP DATABASE (copy-only full backup)
• BACKUP LOG
• Differential not supported
• Offload backups to synchronized or synchronizing secondaries
• Manage backups with new Recovery Advisor
![Page 18: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/18.jpg)
18
Mulit-Subnet Failover
•No VPN needed•No storage replication•Multi IP address• ‘OR’ dependency
![Page 19: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/19.jpg)
19
Keywords for Multi-Subnet AG
• RegisterAllProvidersIP
- Get rid of DNS issue
• MultiSubnetFailover
- Quick establish connection
![Page 20: SQL Server 12 AlwaysOn - PASSshanghai.pass.org/Portals/94/sharedppt/AlwaysOn.pdf · AlwaysOn Failover Cluster Instances (FCI) ... •Offload job from Tier-1 application ... SQL Server](https://reader035.vdocuments.net/reader035/viewer/2022062219/5ab7b4017f8b9a28468be772/html5/thumbnails/20.jpg)
20