"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
Temporal And Other DB2 10 For Z Os Highlights
1. Temporal Data and other
DB2 10 for z/OS Highlights
The Information Management Specialists
2. Topics
• Introduction
• DB2 10 for z/OS Overview
• Temporal Data Support
• Further Reading
• Summary
The Information Management Specialists
3. Introduction
• Director and Principal Consultant at Triton Consulting
• 23 years DB2 experience, 18 as a consultant working with
customers in UK, Europe and the US
• IBM Gold Consultant since 1999
• IBM Information Champion
• Former IDUG (International DB2 User Group) President
• Author of IBM Redbooks, white papers and more recently
“flashbooks”
The Information Management Specialists
4. Topics
• Introduction
• DB2 10 for z/OS Overview
• Temporal Data Support
• Further Reading
• Summary
The Information Management Specialists
5. DB2 10 for z/OS
• Extensive beta program running throughout
2009/10, with customers from all around the world
• Generally available since October 2010
• Upgrade path provided from DB2 8 or DB2 9
• Many customers are currently planning their DB2 10
upgrades, to begin in the next 12-24 months
DB2 8 for z/OS End of Support in April 2012
The Information Management Specialists
6. Top New Features
• CPU/Performance Improvements • In-memory object support
• Temporal Data • Optimiser enhancements
• Virtual Storage Enhancements • MEMBER CLUSTER for UTS
• High performance DBATs • Backup and recovery
• Security Extensions enhancements
• Improved Catalog Concurrency • Enhanced audit
• Access Path Management • Include additional index
columns
• pureXML enhancements
• Currently Committed semantics
• Enhanced SQL OLAP functions
• Automated statistics
• Skip Migration
• Dynamic schema change
enhancements • And many more….
The Information Management Specialists
7. Topics
• Introduction
• DB2 10 for z/OS Overview
• Temporal Data Support
• Further Reading
• Summary
The Information Management Specialists
8. Why Temporal Data?
• Most IT systems need to keep historical as well as current
information
• Industry regulations and competitive pressures are
prompting IT managers to maintain even more data for
longer periods of time
• Most warehousing / analytics applications require a
historical perspective of data
• Implementation requires lots of effort by DBA and
developer to design, test and implement
Lots of “reinventing the wheel”
The Information Management Specialists
9. Why Temporal Data?
• DB2 10 provides this functionality as part of the database
engine – the first major RDBMS vendor to do so
Improve DBAs and developer productivity
Reduce errors in application code
Reduce time-to-market for new applications
Improve performance by driving function into the database
engine
Improve application consistency
Support compliance / audit requirements
The Information Management Specialists
10. Temporal Data Concepts
• Temporal Table - a table that supports “data
versioning” to allow point-in-time queries to be
executed
Multiple versions of each row are kept by DB2 as they
change over time
Additional metadata is kept, recording the period in time
when a given version of the row was valid
Contrast to traditional non-temporal tables, where only
the current version of a row is available unless
developer/DBA have taken steps to support historical
perspective
The Information Management Specialists
11. Temporal Data Concepts
• Period – the time during which a given version of a
row is/was valid
Period is defined by special start timestamp and end
timestamp columns in the temporal table
Note that in current DB2 implementation start timestamp
is inclusive (>=), but end timestamp is not inclusive (<)
CustNo … Start_TS End_TS
Period #1
123 … 2011-05-01 11:03 2011-05-26 23:51
123 … 2011-05-26 23:51 9999-12-31 23:59
Period #2
The Information Management Specialists
12. Temporal Data Concepts
• Business Temporal Table – a temporal table that uses
business-defined periods to record row history
Associated with a business event such as a change of
address
Useful for tracking business events over time
History is maintained in the base table
Application has control over start and end timestamp for a
given period
The Information Management Specialists
13. Temporal Data Concepts
• System Temporal Table – a temporal table that uses DB2
system-defined periods to record row history
Associated with a DB2 system event (INSERT / UPDATE /
DELETE) against table – all changes captured
DB2 automatically sets start and end timestamp for a period
History is maintained in a separate table
Useful for audit/compliance requirements
• Bi-Temporal Table – a temporal table that supports both
business and system time periods
Two sets of start/end timestamps defined
The Information Management Specialists
14. Implementing Temporal Tables
• DBA indicates which tables need temporal support at
CREATE/ALTER time
Includes special start and end timestamp columns for recording
validity period for each row
• For system temporal or bi-temporal tables
DBA also creates separate history table with identical definition
to base table
DB2 automatically copies old version of row to history table
whenever row in main table is changed via DELETE or UPDATE
• Elegant extensions to SELECT statement allow historical
perspective to be seen via standard SQL
The Information Management Specialists
15. Example – Business Temporal
Business
Event
Policy 102 created Policy 102 updated
(address = A3) (address = A4)
T1 T2 Time T3
Policy Address Start_TS End_TS Policy Address Start_TS End_TS
101 A2 T0 31-12-9999 101 A2 T0 31-12-9999
Main 102 A3 T1 31-12-9999 102 A3 T1 T3
Table
102 A4 T3 31-12-9999
SELECT ADDRESS SELECT ADDRESS
FROM TABLE1 = FROM TABLE1
A4
WHERE POLICY=102 FOR BUSINESS TIME AS OF T2 = A3
WHERE POLICY=102
The Information Management Specialists
16. Example – System Temporal
System INSERT INTO EMP UPDATE EMP
Event VALUES (321, 20000) WHERE EMPNO = 321
SET SALARY = 25000
T1 T2 Time T3
EmpNo Salary Start_TS End_TS EmpNo Salary Start_TS End_TS
Main 300 10000 T0 31-12-9999 300 10000 T0 31-12-9999
Table
321 20000 T1 31-12-9999 321 25000 T3 31-12-9999
SELECT SALARY EmpNo Salary Start_TS End_TS
FROM EMP = 25000
WHERE EMPNO = 321 321 20000 T1 T3
SELECT SALARY
FROM EMP History Table
FOR SYSTEM TIME AS OF T2 = 20000
WHERE EMPNO = 321
The Information Management Specialists
17. Topics
• Introduction
• DB2 10 for z/OS Overview
• Temporal Data Support
• Further Reading
• Summary
The Information Management Specialists
18. Further Reading
• IBM DB2 10 Home Page
http://www-01.ibm.com/software/data/db2/zos/db2-10/
• White Paper – DB2 10: A Smarter Database for a Smarter Planet
https://www14.software.ibm.com/webapp/iwm/web/signup.do?source=s
w-infomgt&S_PKG=wp-z-db2-smarter
Also available as part of a “flashbook” - ISBN: 1583473610
• DB2 10 for z/OS Performance Topics Redbook (SG24-7942) coming
soon
• IDUG – International DB2 User Group
http://www.idug.org/
The Information Management Specialists
19. IDUG DB2 10 Migration Experiences Forum
• A new IDUG forum dedicated specifically to DB2 10 for
z/OS migration experiences
Regular updates and surveys on DB2 10 migration topics
Share and discuss your upgrade plans and experiences
with your peers and IBM and other industry experts
Links to valuable DB2 10 technical information from IBM,
IDUG and other sources
• Forum can be found at
http://www.linkedin.com/groups?gid=3797589
The Information Management Specialists
20. Topics
• Introduction
• DB2 10 for z/OS Overview
• Temporal Data Support
• Further Reading
• Summary
The Information Management Specialists
21. Summary
• DB2 10 contains a long list of significant enhancements to improve
performance, scalability and productivity
• Temporal support is an industry first, and offers some compelling
advantages for new applications than need a historical data
perspective
Improve DBAs and developer productivity
Reduce errors in application code
Reduce time-to-market for new applications
Improve performance by driving function into the database engine
Improve application consistency
Support compliance / audit requirements
The Information Management Specialists
22. Contact us
Web – www.triton.co.uk
Email – geeks@triton.co.uk
Phone - +44 870 2411 550
The Information Management Specialists