Presentation is loading. Please wait.

Presentation is loading. Please wait.

SQLSaturday (Silicon Valley) – Mar

Similar presentations


Presentation on theme: "SQLSaturday (Silicon Valley) – Mar"— Presentation transcript:

1 SQLSaturday (Silicon Valley) – Mar 03 2012
SQL Server AlwaysON – Next gen HADR solution SQLSaturday (Silicon Valley) – Mar Prakash Heda

2 Email/Facebook: Prakash@SQLfeatures.com MCDBA/MCITP
Prakash Heda Senior Infrastructure DBA at Advent Software Blog: /Facebook: MCDBA/MCITP

3 Agenda What is SQL Server AlwaysOn AlwaysON failover cluster Instance
What is AlwaysOn Availability Group Availability group on failover cluster Instance SQL 2012 HA comparisons Multiple Active Secondary AlwaysON Live configuration DEMO Conclusion

4 What is SQL Server AlwaysOn
It’s like mirroring, with multiple mirrors where databases can fail over in groups, and shed load by querying the mirrors, offloading backups. Windows Server Failover Cluster AlwaysOn Availability Groups for database protection AlwaysOn Failover Cluster Instances for instance level protection Availability Group uses Windows Server Failover Cluster (WSFC) for Inter-node health detection, Failover coordination, Primary health detection, Distributed data store for settings and state, Distributed change notifications WSFC to perform Witness role Support for Windows Server Core Reduce OS patching by as much as 50-60% Support for rolling upgrade and patching of SQL Server for both Availability Groups and Failover Cluster Instance Fast failover time for both Availability Groups and Failover Cluster Instances New online operations supported LOB Index Adding of column with default

5 AlwaysOn failover cluster Instance
Key Enhancements Windows Server Core Multi-site clustering across subnets Support for tempdb on local drive Flexible Failover Policy Improved system diagnostics Fast instance failover through predictable database recovery time Automatic dns propogation

6 AlwaysOn Availability Groups
AlwaysOn Availability Groups is a new feature that enhances and combines database mirroring and log shipping capabilities Flexible Integrated Efficient Multi-database failover Multiple secondaries Total of 4 secondaries 2 synchronous secondaries 1 automatic failover pair Synchronous and asynchronous data movement Built in compression and encryption Automatic and manual failover Automatic Page Repair Local storage Application failover using virtual name Configuration Wizard Dashboard System Center Integration Rich diagnostic infrastructure File-stream replication Replication publisher failover Supports Contained databases Active Secondary Readable Secondary Backup from Secondary Automation using power-shell However, it is still configured on a "per database" level so you are not replicating the entire SQL instance.  It also has the same restrictions as Database Mirroring in terms of support of databases that use distributed

7 SQL Server 2012 AlwaysON Comparison
Test scenario AlwaysON Failure Mitigation AlwaysON Performance Improvements & Load Balancing In this series of Videos will use Hyper-V to evaluate 2012 AlwaysOn HADR feature for 2 node cluster Part 1: Network Configuration for 2 node cluster Part 2: Setup Domain Controller Part 3: Add Storage Server to Domain Controller Part 4: Preparing nodes for failover cluster Part 5: Configure 2 node failover cluster Part 6: Install Standalone 2012 on both nodes Part 7: Enable availability Groups Part 8: Configure Availability Groups with 2 DB’s Part 9: Readable replica & test force failover Part 10: Implement & Test Virtual Name 2012 CTP1 windows 2008 R2 HyperV AlwaysON AvailablityGroup

8 HA Test scenario Automated failover No single point of failure
Zero data loss Separate server for reporting DR site with 5 min of Data loss acceptable

9 SQL Server 2008 R2 HADR Solution
Log Shipping Async Sync Site 1 Secondary Mirror Active Node/ Primary Mirror Q F G Shared Storage W S F C Cluster Passive Node Log Shipping 2 Site 2 Maintenance effort Connection drop-off on reporting server DB snapshot Manual logshipping

10 SQL Server AlwaysON HADR Solution
Site 3 File Share Witness W S F C Cluster Secondary 1 Async Sync Secondary 2 Site 2 Secondary 3 Primary Mirror Q F G SAN Storage Manual Failover Maintenance effort Connection drop-off on reporting server DB snapshot Manual logshipping Automatic Failover 1 Site 1 Manual Failover

11 SQL Server AlwaysON HADR Solution
Site 3 File Share Witness W S F C Cluster Secondary 1 Async Sync Secondary 2 Manual Failover Manual Failover Virtual Name Site 2 Secondary 3 Primary Mirror Q F G SAN Storage Manual Failover Maintenance effort Connection drop-off on reporting server DB snapshot Manual logshipping Automatic Failover 1 Automatic Failover 1 Site 1 Manual Failover

12 Availability Group Scenario Multiple Secondary's
Windows Server Failover Cluster Node A Node B Secondary AG2 AG1 Secondary AG4 Node C Node D Secondary Secondary Secondary AG3

13 Client Failover with Virtual Name
SQL Server Name : qdcdb21 & 22 & 23 Virtual Name: qdcVsql Availability Group Name qdcAG Synchronous Mirroring App Layer Write Transaction Write Transaction Read Transaction qdcAG qdcVsql DB1 DB2 qdcdb22 DB1 DB2 qdcdb21 DB1 DB2 qdcdb23 Auto Failover W S F C Cluster

14 AlwaysON Failure Mitigation
Attribute Clustering Log shipping Database mirroring Availability group Failure detection Yes No Automatic failover Perceived downtime 30 seconds + recovery N/A 3 seconds Less than 3 seconds (per database) Potential data loss All databases Latest transaction logs No Loss No Loss/ Multiple Copies Masking of storage failure No – shared disk Yes (Multiple copies) Failover level Instance Each database Group of databases (multiple) Scope System and user databases User databases Virtual Name Yes (One per instance) Failover Partner Yes (One for every group) Multi Site Auto Failover Multi Subnet

15 AlwaysONPerformance Improvements & Load Balancing
Attribute Clustering Log shipping Database mirroring AlwaysON Readable Secondary No Yes Yes (only snapshots, stale data) Connection Loss NA Yes (Redo logs) Backup from Secondary Deployment & maintenance Medium Difficult Easy Flexible failover policy DBCC on secondary Yes(Only read operation) Patch Upgrade downtime Minimum Statistics on reporting node Multiple database Copy One set Multiple sets Two sets Up to 5 Sets

16 AlwaysOn Active Secondary
IT efficiency and cost-effectiveness Idle hardware is not an option anymore Balancing read-only workloads Offloading Backup Operations Generate statistics on tempdb Can run dbcc commands Log backup on any replica

17 Database Mirroring Basic Principal of Synchronous Mirroring
Acknowledge Commit Acknowledge Constantly Redoing on Mirror Transmit to Mirror Write to Local Log Committed in Log Log Harden DB Log Log DB

18 Readable Secondary Behavior
Contention between redo thread and query thread avoided by Internally mapping read workload to non blocking isolation levels Read Uncommitted  Snapshot Isolation Read Committed  Snapshot Isolation Repeatable Read  Snapshot Isolation Serializable  Snapshot Isolation Ignore all locking hints Maintains query performance on secondary compared to primary Auto-create statistics on the secondary replica but persist them in TempDB Will incur additional cost of row versioning

19 Read-Only Client Connectivity
New connection string options ApplicationIntent Read-Only Automatic Routing MultiSubnetFailover Driver Support in RC0 MultiSubnetFailover=True Not Supported by NET Framework or OLEDB In RC0, only SQL Native Client 11.0 ODBC supports MultiSubnetFailover=True. Read-Only Routing enables redirection of client connection to new secondary on role change Driver Multi-Subnet Failover ApplicationIntent Read-Only Routing SQL Native Client 11.0 ODBC Yes SQL Native Client 11.0 OLEDB No ADO.NET with .NET Framework 4.0 Q4 CY2011* Q4 CY2011 Microsoft JDBC driver 4.0 for SQL Server

20 Active Secondary – Making Secondary Readable
Failover SQLservr.exe SQLservr.exe Primary Secondary Secondary Primary InstanceA InstanceB DB2 DB1 DB2 DB1 Reports Reports Readable secondary allow offloading read queries to secondary Close to real-time data, latency of log synchronization impact data freshness

21 Active Secondary: Enabling Backup On Secondary
Backups can be done on any replica of a database Backups on primary replica still works Log backups done on all replicas form a single log chain Differential backups are not supported on secondary Only Copy-only full backups are supported on secondary

22 Multi-Site Clustering
Multi-site clustering provides protection from site failures DNS Server Network name DNS record created Network name DNS record created Network name DNS record Updated Node 1 Node 2 Node 3 Node 4 Failover At any given time, one out of two IP address will always be offline. By default SQL VNN creation will register all IP addresses in DNS (RegisterAllProvidersIP=1) which means all clients trying to connect via VNN will have multiple IP addresses registered in cache, in my case there were two. This is helpful specially in failover scenarios where clients can seamlessly connect to new primary without waiting for DNS propagation to complete Set RegisterAllProvidersIP=0 and HostRecordTTL=30 so only online IP is registered in DNS and upon failover maximum wait for client to know about new updated IP addresses will  be 30 seconds. Increase the connection timeout on clients to 30+ seconds. Use "multisubnetfailover=true" in client connection string. In CTP 3 this feature is limited to SQL Native client and those who are using ADO.Net have to wait till this parameters gets back ported into next release of .Net framework, which will not happen till October Site A Site B Data Replication AlwaysOn Failover Cluster Instance natively supports multi-site clustering without requiring V-LAN Each site can have separate IP subnet DNS entry updated to reflect current IP address on failover

23 Contained Databases Introducing Contained Databases or CDB’s
Unit of application programmability in 2012 A DB which establishes a boundary between application and server CDBs sever the user–login relationship Windows users no longer need matching logins Users with passwords replace SQL logins CDB can be part of an availability group and can failover across replicas Authentication information moves with the CDB Limitation Other objects, like jobs are not contained and has to be managed Windows 2008 R2 Core support Less patches, more secure, powershell support Steps: Use for standard VM with minimum configuration Sysprep Pre-Image standalone SQL Server configuration Powershell installation, graphical interface in RTM

24 Introducing Flexible Failover Policy
Flexible Failover Policy provides administrators control over the conditions when an automatic failover should be initiated. SQL Server 2012 Resource DLL SQL Server sp_server_diagnostics Diagnostics Resource DLL SQL Server Select SQL Server 2008 R2 Configurable options eliminate false failover Improved logging for better diagnostics

25 AlwaysOn Setup with RC0 Windows Server 2008 R2 SP1
Install WSFC on each machine and create a single WSFC cluster Install Standalone/Cluster SQL Server Instances on each machine Enable AlwaysOn through SQL Configuration Manager Configure availability group Optional Shared storage Enable TCP/IP No Heartbeat network Full Recovery model Database Backup Windows Authentication

26 Demo Videos (SQL 2012 Configuration)
Part 1: 2012 setup & Network Configuration Part 2: Configure Windows 2008 R2 Domain Controller Part 3: Preparing nodes for failover cluster Part 4: Configure 2 node Windows 2008 R2 SP1 failover cluster Part 5: Install Standalone 2012 on both nodes Part 6: 2012 Availability Groups Explained (Session 1) Part 6: 2012 Availability Groups Explained (Session 2) Part 6: Enable availability Groups (Session 3) Part 7: Configure Availability Groups with 2 DB’s Part 8: Readable replica & test force failover Part 9: Implement & Test Virtual Name In this series of Videos will use Hyper-V to evaluate 2012 AlwaysOn HADR feature for 2 node cluster Part 1: Network Configuration for 2 node cluster Part 2: Setup Domain Controller Part 3: Add Storage Server to Domain Controller Part 4: Preparing nodes for failover cluster Part 5: Configure 2 node failover cluster Part 6: Install Standalone 2012 on both nodes Part 7: Enable availability Groups Part 8: Configure Availability Groups with 2 DB’s Part 9: Readable replica & test force failover Part 10: Implement & Test Virtual Name 2012 CTP1 windows 2008 R2 HyperV AlwaysON AvailablityGroup

27 Demo Setup (Windows 2008 R2 SP1)
VM1 VM2 VM3 System Name W2k8R2dc Qdcdb21 qdcdb22 OS detail W2k8R2 SP1 As DC/DNS (NO DHCP) & Storage Server W2k8R2 SP1 Node1 W2k8R2 SP1 Node2 IP/Subnet/DNS Domain NIC / / / / / / ClusterVIP/Name /alwaysonCls Virtual Name VIP Domain\User sqlfeatures.local\cls Availability Group AlwaysONavg DEMO

28 Useful Links for evaluation RC0
SQL Server 2012 RC0 is now public TechNet 180 day evaluation copy of Windows Server 2008 R2 Sp1 Step-by-step guide on my blog:

29 Thank You SQLSaturday (Silicon Valley) – Mar 03 2012
Blog: Thank You For Attending this session Facebook/


Download ppt "SQLSaturday (Silicon Valley) – Mar"

Similar presentations


Ads by Google