db2 9 for z/os overview

81
IBM Software Group © 2007 IBM Corporation DB2 9 for z/OS Overview Kevin Harrison Certified Senior IT Architect DB2 for z/OS Technical Support Data Management West Region [email protected]

Post on 13-Sep-2014

1.841 views

Category:

Documents


6 download

DESCRIPTION

 

TRANSCRIPT

Page 1: DB2 9 for z/OS Overview

IBM Software Group

© 2007 IBM Corporation

DB2 9 for z/OSOverview

Kevin Harrison

Certified Senior IT Architect

DB2 for z/OS Technical Support

Data Management West Region

[email protected]

Page 2: DB2 9 for z/OS Overview

© 2007 IBM Corporation2

Information contained in this material has not been submitted to any formal IBM review and is distributed on "as is" basis without any warranty either expressed or implied. Measurements data have been obtained in laboratory environment. Information in this presentation about IBM's future plans reflect current thinking and is subject to change at IBM's business discretion. You should not rely on such information to make business plans. The use of this information is a customer responsibility.

IBM MAY HAVE PATENTS OR PENDING PATENT APPLICATIONS COVERING SUBJECT MATTER IN THIS DOCUMENT. THE FURNISHING OF THIS DOCUMENT DOES NOT IMPLY GIVING LICENSE TO THESE PATENTS.

TRADEMARKS: THE FOLLOWING TERMS ARE TRADEMARKS OR ® REGISTERED TRADEMARKS OF THE IBM CORPORATION IN THE UNITED STATES AND/OR OTHER COUNTRIES: AIX, AS/400, DATABASE 2, DB2, e-business logo, Enterprise Storage Server, ESCON, FICON, OS/390, OS/400, ES/9000, MVS/ESA, Netfinity, RISC, RISC SYSTEM/6000, System i, System p, System x, System z, IBM, Lotus, NOTES, WebSphere, z/Architecture, z/OS, zSeries

The FOLLOWING TERMS ARE TRADEMARKS OR REGISTERED TRADEMARKS OF THE MICROSOFT CORPORATION IN THE UNITED STATES AND/OR OTHER COUNTRIES: MICROSOFT, WINDOWS, WINDOWS NT, ODBC, WINDOWS 95

For additional information see ibm.com/legal/copytrade.phtml

Disclaimer and Trademarks

Page 3: DB2 9 for z/OS Overview

© 2007 IBM Corporation3

DB2 9 for z/OS Technology ThemesNew Workload High Volume ProcessingExtend the lead in Availability, Scalability, PerformanceMarket leading design capabilitiesRegulatory ComplianceHybrid data server with pureXMLtm

Enhanced Systems ManagementImproved Data Warehousing & Reporting

DB2 9 for z/OS delivers on more than 225 requirements submitted by customers, business partners, and

worldwide user group communities

Page 4: DB2 9 for z/OS Overview

© 2007 IBM Corporation4

Breaking Through Limits……Delivering InnovationNative XML SupportSecurity and compliance support for today’sbusiness needsA continued evolution of significant indexingenhancementsMore storage moved above the barShared memory objectsNew internal table space and page format– Design flexibility with performance

More data sharing and LOB improvementsModify ERLY code without an IPL

Page 5: DB2 9 for z/OS Overview

© 2007 IBM Corporation5

Version PID Generally Available

MarketingWithdrawal

End of Service

V4 5695-DB2 November 1995

December 2000

December 2001

V5 5655-DB2 June 1997 December 2001

December 2002

V6 5645-DB2 June 1999 June 2002 June 2005

V7 5675-DB2 March 2001 March 2007 June 2008

V8 5625-DB2 March 2004 TBD TBD

V9 5635-DB2 March 2007 TBD TBD

DB2 z/OS Availability Summary

Page 6: DB2 9 for z/OS Overview

© 2007 IBM Corporation6

–DIST now 64-bit–Base Pre-requisites:

–zSeries z800, z890, z900, z990, z9 or later–z/OS V1.7 or above–Data Sharing:CFLEVEL 12–Defined shared memory objects–Satisfy the V8 requirements

–Catalog changes:–Additions for new features–Including Real Time Statistics

–DB2 Connect–V8 FP13, V8.2 FP 6, V9 FP1

–Migration Process:–From Version 8 NFM only–More flexibility switching between modes

• CM, ENFM, NFM–V8 and V9 data sharing coexistence in CM–DSNTIJP9 provided for V8 with PK31841

DB2 9 for z/OS

Building the e-infrastructureContinuous Availability Systems Management, SecurityPerformance/CapacityConnectivityProductivitySynergy: DB2 family & zSeries

= Total Cost of Ownership

Ready forReady for

Page 7: DB2 9 for z/OS Overview

© 2007 IBM Corporation7

DB2 for z/OS Packaging

DB2 BaseIRLM V2R2msys plug inRexxMQSeriesMQListenerIMS AttachRACF Auth ExitPanels (English / Kanji)JDBC / SQLJ / ODBCXML Extender

z/OS Appl Connectivity to DB2 for z/OSManagement Clients Package

DB2 Accessories Suite 5655-R14–See announcement 207-040 for details

DB2 QMF V9–DB2 QMF Enterprise Edition–DB2 QMF Classic Edition

Base

DB2 9 for z/OS

OrderableNo-ChargeFeatures

OrderableCharge

Features

OrderableNo-Charge

Product

Page 8: DB2 9 for z/OS Overview

© 2007 IBM Corporation8

DB2 for z/OS Base

Components– DB2 Base– IRLM V2R2– IMS Attach

• Must be installed– DB2 Customization Center

• Requires IBM Managed System Infrastructure (msys)

– available with z/OS 1.4– RACF Authorization Exit– REXX Language Support– MQSeries, MQ Listener– ODBC– JDBC / SQLJ– DB2 XML Extender

Considerations– The Information Center is the

recommended place for current manuals• Books new to DB2 9 (like the XML

Guide) will not be available in Book Manager

– V8 deprecated / stabilized offerings removed• Net.Data• Net Search• Text Extender• IAV Extender

– QMF Packaging Changes– MQ includes to support the MQ DB2

UDFs

Page 9: DB2 9 for z/OS Overview

© 2007 IBM Corporation9

DB2 9 for z/OS No Charge Featuresz/OS Application Connectivity to DB2 for z/OS– DB2 Universal Database Driver for z/OS, Java

Edition• Java Type 4 Driver

DB2 Management Clients Package (CD)– DB2 Administration Server– z/OS Enablement– DB2 Connect Personal Edition Kit (V9 GA)

• Including & for use with:– Control Center– Development Center– Command Center– IBM Developers Workbench (DWB)– Replication Center

• Also can be used with Optimization Service Center (OSC)

Considerations– Enable Java programs

to use the IBM DB2 Driver for JDBC & SQLJ (formally the Univerval JDBC Driver)

– Visual Explain features have been incorporated into the OSC• Part of the DB2

Accessories Suite

Page 10: DB2 9 for z/OS Overview

© 2007 IBM Corporation10

Considerations– Order the product (5655-

R14)– Order the service and

support (5655-R30)

DB2 9 for z/OS Optional No Charge Product

DB2 Accessory Suite– IBM Optimization Service Center (OSC)– Spatial Support– Internationalization Components for Unicode

• Needed for Spatial Support• Will be used in future text search support

Page 11: DB2 9 for z/OS Overview

© 2007 IBM Corporation11

Major Presentation SectionsScaling Storage and Distributed ImprovementsNative XML SupportSQL EnhancementsOptimization EvolutionSecurity and Administration for Today’s BusinessAdvanced Design OptionsLOB Performance and FeatureIndexing EnhancementsData SharingToolingUtilities OverviewServiceability and Instrumentation

VSTXMLSQLOPTSECDSNLOBIDXDSHTOO

SVCUTL

Page 12: DB2 9 for z/OS Overview

© 2007 IBM Corporation12

Scaling Storage & Distributed Improvements64 bit evolution– DIST Address Space

– More above the bar

WLM Assisted Buffer Pool Management

Large Buffer Pool Management

Prefetch Changes

Distributed Workload Improvements

Converged Temp Space

VST

Page 13: DB2 9 for z/OS Overview

© 2007 IBM Corporation13

DIST

-Com Buffers-Control Blocks-Shared Memory

64 bit Evolution (Virtual Storage Relief)

2 GB

DBM116 EB -Buffer pool

0The bar

16M - Line

-EDM pool- DBDs- Global Dyn Stmt Cache

-RID pool-Sort pool-Compression dictionaries-Castout Buffers-Buffer Mgr Control Blocks-Trace Tables-Accounting Blocks

IRLM-Locks

-Parse treeEDM pool-SKPT / SKCT- Portions of CT / PT--Portions for stmt cache-Page set & RTS blocks-Some thread Runtimes

EDM Pool (EDMPOOL)

DBD Pool (EDMDBDC)

Global Stmt Pool (EDMSTMTC)

2GB

V8

Skeleton Pool (EDM_SKELETON_POOL)

CT / PTOthers

SKCT / SKPT

CT / PTSKCT / SKPT

IFCID 217: detailed DBM1 virtual storage health

IFCID 225: consolidated DBM1 virtual storage healthV9-Log Buffers

Environmental Descriptor Manager Pool

Enabled in CM

VST

Page 14: DB2 9 for z/OS Overview

© 2007 IBM Corporation14

WLM Buffer Pool ManagementWLM-assisted buffer pool management

– -ALTER BUFFERPOOL () AUTOSIZE(YES)– Requires z/OS 1.8– DB2 registers the BP to WLM and reports any synch read I/O delay to

WLM– DB2 periodically reports BP hit statistics to WLM– WLM maintains histograms to project effect of adjusting size on

achieving workload performance goals taking into account overallsystem storage usage

– WLM drives DB2 exit to adjust size if appropriate• V9 restricts to +/- 25%

DSNB555I WLM RECOMMENDATION TO ADJUST SIZE FOR BUFFER POOL bpname HAS COMPLETEDOLD SIZE = csize BUFFERSNEW SIZE = nsize BUFFERS

VST

Page 15: DB2 9 for z/OS Overview

© 2007 IBM Corporation15

Efficient large BP (>5GB) support– LRU control block maintenance in z/OS 1.8– More evenly balanced buffer hash chain

• Also in V8 PK29626 8/06Bigger prefetch and deferred write quantity for bigger buffer pool– Doubling the prefetch quantity for large buffer pools

• Large buffer pool defined as VPSEQT * VPSIZE > 160MB• Max of 128KB V8 ->256KB V9 in SQL table space scan• 256KB V8 ->512KB V9 in utility

– +36% MB/sec in non striped prefetch– +47% in 2-striped prefetch -> more effective striping

More use of dynamic prefetch over sequential prefetch– Except for table space scans– Considered more robust

• Data is usually NOT all sequential NOR all random

Buffer Pool Management

VST

Page 16: DB2 9 for z/OS Overview

© 2007 IBM Corporation16

V9 Improvements for VStor Constraint ReliefDDF address space runs in 64-bit addressing mode– Shared 64-bit memory object avoids xmem moves between DBM1 and DDF and

improves performance– Constraint relief

DBM1 DIST

z/OS Shared Private Storage

2GBBar

Reduced amount of data formatting and data movementReduced virtual storage– It exists once, instead of in each

address spaceHas storage key & fetch protectionDefaults to 2TB sizeDB2 requires a minimum of 128GB configured or V9 will not run– Even if not running DISTSet by HVSHARE in ParmlibDISPLAY VIRTSTORE,HVSHARE

VST

Page 17: DB2 9 for z/OS Overview

© 2007 IBM Corporation17

Other Distributed workload improvementsVTAM definition is now optionalPrepare for Elimination of PRIVATE protocol requester– Includes a tool for identifying which packages need to be bound at

remote servers• Tool DSNTP2DP can be executed with DSNTIJPD

DB2 Connect– Version 8 FP13– Version 8.2 FP6– Version 9 FP1 (FP2 is needed for .NET tooling support)

Support for IPv6 and SSL

– NFM & TCPIP Dual Stack Support– 128-bit IP addresses (as opposed to 32-bit IPv4 addresses)

VST

Page 18: DB2 9 for z/OS Overview

© 2007 IBM Corporation18

Converged TEMP SpaceSingle source for all temporary space in DB2, replacing: DSNDB07, temp databases, workfile database– In CM & NFM

The workfile database is the only temporary databaseSupports 4K and 32K page sizes, with automatic selection of the appropriate page size– Expect an increased use of the 32K temp space– Consider sizing your 32K @ 50% - 100% of your 4K buffers

• Monitor statistics and adjust for actual usageAccess is virtualized for small amounts of data, eliminating cost of work file creation (reduced CPU and I/O)New ZParm for preventing workfile monopolization (MAXTEMPS)

VST

Page 19: DB2 9 for z/OS Overview

© 2007 IBM Corporation19

Native XML SupportXML Overview & Marketplace

XML Relational Comparison

Why XML?

What is XML

XML Components

XML Database Approaches

pureXMLtm

XML Physical Implementation

XML Publishing

Use of XPath

Indexing

Parsing and storage

Restrictions, limits, controls

XML Schema Repository

XML

Page 20: DB2 9 for z/OS Overview

© 2007 IBM Corporation20

Why XML?XML is vendor and platform independentFlexibility, Flexibility, Flexibility !– Any platform, vendor, OS, software, language

XML is a very flexible data model: for structured data, semi-structured data, schema-less dataEasy to extend: define new tags as neededXML is self-describing: any XML parser can "understand" it !Easy to "validate" XML, i.e. to check compliance with a schema -any XML parser can do it!Easy to transform XML documents into other formats (HTML, etc.)Fully Unicode compliant

XML

Page 21: DB2 9 for z/OS Overview

© 2007 IBM Corporation21

Why use XML with Databases?Managing large volumes of XML data is a problem!– Efficient Search & Retrieval of XML Documents

– Persistency, Recovery, Transactions • File system recovery vs. database recovery

– Performance, Scalability• Indexing

– …all the same reasons as for relational data!

Integration– Integrate XML data with existing relational data

– Publish (relational) data as XML

– Database support for web applications, SOA, web services (SOAP)

DocumentRetrieval Search

XML

Page 22: DB2 9 for z/OS Overview

© 2007 IBM Corporation22

Two ways to store XML in a Databases?

Competitors

DB2 9

XML

XML-Enabled Databases – CLOB/Varchar

– Shredding

Pure XML Databases– XDM (XQuery Data Model)

– XPath subset of XQuery

Competitors

Page 23: DB2 9 for z/OS Overview

© 2007 IBM Corporation23

Pure XML StorageXML data is stored in XML-typed columns in tables

create table dept (deptID char(8),…, deptdoc xml);

……

……

<dept> …

<emp>…</emp>

</dept>

“PR27”deptdocdeptID

DB2 Storage

XML

XML is stored in a parsed hierarchicalformatRelational columnsare stored in relationalformatThe XML table space inherits the base table attributes

– Several items (like Compression) will take effect after a REORG or LOAD REPLACE

Page 24: DB2 9 for z/OS Overview

© 2007 IBM Corporation24

XML Objects for Non-partitioned Base Table

XML

Page 25: DB2 9 for z/OS Overview

© 2007 IBM Corporation25

XML Objects for Partitioned Base Table

XML

Page 26: DB2 9 for z/OS Overview

© 2007 IBM Corporation26

Native XML Features

First-class XML data type, native storage of XQuery Data Model

SQL/XML constructor functions

– Construct XML from relational data in V8:XMLElement, XMLAttributes, XMLNamespaces, XMLForest, XMLConcat, XMLAGG

– New constructor functions in DB2 9:XMLText, XMLPI, XMLComment, XMLDocument, and binary string support and more null handling options

XMLPARSE and XMLSERIALIZE (replacing XML2CLOB)

XML indexes

XML

Page 27: DB2 9 for z/OS Overview

© 2007 IBM Corporation27

Native XML Features

Important SQL/XML functions with XPath– XMLEXISTS, XMLQUERY

XML Schema repository, Validation UDF, (and decomposition)

DRDA (distributed support) and application interfaces

Utilities

XML

Page 28: DB2 9 for z/OS Overview

© 2007 IBM Corporation28

Samples Support

DSNTEP2, DSNTEP4, and DSNTIAUL are modified to support the XML data type.

IVP job DSNTEJ1 (creates the sample database) is modified to:

– Create a new sample database for the XML data

– Populate the database with serialized XML values using both SQL and the LOAD utility

New DSNTEJ2H (IVP phase 2) jobs are added to prepare and execute code samples that:

– Do simple updates of XML dataMore samples are being developed.

XML

Page 29: DB2 9 for z/OS Overview

© 2007 IBM Corporation29

Rounding Out XML SupportUtility Support– LOAD/UNLOAD, CHECK DATA/INDEX, COPY, REBUILD,

RECOVER, REORG, etc. XML Schema Support– XSR – XML Schema Repository– Tables to store XML schemas– Stored procedures to register XML schemasDSN_XMLVALIDATE() SQL/XML function– Test XML values for validity against XML schema– Obtain default values and schema normalized values from

XML schemaXML decomposition using annotated XML schema

XML

Page 30: DB2 9 for z/OS Overview

© 2007 IBM Corporation30

Developer Workbench Support of pureXML

Developer Workbench can:

– Create a table with a XML column– Edit XML documents– Insert XML into the database– View XML data in the database– Extract / Load XML data

See the Tooling Section

XML

TOO

Page 31: DB2 9 for z/OS Overview

© 2007 IBM Corporation31

SQL EnhancementsMERGE

SELECT FROM– UPDATE

– DELETE

– MERGE

FETCH FIRST / ORDER BY in Subselect

ORDER OF

INTERSECT

EXCEPT

SKIP LOCKED DATA

TRUNCATE

Built In Functions

Scalar Functions

Session Variables

File Reference Variables

Native SQL Stored Procedures

SQL

LOB

Page 32: DB2 9 for z/OS Overview

© 2007 IBM Corporation32

MERGEArray MERGE operation

Targets OLTP applications like SAP

Maintains trigger integrity

NOT ATOMIC CONTINUE ON SQL EXCEPTION is optional, but must be specified if inserting multiple rows

MERGE INTO account AS TUSING VALUES (:hv_id, :hv_amt) FOR 5 ROWS AS S(id,amt)ON T.id = S.idWHEN MATCHED THEN

UPDATE SET balance = T.balance + S.amtWHEN NOT MATCHED THEN

INSERT (id, balance) VALUES (S.id, S.amt)NOT ATOMIC CONTINUE ON SQL EXCEPTION;

SQL

Page 33: DB2 9 for z/OS Overview

© 2007 IBM Corporation33

SELECT athlete, score FROM FINAL TABLE(UPDATE events SET SCORE=SCORE+10WHERE EVENT=‘BOXING’);

SELECT MEMBER_ID, UPSERT_INDICATOR FROM FINAL TABLE(MERGE INTO MEMBER_PROFILE AS A

INCLUDE (UPSERT_INDICATOR CHAR(1))USING (VALUES (:col1, :col2, :col3) ) AS B

(MEMBER_ID, MEMBER_NAME, MEAL_PREFERENCE)ON (A.MEMBER_ID = B.MEMBER_ID)WHEN MATCHED THEN UPDATE SET A.MEMBER_NAME = B.MEMBER_NAME,

A.MEAL_PREFERENCE = B.MEAL_PREFERENCE,UPSERT_INDICATOR = 'U'

WHEN NOT MATCHED THEN INSERT (MEMBER_ID,MEMBER_NAME,MEAL_PREFERENCE,UPSERT_INDICATOR)VALUES (B.MEMBER_ID, B.MEMBER_NAME, B.MEAL_PREFERENCE, 'I')

NOT ATOMIC CONTINUE ON SQLEXCEPTION);

First example shows SELECT returning data from the nested UPDATESecond example shows SELECT returning data from the nested MERGE with an INCLUDE column.– This include column returns the compare column from the ON clause and an indicator of whether the

row was Updated or Inserted.

Select from Update, Delete, and Merge

SQL

Page 34: DB2 9 for z/OS Overview

© 2007 IBM Corporation34

INSERT INTO T2

(SELECT C1, C2, C3FROM T1

FETCH FIRST 10 ROWS ONLY

ORDER BY C2, C1);

FETCH FIRST/ ORDER BY in Subselect

FETCH FIRST and ORDER BY clauses are now allowed in subselects.

In this example both clauses are used in the subselect as a way to select the top 10 rows from table T1 as ordered by columns C2 and C1.

SQL

Page 35: DB2 9 for z/OS Overview

© 2007 IBM Corporation35

ORDER OF clauseSpecifies that the same ordering of the rows or the result tableshould be applied to the result table of the subselect (or fullselect) that contains the ORDER OF specification.

SELECT * FROM (SELECT * FROM T1

UNION ALL (SELECT * FROM T2 ORDER BY 1)) AS UTABLE

ORDER BY ORDER OF UTABLE;

The ORDER BY ORDER OF clause in the full select specifies that the order of the rows in the result table of the union is to be inherited by the result set specified.

SQL

Page 36: DB2 9 for z/OS Overview

© 2007 IBM Corporation36

Intersect/Except

Intersect – Returns the records that two result sets have in common– Frequently used in ‘find the

duplicates query’– Rows from either result set that

do not match are excluded. Except – Returns the records that are members of one result set that are not members of the other Requirement– Both result sets must have the

same column structure.

RS2RS1

RS2RS1

For 2 given result sets…

Intersect

RS1 RS2

Except

SQL

Page 37: DB2 9 for z/OS Overview

© 2007 IBM Corporation37

SKIP LOCKED DATARows with incompatible locks by other transactions are skippedClause available – On SELECT INTO, PREPARE, searched UPDATE, searched

DELETE, UNLOAD– Effective when CS or RS is in use

• Otherwise it is ignored– Data is locked at the row or pageQW0018SK – ROWS SKIPPED DUE TO INCOMPATIBLE LOCK HELD– Reported in IFCID 018Logic / Scenario– When a transaction needs to find work to do, regardless of

order.– Messaging applications without strict ordering requirements

expect to be able to skip over records that are locked by other transactions

SQL

X X Xdata data data data data data data dataSQL

Page 38: DB2 9 for z/OS Overview

© 2007 IBM Corporation38

TRUNCATEAllows fast delete of all rows in base tables or declared global temporary tables – Simple, segmented, partitioned, universal table spaces or tables– If table contains LOB or XML columns the corresponding table spaces and

indexes are also truncated.– IMMEDIATE option – operation cannot be rolled back

• Allows reusing the allocated space immediately for subsequent insert operations in the same unit of work without committing.

• Not allowed if the table has in-flight modificationsDeletes rows without firing DELETE triggersOption to REUSE or DROP STORAGE– Useful for nightly refresh of summary tables, warehouses, etc.

SQL

Page 39: DB2 9 for z/OS Overview

© 2007 IBM Corporation39

TRUNCATETable cannot be TRUNCATEd if it is a parent in a defined referential constraint

Acts like mass DELETE for tables with Change Data Capture, Multilevel Security, or a VALIDPROC.

ROLLBACK:– TRUNCATE IMMEDIATE: Other tables are rolled back. The truncated table

will be empty.

– TRUNCATE: The truncate is rolled back, along with changes to other tables.

DELETE / ALTER, SYSADM, DBADM or table ownership privileges required. – The ALTER privilege is needed for IGNORE DELETE TRIGGERS

SQL

Page 40: DB2 9 for z/OS Overview

© 2007 IBM Corporation40

Built-in Functions

RANK– Generates a row number defining the rank as 1 plus the number of

rows that precede the row.

– If two or more rows are not distinct with respect to the ordering, there will be one or more gaps in the sequential rank numbering.Also referred to as Olympic Ranking.

DENSE_RANK– Similar to RANK but ensures there are no gaps.

Even though these functions are ordered, cursors remain updatable.

SQL

Page 41: DB2 9 for z/OS Overview

© 2007 IBM Corporation41

SELECT SMALLINT(DENSE_RANK() OVER (ORDER BY score DESC)) AS DENSE_RANK,athlete, event, score FROM scores;

SELECT SMALLINT(RANK() OVER (ORDER BY score DESC)) as RANK,athlete, event, score FROM scores;

Built-in Functions

RANK

DENSE_RANK

SQL

Page 42: DB2 9 for z/OS Overview

© 2007 IBM Corporation42

Built-in Functions

ROW_NUMBER– Creates a sequential row number that is computed for each row

starting with 1.

– No number skipping.

SELECT SMALLINT(ROW_NUMBER() OVER (ORDER BY score DESC)) AS ROW_NUMBER, athlete, score FROM scores ORDER score DESC;

SQL

Page 43: DB2 9 for z/OS Overview

© 2007 IBM Corporation43

Time Scalar FunctionsTIMESTAMPADD(interval, number, timestamp)– Returns the result of adding the specified number of the specified interval

to the specified timestamp

– Add 1 year to the current timestampSELECT TIMESTAMPADD(256,1,CURRENT TIMESTAMP) FROM SYSIBM.SYSDUMMY1;

– Interval values are 256=years, 128=quarters, 64=months, etc

TIMESTAMP_ISO(expression)– Returns a timestamp based on a date, a time, or a timestamp expression.SELECT TIMESTAMP_ISO(DATE(‘1992-02-19’)) FROM SYSIBM.SYSDUMMY1;

– Returns a value ‘1992-02-19-00.00.00.000000’

SQL

Scalar FunctionsPortability

Page 44: DB2 9 for z/OS Overview

© 2007 IBM Corporation44

Session Variables

– SYSIBM.APPLICATION_ENCODING_SCHEME– SYSIBM.COBOL_STRING_DELIMITER– SYSIBM.DATE_FORMAT– SYSIBM.DATE_LENGTH– SYSIBM.DECIMAL_ARITHMETIC– SYSIBM.DECIMAL_POINT– SYSIBM.DEFAULT_DECFLOAT_ROUND_MODE– SYSIBM.DEFAULT_DEFAULT_SSID– SYSIBM.DEFAULT_LANGUAGE– SYSIBM.DEFAULT_LOCALE_LC_CTYPE– SYSIBM.DISTRIBUTED_SQL_STRING_DELIMITER

– SYSIBM.DSNHDECP_NAME– SYSIBM.DYNAMIC_RULES– SYSIBM.ENCODING_SCHEME– SYSIBM.MIXED_DATA– SYSIBM.NEWFUN– SYSIBM.PAD_NUL_TERMINATED– SYSIBM.SQL_STRING_DELIMITER– SYSIBM.SSID– SYSIBM.STANDARD_SQL– SYSIBM.TIME_FORMAT– SYSIBM.TIME_LENGTH

SET :hv1 = GETVARIABLE(SYSIBM.DSNHDECP_NAME);

Session Variables contain server and application process informationBuilds on the 11 Session Variables introduced in V8Use GETVARIABLE to obtain the DB2 9 DSNHDECP assigned value

SQL

Page 45: DB2 9 for z/OS Overview

© 2007 IBM Corporation45

Native SQL Procedural LanguageEliminates generated C code and compilation

Fully integrated into the DB2 engine– Any SQL procedure created without the FENCED or

EXTERNAL keywords are native SQL procedures

zIIP enabled for DRDA clients

Extensive support for versioning:– VERSION keyword on CREATE PROCEDURE

– CURRENT ROUTINE VERSION special register

– ALTER ADD VERSION

– ALTER REPLACE VERSION

– ALTER ACTIVATE VERSION

BIND PACKAGE with new DEPLOY keyword

zIIP Enabledfor DRDA

SQL

Page 46: DB2 9 for z/OS Overview

© 2007 IBM Corporation46

Optimization EvolutionREOPT

Global Query Optimization

Histograms

Real-Time Statistics

OPT

Page 47: DB2 9 for z/OS Overview

© 2007 IBM Corporation47OPT

REOPT AutoAutomatic REOPT based on parameter marker change

– Only for dynamic statements that can be cached

Enabled with REOPTEXT ZParm

Enhancement will take effect when– When REOPTEXT is turned

on, and

– When REOPT(NONE), REOPT(ONCE), REOPT(ALWAYS) and their equivalent bind options are not specified

– NOTE: The existing REOPT options will be effective, regardless of the REOPTEXT parameter setting.

Page 48: DB2 9 for z/OS Overview

© 2007 IBM Corporation48

Global Query Optimization

Cross Query Block Optimization – DB2 will break this query into 2 parts

• correlated subquery and the outer query• optimized independently in V8 and prior

– Global Query Optimization will allow DB2 to optimize a query as a whole rather than as independent parts • considers the effect of one query block on another• considers reordering query blocks

OPT

SELECT * FROM T1

WHERE EXISTS

(SELECT 1 FROM T2,T3 WHERE T2.C2 = T3.C2 AND T2.C1 = T1.C1);

Page 49: DB2 9 for z/OS Overview

© 2007 IBM Corporation49

Histogram Statistics - RUNSTATSSummarizes data distribution on an interval scaleUp to 100 quantiles per column / group of columnsReverts to distribution statistics if < 100 valuesNot supported by LOAD or REORGDB2 uses equal-depth histograms– Each quantile has about the same number of rows– Example - 1, 3, 3, 4, 4, 6, 7, 8, 9, 10, 12, 15 (sequenced),

cut into 3 quantiles

3/123151034/1249625/12 3411

FrequencyCardinalityHigh ValueLow ValueSeq No

OPT

Page 50: DB2 9 for z/OS Overview

© 2007 IBM Corporation50

Real-Time Statistics EvolutionReal Time Statistics (RTS) have been collected automatically since V7DB2 9 moves RTS into the Catalog & externalizes the information automatically– DSNDB06.SYSRTSTS

• SYSIBM.SYSTABLESPACESTATS• SYSIBM.SYSINDEXSPACESTATS

– During ENFM processing, the data is moved from user-defined tables to the new catalog tables

– Drop user-defined tables after ENFM

Gather information about indexes that are used / not used– SYSINDEXSPACESTATS.LASTUSED– "Used", as defined by DB2 is the following:

• As an access path for query or fetch.• For searched UPDATE / DELETE SQL statement.• As a primary index for referential integrity.• To support foreign key access.

OPT

Page 51: DB2 9 for z/OS Overview

© 2007 IBM Corporation51

Security & Administration for Today’s BusinessTrusted Context

Roles

Establishing Trusted Connections

Auditing

Offload Encryption

SEC

Page 52: DB2 9 for z/OS Overview

© 2007 IBM Corporation52

Security ChallengesThree-tier architecture issues– All interactions with database server occur under middle-tier

authorization ID• Loss of end-user identity• Over granting of privileges to the middle-tier authorization ID• Diminished user accountability• Weakened security

– Performance problems with using end user credentials

Other administrative issues– Shared DBA ids– Lack of individual accountability for SYSADM authority– DBADM can create view/alias for another ID, but has no

DROP/ALTER privilege

SEC

Page 53: DB2 9 for z/OS Overview

© 2007 IBM Corporation53

Security Challenges

Dynamic SQL Support– Users need dynamic access to table within the context of an

application

– You don’t want end users to have this same access outside of the application

SEC

Page 54: DB2 9 for z/OS Overview

© 2007 IBM Corporation54

Trusted Context & RolesEstablishes a trusted relationship between DB2 and an external entity– A Server or a User ID– Once established, a provides for specialized privileges only available via the

Trusted Context via a Role– Remote: IP Address, Domain Name or SERVAUTH security zone attributes– Local: Job or Task name attributesRole– Database entity that groups privileges– Can be assigned to a User ID– ROLE AS OBJECT OWNER

• CREATE– The Role will own the object

• BIND w/o OWNER: – The Role will own the Plan / Package– Outbound Auth ID translation is not in effect for remote binds

• SET CURRENT SQLID will be ignored– Trusted Context has a Default RoleSee Admin Guide, Ch.3, “Implementing your database design”

SEC

Page 55: DB2 9 for z/OS Overview

© 2007 IBM Corporation55

Trusted ContextConnection Trust Attributes– These attributes are not checked at time of definition– Remote Trust Attributes

• ADDRESS– IP Address or domain name– Must be TCPIP

• SERVAUTH– Name of resource in the RACF SERVAUTH class– The network access security zone that contains the IP Address

• ENCRYPTION– Specifies the minimum level of network encryption of the data stream– NONE is the default– LOW for DRDA data stream encryption– HIGH for SSL encryption

– Local Trust Attribute• JOBNAME

– Local z/OS started task or jobname

SEC

Page 56: DB2 9 for z/OS Overview

© 2007 IBM Corporation56

RolesThe Role must be created prior to referencing it in a Trusted Context

A Role is not usable outside of a Trusted Context

A way to acquire context specific privileges

The context can specify default and user specific roles.– User Roles take precedence over the default

Roles can own objects

GRANT privileges to the Role

Requires SYSADM or SYSCNTL authority

A Role is not managed through RACF (Security Server)

SEC

Page 57: DB2 9 for z/OS Overview

© 2007 IBM Corporation57

Using a Trusted ConnectionSwitching Users – DB2I

• Use the AS USER field on DB2I DEFAULTS PANEL– DB2 allows the switch if the Primary Auth ID is allowed to use the Trusted

Context without authentication– If an implicit or explicit Security Label exists for the User in the Security Server

– RRSAF SIGNON– DSN ASUSER– SQL CONNECT … USER … USING– DB2 CDB

• TRUSTED in the LOCATION table indicates a trusted connection is desired• SECURITY_OUT & USERNAMES in IPNAMES determine the System Auth ID

and the “switch to” ID

SEC

SQL CONNECT

received at

requester

LOCATIONTRUSTED=?

IPNAMESSECURITY_OUT=?

USERNAMES=?

TRUSTED=“Y”

TRUSTED=“N”

V8 Behavior

Page 58: DB2 9 for z/OS Overview

© 2007 IBM Corporation58

SSL and Trusted Context

Configure AT-TLS layer at the DB2 requester and server

At the DB2 z/OS requester– Set Secure column in the SYSIBM.LOCATIONS table to ‘Y’– Configure SYSIBM.IPNAMES and SYSIBM.USERNAMES tables

Create trusted context at the server

DB2 Server

CREATE TRUSTED CONTEXT SSLCTX ..SYSTEM AUTHID DB2SYS …ATTRIBUTES (ADDRESS ‘9.10.11.12’,

ENCRYPTION ‘HIGH’)

DB2 Requester

CDB:LOCATIONS.PORT=‘448’LOCATIONS.TRUSTED=‘Y’LOCATIONS.SECURE=‘Y’

DB2SYS

SEC

Page 59: DB2 9 for z/OS Overview

© 2007 IBM Corporation59

Improved Audit: DB2 Trace Filtering-START TRACE new filtering capabilities that INCLUDE or EXCLUDE based on the keywords / wildcards (“*”, “_”)– USERID – client user ID

– WRKSTN – client workstation name

– APPNAME – client application name

– PKGLOC – package LOCATION name

– PKGCOL - package COLLECTION name

– PKGPROG – PACKAGE name

– CONNID – connection ID

– CORRID – correlation ID

– ROLE – end user’s database Role

-STA TRACE … ROLE(DBAROLE, USRROLE)-STA TRACE … XROLE(DBAROLE, USRROLE)

SEC

Page 60: DB2 9 for z/OS Overview

© 2007 IBM Corporation60

Advanced Design Options

New Data TypesImplicitly Hidden ColumnsUniversal Table SpaceReordered Row FormatPartitioned By GrowthOptimistic LockingCLONE TablesNOT LOGGED TablesTable APPEND OptionINSTEAD OF TriggersRENAME COLUMN, INDEX

Rename Schema, Owner, VCATSMS DDL IntegrationImplicit Database Support

DSN

Page 61: DB2 9 for z/OS Overview

© 2007 IBM Corporation61

New Data Types

DECFLOAT– DECFLOAT(16)

• 10+384 to 10-383 Positive & Negative– DECFLOAT(32)

• 10+6144 to 10-6143 Positive & Negative

BIGINT– -9223372036854775808 to

– 9223372036854775807

BINARY

VARBINARY

DSN

Page 62: DB2 9 for z/OS Overview

© 2007 IBM Corporation62

Universal Table SpacesUniversal Table Space– Combination of segmented with partitioning options

• Better space management• Support of mass deletes / TRUNCATE

– If partitioned• Still must be one table per table space• Can choose Range Based partitioning (as before: PBR)• Can choose Partitioned By Growth (PBG)

– DROP / CREATE to migrate existing page sets

– Simple table spaces can not be created• Default table space is now Segmented

DSN

Page 63: DB2 9 for z/OS Overview

© 2007 IBM Corporation63

Reordered Row Format (RRF)Automatic repositioning of Variable columns to end of row– Length attributes replaced with Indicators positioned after fixed

length columns

Any table space created in DB2 9 NFM

To Convert:– REORG or LOAD REPLACE a table space or partition

– ADD PARTITION

No EDITPROCs or VALIDPROCs

PIT RECOVER will set the table space to the row format of the PIT

Catalog / Directory remains in Basic Row Format (BRF)

Prefix Fixed Length Cols VarcharIndicators

Varying Length Cols

DSN

Page 64: DB2 9 for z/OS Overview

© 2007 IBM Corporation64

Universal Table SpacesPartition By Growth (PBG)– CREATE TABLESPACE…. MAXPARTITIONS n

• Can specify DSSIZE (or defaults to 64GB)• Only the first partition is created with the CREATE statement (if DEFINE YES)• No ranges specified• SEGSIZE defaults to 4 and LOCKSIZE to ROW

– No USING VCAT.– The compression dictionary is copied as new partitions are created.– Also syntax to specify PGB on CREATE TABLE, when defaulting

the DB & TS.– Considerations:

• Single-table table space• Always defines as LARGE• Need PBR for query partition elimination• No LOAD PART, ALTER ADD PART, or ROTATE PART• All indexes are NPSIs

DSN

Page 65: DB2 9 for z/OS Overview

© 2007 IBM Corporation65

CLONE TablesAllows fast replacing production data without renames and rebinds

– A capability to support online load replace

ALTER TABLE to create a Clone Table– All indexes are also cloned

– Table and Index data are not copied

– Base and Clone tables share the same table space and index names

– Underlying data sets are differentiated by a data set instance number

DSN

Page 66: DB2 9 for z/OS Overview

© 2007 IBM Corporation66

CLONE Tables…On single-table table spaces (partitioned or non-partitioned)

Use insert or load to populate clone tablesUtilities (except RUNSTATS) can operate on clone tables with a new CLONE keywordUse EXCHANGE to switch logical names with underlying data– FLIGHTS now references the data that was in

FLIGHTS_CLONEIndicated in SYSTABLESPACE .CLONE

DDL DISPLAY

DSN

Page 67: DB2 9 for z/OS Overview

© 2007 IBM Corporation67

NOT LOGGED TablesIs actually NOT LOGGED tables, indexes, LOB, XMLALTER / CREATE a TABLESPACE as NOT LOGGED– ALTER not allowed if in same UOW with an update to the

table spaceIndexes, LOB, and XML inherit the logging attribute of the base– This are considered “Linked” objects– Can dissolve the link for LOBsEffects the UNDO / REDO records– Control information is still loggedLOB continue to log system pages & auxiliary indexesA Unit of Recovery (UR) is still createdNo rollback, so there are many ways to end up in RECP & in LPL

DSN

Page 68: DB2 9 for z/OS Overview

© 2007 IBM Corporation68

INSTEAD OF TriggersFor consistent use of views with Select, Insert, Update, and Delete– Many views are not updatable, so customers have to access base

tables for data changes. Triggers can be used to help control updates.

A new type of trigger (~ BEFORE, AFTER triggers)Processed instead of the UPDATE, DELETE or INSERT statement that activated the triggerCan only be defined on views at the current server– provides an extension to the updatability of views– requested update operation against the view gets replaced by the

trigger logic– application still believes all operations are performed against the

view– applicable even for updatable views

DSN

Page 69: DB2 9 for z/OS Overview

© 2007 IBM Corporation69

Indexing EnhancementsLarger Page Sizes

Randomized Indexes

Online Index Rebuild

Asymmetric Page Splits

Index on Expression

Index Compression

DPSIs Improvements

Index Lookaside Expansion

XML Indexes

IDX

Page 70: DB2 9 for z/OS Overview

© 2007 IBM Corporation70

Index Compression

Solution provides page-level compression– Data is compressed to 4K pages

on disk

– 32K/16K/8K pages results in up to 8x/4x/2x disk savings• Use DSN1COMP to estimate

– No compression dictionaries• Compression on the fly• No LOAD or REORG required

IDX

Page 71: DB2 9 for z/OS Overview

© 2007 IBM Corporation71

Which product do I need?

YesAccess Path Advisor

YesWorkload Query Advisor

YesQuery Advisor

YesWorkload Index Advisor

YesQuery Index Advisor

YesYesProfile based Monitoring

YesYesWorkload Statistics Advisor

YesYesYesQuery Statistics Advisor

YesYesVisual Plan Hint

YesYesYesAccess Plan Graph

YesYesQuery Formatter, Annotation

YesYesYesQueries from Cache, Catalog

Optimization Expert

Optimization Service Center

Visual Explain

Functions

Page 72: DB2 9 for z/OS Overview

© 2007 IBM Corporation72

Data SharingAvoid Log Latch Contention

Restart improvements

-ACCESS DB command– Remove GBP Dependency

– Prime Open Data Sets

GRECP Improvements

Health Monitoring

Balance Group Connections

DSH

Page 73: DB2 9 for z/OS Overview

© 2007 IBM Corporation73

Data Sharing V9 EnhancementsLog latch contention relief– Avoid LRSN “spinning”

Restart performance enhancements– Reduced impact of retained locks

• Released as rollbacks are completed– Open data sets ahead of log apply– Remove Buffer Manager locks that have potential of ‘hanging’ restart

Command to remove GBP-dependency at object level– ACCESS DB MODE(NGBPDEP)– Typical usage would be before batch run– Issue on the member on which you plan to run batch

Command to “prime” open data set– ACCESS DB MODE(OPEN) [PART]

DSH

Page 74: DB2 9 for z/OS Overview

© 2007 IBM Corporation74

Data Sharing V9 Enhancements…

Auto-recover GRECP/LPL objects on group restart– Useful in Disaster Recovery or GDPS scenarios

DB2 overall health taken into account for WLM routing

Balance group attach connections across multiple members on same LPAR (V7, V8 usermod)

Indexing improvements help with:– Controlling Inter-DB2 RW Interests

– Contention

– Recovery

– See the Index Enhancements section

DSH

IDX

Page 75: DB2 9 for z/OS Overview

© 2007 IBM Corporation75

Utilities OverviewpureXML Support

More online utilities

REORG BUILD2 elimination

Template switching

MODIFY improvements

COPY improvements

SYSTEM BACKUP / RECOVERY improvements

UTL

Page 76: DB2 9 for z/OS Overview

© 2007 IBM Corporation76

Utilities HighlightsExtensive support has been added to DB2 utilities for the pureXML– CHECK, COPY, LOAD, MERGECOPY, REBUILD INDEX, RECOVER,

REORG, …More online utilities– Rebuild Index SHRLEVEL CHANGE– Reorg LOB now supports SHRLEVEL REFERENCE (space reclamation)– Check data, LOB and repair locate … SHRLEVEL CHANGE– Check index SHRLEVEL REFERENCE supports parallel for > 1 indexOnline REORG BUILD2 phase eliminationIntra-REORG parallelism for UNLOAD, RELOAD, LOG phasesUtility TEMPLATE switchingMODIFY Recovery enhancements– CLONE support– “Retain” keyword added to improve management of copies

• LAST, LOGLIMIT, GDGLIMIT

UTL

Page 77: DB2 9 for z/OS Overview

© 2007 IBM Corporation77

Serviceability and InstrumentationDISPLAY Commands

CANCEL Commands

Health Monitoring

Start up messages

Serviceability items

Denial of Service

SVC

Page 78: DB2 9 for z/OS Overview

© 2007 IBM Corporation78

DISPLAY CommandsDISPLAY / CANCEL– DISPLAY now shows Trusted Context information if applicable– Commands run concurrently via the console

DISPLAY THREAD(*) SERVICE(WAIT)– Command automatically driven @ 1 min interval– Boosts priority of tasks in the way of high priority tasks– Avoids DISCRETIONARY workloads from starving PRIORITY

workloads when CPU % is high– Made available to V8 with maintenance (PK01230)

DISPLAY THREAD(*) TYPE(SYSTEM)– List system type thread

• Like Commands– If command is cancelable

• A non-0 token will be provided

SVC

Page 79: DB2 9 for z/OS Overview

© 2007 IBM Corporation79

DISPLAY Commands

DISPLAY UTILITY– Recover Utility

• Provides an estimate for log processing completed.– REORG SHRLEVEL(CHANGE) or SHRLEVEL(REFERENCE)

• Now shows progress for subtasks processing in parallel

SVC

Page 80: DB2 9 for z/OS Overview

© 2007 IBM Corporation80

ServiceabilityImproved usability of integrity verification tools– Online CHECK INDEX

– Online CHECK DATA

– Online CHECK LOB

– Restrictive states not set if error detected by online utility

– COPY CHECKPAGE no longer sets CHKP if error detected

Improved FFDC for utilities– Additional deadlock & timeout information supplied in job output

– Date and time now included in utility SYSPRINT messages

DSN1PRNT FORMAT formats page even if broken

SVC

UTL

Page 81: DB2 9 for z/OS Overview

© 2007 IBM Corporation81

ServiceabilityImproved logging for SYSUTILX updates– Change data capture enabled– Complete records captured for improved diagnosis of utility issues

Improved logging of DBET information– SCA DBET data check pointed periodically

Restart– New options to specify timestamp on Conditional Restart

– Initiate page set open earlier in forward log phase• Asynchronous page set open at log read rather than waiting until LOGAPPLY

– Defer closing SYSLGRNX ranges until after restart

After the IPL for DB2 9 ERLY code– ERLY code can be refreshed with

REFRESH DB2,EARLY

SVC