db2 for z/os - application developers€¦ · db2 for z/os - application developers . ... need to...

66
© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 0 DB2 for z/OS - Application Developers Baltimore/Washington DB2 Users Group December 11, 2013 Ted Alexander [email protected]

Upload: lequynh

Post on 04-Jun-2018

233 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 0

DB2 for z/OS -

Application

Developers

Baltimore/Washington DB2 Users Group

December 11, 2013

Ted Alexander [email protected]

Page 2: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 1

Overview

• Things are changing with every release of DB2 for z/OS.

More features for application developers to exploit and a few

that are going away. In this session we will cover DB2 for

z/OS version 9 and DB2 for z/OS version 10 and we'll see if

we can find some stuff on DB2 for z/OS version 11.

• This presentation is geared towards the application

developer and the tricks that can make their applications run

smoothly and upgrades to the next release of DB2 easier.

• Did you ever wonder how DB2 for z/OS new features are

chosen; we'll have a look at that too.

Page 3: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 2

Agenda

Session designed for Application Developers

Current Editions of DB2 for z/OS

Sunsetting Previous DB2 for z/OS Versions

Features

Enhancements for Application Developers

Utilities

In Structured Query Language (SQL)

DB2 for z/OS – What’s Next – 11

Interesting Links

Hey did you know this was out there?

SEGUS

Questions & Wrap Up

Page 4: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 3

What’s Driving DB2 10 for z/OS Adoption

Proliferation of mobile and other network-connected devices is

driving increases in:

transaction workloads

data volumes

24x7 requirements

Continued focus on cost containment and resource efficiency

Competitive pressures continue to drive an increasing need for

innovation, analytics, and data integration

DB2 for z/OS has leading edge capabilities to support these

requirements and DB2 11 makes important improvements

Out of the Box CPU Saving

HASHED Indexes and more

Page 5: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 4

DB2 10 for z/OS Snapshot

• Fastest uptake • +2x customers vs. 9

• +2.5x licenses vs. 9

• 25% from DB2 V8

• What’s driving Adoption:

• Performance improvements

without application changes

• Virtual Storage Constraint relief

for more threads

• Security, RAS improvements

• Bi-temporal data

Page 6: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 5

DB2 10 Virtual Storage Constraint Relief

SKCT SKPT

Global DSC

DBD CT/PT

Local DSC

Thread / Stack

75-90% less usage DBM1 below bar after REBIND

Thread/Stack/working

• DBM1 below 2GB

– 75-90% less usage in DB2 10

compared to DB2 9

– Some of working storage (stack,

xproc storage) stays below 2GB

• Larger number of threads

– Possible data sharing member

consolidation

• Improve CPU with storage

– More release deallocate

– Larger MAXKEEPD values for

KEEPDYNAMIC=YES

Page 7: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 6

DB2 10 Performance Points

• Most customers can see a 5% - 10% out-of-the-box CPU reduction (transactions and batch) after rebind

• Some workloads and customer situations can see a CPU reduction of up to 20%

• Synergistic operation with latest System z hardware

Sample: Preliminary Measurements of IBM

Relational Warehouse Workload (IRWW) with

Data Sharing

Base: DB2 9 NFM REBIND with PLANMGMT

EXTENDED

DB2 9 NFM DB2 10 CM without REBIND

showed 1.3% CPU reduction

DB2 10 CM REBIND with same access path

showed 4.8% CPU reduction

DB2 10 NFM brought 5.1% CPU reduction

DB2 10 CM or NFM with RELEASE

DEALLOCATE 12.6% CPU reduction from DB2 9

0

2

4

6

8

10

12

14

CM CM

REBIND

NFM DEALLOC

CPU Percent reduced from DB2 9

Page 8: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 7

DB2 10 Productivity – Doing More with Less!

• Easier scaling, simpler memory management

• Reduce contention, more online processing

• Reduced need for REORG

– Build compression dictionary on the fly

– Index list prefetch enhancements

– Row-level sequential detection

• Configure IBM UDFs and stored procedures

• Statement level monitoring

• Access path stability, APREUSE & APCOMPARE

• DDF thread management enhancements

Reduce or Eliminate: Manual invocation of

•RUNSTATS

•COPY/BACKUP SYSTEM

•QUIESCE

•MODIFY RECOVERY

•REORG

Doing So Much, With So Little, For So Long

Page 9: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 8

DB2 10 Connection Profile

• Problem: For distributed workloads, low priority or poorly behaving

client applications may monopolize DB2 resources and prevent high-

priority applications from executing.

• Solution: Increased granularity of monitoring for system level activities

– Number of connections

– Number of threads

– Idle thread timeout

• Profiles specified in SYSIBM.DSN_PROFILE_TABLE

• DB2 10 for z/OS adds support for filtering and threshold monitoring of

system related activities via new keywords

– Number of threads

– Number of connections

– Idle thread timeout

• New scope filters

– ROLE (available through Trusted Context support)

– Product-specific identifier

• Use InfoSphere Optim Configuration manager to manage profiles

Page 10: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 9

Temporal Based Analysis

• System-maintained temporal tables

– DB2 generated history

– AS OF query

• User-maintained temporal tables

– User provided time period

– Automatic business time key enforcement.

– Query over any current, any prior, future point/period in business time.

– New time range update/delete statements support automatic

row splitting, exploited by the merge statements.

• Bi-temporal, combination of the above two

+

Page 11: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 10

DB2 Family Row & Column Access Control

• A table level authorization function fully implemented in the database provides: – Row level access control based on customer-

supplied rules • A doctor can see rows representing his patients only

• A manager can see rows representing his employees only

– Column level access control based on customer-supplied rules

• This is also called data masking

• A teller can see only the last 4 digits of the credit card number column

• Defined and managed by SECADM

Page 12: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 11

DB2 10 Business Security & Compliance

• Protect sensitive data from privileged users and improve productivity – Separation of duties – More granular control – New SECADM authority for security administration – System level DB admin with/without access control and

with/without data access privileges – Usability: DBADM for all DB – New Explain privilege

• Audit policy for improved data auditing – Audit admin authority usage – Dynamic table auditing – All access, statement id level

• Support distributed identities introduced in z/OS 1.11

• Support client certificate authentication in z/OS 1.10

• Support password phrases in z/OS 1.10

• Connection level security enforcement using strong authentication

• Row and column access control – Allow masking of value – Restrict user access to individual cells

Monitor

Security

Admin

Tasks

System

Admin

Tasks

Access

Audit

Database

Admin

Tasks

Page 13: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 12

Current Editions of DB2 for z/OS

DB2 V8.1.0 for z/OS

GA: 03-2004 EOM: 09-2009 EOS: 04-2012

DB2 9 for z/OS

GA: 03-2007 EOM: 12-2012 EOS: 06-2014

DB2 10 for z/OS

GA: 10-2010 EOM: N/A EOS: N/A

DB2 11 for z/OS (ESP)

Planned Availability Date: 1Q-2013 / 2Q-2013

Any DB2 V7 for z/OS

Any previous elements of earlier releases

Page 14: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 13

Sunsetting Previous DB2 for z/OS Features

Private Protocol is going away DRDA

If your program was bound before V6, you will

need to Bind or Rebind your plans and packages

If Acquire(Allocate) was used in your Bind, you will

need to change to Acquire(Use) and Bind / Rebind

If you’re using Explain Tables before DB2 9 , you’ll

need to change those (Unicode changes)

Page 15: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 14

Sunsetting Previous DB2 for z/OS Features –cont.

With DB2 10 for z/OS, DBRMs are no longer

supported, they will need to be converted to

packages.

The “MEMBER” parameter is no longer supported as

well

REBIND PLAN (PLANNAME) COLLID(*)

Using this statement will place the plans with DBRMs in

to a default package (“*”) is for the default package)

Page 16: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 15

Sunsetting Previous DB2 for z/OS Features –cont.

If you’re Skipping DB2 9

You can’t use Simple table spaces any longer

DB2 Managed Stored Procedures are no longer

supported

JDBC and SQLJ Drivers for OS/390 and z/OS are

no longer supported

Page 17: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 16

Migration to DB2 10 for z/OS

Several Options for Migrations

DB2 V8 for z/OS DB2 9 for z/OS

DB2 V8 for z/OS DB2 10 for z/OS

As well as

DB2 9 for z/OS DB2 10 for z/OS

Any DB2 V7 for z/OS – well it’s time to migrate to a new

version of DB2

Page 18: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 17

Enhancements for Application Developers

Temporal Tables

Explain

Bind / ReBind / Automatic

Access Paths and Hints

Release De-allocate

Package Last Used

Stored Procedures

Page 19: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 18

Temporal Data Tables

In Version 10 Temporal Data support is implemented.

There are three types available;

System Time and

Business Time and

BI-Temporal

Page 20: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 19

Temporal Data – cont.

System Time versus Business Time

System Time

Controlled by the system

Data as it relates to the system, i.e. when did the system get it

Time periods many require history tables

Business Time

Controlled by the application

Data as it relates to the application and users

Time periods as the are used by the business

Page 21: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 20

Supporting Temporal Data

Using Temporal Data Causes some changes in;

Indexes – new parameter

For a Unique Constraint

ColumnName, BUSINESS_TIME WITHOUT

OVERLAPS defined in the index statement

SQL statements DDL and DML

As well as certain Requirements and Restrictions

Page 22: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 21

Temporal Data - DDL

CREATE TABLE IMDB_CAPITAL

(IMDBNO INTEGER NOT NULL,

TITLE VARCHAR(25) NOT NULL,

MALE_STAR VARCHAR(25) NOT NULL,

FEMALE_STAR VARCHAR(25) NOT NULL,

SEASON VARCHAR(10) NOT NULL,

EPISODE INTEGER NOT NULL,

CAPITAL_START DATE NOT NULL,

CAPITAL_END DATE NOT NULL,

PERIOD BUSINESS_TIME(CAPITAL_START, CAPITAL_END),

PRIMARY KEY(IMDBNO, BUSINESS_TIME WITHOUT

OVERLAPS)

;

Page 23: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 22

Tempoal Data – DDL - Index

Given we have a UNIQUE Index we must build it.

CREATE UNIQUE INDEX IMDBNO_UI ON IMDB_CAPITAL

(IMDBNO, BUSINESS_TIME WITHOUT OVERLAPS)

USING STOGROUP DSN62010

PRIQTY 1024

SECQTY 512

ERASE NO

COPY YES

;

Page 24: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 23

Temporal Tables – SQL

SQL has some new syntax;

period-specification

Specifies that a period specification applies to the table-reference. The same period name (SYSTEM_TIME or

BUSINESS_TIME) must not be specified more than one time for the same table. The table-reference must not be a

view.

The rows of the table reference are derived by application of the specified period specification.

If the table is a system-period temporal table and a period-specification for the SYSTEM_TIME period is not

specified, the table reference includes all current rows of the table and does not include any historical rows of the

table.

If the table is an application-period temporal table and a period-specification for the BUSINESS_TIME period is not

specified, the table reference includes all rows of the table.

If the table is a bitemporal table and a period-specification is not specified for either SYSTEM_TIME or

BUSINESS_TIME, the table reference includes all current rows of the table and does not include any historical rows

of the table.

FOR SYSTEM_TIME

Specifies that the SYSTEM_TIME period is used for the period-specification.

The table must be a system-period temporal table.

FOR BUSINESS_TIME

Specifies that the BUSINESS_TIME period is used for the

period-specification. The table must be an application-period temporal table.

Page 25: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 24

Temporal Tables - System

Restrictions can apply: in DB2 10.

For point-in-time recovery, to keep the data in the system-period temporal table and the data in the

history table synchronized, you must recover the table spaces for both tables as a set. You can recover

the table spaces individually only if you specify the VERIFYSET NO option in the RECOVER utility

statement.

You cannot run a utility operation that deletes data from a system-period temporal table. These utilities

include LOAD REPLACE, REORG DISCARD, and CHECK DATA DELETE YES.

You cannot run the CHECK DATA utility with the options LOBERROR INVALIDATE, AUXERROR

INVALIDATE, or XMLERROR INVALIDATE on a system-period temporal table. The CHECK DATA

utility will fail with return code 8 and message DSNU076.

You cannot alter the schema (data type, check constraint, referential constraint, etc.) of a system-

period temporal table or history table; however, you can add a column to system-period temporal table.

You cannot drop the history table or its table space.

You cannot define a clone table on the system-period temporal table or the history table.

You cannot create another table in table space for either the system-period temporal table or history

table.

On the history table, you cannot use the UPDATE, DELETE, or SELECT statement syntax that

specifies the application period.

You cannot rename a column or table name of a system-period temporal table or a history table.

Currently, there is no support for ALTER INDEX to specify ADD BUSINESS_TIME WITHOUT

OVERLAPS. And there is no support for SELECT FROM UPDATE and SELECT FROM.

DELETE when the UPDATE or DELETE statement has the FOR PORTION OF clause specified.

Page 26: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 25

Temporal Tables - Why

Shortens the time to build objects (tables, indexes and code)

Your applications needs less code and be easier to maintain

Your solution needs to straightforward and solve many business

requirements

Cost savings from reduced CPU usage, (ROT) the closer to the

DB2 function / engine the more efficient UOW. Versus In-House

code.

Uses the IBM architecture that has been standardized via ISO

This form of Temporal Table is in the Catalog and in the Data

Model, no more sifting through code to see that it exists

Given the standardized model, interoperability will be increased

Page 27: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 26

DB2 for z/OS prefetch available

Sequential: Selected at SQL statement bind time. At statement execution time, as soon

as the target table space is accessed, two prefetch quantities of sequential

pages are read into the buffer pool. Additional requests for a prefetch quantity

of pages are issued each time a trigger page is accessed by the executing

SQL statement. A trigger page is one that is a multiple of the prefetch

quantity. DB2 therefore tries to stay at least one prefetch quantity of pages

ahead of the application process.

List RIDs for qualifying rows (per a query’s predicates) are obtained from one or

more indexes. In most cases, DB2 sorts the RIDs, then issues asynchronous

multi-page read requests against the base table space.

Dynamic: DB2 determines at query run time that the pattern of page access for a target

table or a utilized index is sequential enough to warrant activation of prefetch

processing. If the page access pattern subsequently strays from sequential

enough, prefetch processing is turned off. It is turned on again if sequential

enough access resumes.

Page 28: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 27

Dynamic Prefetch

DB2 Version 2.3 introduced dynamic prefetch.

Sequential Prefetch is enabled only for table space

scans.

For SQL access, the maximum prefetch quantity;

DB2 V8 for z/OS – 32 4K pages

DB2 9 for z/OS – 64 4K pages for tables and indexes

DB2 10 for z/OS - Same

For utility access (in 4k BP)

DB2 9 for z/OS – 64 pages

DB2 10 for z/OS – remains the same.

Page 29: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 28

Prefetch and Indexes

In Version 9

When doing Sequential I/O, DB2 reads 32 4k pages

DB2 9 needs help keeping the Index Organized

In Version 10

DB2 10 can now use leaf pages when doing list prefetch

of index data

DB2 10 removes most of the performance issues of

poorly organized indexes

Page 30: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 29

DDF Enhancements

DB2 10 includes a number of enhancements to DDF

processing to improve the overall performance of distributed

workload:

High performance DBATs are introduced to make it more

palatable to bind distributed packages with the option

RELEASE(DEALLOCATE).

Together with other optimizations between the DIST address

space and the DBM1 address space, DB2 10 performs an

implicit close between the DIST address space and the

DBM1 address space when only one row is to be returned.

Page 31: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 30

RELEASE(DEALLOCATE) BIND option

Distributed pooled threads are expenses to create and

destroy (allocate and deallocate)

Excessive lock timeouts can occur with DDF threads holding

locks when packages are bound with

RELEASE(DEALLOCATE) or KEEPDYNAMIC(YES).

These page set and package locks make it difficult for other

processes, such as BINDs and DDL, to break in.

Page 32: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 31

Plans and Explains

Plans that Contain DBRMs must be converted

This is done with

REBIND PLAN(PLANNAME) COLLID (*) or (CollName)

This must be done Prior to Migration

OR, and maybe you don’t want this,

DB2 10 will automatically REBIND the plan the first time it

is executed

Page 33: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 32

Plans and Explains – cont.

Plans and packages pre DB2 V6 are no longer acceptable to

DB2 10

They must go through the ReBind process

Look familiar. OR, and maybe you don’t want this,

DB2 10 will automatically REBIND the plan the first time

it is executed

This can yield unknown results

Can be an issue depending on how many plans there are

Page 34: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 33

Explain Privileges

SQLADM role

Can issue the EXPLAIN statement

This can be done with NO access to the underlying

DATA

They can not issue DDL statements

New Explain Privilege

Can issue the EXPLAIN statement

This can be done with NO access to the underlying

DATA

Can Use EXPLAIN(ONLY) to bind plans

REBINDing allows your PLAN or PACKAGE awareness to

the new DB features

Page 35: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 34

Plans and Explains – cont.

Plan tables have more in them, and must be a minimum in Version 8

format. (SQLCODE -20008)

Unicode

PK85068: EXPLAIN TABLE MIGRATION

New DSN Jobs

Queries to help ID bad tables

DB2 10 CM, use of EXPLAIN tables in and use of EBCDIC EXPLAIN

tables and EXPLAIN tables in DB2 V8 or 9 format will result in

SQLCODE +20520.

Page 36: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 35

Binds

When to REBIND?

• Avoid incremental/auto- (RE-)BINDs

* Consider the enhanced RUNSTATS when doing a

skip migration

** life the operating your DB2

Page 37: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 36

Why Rebind under 10

– REBIND packages to generate new SQL run time

– Improved performance from new run time (avoid puffing, enable SPROC)

– Maximize DBM1 31-bit VSCR

– Allow RID overflow to workfile

– Take advantage of query optimization changes (in CM mode)

– Reduce exposure to problems with migrated packages from earlier releases

» INCORROUTs

» Thread abends

• Can mitigate exposure to bad access path change introduced with REBIND which leads to degraded run time performance (regression)

– Use access plan stability (PLANMGMT=EXTENDED|BASIC) and fallback if needed

» PLANMGMT=EXTENDED is now the default

– Use APREUSE and APCOMPARE

Page 38: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 37

Why Rebind under 10

• Use of RELEASE(DEALLOCATE)

• Early evaluation of residual predicates

• IN-list improvements (new access method)

• SQL pagination (new access method)

• Query parallelism improvements

• Index include columns

• More aggressive view/table expression merge

• Predicate evaluation enhancements

• RID list overflow improvements No REBIND required for

• Index list prefetch

• INSERT index I/O parallelism

• Workfile spanned records

• SQLPL performance

• High performance DBATs

• Inline LOBs

Page 39: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 38

Bind ImpactExpert® for DB2 z/OS

Eliminate the risk associated with REBINDs and BINDs

Analyze access path changes prior to DB2 version migration

Suppress REBINDs that would degrade performance

Pinpoint poor performing SQL statements

Improve application performance & Optimize QA processes

Protect the dynamic statement cache from invalidation

Predict RUNSTATS that improve dynamic SQL performance

Empower the DBA with Access Path Restore for the dynamic

statement cache

Page 40: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 39

Bind ImpactExpert® for DB2 z/OS – Key Points

Processes all types of REBIND or BIND package statements

Reduces locks on the DB2 catalog by eliminating

unnecessary rebinds, which account for a large percentage

of all REBINDs

Logs and displays all activities in an easy-to-use ISPF online

interface

Customizable weight system to compare access path types

Runs standalone to process packages and entire collections

Integrates into existing infrastructure and maintenance

procedures

Pre-screens DB2 version migrations and pack refreshes for

dynamic and static SQL

Secures the exploitation of DB2 9 and 10

Supports DSN_VIRTUAL_INDEXES, allowing you to drop or

create indexes to

Page 41: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 40

Bind ImpactExpert® for DB2 z/OS

AUTOMATICALLY IDENTIFIES AND INTERCEPTS

REBIND STATEMENTS THAT WILL DEGRADE

PERFORMANCE

Integrates and Evaluates

ELIMINATES UNNECESSARY REBINDS

Allowing only those REBINDs

AUTOMATES QUALITY ASSURANCE DURING THE

HAND-OVER OF CHANGED APPLICATIONS

Automatically pinpoints any SQL changes

QUICKLY IDENTIFIES WHY AN ACCESS PATH

MIGHT DEGRADE PERFORMANCE

Automatically pinpoints potentially problematic SQL

within packages & plans

predicts RUNSTATS that will improve dynamic SQL

performance

SECURE THE EXPLOITATION OF NEW DB2

VERSIONS AND CPU UPGRADES

Page 42: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 41

SEGUS – Bind ImpactExpert (BIX)

Static SQL - You bet

Dynamic SQL - Yes We do.

Page 43: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 42

Currently Committed Data

DB2 allows access only to data that is committed and

consistent, (ISOLATION (UR)) option for BIND.

In DB2 9, SKIP LOCKED DATA clause on the SELECT

statement allows DB2 to skip pages or rows blocked by locks

held by other UOW. Only committed and consistent data is

returned; This doesn’t mean all qualifying row are.

In DB2 10, enhances this UOW by allowing it to access the

version of data that was last committed. This is the version of

data as it was before the “blocking” UOW changed the row

but has not yet committed the change).

Some Restrictions Apply

Page 44: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 43

Currently Committed Data – cont.

A couple of New statements A new BIND option CONCURRENTACCESSRESOLUTION

A new PREPARE option USE CURRENTLY COMMITTED

A new CREATE or ALTER PROCEDURE option

Page 45: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 44

LASTUSED for Packages

In the past,

it was difficult to identify old packages

No longer being executed

Wasting space in the Catalog

Wasting space in SPT01 (space limits and plan stability).

Reconcile accounting reports against the DB2 catalog, to

manual

In DB2 10,

an new column, LASTUSED (DATE), in

SYSIBM.SYSPACKAGE and SYSIBM.SYSPLAN.

Populated when the package is requested from EDM.

After BIND (REPLACE) LASTUSED is reset to the default

value (CURRENT DATE). This column can be updated in

DB2 10 CM.

Page 46: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 45

Utilities in DB2 10

Utilities are enhanced to support new functions;

Universal table space (UTS) enhancements,

Online schema changes,

Inline LOBs, XML, and other new functions.

A new DB2 Sort for z/OS tool provides high-speed sort

processing for data

DB2 10 utilities continue to trend towards providing

autonomic utility usage

And more

Page 47: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 46

DB2 Family SQL z z/OS 10 Commonalities LUW Linux, UNIX & Windows

Multi-row INSERT, FETCH & multi-row cursor UPDATE, Dynamic Scrollable Cursors, GET

DIAGNOSTICS, Enhanced UNICODE SQL, join across encoding schemes, IS NOT

DISTINCT FROM, VARBINARY, FETCH CONTINUE, MERGE, SELECT from MERGE, data

versioning, access Controls

Inner and Outer Joins, Table Expressions, Sub-queries, GROUP BY, Complex Correlation,

Global Temporary Tables, CASE, 100+ Built-in Functions including SQL/XML, Limited Fetch,

Insensitive Scroll Cursors, UNION Everywhere, MIN/MAX Single Index, Self Referencing

Updates with Sub-queries, Sort Avoidance for ORDER BY, and Row Expressions, 2M

Statement Length, GROUP BY Expression, Sequences, Scalar Full-select, Materialized

Query Tables, Common Table Expressions, Re-cursive SQL, CURRENT PACKAGE PATH,

VOLATILE Tables, Star Join Sparse Index, Qualified Column names, Multiple DISTINCT

clauses, ON COMMIT DROP, Transparent ROWID Column, Call from trigger, statement

isolation, FOR READ ONLY KEEP UPDATE LOCKS, SET CURRENT SCHEMA, Client

special registers, long SQL object names, SELECT from INSERT, UPDATE or DELETE,

INSTEAD OF TRIGGER, Native SQL Procedure Language, BIGINT, file reference variables,

XML, FETCH FIRST & ORDER BY in sub-select & full-select, case-less comparisons,

INTERSECT, EXCEPT, not logged tables, OmniFind, spatial, range partitions, data

compression, session variables, DECIMAL FLOAT, optimistic locking, ROLE, TRUNCATE,

index & XML compression, created temps, inline LOB, administrative privileges, implicit cast,

date/time changes, currently committed, moving sum & average, index include columns,

PureScale

Updateable UNION in Views, GROUPING SETS, ROLLUP, CUBE, more Built-in Functions,

SET CURRENT ISOLATION, multi-site join, MERGE, MDC, XQuery, XML enhancements,

array data type, global variables, even more vendor syntax, temp table compression

z/O

S C

omm

on

LUW

Page 48: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 47

DB2 9 -> 10 Beta Performance

What’s Coming in 11 ?????

Page 49: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 48

SQL Enhancements – 10

IN List

Range List

Index INCLUDE

Matching Multiple IN-List

Avoiding Index Probing overhead

Allows list pre-fetch for IN-list predicates.

INSERT index read I/O parallelism

IN-list predicate transitive closure

Page 50: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 49

SQL Enhancements – 11

New Stage 1 predicates

New IN (list ) processing

GROUPING SETS, ROLLUP & CUBE

DPSI performance improvements

DGTT performance improvements

Temporal data enhancements

Transparent archive query

We’ll See.

Page 51: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 50

DB2 for z/OS

– What’s Next

Page 52: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 51

What’s Next Disclaimer

• Questions:

• Is this what’s going to be in the next release?

– Quoting Bugs Bunny “Humm Yep Could Be”

• When will we see this features?

– Quoting Elmer Fudd “Which way did he go”

• Actually, IBM is not making any promises that these features will be included in the next release, nor is there any promise of time of delivery. This information is only for discussion at this time.

• This is my version.

• Now for theirs…..

Page 53: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 52

What’s Next Disclaimer - IBM

IBMs statements regarding its plans, directions, and intent are subject to

change or withdrawal without notice at IBM’s sole discretion.

Information regarding potential future products is intended to outline our

general product direction and it should not be relied on in making a

purchasing decision.

The information mentioned regarding potential future products is not a

commitment, promise, or legal obligation to deliver any material, code or

functionality. Information about potential future products may not be

incorporated into any contract. The development, release, and timing of any

future features or functionality described for our products remains at our

sole discretion.

Performance is based on measurements and projections using standard

IBM benchmarks in a controlled environment. The actual throughput or

performance that any user will experience will vary depending upon many

factors, including considerations such as the amount of multiprogramming

in the user’s job stream, the I/O configuration, the storage configuration,

and the workload processed. Therefore, no assurance can be given that an

individual user will achieve results similar to those stated here.

Page 54: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 53

DB2 11 Major Themes

• Performance Improvements – Improving efficiency, reducing costs, no application changes

– 0-5% for OLTP

– 20-30% for query workloads

– Less overhead for data de-compression

– Exploitation of new zEC12 hardware features

• Continuous Availability Features – Improved autonomics reducing costs &improves availability

– Online REORG improvements, less disruption

– DROP COLUMN, online change of partition limit keys

– Extended log record addressing capacity (1 yottabyte)

– BIND/REBIND break into persistent threads

• Enhanced business analytics – Faster, more efficient performance for query workloads

– Temporal and SQLPL enhancements

– Transparent archiving

– SQL improvements and IDAA enhancements

• Simpler, faster DB2 version upgrades – No application changes required for DB2 upgrade

– Access path stability improvements

– Stability: support pre GA customer production

ESP Announced on Oct. 3, 2012 ESP to start in March, 2013

Page 55: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 54

Some Planned DB2 11 RAS Improvements

• BIND / DDL concurrency with persistent threads

– Use of persistent threads likely will increase in V10 with vstor relief

• More online schema changes

– Alter partitioning limit keys

– DROP column

– Point in time recovery support for deferred schema changes

• Cancel DDF Threads – new FORCE option

• Open data set limit raised to 200K

• Workfile space shortage warning new instrumentation and messages

• REORG avoidance

– Automatic cleanup of index pseudo deleted entries

• Online REORG improvements – if a REORG is needed, then the goal is non-disruptive

– SWITCH phase performance improvements

– Drain improvements to improve concurrency of log apply and switch phases

– REORG REBALANCE SHRLEVEL(CHANGE)

• Easier query performance management

– Optimizer input to Runstats

• DB2/RACF authorization control enhancements

• Buffer pool management improvements

– New FRAMESIZE BP attribute for direct control of z/OS large page frame usage

– Max/min size for WLM system-managed BPs

Page 56: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 55

DB2 11 Some Planned New Application Features

• Global variables

• SQLPL improvements (performance, manageability, function)

– Autonomous transactions

– Lift 2M SQL statement length limit

– Array data type support

• Alias/synonym support for Sequence Objects

• Grouping sets

• DPSI performance improvements

• DGTT performance improvements

• Temporal data enhancements

– Support for views and Special register support

• Transparent archive query

■ New DDL to relate the current table to the archive

■ Applications can query current + archive with no SQL changes

■ Archiving process is user-controlled

■ Leverages DB2 10 temporal constructs for archiving

Page 57: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 56

Easier DB2 Version Upgrade

• SQL Compatibility – new option for enforcement

– Limit SQL incompatibilities when possible

– Provide mechanism to identify applications affected by

SQL changes

– Provide seamless mechanism to make changes at an

application (package) level

• This mechanism will enable support for up to two

back level releases (N-2)

• DB2 11 will be the initial deployment of this capability

• DB2 10 will be the lowest level of compatibility

supported

• More Access path stability improvements

Page 58: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 57

DB2 11 Planning

• Dual mode migration (CM, NFM)

• Migration from DB2 10 only (no skip)

• z/OS 1.13 or above. z10 or above.

• No pre-9 bound packages

• Sysplex query parallelism support is removed

Page 59: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 58

Requirements for DB2 11 for z/OS

z/OS V1.13 Base Services, (5694-A01), or later

DFSMS V1.13

Language Environment® Base Services

z/OS V1.13 Security Server ( RACF® )

DB2 11 for z/OS operates on z10 or later processors running

z/OS V1.13, or later. The processors must have enough real

storage to satisfy the combined requirements of:

DB2

z/OS

The appropriate DFSMS storage management subsystem

components, access methods, telecommunications, batch

requirements, and other applications

DB2 11 will probably require increased real storage as

compared to DB2 10 for z/OS .

IRLM V2.3 (delivered with DB2 11)

Page 60: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 59

Interesting Links

IBM DB2 z/OS Home Page

http://www-01.ibm.com/software/data/db2/zos/library.html

IBM DB2 for z/OS Information Center

http://pic.dhe.ibm.com/infocenter/dzichelp/v2r2/index.jsp?

World of DB2 for z/OS - 1700+ members

http://db2forzos.ning.com/

DB2 10 LinkedIn - 1000+ members

http://linkd.in/IBMDB210

DB2 for z/OS What’s On LinkedIn – 2000+ members

http://linkd.in/kd05LH

DB2 for z/OS YouTube

http://www.youtube.com/user/IBMDB2forzOS

WW IDUG LinkedIn Group - 2000 +members

http://linkd.in/IDUGLinkedIn

IBM DeveloperWorks

http://www.ibm.com/developerworks/data/community/

Page 61: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 60

Request For Enhancements

http://www.ibm.com/developerworks/rfe/execute?use_case=changeRequestLanding

The DB2 and IMS Tools RFE provides customers with greater

accessibility to the requirements that are of interest to them.

Please use the DB2 and IMS Tools RFE to submit customer

requirements going forward

Page 62: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 61

About Segus

Founded in 1992 as the North American subsidiary of SOFTWARE

ENGINEERING GmbH in Germany, SEGUS Inc has provided

North American customers with quality tools for more than 20 years.

Our parent company SOFTWARE ENGINEERING GmbH is based

in Dusseldorf, Germany. With over 30 years of experience and over

500 customers worldwide, SOFTWARE ENGINEERING GmbH is

one of the largest independent software companies in Germany.

SEGUS and SOFTWARE ENGINEERING GmbH specializes in the

development of DB2 for z/OS solutions and services. Our DB2

tools optimize DB2 performance, precisely-maintained databases,

and reduce outages. By predicting SQL performance degradations,

automatically managing BIND/REBIND processes, and ensuring

database recoverability, SEGUS Inc tools support the high

availability demands of today’s 24/7 businesses.

Page 63: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 62

Wrap Up and Questions

•There is a lot we did not talk about in DB2 10 and DB2 11 •There are more areas for developers to research •More DB2 technologies are impacting DBAs as well as •Developers •There's more technology on the way

Page 64: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 63

Thanks & Contact Info

Thank You for having SEGUS and I at the meeting.

Thanks to Your Board Members for this meeting as

well as all their hard work in supporting the group.

Thank You for your participation as well.

Ted

Ted Alexander [email protected]

Page 65: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 64

References

IBM DB2 9 Product Documentation

IBM DB2 10 Product Documentation

DB2 9 System Administration for z/OS –

Judy Nall

Years of buying: Craig Mullins books

DB2 10 for z/OS Database Adm.

Certification Study Guide – Susan Lawson

IBM Redbooks

Page 66: DB2 for z/OS - Application Developers€¦ · DB2 for z/OS - Application Developers . ... need to Bind or Rebind your plans and packages ... REBIND PLAN

© 2013 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 65

Other Topics

Security

Performance Enhancements

Logging

DSNZPARMS

Programming Performance – Batch

Online

Distributed