* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Powerpoint
Survey
Document related concepts
Transcript
SQL Server 2016
What Microsoft Say…
“SQL Server 2016 is the biggest leap forward in Microsoft data platform
history with features that increase performance, simplify management, and
transform your data into actionable insights—all on a database that has the
least vulnerabilities of any major platform.”
“The world’s fastest and most price-performant database for HTAP (Hybrid
Transactional and Analytical Processing) with updateable, in-memory
columnstores and advanced analytics through deep integration with R
Services.”
“Customers can gain tremendous performance improvement by simply
upgrading to SQL Server 2016 without application changes (e.g. queries will
run up to 34x faster). In addition to leading performance benchmarks, SQL
Server 2016 also delivers top price/performance for both workloads.”
1 | 27/08/2016
David Postlethwaite
SQL Server 2016 New Features
David Postlethwaite
27/08/2016
David Postlethwaite
Say thank you to our Sponsors :
3 | 27/08/2016
David Postlethwaite
About Me
David Postlethwaite
Liverpool Victoria LV=
SQL and Oracle DBA
MCSE 2012 Data Platform
MCITP 2008, 2005
Oracle OCA
25 years IT Experience
7 years as DBA
david@clunyweb.co.uk
https://www.linkedin.com/in/davidpostlethwaite
Blog: gethynellis.com
4 | 27/08/2016
David Postlethwaite
SQL Server 2016
What Microsoft Say…
“SQL Server 2016 is the biggest leap forward in Microsoft data platform
history with features that increase performance, simplify management, and
transform your data into actionable insights—all on a database that has the
least vulnerabilities of any major platform.”
“The world’s fastest and most price-performant database for HTAP (Hybrid
Transactional and Analytical Processing) with updateable, in-memory
columnstores and advanced analytics through deep integration with R
Services.
"Customers can gain tremendous performance improvement by simply
upgrading to SQL Server 2016 without application changes (e.g. queries will
run up to 34x faster). In addition to leading performance benchmarks, SQL
Server 2016 also delivers top price/performance for both workloads.“
5 | 27/08/2016
David Postlethwaite
Specifications 13.0.xxxx
Feature
Enterprise
Standard
Express
Express with Advanced
Services
Developer
CPU DBMS
OS Maximum
Limited to lesser of 4 Limited to lesser of 1 Limited to lesser of 1 socket
OS Maximum
sockets or 24 cores socket or 4 cores
or 4 cores
CPU SSAS
OS Maximum
Limited to lesser of 4 Limited to lesser of 1 Limited to lesser of 1 socket
OS Maximum
sockets or 24 cores socket or 4 cores
or 4 cores
Memory DBMS
OS Maximum
(4TB)
128 GB
1 GB
1 GB
OS Maximum
Memory SSAS
OS Maximum
Tabular: 16 GB
MOLAP: 64 GB
N/A
N/A
OS Maximum
Memory SSRS
OS Maximum
64 GB
N/A
4 GB
OS Maximum
Maximum DB Size
524 PB
524 PB
10 GB
10 GB
524 PB
SQL Server 2016 Developer Edition free download at Visual Studio Dev Essentials
https://myprodscussu1.app.vssubscriptions.visualstudio.com/downloads?pid=2057
SSMS
supports 2008 and above
.
SQL Server 2016 for Linux will be available in the middle of 2017
6 | 27/08/2016
David Postlethwaite
Discontinued & Deprecated Features
64 bit Only – SSMS still 32 bit
Compatibility level 90 (2005) is discontinued
Deprecated – Due to be removed “soon”
Data types: text, ntext, image
sp_attach_db, sp_adduser and many other similar “sp_” procs
Mirroring – Now use “Always On Availability Groups”
BACKUP … TO TAPE
SQL Trace stored procedures, functions, and catalog views
Get into habit of ending lines with a semi colon “;”
https://msdn.microsoft.com/en-us/library/ms144262.aspx
https://msdn.microsoft.com/en-us/library/ms143729.aspx
7 | 27/08/2016
David Postlethwaite
Installation Changes
SSMS is now separate (web only) installation
https://msdn.microsoft.com/en-us/library/mt238290.aspx
8 | 27/08/2016
David Postlethwaite
Installation Improvements
Perform Volume Maintenance Tasks
Instant File Initialization
https://msdn.microsoft.com/en-us/library/ms175935.aspx
9 | 27/08/2016
David Postlethwaite
Installation Improvements
Data Folders
10 | 27/08/2016
David Postlethwaite
Installation Improvements
Multiple TempDB Database Files
11 | 27/08/2016
David Postlethwaite
Tempdb Contention and File Growth
Trace Flags 1117 and 1118 Enabled
1118 avoids contention in tempdb
1117 stops uneven file growth
1117 Good for TempDB
But not always wanted for User Databases
12 | 27/08/2016
David Postlethwaite
Dynamic Data Masking
Enterprise and Standard
Mask production data in UAT without running obfuscation scripts
CREATE TABLE [Sales].[CustomerPII](
[CustomerID] [int] NOT NULL,
[FirstName] [dbo].[Name] NOT NULL,
[PhoneNumber] [nvarchar](25) MASKED WITH (FUNCTION = 'default()') NULL,
[EmailAddress] [nvarchar](50) MASKED WITH (FUNCTION = 'email()') NULL,
[LastName] [dbo].[Name] MASKED WITH (FUNCTION='partial(2,"XXXX",2)') NOT NULL
) ON [PRIMARY]
GRANT UNMASK TO SalesPersons
13 | 27/08/2016
David Postlethwaite
Row Level Security
Enterprise and Standard
Control access to rows in a table based on the characteristics of the
user (e.g. group membership or execution context).
The access restriction logic is located in the database rather than
application.
The database applies the access restrictions every time that data is
viewed or updated. From anywhere.
Makes security more reliable and robust by reducing the surface
area of your security system.
ALTER SECURITY POLICY Security.customerPolicy
ALTER FILTER PREDICATE Security.customerAccess(TerritoryID) ON Sales.CustomerPII,
ALTER BLOCK PREDICATE Security.customerAccess(TerritoryID) ON Sales.CustomerPII
14 | 27/08/2016
David Postlethwaite
Always Encrypted
Enterprise Only
Encrypt columns using a certificate
CREATE TABLE [Sales].[CustomerPII](
[CreditCardNumber] [nvarchar](25) COLLATE Latin1_General_BIN2 ENCRYPTED WITH
(COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM =
'AEAD_AES_256_CBC_HMAC_SHA_256') NULL,
) ON [PRIMARY]
Unencrypted values can only be seen from computer with the certificate installed
Need extra parameter in connection string column encryption setting=enabled
Currently Only Supported with ADO.NET 4.6 and ODBC 13.1
Must use a parametrised query to update the data
15 | 27/08/2016
Temporal Tables
Enterprise and Standard
System-versioned Tables
Allow SQL to automatically keep history of the data in a table
Typical uses
Audit. With temporal tables you can find out what values a specific entity has had over its
entire lifetime.
Slowly changing dimensions. A system-versioned table exactly behaves like a dimension
with type 2 changing behavior for all of its columns.
Repair record-level corruptions. Think of it as a sort of back-up mechanism on a single
table. Accidentally deleted a record? Retrieve it from the history table and insert it back into
the main table.
WITH (SYSTEM_VERSIONING = ON (HISTORY_TABLE = [Person].[Person_History]));
Requires two extra columns for start and end date of the row
Not a replacement for Change Data Capture
16 | 27/08/2016
David Postlethwaite
Stretch Database
Enterprise and Standard
Take advantage of “cheap” Azure storage
Split a table in two
Place “old” data in a database in Azure
Leave current data “on premises”
Query knows if data is in current table or archive table and returns
merged results seamlessly
SQL will move data to Azure when it becomes “old”
Lots of limitations
Not as cheap as it looks (minimum of €700/month)
17 | 27/08/2016
David Postlethwaite
Query Store
Enterprise and Standard
Historical Query Plans
Collects Information on Query Plans for a database over Time
Search for problematic or regressed queries
Set FORCE PLAN policies to force a query to use an old better execution plan
Identify expensive queries by CPU, memory I/O etc.
18 | 27/08/2016
David Postlethwaite
Live Query Statistics
Enterprise and Standard
Watch Query Stats run in real time
See Complex queries being made
19 | 27/08/2016
David Postlethwaite
SSMS Plan Comparison Tool Enterprise and Standard
Save execution plans to disk
Then compare current plan to a saved file
20 | 27/08/2016
David Postlethwaite
T-SQL Enhancements
Enterprise and Standard
Drop If Exists
Old Way
IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Table1]') AND [type]
IN (N'U'))
DROP TABLE [dbo].[Table1];
AGGREGATE
SCHEMA USER
PROCEDURE
DEFAULT
DROP TABLE IF EXISTS [Person].[CountryRegion];
DROP TRIGGER IF EXISTS trg_PersonAddress;
TABLE
SECURITY POLICY
ASSEMBLY
VIEW
ALTER TABLE t1 DROP CONSTRAINT IF EXISTS t1_column1_pk;
ALTER TABLE t1 DROP COLUMN IF EXISTS ID;
ROLE
FUNCTION
TRIGGER
SEQUENCE
VIEW
INDEX
RULE
TYPE
DATABASE
SYNONYM
New Way
NO “CREATE or REPLACE” function… yet
21 | 27/08/2016
David Postlethwaite
T-SQL Enhancements
Enterprise and Standard
TRUNCATE TABLE with PARTITION
TRUNCATE TABLE dbo.myTable WITH (PARTITIONS (1,5 TO 8));
22 | 27/08/2016
David Postlethwaite
T-SQL Enhancements
Online DDL changes
ALTER TABLE dbo.Table1
ALTER COLUMN x VARCHAR(255) NOT NULL
WITH (ONLINE = ON);
23 | 27/08/2016
David Postlethwaite
Enterprise Only
T-SQL Enhancements
Enterprise and Standard
Changes to CHECKDB
Improvements to make it faster
Check Scanner uses lock free design
Extended Logical Checks Removed from default
MAXDOP option
24 | 27/08/2016
David Postlethwaite
T-SQL Enhancements
Enterprise and Standard
Compress and DeCompress
Gzip compression
INSERT INTO Table1 (name,info) VALUES ('David',COMPRESS('SQL Server 2016 is
here'));
SELECT name, CAST(DECOMPRESS(info) AS VARCHAR(MAX)) 'DECOMPRESSED-Value'
FROM Table1;
GO
Reduce table size
Reduce bandwidth between database and application
Not the same as Page and Row Compression
25 | 27/08/2016
David Postlethwaite
Column Store Index
Enterprise Only
Introduced in SQL 2012
Major Improvements in SQL 2016
A clustered columnstore index can have one or more
nonclustered (B-tree) indexes
In-memory tables can have columnstore index
Support for primary keys and foreign keys
compression delay option
Microsoft claim…
100x query performance on large data tables
10x data compression
27 | 27/08/2016
David Postlethwaite
Hekaton (In Memory OLTP)
Enterprise Only
Introduced with SQL Server 2014
Gives in-memory tables
No Locking / blocking in the table
SQL 2016 Improvements
Maximum size from 250MB to 2GB
FileStream data
Transparent Data Encryption (TDE)
Foreign Keys
Check Constraints
Up to 100x faster than traditional tables
Combine with Column Store index for supercharged performance
Requires lots of Memory !
WITH ( MEMORY_OPTIMIZED = ON , DURABILITY = SCHEMA_AND_DATA )
28 | 27/08/2016
David Postlethwaite
PolyBase
PolyBase compute node
PolyBase head node
29 | 27/08/2016
David Postlethwaite
Enterprise and Standard*
Standard and Enterprise
Enterprise Only
R
Enterprise and Standard*
Primary analysis language for the majority of data scientists and
statisticians
R now integrated into SQL Server
Basic R integration
Advanced R Integration
R Server
30 | 27/08/2016
David Postlethwaite
All Editions
Enterprise Only
Enterprise Only
JSON Support
DECLARE @json NVARCHAR(4000)
SET @json =
N'{
"info":{
"type":1,
"address":{
"town":"Bristol",
"county":"Avon",
"country":"England"
},
"tags":["Sport", "Water polo"]
},
"type":"Basic"
}'
-- Using JSON_VALUE
SELECT
JSON_VALUE(@json,
JSON_VALUE(@json,
JSON_VALUE(@json,
JSON_VALUE(@json,
31 | 27/08/2016
function
'$.type') a,
'$.info.type') b,
'$.info.address.town') c,
'$.info.tags[0]') d
David Postlethwaite
Enterprise and Standard
Time for a Demo
32 | 27/08/2016
David Postlethwaite
Feature Comparison
What’s in only in Enterprise or Standard
https://msdn.microsoft.com/en-us/library/cc645993.aspx
33 | 27/08/2016
David Postlethwaite
Example Databases and Scripts
AdventureWorks 2016 CTP3
https://www.microsoft.com/en-us/download/details.aspx?id=49502
Wide World Importers
https://www.mssqltips.com/sqlservertip/4391/installing-new-sqlserver-sample-databases-wideworldimporters/
34 | 27/08/2016
David Postlethwaite
Any Questions
Conclusion
Hopefully this has given you a head start when you start looking at
SQL Server 2016
Q&A
david@clunyweb.co.uk
Blog: gethynellis.com
Watch again on YouTube
http://tinyurl.com/postledm
35 | 18/06/2016
David Postlethwaite
Say thank you to our Sponsors :
36 | 27/08/2016
David Postlethwaite
Don’t miss
Evaluations
The Raffle
27/08/2016
David Postlethwaite