Sql 2016 - What's New

22
SQL 2016 – WHAT’S NEW? David Cobb sql@davidcobb. net Daveslog.com

Transcript of Sql 2016 - What's New

David CobbSQL Trainer / ConsultantMCT, MCSE Data Platform for SQL 2012

[email protected]

PresenterPast Roles: Tech Support, Network Admin, Web Developer, DBACurrent:Systems Architect for CheckAlt.com

Training SQL Since: 2002

Favorite Techs of the Moment: PowerShell & Azure

WHAT WE’LL (TRY TO) COVER:Database Engine Improvements

ColumnStore Improvements In-Memory OLTP Query StoreTemporal TablesAlways EncryptedStretch DatabaseLive Query StatisticsRow Level SecurityDynamic Data Masking

SLIDES

DEMOS!Whirlwind tour

WHAT WE’LL SKIP

Reporting ImprovementsAnalysis Services Improvements Integration Services Improvements

Looking to CTP3 for more soon…You can find out more at:http://bit.ly/sql2016-whats-new

HOW DO I SQL 2016?

30 Day Azure Trial!

MSDN? You get free Azure to learn and test.

If you can use fill in a web form and use Remote Desktop, you can spin up virtual machines in the cloud and learn without downloading or installing.

Windows 10, Server 10, Visual Studio 2015 previews are also available.

Why not?

COLUMNSTORE IMPROVEMENTS

Whitepaper:http://bit.ly/sql2016-columnstore

Columnstore Index Feature SQL Server 2012

SQL Server 2014

SQL Server 2016 (CTP2)

Azure SQL Database

Batch execution for multi-threaded queries yes yes yes yes

Batch execution for single-threaded queries yes yes

Archival compression option. yes yes yesSnapshot isolation and read-committed snapshot isolation yes yes

Specify columnstore index when creating a table. yes yes

AlwaysOn supports columnstore indexes. yes yes yes yes

AlwaysOn readable secondary supports read-only columnstore indexes.

yes yes yes yes

AlwaysOn readable secondary supports updateable columnstore indexes.

yes

Read-only nonclustered columnstore index on heap or btree. yes yes yes1 yes1

Updateable nonclustered columnstore index on heap or btree

yes yes

Additional btree indexes allowed on a heap or btree that has a columnstore index.

yes yes yes yes

Updateable clustered columnstore index. yes yes yes

Btree index on a clustered columnstore index. yes yes

Columnstore index on a memory-optimized table.

Yes!

Nonclustered columnstore index definition supports using a filtered condition.

yes yes

KEY IMPROVEMENTS FOR IN MEMORY OLTP

• Recommended maximum size for in memory table goes from 256MB->2TB

• Collations besides BIN2 allowed for columns in indexes (advised they don't perform as well)

• ALTER TABLE can be used on memory-optimized tables to add, drop or alter columns, or to add, drop or rebuild indexes.

• ALTER PROCEDURE can be used on natively compiled stored procedures

• Native compiled procedures allows additional syntax (LEFT JOIN, SELECT DISTINCT, UNION, all math functions)

• Better scaling with additional sockets

• AlwaysOn replicas see in-memory data changes undelayed.

• Improved garbage collection

COLUMNSTORE + IN MEMORY OLTP= OPERATIONAL ANALYTICS

In-memory, updateable, non-clustered columnstore index over either disk-based or in-memory tables.

Learn more:Sunil Agarwal on Data Exposed:https://channel9.msdn.com/Shows/Data-Exposed/SQL-Server-2016-Operational-Analytics

Sunil’s Ignite 2015 Presentation:http://channel9.msdn.com/Events/Ignite/2015/BRK4552

QUERY STORE

Demo

Best 2016 Feature?

TEMPORAL TABLES

Demo

Look back in timeat your data

Table Templates

Works along with SQL AUDITfor complete data change history(WHO,WHAT,WHEN)

New Time Travel SQL Syntax!

Source: https://msdn.microsoft.com/en-us/library/dn935015%28v=sql.130%29.aspx

Syntax for Querying Temporal DataSYNTAX FOR QUERYING TEMPORAL DATAExpression Qualifying Rows Description

AS OF<date_time> SysStartTime <= date_time AND SysEndTime > date_time

Returns a table with single record for each row containing the values that were actual (current) at the specified point in time in the past. Internally, a union is performed between the temporal table and its history table and the results are filtered to return the values in the row that was valid at the point in time specified by the <date_time> parameter. The value for a row is deemed valid if thesystem_start_time_column_name value is less than or equal to the <date_time> parameter value and thesystem_end_time_column_name value is greater than the <date_time> parameter value.

FROM<start_date_time>TO<end_date_time>

SysStartTime < end_date_time AND SysEndTime > start_date_time

Returns a table with the values for all record versions that were active within the specified time range, regardless of whether they started being active before the <start_date_time> parameter value for the FROM argument or ceased being active after the<end_date_time> parameter value for the TO argument. Internally, a union is performed between the temporal table and its history table and the results are filtered to return the values for all row versions that were active at any time during the time range specified. Records that became active exactly on the lower boundary defined by the FROM endpoint are included and records that became active exactly on the upper boundary defined by the TO endpoint are not included.

BETWEEN<start_date_time>AND<end_date_time>

SysStartTime <= end_date_time AND SysEndTime > start_date_time

Same as above in the FOR SYSTEM_TIME FROM <start_date_time>TO <end_date_time> description, except the table of rows returned includes rows that became active on the upper boundary defined by the <end_date_time> endpoint.

CONTAINED IN(<start_date_time> , <end_date_time>)

SysStartTime >= start_date_time AND SysEndTime <= end_date_time

Returns a table with the values for all record versions that were opened and closed within the specified time range defined by the two datetime values for the CONTAINED IN argument. Records that became active exactly on the lower boundary or ceased being active exactly on the upper boundary are included.

ALWAYS ENCRYPTED

Demo

Data encypted in flight and at rest

Better than TDE, encrypted for all users, even admins.

Requires .Net 4.6!(As does SSMS 2016)

Source (MSDN Blog): http://bit.ly/sql2016-always-encrypted-walkthru

STRETCH DATABASE

Demo

Interesting solution to where to put that historical data without taking up valuable disk space or prolonging backups.

Queries don’t change, SQL combines local and ‘stretched’ data.

Looking forward to additional controls here.

LIVE QUERY STATISTICS

Demo

Works with debugging!

ROW LEVEL SECURITY

Demo

Already in V12 version of Azure SQL Database

Extremely customizable, granular control over data access on row by row level.

Source: Francesco Cogno Blog http://blogs.msdn.com/b/frcogno/

DYNAMIC DATA MASKING

Demo

Already in V12 version of Azure SQL Database

Effectively protects sensitive data in application layer, not effective for admins or users with SELECT rights.

OTHER STUFF

SELECT * FROM Table FOR JSON AUTO

PolyBase

Managed Backup & Backup to Azure Improvements (Backup to Blob)

Multiple TempDBs upon install

Online ALTER COLUMN

Find out more:http://bit.ly/sql2016-whats-new-db-engine

GUESSES FOR NEXT CTP:

Bug fixes and feature improvements on CTP2

PowerBI functionality for onsite SQL Servers?

R for Data Analysis

Mobile Reporting?

???

RESOURCES

Scott Klein’s Data Exposed series on Channel 9http://channel9.msdn.com/Shows/Data-Exposed

SQL 2016 Home Page (datasheet, whitepapers)http://www.microsoft.com/en-us/server-cloud/products/sql-server-2016/

SQL 2016 – What’s New (Books Online)http://bit.ly/sql2016-whats-new

Slides and link to scripts will be on SQLSaturday site and daveslog.com

QUESTIONS?

SPEAKERS CRAVE [email protected] fill out evals!