Presentation is loading. Please wait.

Presentation is loading. Please wait.

Example of a page header

Similar presentations


Presentation on theme: "Example of a page header"— Presentation transcript:

1

2 Example of a page header
SQL Server 2016 Using Temporal Tables for Data Forensics and Auditing Bob Rubocki – Pragmatic Works January 10, 2017

3 SQL Server 2016 – System Versioned Tables
Bob Rubocki Sr. Business Intelligence Consultant linkedin.com/in/robertrubocki bobrubocki.wordpress.com @BobRubocki

4 SQL Server 2016 – System Versioned Tables
Agenda What are Temporal Tables? Why? Configuration Querying (Forensics & Auditing) Management and Data Retention

5 SQL Server 2016 – System Versioned Tables
What are Temporal Tables? Temp tables “System Versioned Tables” Automatically keep history of data changes Record version effective start/end dates ANSI SQL:2011 SQL Server 2016, Azure SQL DB

6 SQL Server 2016 – System Versioned Tables
How Does it Work? From MSDN - Link

7 SQL Server 2016 – System Versioned Tables
Querying System Versioned Tables From MSDN - Link

8 SQL Server 2016 – System Versioned Tables
Use Cases Data change tracking (audit trail) Point-in-time Querying (time travel) Data Warehouse – Slowly Changing Dimensions Application debugging Undoing mistakes

9 SQL Server 2016 – System Versioned Tables
What about Change Data Capture (CDC)? Queries transaction logs Asynchronous – data changes not immediately visible Requires SQL Agent job execution Additional DB objects for querying Harder to query history Shows specifically what changed

10 SQL Server 2016 – System Versioned Tables
What about Change Tracking? Records only whether a row changed Includes DML Operator used (Insert, Update, Delete) No data history

11 SQL Server 2016 – System Versioned Tables
Demo Demo System Versioned Tables

12 SQL Server 2016 – System Versioned Tables
Other Notes Must have a primary key – tie current records to historical History table must reside in same DB as current table History table - No constraints allowed Indexed views not allowed (FOR SYSTEM_TIME is non-deterministic) Triggers – AFTER is OK, INSTEAD OF are not allowed Partitioning - Replication No Merge Replication Snapshot/transaction replication – single subscriber Always On – full support

13


Download ppt "Example of a page header"

Similar presentations


Ads by Google