SQL Server 2016
SQL Server 2016
&
SQL in Azure Inspire
Agenda
• Nyheder i SQL Server 2016 og SP1
• Performance og scalability
• Security
• High Availability
• Troubleshooting og support
• SQL in Azure
• Stretch Databases
• Backup til Azure
• SQL i Azure
• Spørgsmål og evaluering
Praktisk info
• Timing
• Vi forventer af slutte ca. kl 15:00
• Frokost er kl. 12:00 til 13:00
CUSTOMER
Enterprise-grade
DATACENTER
Global reach, scale, and security to meet
business demands
Hybrid cloud
CONSISTENT
Consistent platform across multiple
PLATFORM environments and clouds
SQL Server
XML ● KPIs 2000
SQL Server
Management Studio ● Mirroring 2005
SQL Server
AlwaysOn ● ColumnStore Index ● Data Quality Services ● Power View ● Cloud Connectivity
2012
In-Memory Across Workloads ● Performance & Scale ● Hybrid Cloud Optimized ● HDInsight ● Cloud BI SQL Server
2014
Enhanced Always On ● In-Memory OLTP ● Stretch DB ● Temporal Tables ● Enhanced Backup to Cloud ● Polybase ● Real- SQL Server
Time Operational Analytics ● Row-Level Security ● Query Store ● R Services● Always Encrypted ● Mobile BI 2016
Do more. Achieve more.
Mission-critical performance
Performance Security Availability Scalability
In-Memory OLTP Always Encrypted Basic Availability Groups Windows Server Support
enhancements Sensitive data remains encrypted With SQL Server 2016 Standard Support of new features in
at all times, with ability to query Edition Windows Server 2016
Greater T-SQL surface area,
terabytes of memory supported, Dynamic Data Masking Enhanced Always On Live migration
and higher number of parallel Real-time obfuscation of data to Distributed Availability Groups, Faster live migration, live
CPUs prevent unauthorized access automatic replica seeding, migration for non-clustered VMs
distributed transactions, automatic
Operational Analytics Row-Level Security failover, load balancing, Scalability enhancements
Insights on operational data; Fine-grained access control for manageability Hardware acceleration for TDE,
works with In-Memory OLTP and table rows parallelized decryption, TempDB
disk-based OLTP Backup enhancements optimization, and more
Other enhancements Managed backup to Azure,
Query Store Audit success/failure of database
Monitored, optimized query plans Database Recovery Advisor
operations
Temporal Tables TDE support for storage of
Query data as points in time and In-Memory OLTP tables
recover from accidental data Enhanced auditing for OLTP with
changes and application errors ability to track history of record
changes
Mission-critical performance
Performance Security Availability Scalability
In-Memory OLTP Always Encrypted Basic Availability Groups Windows Server support
enhancements Sensitive data remains encrypted With SQL 2016 Standard Edition Support for Windows Server Core
at all times, with ability to query and Windows Server ReFS
Greater T-SQL surface area, Enhanced AlwaysOn
terabytes of memory supported, Dynamic Data Masking Distributed availability groups, Live migration
and higher number of parallel Real-time obfuscation of data to automatic replica seeding, Faster live migration, live
CPUs prevent unauthorized access distributed transactions, automatic migration for non-clustered VMs
failover, load balancing,
Operational Analytics Row-Level Security manageability Scalability enhancements
Insights on operational data; Fine-grained access control for Hardware acceleration for TDE,
works with In-Memory OLTP and table rows Backup enhancements parallelized decryption, TempDB
disk-based OLTP Managed backup to Azure, optimization, and more
Other enhancements Database Recovery Advisor
Query Store Audit success/failure of database
Monitored, optimized query plans operations
Temporal Tables TDE support for storage of
Query data as points in time and In-Memory OLTP tables
recover from accidental data Enhanced auditing for OLTP with
changes and application errors ability to track history of record
changes
In-Memory OLTP
enhancements
Performance and Scaling Improvements
The ALTER TABLE syntax is used for making changes to the table schema, as well as for
adding, deleting, and rebuilding indexes
Key advantage is the ability to change the BUCKET_COUNT with an ALTER INDEX
statement
Performance
Altering natively compiled stored procedures
CREATE PROCEDURE [dbo].[usp_1]
WITH NATIVE_COMPILATION, SCHEMABINDING, EXECUTE AS OWNER
You can now perform ALTER
AS BEGIN ATOMIC WITH operations on natively compiled
stored procedures using the
(
TRANSACTION ISOLATION LEVEL = SNAPSHOT, LANGUAGE =
N'us_english'
)
ALTER PROCEDURE statement
SELECT c1, c2 from dbo.T1
END Use sp_recompile to
GO
recompile stored procedures on
ALTER PROCEDURE [dbo].[usp_1]
WITH NATIVE_COMPILATION, SCHEMABINDING, EXECUTE AS OWNER the next execution
AS BEGIN ATOMIC WITH
(
TRANSACTION ISOLATION LEVEL = SNAPSHOT, LANGUAGE =
N'us_english'
)
SELECT c1 from dbo.T1
END
GO
Performance
Transact-SQL
Character columns in index keys can use any SQL Server collation
Performance
Cross-Feature Support
Performance
Support for Transparent Data Encryption (TDE)
Windows Operating System
Level Data Protection In SQL Server 2016, the
DPAPI encrypts the Service Master Key
storage for memory-
optimized tables will be
SQL Server
Created at a time of SQL Server setup
Instance Level Service Master Key
Master Statement:
encrypted as part of enabling
TDE on the database
Database Level Database Encryption Key CREAT MASTER KEY…
Statement:
ALTER DATABSE… SET ENCRYPTION
Performance
Improvements in Management Studio
Performance
Improved scaling
7x
Performance
New Transaction Performance Analysis Overview report
Performance
Summary: In-Memory OLTP enhancements
Capability
ALTER support for memory-optimized tables
Benefits
Improved scaling: In-Memory OLTP engine has been enhanced to scale linearly on servers up to 4 sockets
TDE (Transparent Data Encryption)-enabled: all on-disk data files are now encrypted once TDE is enabled
Performance
Operational Analytics:
disk-based and in-
memory tables
Traditional operational/analytics architecture
High demand;
requires real-time analytics
Performance
Minimizing data latency for analytics
BI analysts
Challenges
Analytics queries are resource intensive and can
cause blocking
Benefits
No data latency
No ETL
Performance
Operational Analytics
The ability to run analytics queries concurrently with operational
workloads using the same schema
Goals:
• Minimal impact on operational workloads with concurrent analytics
• Performance analytics for operational schema
Performance
Operational Analytics with columnstore index
Key points
B-tree index
Create an updateable NCCI for analytics
queries
Performance
Using Availability Groups instead of data warehouses
Always On Availability Group Key points
Mission-critical operational workloads
typically configured for high availability
using Always On Availability Groups
Secondary
replica You can offload analytics to readable
secondary replica
Primary Secondary
replica replica
Secondary
replica
Performance
Operational
Analytics:
In-Memory Tables
Operational Analytics: columnstore on In-Memory Tables
Hash index
No explicit delta row group
Rows (tail) not in columnstore stay in In-Memory OLTP table
nonclustered index
No columnstore index overhead when operating on tail
Performance
Summary of improvements
Improvements SQL Server 2014 SQL Server 2016
clustered Master copy of the data (10x compression) Master copy of the data (10x compression)
Only index supported; simplified analytics
columnstore Additional B-tree indexes for efficient equality, short-range searches, and PK/FK
No PK/FK constraints
index Uniqueness can be enforced through materialized views
constraints
Locking granularity for UPDATE/DELETE at row group level Locking granularity at row level using NCI index path
DDL: ALTER, REBUILD, REORGANIZE DDL: ALTER, REBUILD, REORGANIZE
equality and Row group elimination (when possible) Optimizer can choose NCI on column C1; index points directly to row group
short-range Partition-level scan (somewhat expensive) No full index scan
queries Full index scan (expensive) Covering NCI index
string predicate Retrieve 10 million rows by converting dictionary encoded Apply filter on dictionary entries
value to string Find rows that refer to dictionary entries that qualify (R1)
pushdown
Find rows not eligible for this optimization (R2)
Apply string predicate on 10 million rows Scan returns (R1 + R2) rows
Filter node applies string predicate on (R2)
Row returned by Filter node = (R1 + R2’)
Performance
Support for index maintenance
Operation SQL Server 2014 SQL Server 2016
Removing deleted rows Requires index REBUILD Index REORGANIZE
Remove deleted rows from single compressed RG
Merge one or more compressed RGs with deleted rows
Done ONLINE
Delete Lock at row group level Row-level lock in conjunction with NCI
Update Lock at row group level Row-level lock in conjunction with NCI
Implemented as Delete/Insert
AlwaysON Availability Groups Fully supported except readable secondary Fully supported with readable secondary
Performance
Query Store
Your flight data recorder
for your database
Problems with query performance
Website
Database
is not
Fixing query plan choice regressions is difficult
Is down
working • Query plan cache is not well-suited for performance troubleshooting
Temporary Impossible
Long time to detect the issue (TTD)
perf issues to predict / • Which query is slow? Why is it slow?
root cause
• What was the previous plan?
Performance
The solution: Query Store
Performance
Query Store Architecture
Collects query texts (plus all relevant properties)
Performance
Monitoring performance by using the Query Store
Performance
Temporal Tables
Temporal in DB
Time travel Data audit Automatically tracks history of data changes
Performance
How to start with temporal
ANSI 2011 No change in programming model New Insights
compliant
Performance
Temporal database support: BETWEEN
System (transaction)-time
Application-time
Performance
How does system-time work?
* Include historical
version
Performance
Application-time temporal
CREATE
SELECT
ALTER
UPDATE
(
TABLE
FROM
TABLE Employee
* Employee
Employee
Employee
Limits of system-time
FOR[EmployeeNumber] Time flows ‘forward only’
WHERE
ADD VALID_TIME
CONSTRAINT
PORTION int NOT
CONTAINS NULL,
'2013-06-30'
OF FK_Employee_Department
VALID_TIME
[Name]
FOREIGN nvarchar(100)
FROM '2010-01-01'
KEY (LocationId, NOT NULL,VALID_TIME)
TO '2012-01-01'
PERIOD
[LocationId]
REFERENCES int NOT
Location NULL,
(LocationId, PERIOD VALID_TIME); System-time ≠ business-time
[Position]
SELECT * FROM varchar(50)
Employee NOT NULL,
(sometimes)
SET [Position] = 'CEO'
WHERE[AnnualSalary]
WHEREEmployeeNumberdecimal
EmployeeNumber (10,2) NOT NULL,
= =1 1AND
ValidFrom
VALID_TIME datetime2
OVERLAPS NOT ('2013-06-30',
PERIOD NULL, '2014-01-01') Immutable history, future does not
ValidTo datetime2
DELETE FROM Employee NOT NULL, exist
PERIOD FOR VALID_TIME (ValidFrom,ValidTo),
/*FOR
Temporal
PORTIONjoin */
OF VALID_TIME
SELECT * FROM Employee
FROM '2012-01-01' E
TO '2013-01-01'
CONSTRAINT PK_Employee App-time = new scenarios
JOIN PRIMARY
PositionKEY
D CLUSTERED
ON E.Position = D.Position AND
WHERE EmployeeNumber
(EmployeeNumber,
= 1
VALID_TIME WITHOUT OVERLAPS)
D.VALID_TIME CONTAINS PERIOD E.VALID_TIME Correct past records as new info is
available (HR, CRM, insurance,
)
banking)
Consistency
Project future events (budgeting,
what-if, loan repayment schedule)
Easy time
Temporal
Batch DW loading (with delay)
travel
querying edits
Performance
Temporal data continuum
SQL Database
Performance
In-Memory OLTP and temporal
Internal
data
retention
Performance
Summary: Temporal Tables
Allows customers to securely store sensitive data outside of their trust boundary.
Data remains protected from high-privileged, yet unauthorized, users.
Security
How it works
Help protect data at rest and in motion, on-premises and in the cloud
Encrypted sensitive data and corresponding keys
are never seen in plaintext in SQL Server
Client SQL Server or SQL Database
ciphertext
dbo.Customers
Name SSN Country
trust boundary 0x19ca706fbd9a 0x7ff654ae6d USA
ciphertext
Security
Types of encryption for Always Encrypted
Randomized encryption
Encrypt('123-45-6789') = 0x17cfd50a
Two types of encryption
Repeat: Encrypt('123-45-6789') = 0x9b1fcf32
Allows for transparent retrieval of encrypted
available
data but NO operations Randomized encryption uses a method
More secure that encrypts data in a less predictable
manner
Deterministic encryption
Encrypt('123-45-6789') = 0x85a55d3f Deterministic encryption uses a method
Repeat: Encrypt('123-45-6789') = 0x85a55d3f that always generates the same encrypted
Allows for transparent retrieval of encrypted value for any given plaintext value
data AND equality comparison
E.g. in WHERE clauses and joins, distinct,
group by
Security
Example
Client (trusted) CMK store SQL Server (untrusted)
using (SqlCommand cmd = new SqlCommand( exec sp_describe_parameter_encryption
"SELECT Name FROM Customers WHERE SSN = @params = N'@SSN VARCHAR(11)'
, @tsql = N'SELECT * FROM Customers WHERE SSN = @SSN'
Encryption metadata
@SSN“
, conn))
{ Encryption CMK Store
cmd.Parameters.Add(new SqlParameter( Plaintext Type/ Encrypted Provider
Param Algorithm CEK Value Name CMK Path
"@SSN", SqlDbType.VarChar, 11).Value =
"111-22-3333");
CEK
SqlDataReader reader = Cache @SSN DET/ AES CERTIFICATE_ Current User/
cmd.ExecuteReader(); 256 STORE My/f2260…
EXEC sp_execute_sql
N'SELECT * FROM Customers WHERE SSN = @SSN'
, @params = N'@SSN VARCHAR(11)', @SSN=0x7ff654ae6d
Encryption metadata
Result set (plaintext) Encryption CMK Store
Name
Enhanced Type/ Encrypted Provider
Jim Gray
ADO.NET Param Algorithm CEK Value Name CMK Path
Security
Summary: Always Encrypted
Protect data at rest and in motion, on-premises and in the cloud
Security
Dynamic Data Masking
SQL Server 2016
SQL Database
Dynamic Data Masking Table.CreditCardNo
4465-6571-7868-5796
Security
Benefits of Dynamic Data Masking
Limit access to sensitive data by defining policies to obfuscate specific database fields, without
affecting database integrity
Security
Dynamic data masking walkthrough
1) Security officer defines dynamic data masking policy in T-SQL over sensitive data in Employee table
2) Application user selects from Employee table
3) Dynamic data masking policy obfuscates the sensitive data in the query results
SELECT [Name],
[SocialSecurityNumber],
[Email],
[Salary]
FROM [Employee]
Security
Summary: Dynamic Data Masking
Capability
Protects against unauthorized disclosure of sensitive data in application
Benefits
Enables setup of policies at table and column level that provide multiple masking functions
Allows certain privileged logins to see data unmasked
Security
Row-Level Security
SQL Server 2016
SQL Database
The need for Row-Level Security
Protect data privacy by ensuring
appropriate access across rows
Fine-grained access control over specific rows in Customer 1
database table Customer 2
Security
Benefits of Row-Level Security
Store data intended for many consumers in a single database/table while also restricting
row-level read-and-write access based on user execution context
Security
Common RLS use cases
Traditional RLS workloads
Custom business logic to determine which rows each user can SELECT, INSERT, UPDATE, and
DELETE based on role, department, and security level
Multi-tenant databases
Ensuring tenants can access only their own rows of data in a shared database, with
enforcement logic in database rather than app tier
For example: Multi-tenant shards with elastic database tools in SQL Database
Security
RLS in three steps
Two
Three
One
Security
App
Policyuser
Policy
(e.g., transparently
manager nurse)
createsselects rewrites
from
a filter Patients
query
predicate andtable
tosecurity
apply filter predicate
policy
Nurse
Database Policy Manager
Security Filter
Predicate:
Policy INNER
JOIN…
Security
Summary: Row-Level Security
Capability
Row-Level Security provides fine-grained access control
over rows in a table based on conditions you set up
Benefits
Store data for many users in same databases and tables
while limiting access by other users who share same tables
Security
Security enhancements
Audit filtering: Provides greater flexibility to filter wanted events in audit log
Audit resilience: Audit logging is now tolerant to loss of connectivity to target directory and will
recover automatically once network connection is re-established
Security
Transparent Data Encryption (TDE)
Security
Transparent Data Encryption (TDE)
Security
Summary: Security
Availability
AlwaysOn
Failover Cluster Instances Availability Groups
for servers for groups of databases
Availability
Failover Cluster Instances
Availability
Availability Groups
Availability
Group Listener
Multi-database failover
SQL Server 2016 SQL Server 2016
Availability
Availability Groups + Failover Clustering
Windows Server Failover Clustering (WSFC) Cluster
Node
Network Subnet
Node Node
Network Subnet
Node Node
AlwaysOn:
WSFC WSFC WSFC WSFC WSFC
Availability
Basic Availability
Groups
Basic Availability Groups
Availability
Enhancements in
Always On
Availability Groups
Improvements in Always On Availability Groups
Greater scalability
Unified HA solution
Load-balancing readable secondaries
Increased number of automatic failover targets
Log transport performance
AG_Listener
AG Improved manageability
Hong Kong DTC support with limitations
Asynchronous data (Secondary)
movement
Database-level health monitoring
AG Group Managed Service Account
AG
New Jersey Domain-independent Availability Groups
Synchronous data (Secondary)
New York movement
(Primary)
Availability
Load balancing in readable secondaries
Availability
Database-level failover trigger
Availability
Cross-Database Transactions and Distributed Transactions
Support for cross-database transactions within the same SQL
Server Instance
Cross-database transactions within the same SQL Server instance are not supported for Always
On Availability Groups
Availability
Domain-independent Availability Groups
Environments supported:
Cross domains (with trust)
Cross domains (no trust)
No domain at all
Availability
Summary: Enhanced Always On
Capability
For scalability, SQL Server 2016 adds in load balancing of readable secondaries
Increases number of auto-failover targets from two to three
Benefits
Log transport performance has been improved
Support for Distributed Transaction Coordinator (DTC): Enrolled transactions for
Availability Group databases with limitations
Database-level health monitoring
gMSA: Domain-level accounts that are automatically managed
Availability
Backup
enhancements
Database Recovery Advisor
Availability
Backup to Azure block blobs
Availability
Managed Backup
Support for databases in full, bulk logged, and simple recovery model
Availability
Backups and Stretch Databases
Unparalleled security
Fine-grained security controls
12 TB of memory WS 2016 max Built-in anti-malware
cores
Scalability
Support for Windows Server Core
Scalability
Microsoft Storage Spaces Direct
Hyper-V cluster with local storage
Scalability
Domain-independent Availability Groups
Scalability
Live migration
Scalability
Clustering enhancements
Cluster-aware updating
Applies updates automatically to host operating system—or to other system components in
a clustered SQL Server environment—while maintaining availability
Increases SQL Server availability during update process in both virtualized and non-
virtualized environments
Dynamic Quorum
Enables AlwaysOn cluster to dynamically adjust number of required quorum votes
Increases availability of cluster in failover scenarios with ability to recalculate quorum as
needed and still maintain working cluster
Scalability
SQL Server
scalability
enhancements
Encryption enhancements
Parallelizable decryption
Decryption now supported as parallelizable (used to be sequential only)
Dramatically improved response times for queries with encrypted data columns
Scalability
Distributed Replay
Scalability
TempDB optimization
Scalability
Core engine scalability
Eliminates need for trace flag, but also dynamically determines partition based on contention
Scalability
Summary: Scalability
Windows Server
12 TB RAM, WS2016 max cores
Server Core supported
Storage Spaces Direct
Domain-independent Availability Groups
Improved live migration
Enhanced scalability
Hardware acceleration for TDE
Distributed Replay
TempDB optimization
Scalability
Want high
performance ?
=> Upgrade !!!
“It Just Works Faster”
– Performance Improvements “under the hood” in
SQL Server 2016 Database Core Engine
Driving Issues
Increase in Larger
High Speed High Speed Data
CPUs per Memory
I/O Network Explosion
Node Footprints
Highlights
DBCC Spatial
TEMPDB
SOS_RWLock
Delay Start MSDTC
Parallel Recovery
Core improvements apply to all SKUs. Some features are SKU specific.
DBCC Scales 7x
Old: MultiObjectScanner
New: CheckScanner
https://blogs.msdn.microsoft.com/psssql/2016/02/25/sql-2016-it-just-runs-faster-dbcc-scales-7x-better
https://blogs.msdn.microsoft.com/psssql/2016/03/01/sql-2016-it-just-runs-faster-dbcc-extended-checks
TEMPDB
-T1117 Default
-T1118 Default
Multiple Files
https://blogs.msdn.microsoft.com/psssql/2016/03/15/sql-2016-it-just-runs-faster-t1117-and-t1118-changes-for-tempdb-and-user-databases
https://blogs.msdn.microsoft.com/psssql/2016/03/17/sql-2016-it-just-runs-faster-automatic-tempdb-configuration
Auto-soft NUMA Batch Requests / Sec
Scheduling
Partitioning
Logical vs Physical
https://blogs.msdn.microsoft.com/psssql/2016/03/30/sql-2016-it-just-runs-faster-automatic-soft-numa
Deficit Scheduling
Quantum Tracked
https://blogs.msdn.microsoft.com/psssql/2016/04/01/sql-2016-it-just-runs-faster-updated-scheduling-algorithms
Dynamic Memory Object Partitioning
Replaces –T8048
+250% batch/sec
Dynamic
Instance Wide
To Node ~0 waits
To CPU
https://blogs.msdn.microsoft.com/psssql/2016/04/06/sql-2016-it-just-runs-faster-dynamic-memory-object-cmemthread-partitioning
Indirect Checkpoint
Per Database
Database Default
https://blogs.msdn.microsoft.com/psssql/2016/04/12/sql-2016-it-just-runs-faster-indirect-checkpoint-default
Multiple Log Writers
4 Maximum
Multiple Nodes
Share Responsibility
CPU Bound
https://blogs.msdn.microsoft.com/psssql/2016/04/19/sql-2016-it-just-runs-faster-multiple-log-writer-workers
Spatial (2000x)
Geometry Geography TVP Before the Fix: 8000 rows/sec
Filter Filter TVP After the Fix: 120,000 rows/sec
MakeValid MakeValid
https://blogs.msdn.microsoft.com/psssql/2016/03/03/sql-2016-it-just-runs-faster-native-spatial-implementations
https://blogs.msdn.microsoft.com/psssql/2016/03/08/sql-2016-it-just-runs-faster-tvps-with-spatial-columns
https://blogs.msdn.microsoft.com/psssql/2016/03/10/sql-2016-it-just-runs-faster-spatial-index-builds-faster
Vector Instructions
Used by ->
- Column Store
- Bulk Insert
https://blogs.msdn.microsoft.com/psssql/2016/04/22/sql-2016-it-just-runs-faster-column-store-uses-vector-instructions-sseavx
https://blogs.msdn.microsoft.com/psssql/2016/04/27/sql-2016-it-just-runs-faster-bulk-insert-uses-vector-instructions-sseavx
Always On
Throughput MB/s Average CPU utilization (secondary) MB sent on wire/sec
Parallel Compression
Improved Compression
10x Faster
Reduced CPU
SSMS Improvement
Ports
SQL 2012 - https://support.microsoft.com/en-us/kb/3112710
SQL 2014 - https://support.microsoft.com/en-us/kb/3075950
Future Considerations
Backup/Restore Compression
… and MORE
Hyperscale cloud
Hybrid solutions
Stretch SQL Server into Azure
Securely stretch cold tables to Azure with remote query processing
Capability
Stretch large operational tables
from on-premises to Azure with
the ability to query
Azure Benefits
SQL
SERVER
2016
Hybrid solutions
Stretch Database architecture
How it works
Internet boundary
Creates a secure linked server definition
in the on-premises SQL Server
Hybrid solutions
Typical workflow to enable Stretch Database
-- Enable local server
High-level steps
EXEC sp_configure 'remote data archive' , '1'; Configure local server for remote data
RECONFIGURE; archive
-- Provide administrator credential to connect to Create a credential with administrator
-- Azure SQL Database permission
CREATE CREDENTIAL <server_address> WITH
IDENTITY = <administrator_user_name>, Alter specific database for remote data
SECRET = <administrator_password> archive
-- Alter database for remote data archive Create a filter predicate (optional) to
ALTER DATABASE <database name> select rows to migrate
SET REMOTE_DATA_ARCHIVE = ON (SERVER = server name);
GO Alter table to enable Stretch for a table
-- Alter table for remote data archive Stretch Wizard in SQL Server
ALTER TABLE <table name> Management Studio makes all this
ENABLE REMOTE_DATA_ARCHIVE easy (does not currently support
WITH ( MIGRATION_STATE = ON ); creating filter predicates)
GO;
Hybrid solutions
Queries continue working
Hybrid solutions
Advanced security features supported
Hybrid solutions
Backup and restore benefits
Hybrid solutions
Current limitations that block stretching a table
• Tables with more than 1,023 columns or more than 998 indexes cannot be
stretched
• FileTables or FILESTREAM data not supported
• Replicated tables, Memory-optimized tables
• CLR data types (including geometry, geography, hierarchyid and CLR user-
defined types)
• Column types (COLUMN_SET, Computed columns)
• Constraints (Default and check constraints)
• Foreign key constraints that reference the table in a parent-child relationship.
You can stretch the child table (for example Order_Detail)
• Full text indexes
• XML indexes
• Spatial indexes
• Indexed views that reference the table
Microsoft
Azure
Order
Order history
history Stretch to cloud
Name SSN Date
Name
Jane Doe SSN Date
cm61ba906fd 2/28/2005
Jim Gray
Jane Doe
Customer data
cm61ba906fd
ox7ff654ae6d 2/28/2005
3/18/2005 Query
John Smith
Jim Gray i2y36cg776rg
ox7ff654ae6d 4/10/2005
3/18/2005
Product data
Bill Brown nx290pldo90l 4/27/2005
John Smith i2y36cg776rg 4/10/2005
Sue Daniels
Bill
SarahBrown
Jones
✓
ypo85ba616rj 5/12/2005
Order History
nx290pldo90l 4/27/2005
bns51ra806fd 5/22/2005 App
Jake Marks mci12hh906fj 6/07/2005
Eric Mears utb76b916gi 6/18/2014
Rachel Hogan px61hi9306fj 7/1/2014
Sam Johnson ol43bi506gd 7/12/2014
Hybrid
Davidsolutions
Simon tx83hal916fi 7/29/2014
High availability
Enhanced Always On Availability Groups
Greater scalability
Unified HA solution Load-balancing readable secondaries
Increased number of automatic failover targets
Log transport performance
AG_Listener
AG
Improved manageability
Hong Kong DTC support with limitations (see Mission Critical
Asynchronous data (Secondary) section for details)
movement
Database-level health monitoring
AG
Group Managed Service Account
AG
New Jersey
Synchronous data (Secondary) Domain Independent Availability Groups
New York movement
(Primary)
Domain Independent Availability Groups
Environments supported:
Cross domains (with trust)
Cross domains (no trust)
No domain at all
Simplicity
Simplified Add Azure Replica Wizard
Simplicity
Enhanced
backup
Enhanced backup to Azure
Managed backup Backup to Azure block blobs Azure Storage snapshot backup
Granular control of the backup Cost savings on storage Fastest method for creating
schedule backups and running restores
Significantly improved restore
Local staging support for faster performance SQL Server database files on Azure
recovery and resiliency to transient Blob Storage
More granular control over Azure
network issues
Storage
Support for system databases
Support for simple recovery mode
Hybrid solutions
Managed backup
144
Hybrid solutions
Customized scheduling
Step1: Run the Scheduling SP to configure custom scheduling
EXEC Managed_Backup.sp_backup_config_schedule
@database_name = 'testDB'
,@scheduling_option= 'Custom'
,@full_backup_freq_type = 'weekly’
,@days_of_week = 'Saturday'
,@backup_begin_time = '11:00'
,@backup_duration = '02:00'
,@log_backup_freq = '00:05'
EXEC msdb.managed_backup.sp_backup_config_basic
@database_name= 'testDB',
@enable_backup=1,
@container_url='https://storage account name.blob.core.windows.net/container name',
@retention_days=30
Hybrid solutions
Backup to Azure block blobs
2x cheaper storage
Backup striping and faster restore
Maximum backup size is 12 TB+
Granular access and unified credential story (SAS URIs)
Support for all existing backup/restore features (except append)
Hybrid solutions
Backup to Azure with file snapshots
MDF MDF
Database BAK
LDF LDF
Instance
Hybrid solutions
Backup to Azure with file snapshots
Hybrid solutions
Hyperscale cloud
On-premises
Microsoft Azure
Simplicity
Migration methodologies
Method 1 Method 2 Method 3
SQL Server SQL Server
SQL Server
Visual
1. Import Studio
Source
Source Source database
DB
DB DB project
1. Export 4. Copy
1. 2. Transform
Generate 5. Publish
SSMS OR 1. Deploy SQL Azure SQL Azure
SSMS Copy
Migration T-SQL *.sql Migration
.bacpac DB
Wizard Wizard
2. Import 2. Execute
3. Edit, build
6. Export/
and test
import
Target or deploy 4. Publish (schema only)
Target Target
DB DB DB
Migrate a compatible database Migrate a near-compatible Update database schema offline using
using SSMS database using SAMW Visual Studio and SAMW, and then
deploy it with SSMS
Simplicity
Migration Cookbook
Migrate an on-premises SQL Server database
to SQL Database (v12)
Download: http://aka.ms/azuresqlmigration
Simplicity
Suite of advisors
for upgrading
Upgrade workflow today
Discover
Upgrade is a complicated process with many considerations
Review Plan
Implement
Simplicity
Suite of advisors
Modern, scenario-driven user
experience
Suite of advisors
Designed to move to a
community project
Auto-update notifications
Simplicity
Upgrade Advisor Analysis Wizard
Simplicity
Advisor for upgrade issues and recommendations
Analyzes instance for potential upgrade issues:
Pre-upgrade issues
Pre-upgrade recommendations
Post-upgrade considerations
Download: https://www.microsoft.com/enus/download/details.aspx?id=48119
Simplicity
Guidance and customer feedback
New engine for defining
guidance rules
Self-contained HTML results as well as CSV
Customer feedback
Modern telemetry pipeline
Built-in feedback feature
Simplicity
Hyperscale cloud
Consistent and
integrated platform
Virtualization
Common identity
Consistency
Consistent tools
Consistency across:
On-premises, private cloud, public cloud
Consistency
SQL Server, Azure VMs, SQL Database
On-premises
Hybrid cloud Options:
Shared
SQL Server on physical machines
lower cost Platform as Software as
a service a service
SQL Server in on-premises VMs
(private cloud)
Infrastructure SQL
SQL Database
as a service Virtualized databases
SQL Server in Azure VMs
SQL Server in Azure VM (public cloud)
Virtual SQL Virtualized machines
SQL Server
Dedicated Physical machines (raw iron)
SQL
higher cost
Off-premises
Consistency
SQL Server 2016 SP1 – Nye features
SQL Server 2016 SP1 – Nye features
Standard Edition og Memory med SP1
[email protected] +45 70 27 70 22
www.it-Craft.dk
www.linkedin.com/company/itcraftdk
www.facebook.com/itCraftDK
twitter.com/itCraftDK