AlwaysOn Introduction in Denali November 27 th, 2011.

Slides:



Advertisements
Similar presentations
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Advertisements

SQL Server AlwaysOn: Active Secondaries Luis Vargas Program Manager Microsoft Corporation DBI312.
Implementing SQLServer AlwaysON Sarabpreet Singh Anand SQL Server – MVP SQLServerGeeks.com (VP)
Mecanismos de alta disponibilidad con Microsoft SQL Server 2008 Por: ISC Lenin López Fernández de Lara.
1EMC CONFIDENTIAL—INTERNAL USE ONLY Overview of SQL Server 2012 High Availability and Disaster Recovery (HADR) Wei Fan Technical Partner Management – Microsoft.
SQL Server AlwaysOn.
Oracle Data Guard Ensuring Disaster Recovery for Enterprise Data
Virtual techdays INDIA │ September 2011 High Availability - A Story from Past to Future Balmukund Lakhani │ Technical Lead – SQL Support, Microsoft.
SQL Server 2012 Always On Premier Field Engineer Microsoft Corporation Lisa Gardner
SQL Server AlwaysOn: Active Secondaries Luis Vargas Program Manager Microsoft Corporation DBI312.
National Manager Database Services
Convergence /20/2017 © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Performance and Scalability. Performance and Scalability Challenges Optimizing PerformanceScaling UpScaling Out.
Maintaining a Microsoft SQL Server 2008 Database SQLServer-Training.com.
Sofia, Bulgaria | 9-10 October SQL Server 2005 High Availability for developers Vladimir Tchalkov Crossroad Ltd. Vladimir Tchalkov Crossroad Ltd.
MODIFY THIS SLIDE FOR ACTUAL PRESENTER, DELETE THIS BAR AFTER MODIFICATION.
SQLintersection SQL37 SQL Server 2012 Availability Groups: High Availability for Your Most Important Data Aaron Bertrand,
SQLintersection Session SQL37 SQL Server 2012 Availability Groups Aaron Bertrand
DBI Meets mission critical high availability SLA Integrated Efficient Flexible.
October 11-14, Seattle, WA All the Magic Knobs Low Effort, High Return Tuning Cindy Gross Microsoft Certified Master : SQL Server Dedicated Support Engineer.
1099 Why Use InterBase? Bill Todd The Database Group, Inc.
SharePoint enhancements through SQL Server RSS integration with SharePoint What’s New Elimination of IIS
Enterprise Database Administration & Deployment SIG ▪ 313M ▪ Sept 29, 2005 ▪ 10:15 AM SQL Server 2005 Performance Diagnosis and Tuning using SQL Tools.
SQL School is strongly committed to provide COMPLETE PRACTICAL REALTIME Trainings on SQL Server Technologies – Dev, SQL DBA, MSBI (SSIS, SSAS, SSRS) and.
Alwayson Availability Groups
SQLintersection Understanding Transaction Isolation Levels Randy Knight Wednesday, 3:45-5:00.
Your Data Any Place, Any Time Performance and Scalability.
Data Disaster Recovery Planning Greg Fibiger 1/7/2016.
Log Shipping, Mirroring, Replication and Clustering Which should I use? That depends on a few questions we must ask the user. We will go over these questions.
Narasimha Reddy Gopu Jisha J. Agenda Introduction to AlwaysOn * AlwaysOn Availability Groups (AG) & Listener * AlwaysOn Failover * AlwaysOn Active Secondaries.
Does the Optimistic Concurrency resolve your blocking problems Margarita Naumova, SQL Master Academy.
SQL Server High Availability Introduction to SQL Server high availability solutions.
Locks, Blocks & Isolation Oh My!. About Me Keith Tate Data Professional for over 14 Years MCITP in both DBA and Dev tracks
AlwaysOn In SQL Server 2012 Fadi Abdulwahab – SharePoint Administrator - 4/2013
FUN WITH AVAILABILITY GROUPS Christopher Wolff SQL Server Database Engineer, Xero.
Session Name Pelin ATICI SQL Premier Field Engineer.
SQL 2012 – Always On Deep Dive Bob Duffy Database Architect Prodata SQL Centre of Excellence 11 th April 2013.
Level 400 SQL Server 2012 AlwaysOn Deep Dive Christian Bolton, Coeo Ltd.
High Availability & Disaster Recovery with SQL Server AlwaysOn Availability Groups Turgay Sahtiyan Microsoft – Senior SQL Server PFE
SQLSaturday (Silicon Valley) – Mar
Turgay Sahtiyan Istanbul, Turkey
Sponsors.
SQL Server AlwaysOn Availability Groups DrillDown
AlwaysOn Readable Secondary
Example of a page header
A Technical Overview of Microsoft® SQL Server™ 2005 High Availability Beta 2 Matthew Stephen IT Pro Evangelist (SQL Server)
Always On Availability Groups
Always on HA SQL Server Always ON feature is the new comprehensive high availability and disaster recovery solution which increases application availability.
Isolation Levels Understanding Transaction Temper Tantrums
# - it’s not about social media it’s about temporary tables and data
# - it’s not about social media it’s about temporary tables and data
Contained DB? Did it do something wrong?
Required 9s and data protection: introduction to sql server 2012 alwayson, new high availability solution Santosh Balasubramanian Senior Program Manager.
AlwaysOn, an Early bird Overview
SQL Server High Availability Amit Vaid.
Auditing in SQL Server 2008 DBA-364-M
Getting To Know Your Indexes
SQL 2014 In-Memory OLTP What, Why, and How
What’s new in SQL Server 2016 Availability Groups
Understanding Transaction Isolation Levels
Active Secondary: Enabling Backup On Secondary
AlwaysOn Availability Groups
Batches, Transactions, & Errors
High Availability/Disaster Recovery Solution
Sioux Falls, SD | Hosted by (605) SQL
Governing Your Enterprise with Policy-Based Management
Distributed Availability Groups
Isolation Levels Understanding Transaction Temper Tantrums
Module 13: Creating Highly Concurrent SQL Server 2012 Applications
Designing Database Solutions for SQL Server
Presentation transcript:

AlwaysOn Introduction in Denali November 27 th, 2011

Seventh Activity Activities Brief Introduce the AlwaysOn features of SQL2011 – Denali Deep dive of AlwaysOn characters

Attendees Tony Wu Eric Xia (Microsoft) Hua Zhu (Microsoft) Simon Liao

Introducing AlwaysOn Active Secondary

Active Secondary: Enabling Backup On Secondary Kevin Farlee

Active Secondary: Enabling Backup on Secondary Today’s Story Architecture Features and Limitations Backup Automation Demo

Agenda Database Mirroring Backups Backup On Secondary Features and Limitations Backup Automation – Current Solutions – Backup On Secondary Solution – Configuring Backup Preferences – Example Configurations Demo

Database Mirroring Backups Backups are only allowed on Primary Secondary cannot be leveraged for backups Backup Workload impacts production Server

Active Secondary: Offloading Backup Backups are allowed on any replica – Primary and secondary can be leveraged for backups Backup workload does not impact production server Highly requested feature

Database Mirroring Backups SQL 2008 Database Mirroring R/W workload PrimarySecondary Failed Backups

Active Secondary: Enabling Backup On Secondary R/W workload Primary Backups Secondary Backups Secondary Backups

Capabilities Backups can be done on any replica of a database Secondary replica may be synchronous or asynchronous Backups on primary replica still works Log backups done on all replicas form a single log chain Recovery Advisor makes restores simple

Log backups done on all replicas form a single log chain Replica 1 Log back up Log Bac kup LSN LSN Replica 2 Log Bac kup LSN LSN

Restrictions, cautions, and gotchas Differential backups are not supported on secondary Only Copy-only full backups are supported on secondary The only distinction is the differential bitmap clearing Advisable for backups to be stored centrally

Automated Backups How to choose which replica to use for a backup? DBM: Only the primary would work Now: Backups succeed on all replicas Solution: Declarative policy

Declarative Policy Preference for which role to use: – Primary Only – Secondary Only – Secondary (but use Primary as fallback) – Don’t care Relative Priority for each replica

Declarative Policy Logic: – Filter out replicas which are not up & online – Filter out replicas which don’t meet the policy for role – Select the highest priority replica among the remaining set – Use instance name as tie-breaker

Session Code | Session Title19

Declarative Policy Policy is advisory only (NOT enforced) Automatically used by Maintenance Plans and Log Shipping Implemented as a system function (returns boolean)

DEMO Backup On Secondary Session Code | Session Title21

Active Secondary: Off-loading Reporting Workload Sunil Agarwal

Agenda Readable Secondary – Reporting Workloads Today – Value Proposition – Architecture – Impact and Performance – Demo – Application Connectivity

Reporting Workloads Today Database Mirroring Transactional Replication Run all workloads including reporting on Primary Impacts primary workload Resource/Blocking Run reporting on mirror with snapshots. Data Latency Additional management overhead No application failover Performance Impact during snapshot Most widely used for offloading reporting scenarios today Pros: Large number of subscribers, Filtering of data Reporting work load specific indexes Cons: Need replication expertise to manage and tune environment

Readable secondary allow offloading read queries to secondary Low data latency. After failover, the read applications can be automatically redirected to the new Secondary (require explicit connection request) Not a replacement for replication scenarios DB2DB1 SQLservr.exe InstanceA DB2DB1 Primary Secondary Database Log Synchronization InstanceB Reports Primary Secondary Reports ReadSec: Reporting Workload CRASH

Log Cache Secondary read is always behind primary during transaction activity DB1 DB1 Log DB1 Primary Secondary Log Capture Log Recieve DB1 Data Network Redo Thread Redo Pages DB1 Log DB1 Data Log Hardened Log Flush Commit Acknowledge Commit Log Pool ReadSec – Data Latency Log Capture

Impact on RTO Reporting workload can take resources away from REDO thread – Can impact the recovery time(RTO) Mitigation – User resource-governor to control resources taken by reporting workload – If using combination of sync/Async secondary, offload reports to Async Secondary. Log Cache DB1 Log Apply Redo Thread Redo Pages DB1 Log DB1 Data Reports Resource Intensive (IO, Memory, CPU) Resource Intensive (IO, Memory, CPU) ReadSec: Impact of Read Workload Secondary

Impact on RTO (cont.) Concurrency and Blocking – REDO can get blocked by reporting workload – REDO thread and read workload can deadlock Solution – Internally map read workload to non blocking isolation levels (no application changes required) Read Uncommitted  Snapshot Isolation Read Committed  Snapshot Isolation Repeatable Read  Snapshot Isolation Serializable  Snapshot Isolation Ignore all locking hints – Never choose REDO as deadlock victim Result – Blocking and deadlock between Reporting workload (i.e. Query) and REDO thread is eliminated – No issues with DML (INSERT/DELETE/UPDATE) as it is not allowed – Will incur additional cost of row versioning. ReadSec: Impact of read workload

Support Snapshot Isolation Mapping – Row versions must be created on the secondary replica Rule: – Primary and Secondary replica (i.e. database(s) must have the same physical structure Implications: – 14 bytes must be added to data/index row on the primary replica – Not an issue if SI or RCSI is already enabled on the primary replica – Does not require enabling SI/RCSI on primary Data Row XSN RID RID 6 bytes 8 bytes SI Mapping and Row Versioning

Row Versioning Optimizations

On standalone SQL Server – Query can block (even with NOLOCK) a concurrent DDL Same can happen on Readable Secondary – REDO can block Reporting Workload – Read workload can block REDO thread Mitigation – DDL not common in production environment – You may have flexibility in scheduling maintenance jobs with concurrent Reporting Workload – Tools to identify blocking An XEvent is generated when REDO is blocked. You can choose to kill Reporting workload Query the DMV to find the blocked thread in the database Primary ReplicaSecondary Replica Start Reporting workload on table T1 Takes SCH-S lock on table T1 Execute DDL operation on table T1 REDO processes the DDL log record Requests SCH-M lock on table T1 Reporting Workload completes Blocked DDL and Reporting Workload

Optimized Query Plans Goal: Comparable query plan on Readable Secondary Query Optimization and Statistics – SQL Server uses cost based optimizer that heavily relies on object statistics – If statistics are missing, SQL Server automatically creates them and persists Auto-stat on readable secondary will require physical Changes – Example: Table T1 (C1, C2, C3) Query on primary with predicate (C3 > 10). SQL Server auto-create the statistics, if needed, on column C3 on primary replica Won’t work on Readable Secondary as it will cause physical changes to the database. – Similar issue if the statistical information is stale on the secondary replica. Solution – Auto-create statistics on the secondary replica but persist them in TempDB – Existing catalog views (e.g. sys.stats) show temporary statistics Query Performance on Secondary

Auto Stats: Permanent vs. Temp SQL Memory On RS Stats blob T1/C1

RS: Ghost Cleanup Issue – Cannot remove the ghost row if needed on RS by active query Solution – Expose low_water_mark_for_ghosts for each database – Ghost can only be removed when it is safe to. – If RS preventing ghost clean up, user action is required.

DEMO Session Code | Session Title35 Readable Secondary

Setting up Readable Secondary

ApplicationIntent – A New Connection Property – Used to gate access to secondary – Applicable when Secondary Replica set with ALLOW_CONNECTIONS =READ_ONLY Connection String – Connect directly to a secondary instance Server=N2; Database=Db1; ApplicationIntent = ReadOnly Read-Only Routing – Connection behavior optimized for automatic routing of read only applications to secondary Application Connectivity

Catalog Views – Sys.availability_replicas (used to see if secondary allows READ) – Sys.stats New column to indicate if the statistics is temporary DMVs – Sys.dm_hadr_database_replica_states Xevents – REDO Blocked – REDO Unblocked PerfMon – REDO blocking Supportability

Better return on hardware investment – Primary workload can better use available resources – Reporting workload can use secondary replicas Comparable query plans on secondary replica Easy to manage and setup Summary

Complete the Evaluation Form to Win! Win a Dell Mini Netbook – every day – just for submitting your completed form. Each session evaluation form represents a chance to win. Pick up your evaluation form: – In each presentation room – Online on the PASS Summit website Drop off your completed form: – Near the exit of each presentation room – At the Registration desk – Online on the PASS Summit website Sponsored by Dell 40Session Code | Session Title

Thank you for attending this session and the 2011 PASS Summit in Seattle

42Session Code | Session Title Microsoft SQL Server Clinic Work through your technical issues with SQL Server CSS & get architectural guidance from SQLCAT Microsoft SQL Server Clinic Work through your technical issues with SQL Server CSS & get architectural guidance from SQLCAT Microsoft Product Pavilion Talk with Microsoft SQL Server & BI experts to learn about the next version of SQL Server and check out the new Database Consolidation Appliance Microsoft Product Pavilion Talk with Microsoft SQL Server & BI experts to learn about the next version of SQL Server and check out the new Database Consolidation Appliance Ask The Dev Pods Meet Microsoft SQL Server Engineering team members & SQL MVPs Ask The Dev Pods Meet Microsoft SQL Server Engineering team members & SQL MVPs Hands-on Labs Get experienced through self-paced & instructor-led labs on our cloud based lab platform - bring your laptop or use HP provided hardware Hands-on Labs Get experienced through self-paced & instructor-led labs on our cloud based lab platform - bring your laptop or use HP provided hardware Room 611Expo Hall6 th Floor LobbyRoom