Professional Documents
Culture Documents
Important Disclaimer
THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN ADDITION, THIS INFORMATION IS BASED ON IBMS CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE. IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION. NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF:
CREATING ANY WARRANTY OR REPRESENTATION FROM IBM (OR ITS AFFILIATES OR ITS OR THEIR SUPPLIERS AND/OR LICENSORS); OR ALTERING THE TERMS AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT GOVERNING THE USE OF IBM SOFTWARE.
Agenda
Performance considerations
DB2
EXEC SQL CALL PROGX Catalog Entry
WLM-SPAS
LE Enclave
Sched PROGX Execute SQL locally Execute SQL locally Return parms C1 rows (only stored procedures) PROGX: EXEC SQL OPEN C1 WITH RETURN EXEC SQL proc end. STEPLIB PDS/PDSE Load Library (PROGX)
z/OS
When code reuse benefit outweigh overhead (additional 30K+ instructions) High overhead environment such as Java on z/OS Dynamic SQL but prefers static SQL
Nested and concurrent routines Multiple invocations of stored procedures/ UDFs requires multiple the resource
One task per routine Scheduling time for each routine
Performance considerations Do not call the metadata routines SYSIBM.SQLPROCEDURECOLS Metadata stored procedure supplied by server Invoked implicitly by V8 CLI client
DB2 LUW client FP4: only invoked if first attempt fails
Performance considerations Do not display/printf() in Production Display/printf() add debugging statements Put routine name, timestamps on messages Multiple routines output to SYSOUT: 02A abend
Runopts: 'MSGFILE(SYSOUT,,,, ENQ)'
Expensive
10
Performance considerations
STAY RESIDENT YES PROGRAM TYPE SUB Different runopts on separate WLM Environment
11
12
Performance considerations Use SP authorization cache ZPARM ROUTINE AUTH CACHE option on INSTALL DB2 PROTECTION PANEL If set to 0 no caching is done: catalog access on each invocation Default 100K Max 5M Max of 5 IDs cached for each routine
SHARE session 1334 2008 IBM Corporation 14
Performance considerations
Use Security DB2 If not accessing non-SQL resources No need to build special external security environment
15
Performance considerations
No more than 512 different load modules in one WLM environment 512 entries in table storing load module names No fancy replacement algorithm
16
17
WLM-SPAS considerations How many to define Sensitive applications TYPE SUB with special runopts Test/development Java Separate if need special JCL
18
WLM-SPAS considerations Need to refresh if code modified V WLM,APPLENV=<APPLENV>,REFRESH DB2 supplies WLM_RESFRESH SP
Use RACF Authority check Can be invoked remotely
19
21
How to control
-STOP PROC/FUNC -CANCEL THD WLM QUISCE
Manual Control
http://www-1.ibm.com/support/docview.wss? uid=swg21239743
22
Control runaways Use ASUTIME to control looping Specified on CREATE Monitored every 20 seconds If no ASUTIME specified and looping
-Cancel Thread wait couple mins Refresh WLM environment Cancel WLM address space as a last resort In the order above!
SHARE session 1334 2008 IBM Corporation 23
Hot Topics
zIIP and stored procedures Native SQL Procedure language Package Path
24
DB2 9 Native SQL PL procedure zIIP eligible when invoked over DDF
SHARE session 1334 2008 IBM Corporation
25
Native SQL PL procedure language DB2 9 Eliminates Generated C code and compilation Fully integrated into DB2 engine Extensive support for versioning
VERSION keyword on CREATE PROCEDURE CURRENT ROUTINE VERSION special register ALTERs
26
Package Path on Create SP DB9 V8 provides special register to identify list of package collection
SET CURRENT PACKAGE PATH
Java Routines Performance Considerations zAAP Java shared classes Common JAR Tips
28
Java Routine Performance Considerations Similar considerations applies Consider path length for each invocation Tune the SQL statements Do not call metadata routines Use SP authorization cache Do not println() in production
29
30
JSPDEBUG
32
zAAP System z Application Assist Processor Runs Java workload (Java application code) Java stored procedures eligible Native system services (i.e.. I/O) not eligible
33
Java Shared Classes Java 5 Uses z/OS shared memory segments Parameter on JVM property file:
-Xscmx4M -Xshareclasses:name=myCache
Statistic
Java Xshareclasses:name=myCache,printStats
Destroy
Java Xshareclasses:name=myCache,destroy
SHARE session 1334 2008 IBM Corporation 34
35
Tips
JVM property startup options in ENVAR
Heap size example
"JVMPROPS=/u/<filename>" create a text file in HFS add this line to the file: -Xmx100M Support for envars > 254 chars in a separate HFS file: ENVAR("_CEE_ENVFILE=/u/<filename>"
36
37
References Redbooks
www.redbooks.ibm.com SG24-7083 Through the call and beyond
Take advantage of the following information resources available for DB2 UDB for z/OS:
Information center http://publib.boulder.ibm.com/infocenter/dzichelp/index.jsp Information roadmap www.ibm.com/software/data/db2/zos/roadmap.html DB2 UDB for z/OS library page www.ibm.com/software/data/db2/zos/library.html Examples trading post www.ibm.com/software/data/db2/zos/exHome.html DB2 for z/OS support www.ibm.com/software/data/db2/zos/support.html Official Introduction to DB2 for z/OS www.ibm.com/software/data/education/bookstore
40
Summary