Adam Machanic Database Consultant SQLblog SESSION CODE: DAT318
Independent SQL Server and.NET Consultant Boston, MA Conference and INETA Speaker Connections, PASS, TechEd, DevTeach, etc. Author SQL Server 2008 Internals Expert SQL Server 2005 Development Co-Founder: SQLblog.com The SQL Server Blog Spot on the Web
Change Detection: A Primer and Prehistory Change Tracking: Which Rows Changed? Change Data Capture: What Changed? SQL Audit: Who Made a Change? (or: Who Read My Data?)
Change Detection: A Primer and Prehistory Change Tracking: Which Rows Changed? Change Data Capture: What Changed? SQL Audit: Who Made a Change? (or: Who Read My Data?)
T0: Txn 1 Starts Time (T) T1: Txn 2 Starts T1: Txn 2 Ends T3: App Requests Changes T4: Txn 1 Ends
Change Detection: A Primer and Prehistory Change Tracking: Which Rows Changed? Change Data Capture: What Changed? SQL Audit: Who Made a Change? (or: Who Read My Data?)
Database Commit Table xact_id – transaction identifier commit_ts – the external version # Change Table xact_id xact_sequence xact _operation (I,U,D) Base Table PK cols Base Table xact_id – what transaction last modified the row? (hidden column) 1: Transaction Starts xact_id generated 2: Rows Modified xact_id used in base and change table 3: Transaction Committed commit_ts generated
SNAPSHOT Transaction ? Is MIN_VALID_VERSION > [version from the last collection] … or … Does [version from the last collection] == 0 Call CHANGETABLE in VERSION mode Get the initial snapshot Call CHANGETABLE in CHANGES mode Get changes since the last collection Collect CHANGE_TRACKING_CURRENT_VERSION Store for the next iteration YES NO
Change Detection: A Primer and Prehistory Change Tracking: Which Rows Changed? Change Data Capture: What Changed? SQL Audit: Who Made a Change? (or: Who Read My Data?)
Step 1: Rows Modified, Transaction Committed Step 2: Sometime later… Log Reader kicks in, reads the changes from the log Step 3: Change information written to table in CDC schema
Change Detection: A Primer and Prehistory Change Tracking: Which Rows Changed? Change Data Capture: What Changed? SQL Audit: Who Made a Change? (or: Who Read My Data?)
Advanced tracing infrastructure—new in SQL Server 2008 SQL Audit is built on top of XEvent Similar scope to SQL Trace, but much bigger surface area Designed from the ground up for performance and scalability
Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub.
Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31 st You can also register at the North America 2011 kiosk located at registration Join us in Atlanta next year