Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to SQL Server Essential Concepts

Similar presentations


Presentation on theme: "Introduction to SQL Server Essential Concepts"— Presentation transcript:

1 Introduction to SQL Server Essential Concepts
Bradley Ball Sr. Azure Engineer, Microsoft Level: Intermediate

2 Speaker Introduction: Bradley Ball
Currently Sr. Azure Engineer FastTrack CXP Microsoft Over 15 Years IT Experience, Former Microsoft MVP Previous experience DBA, for the U.S. Army, The Executive Office of the President, Sr. SQL DBA Staff Specialist at Publix, Data Platform Practice Manager for Pragmatic Works Pro SQL Server 2012 Practices Author Chapter 14 PAGE & ROW COMPRESSION! Managing Author on Pro Admin 2014 Guide

3 IT Experts Learn SQL Backwards

4 Learning Backwards: How SQL Works
Database V Tables Views Clustered Indexes Non-Clustered Indexes

5 Why Learn the Internals

6 ACID Atomicity Consistency Isolation Durability

7 Transaction Isolation Levels
Serializable Read Committed Read Uncommitted Repeatable Read Snapshot Isolation SQL Server Default SQL Database Default

8 Demo

9 SQL 2012 and below: Select Relational Engine SNI Buffer Pool
USER Command Parser Optimizer Query Executor Buffer Pool Storage Engine Plan Cache Transaction Manager Access Methods Buffer Manager Data Cache DATA on Disk Discuss the SNI, Relational Engine, Storage Engine, and SQL OS DATA SQL OS

10 On The Inside: In-Memory OLTP
Store SNI Relational Engine Classic Query Executor Command Parser In-Memory SP’s and Schema In-Memory Query Executor Query Executor Optimizer Buffer Pool Query Interop In-Memory Data Storage Engine Plan Cache Memory Optimized Tables and Indexes Transaction Manager Access Methods Buffer Mngr Data Cache DATA IN-Memory Data *Loaded on Start up DATA SQL OS

11 SQL OS Pre-emptive Scheduling Cooperative Pre-emptive Scheduling

12 Locks, Latches, Waits Locks (like a stop light)
Row, Page, and Table Escalation Latches (like - who watches the locks/’watchmen’) Locks for Locks Waits Cooperative Scheduling Giving up our place in line willingly

13 Linux Oh Wait, You thought you just needed to understand Windows?

14 Software isolated process
SQL 2017 – Linux Linux Process SQLPAL managed Software isolated process SQL Server SQLPAL Linux Host Extension Windows Calls (+1200) ABI Calls (50) Linux OS Linux OS Calls

15 Azure SQL Database SQL Database Elastic Pools SQL Managed Instance

16 What’s available on Linux?
Operational features Support for RHEL, Ubuntu, SLES, Docker Package-based installs Support for OpenShift, Docker Swarm Failover clustering via Pacemaker Backup/Restore SSMS on Windows connected to Linux Command-line tools: sqlcmd, bcp Transparent Data Encryption Backup Encryption SCOM Management Pack Dynamic management views Table partitioning SQL Server Agent Full-Text Search Integration Services Active Directory integrated authentication TLS for encrypted connections SQL Server on Linux aims to support the core relational database engine capabilities. In general, our goal is “it’s just SQL Server.” 95% of features just work – anything app or coding related Some features have partial support – e.g. SQL Server Agent isn’t going to launch a windows command prompt Some features are in progress Some features we’ll never support – e.g. FileTable, where you have a win32 share to place files that show up in the engine – the next slide contains more details And while it’s the same SQL Server that you may (or may not!) be used to, we’re putting in a lot of effort to be a good Linux citizen. Callouts: Package-based installs – no “crappy installers” like predicted on Twitter; if SQL is coming to Linux, we’re going to do it right Failover Clustering – resilience against OS/SQL failures; automatic failover within seconds Log Shipping – warm standbys for DR Xplat CLI – sqlcmd lets you connect/query from any OS; bcp lets you bulk copy data; In-Memory – x performance increases by keeping tables in-memory and using natively compiled queries ColumnStore – why SQL Server is the leader in Gartner’s Magic Quadrant for Data Warehousing, holds the top 3 slots in performance benchmark Always Encrypted – protect your most sensitive data even from high-privileged database administrators AD authentication – no need to manage separate credentials for SQL Server on Linux (

17 What’s available on Linux?
Programming features All major language driver compatibility In-Memory OLTP Columnstore indexes Query Store Compression Always Encrypted Row-Level Security, data masking Auditing Service Broker CLR JSON, XML Third-party tools SQL Server on Linux aims to support the core relational database engine capabilities. In general, our goal is “it’s just SQL Server.” 95% of features just work – anything app or coding related Some features have partial support – e.g. SQL Server Agent isn’t going to launch a windows command prompt Some features are in progress Some features we’ll never support – e.g. FileTable, where you have a win32 share to place files that show up in the engine – the next slide contains more details And while it’s the same SQL Server that you may (or may not!) be used to, we’re putting in a lot of effort to be a good Linux citizen. Callouts: Package-based installs – no “crappy installers” like predicted on Twitter; if SQL is coming to Linux, we’re going to do it right Failover Clustering – resilience against OS/SQL failures; automatic failover within seconds Log Shipping – warm standbys for DR Xplat CLI – sqlcmd lets you connect/query from any OS; bcp lets you bulk copy data; In-Memory – x performance increases by keeping tables in-memory and using natively compiled queries ColumnStore – why SQL Server is the leader in Gartner’s Magic Quadrant for Data Warehousing, holds the top 3 slots in performance benchmark Always Encrypted – protect your most sensitive data even from high-privileged database administrators

18 Features not currently supported on Linux
Database Engine Transactional replication Merge replication Stretch DB PolyBase Distributed query with third-party connections System extended stored procedures (XP_CMDSHELL, etc.) Filetable CLR assemblies with the EXTERNAL_ACCESS or UNSAFE permission set Buffer Pool Extension SQL Server Agent Subsystems: CmdExec, PowerShell, Queue Reader, SSIS, SSAS, SSRS Alerts Log Reader Agent Change Data Capture Managed Backup Services SQL Server Browser SQL Server R Services StreamInsight Analysis Services Reporting Services Data Quality Services Master Data Services High Availability Database Mirroring Security Extensible Key Management NB: This slide is correct as at SQL Server 2017 RC2. The list of unsupported features might change in later releases. For more information, see:

19 SQL Server on Linux investment roadmap
SQL Server Agent transaction replication ​ Machine Learning Services in R & Python PolyBase on Linux HA on Containers and Kubernetes AD authentication for linked servers and AGs Distributed Transactions (DTC)​ 3rd party AD tools like Centrify

20 What Did We Just Cover SQL Internal Components

21 IAM Chains and Allocation Units
SQL Data Hierarchy IAM Chains and Allocation Units Allocation Bit Maps Extents Pages Records

22 What in the Shire Do Hobts Have to Do With My Data?!
Allocation Units are made of 3 types IN_ROW_DATA Also known as HoBTs Stands for Heap or B-Trees LOB_DATA Also known as LOBs Stands for Large Object Data ROW_OVERFLOW_DATA Also known as SLOBs Small Large Object Data Partitions

23 Heaps vs. Tables

24 B-Tree

25 Demo

26 What Did We Just Cover Internal Storage Structures
SQL Internal Components Internal Storage Structures

27 Recovery Models Terms HA – High Availability DR – Disaster Recovery
On Premise Full Bulk Logged Simple Terms HA – High Availability DR – Disaster Recovery SLA – Service Level Agreement RTO – Recovery Time Objective RPO – Recovery Point Objective

28 Recovery Models In the Cloud
Full Recovery with constant Transaction Log Backups Point in time recovery up to any time in backup retention Retention depends on DB activity Default capacity can be expanded, cost is Azure Storage Terms HA – High Availability DR – Disaster Recovery SLA – Service Level Agreement RTO – Recovery Time Objective RPO – Recovery Point Objective

29 Demo

30 What Did We Just Cover Internal Storage Structures Recovery Models
SQL Internal Components Internal Storage Structures Recovery Models

31 Transaction Log

32 Transaction Log In Action In Simple Recovery
Virtual Log File Demo 03

33 Demo

34 Backups Full Transaction Log Differential FileGroup

35 Restores Full Differential Transaction Log Filegroup Piecemeal Page

36 Demo

37 What Did We Just Cover Internal Storage Structures Recovery Models
SQL Internal Components Internal Storage Structures Recovery Models Backup Types

38 Don’t Beat Yourself Up Nobody Knows everything
Nobody can know everything Do your best Never stop learning

39 Additional Terms Query data store Do your best Never stop learning


Download ppt "Introduction to SQL Server Essential Concepts"

Similar presentations


Ads by Google