+ All Categories
Home > Documents > DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

Date post: 12-Sep-2021
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
52
© Xephon plc 2002 February 2002 112 3 DB2 710 utilities 19 Data tool for database management 31 Explaining the UDB DB2 Governor 40 Leveraging mainframe data using a data warehouse 52 DB2 news
Transcript
Page 1: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© Xephon plc 2002

February 2002

112

3 DB2 710 utilities19 Data tool for database management31 Explaining the UDB DB2

Governor40 Leveraging mainframe data using a

data warehouse52 DB2 news

Current Support
Xephon magazine issues are now supported at www.cbttape.org. Please go to www.cbttape.org if you have any support questions.
Page 2: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

2

DB2 UpdatePublished byXephon27-35 London RoadNewburyBerkshire RG14 1JLEnglandTelephone: 01635 38342From USA: 01144 1635 38342E-mail: [email protected]

North American officeXephonPO Box 350100Westminster, CO 80035-0100USATelephone: 303 410 9344

Subscriptions and back-issuesA year’s subscription to DB2 Update,comprising twelve monthly issues, costs£255.00 in the UK; $380.00 in the USA andCanada; £261.00 in Europe; £267.00 inAustralasia and Japan; and £265.50elsewhere. In all cases the price includespostage. Individual issues, starting with theJanuary 1997 issue, are available separatelyto subscribers for £22.50 ($33.75) eachincluding postage.

DB2 Update on-lineCode from DB2 Update, and complete issuesin Acrobat PDF format, can be downloadedfrom our Web site at http://www.xephon.com/db2; you will need to supply a wordfrom the printed issue.

© Xephon plc 2002. All rights reserved. None of the text in this publication may be reproduced,stored in a retrieval system, or transmitted in any form or by any means, without the priorpermission of the copyright owner. Subscribers are free to copy any code reproduced in thispublication for use in their own installations, but may not sell such code or incorporate it in anycommercial product. No part of this publication may be used for any form of advertising, salespromotion, or publicity without the written permission of the publisher. Copying permits areavailable from Xephon in the form of pressure-sensitive labels, for application to individualcopies. A pack of 240 labels costs $36 (£24), giving a cost per copy of 15 cents (10 pence).To order, contact Xephon at any of the addresses above. Printed in England.

EditorTrevor Eddolls

DisclaimerReaders are cautioned that, although theinformation in this journal is presented in goodfaith, neither Xephon nor the organizations orindividuals that supplied information in thisjournal give any warranty or make anyrepresentations as to the accuracy of thematerial it contains. Neither Xephon nor thecontributing organizations or individualsaccept any liability of any kind howsoeverarising out of the use of such material.Readers should satisfy themselves as to thecorrectness and relevance to theircircumstances of all advice, information,code, JCL, and other contents of this journalbefore making any use of it.

ContributionsWhen Xephon is given copyright, articlespublished in DB2 Update are paid for at therate of £170 ($260) per 1000 words and £100($160) per 100 lines of code for the first 200lines of original material. The remaining codeis paid for at the rate of £50 ($80) per 100lines. In addition, there is a flat fee of £30($50) per article. To find out more aboutcontributing an article, without anyobligation, please download a copy of ourNotes for Contributors from www.xephon.com/nfc.

Page 3: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

3© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

DB2 710 utilities

INTRODUCTION

With DB2 710, IBM separated most of the utilities from the base DB2product. Most utilities have been grouped in three separate independentproducts:

• Operational utilities – this product, program number 5655-E63(FMID JDB771K), includes Copy, Load (including Cross Loader),Rebuild Index, Recover, Reorg Tablespace, Reorg Index, Runstats(enhanced with history), Stospace, and Unload (new).

• Diagnostic and Recovery utilities – this product, program number5655-E62 (FMID JDB771M), includes Check Data, CheckIndex, Check LOB, Copy, CopyToCopy (new), Mergecopy,Modify Recovery, Modify Statistics (new), Rebuild Index, andRecover.

• Utilities Suite (FMID JDB771K + JDB771M), which includesall the utilities in the above two products.

All the utilities are shipped deactivated with the Base Engine. Thecorresponding product licences must be obtained to activate thespecific utilities functions. However, all utilities are always availablefor execution on DB2 Catalog and Directory.

The following utilities, and all stand-alone utilities, are consideredcore utilities and are included and activated with DB2 V7: CATMAINT,DIAGNOSE, LISTDEF, OPTIONS, QUIESCE, REPAIR, REPORT,TEMPLATE, and DSNUTILS.

The enhancements to the utilities provide improved functionality andperformance. This allows the utilities to compete with IndependentSoftware Vendor (ISV) offerings.

The most significant changes are grouped around:

• Dynamic utility jobs using wildcarding and dynamic allocation– this provides better, more automated administration and usageof all the utilities.

Page 4: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 4

• The new UNLOAD utility now includes many of the features,functions, and improved performance that users have beenlooking for.

• Enhancements to Online Reorg to minimize the period of timeduring which the data is not available.

• The new CopyToCopy utility which allows ‘offline’ imagecopies duplication.

• The ability to keep Statistics History, allowing better performanceanalysis.

DYNAMIC UTILITY JOBS

Development and maintenance of utility jobs can be very time-consuming and error-prone. Users primarily face three challenges:

• DD statements must be provided for all datasets.

• Within each DD statement, space, disposition, and otherparameters must reflect the current situation.

• Utility statements must explicitly list all DB2 objects to beprocessed and these objects must be named accurately.

As new objects are constantly created, others are deleted, and sincethe sizes of most objects vary over time, it is particularly difficult tokeep up with the changes.

DB2 710 addresses these three challenges by introducing the newutility control statements, TEMPLATE and LISTDEF.

With DB2 710, database administrators can submit utility jobs morequickly and easily.

Now you can:

• Dynamically allocate the datasets required to process thoseobjects (TEMPLATE).

• Dynamically create object lists from a pattern-matching expression(LISTDEF).

The use of TEMPLATE utility control statements simplifies your JCL

Page 5: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

5© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

by eliminating most dataset DD cards. Now you can provide datasettemplates, and the DB2 product dynamically allocates the datasetsthat are required based on your allocation information.

Using a LISTDEF facility, you can standardize object lists and theutility control statements that refer to them. Standardization reducesthe need to customize and change utility job streams over time.

Using these new functionalities, database administrators require lesstime to maintain utilities jobs.

TEMPLATE

With the TEMPLATE utility control statement, you define a dynamiclist of dataset allocations.

More precisely:

• You create a skeleton or a pattern for the names of the datasets toallocate.

• The creation of the list of datasets to allocate is dynamic. That is,this list is generated each time the template is used by anexecuting utility. Therefore, a template automatically reflects thedataset allocations currently needed.

• The allocation of the datasets is dynamic. That is, the datasets arenot allocated at the beginning of the job step, but each invokedutility allocates the datasets at execution time.

• You make use of a template by specifying the name of thetemplate within a utility control statement – for example, duringan image copy, within the COPY control statement.

In order to illustrate the use of the TEMPLATE statement, we willconsider JCL to copy two partitions tablespaces of the DB2 catalog.

In DB2 Version 610, you should code something like:

���������������� �������������������

���

���������������������������������������������������������

������������������������������������ ������� �����

���

���������������������������������������������������������

Page 6: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 6

������������������������������������ ������� �����

���

���������������

����������������������� ������� �����������������

����������������������� ������� �����������������

��

In DB2 Version 710, you could use TEMPLATE to generatedynamically primary image copy dataset names:

���������������� �������������������

���

���������������

��������������������������!������!����!�����!"�������!#� ��!��� ����

����������������������� ������� ������������

����������������������� ������� ������������

��

Then you get the following utility output:

���� ����������� � ��$�� �� ��������%��� �������� �����������

���� �&��������� � ��$�������������

�����������!������!����!�����!"�������!#� ��!�������

���� ��'&������� "����$������������������������������ ���% ���

���� �&��������� � ��$���������������������� ������� ������������

���� ��'(������� �����$�������������������������������

���������������������������������������

���������������������������������������������� ������� �������� ����(�'

���� )���������� �����$��������������%������������������� ������� �

������������������������ ������%�������'

������������������������*�������������%���������������������'���

�������������������������������%�#�������������������

��������������������������������������+��+��

���� )�(�������� �����$���������������� ���% ��%������������

������ ������� �

���� �&��������� � ��$���������������������� ������� ������������

���� ��'(������� �����$�������������������������������

���������������������������������������

���������������������������������������������� ������� �������� ����(�'

���� )���������� �����$��������������%������������������� ������� �

������������������������ ������%�������'

������������������������*�������������%���������������������&�''

�������������������������������%�#�������������������

��������������������������������������+��+��

���� )�(�������� �����$���������������� ���% ��%������������

������ ������� �

���� ����������� ����$� ��������� ��������������#��#������� ��

�����

Page 7: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

7© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

Dataset names

The first challenge we mentioned is to provide a correct dataset namefor the DB2-generated DD statements.

This is done using substitution variables.

The TEMPLATE dataset names pattern can be specified using a broadset of substitution variables

Job-related variables are:

• JOBNAME

• STEPNAME

• USERID

• SSID – DB2 subsystem ID.

Utility-related variables are:

• UTIL – utility ID (truncated to 8 characters).

• ICTYPE – image copy type F or I.

• LOCREM – character L is used when the utility defines aCOPYDDN ddname.

The character R is used when the utility defines aRECOVERYDDN DDname.

It is valid only for image copy templates.

• PRIBAK – character P is used when the utility defines aCOPYDDN DDname.

The character B is used when the utility defines aRECOVERYDDN DDname.

It is valid only for image copy templates.

Object-related variables are:

• DB – database name

• TS – tablespace name

• IS – index space

Page 8: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 8

• SN – space name

• LIST – name of the list LISTDEF

• SEQ – sequence number of the object in the list.

Date and time-related variables are:

• DATE – yyyyddd

• YEAR – yyyy

• MONTH – mm

• DAY – dd

• JDATE – yyyddd

• TIME – hhmmss

• HOUR – hh

• MINUTE – mm

• SECOND – ss.

You should notice that all date/time values are set using GreenwichMean Time (GMT).

Space allocation

The second challenge we mentioned is the provision of the correctparameters for the DB2-generated dataset allocations. Most notably,the space parameters should reflect the current size of the tablespaceor index space and the different space requirements for the differentDASD datasets used by a particular utility.

As DB2 automatically allocates these datasets when using templates,it must also generate the correct space parameters for each datasetautomatically, if you have not specified the space option in yourtemplate definition.

To this end, DB2 uses formulae which are specific for each utility andeach dataset. The input values used in these formulae mostly comefrom the DB2 catalog tables. The high-used RBA is read at open timeand it is maintained by the buffer manager. It is the most current value,updated before it is even written to the ICF catalog.

Page 9: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

9© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

All these formulae are documented in the standard DB2 manuals.

LISTDEF

Having already replaced the DD statements and related dispositionparameters by templates, we now address the next mentioned challengewhen coding a utility job: how to generate a complete and accurate listof all DB2 objects to be processed by the utility. This can be doneusing the new LISTDEF utility.

With this utility control statement you define a dynamic list of DB2objects, namely tablespaces, index spaces, or their partitions.

As mentioned before, the actual list is generated each time it is usedby an executing utility. Therefore, a list automatically reflects whichDB2 objects currently exist.

More precisely:

• You provide the rules or the algorithm used to generate the list ofsuch DB2 objects.

• This list is dynamic. That is, the actual list is generated each timethe list is used by an executing utility. Therefore, a list automaticallyreflects the existing DB2 objects.

• You make use of such a list by specifying the name of the list afterthe keyword LIST within a utility control statement – for example,within the COPY control statement.

In order to illustrate the use of the LISTDEF statement, we willconsider the JCL to recover all tablespaces PTDB.PTTSRT*.

In DB2 Version 610, you should code something like:

������������

�����������������������������

�����������������������������

������������������������������

�����������������������������

��

In DB2 Version 710, you could use a LISTDEF statement to generatedynamically a tablespaces list:

���������������� �������������������

Page 10: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 10

���

���������������

���������%��������� ������������������������,

���������������������������!������!����!�����!"�������!#� ��!��� ����

�������������������������

��

Then, you get the following utility SYSOUT:

���� ����������� � ��$�� �� ��������%��� �������� �����������

���� �&��������� � ��$��������%������� ������������������������,

���� ��'&������� �����$�������%��������������������� ���% ���

���� �&��������� � ��$�������������

�����������!������!����!�����!"�������!#� ��!��� ����

���� ��'&������� "����$������������������������������ ���% ���

���� �&��������� � ��$������������������������

���� ��'(������� �����$�������������������������������

���������������������������������������

������������������������������������������������������������ )���')-

���� )���������� �����$��������������%��������������������������

������������������������ ������%��������

������������������������*�������������%���������������������)���

�������������������������������%�#�������������������

��������������������������������������+��+��

���� ��'(������� �����$�������������������������������

���������������������������������������

���������������������������������������������������� ������� )���')-

���� )���������� �����$��������������%�������������������������

������������������������ ������%��������

������������������������*�������������%���������������������)���

�������������������������������%�#�����������������'(

��������������������������������������+��+��

���� ��'(������� �����$�������������������������������

��������������������������������������'

������������������������������������������������������������ )���')-

���� )���������� �����$��������������%��������������������������

������������������������ ������%��������

������������������������*�������������%���������������������)���

�������������������������������%�#�������������������

��������������������������������������+��+��

���� ��'(������� �����$�������������������������������

��������������������������������������)

���������������������������������������������������� ������� )���')-

���� )���������� �����$��������������%�������������������������

������������������������ ������%��������

������������������������*�������������%���������������������)���

�������������������������������%�#�����������������'(

��������������������������������������+��+��

���� )�(�������� �����$���������������� ���% ��%������������

Page 11: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

11© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

�������������

���� )�(�������� �����$���������������� ���% ��%������������

������������

���� )�(�������� �����$���������������� ���% ��%������������

�������������

���� )�(�������� �����$���������������� ���% ��%������������

������������

���� ����������� ����$� ��������� ��������������#��#������� ��

�����

You should note that the LISTDEF control statement does not supportpattern-matching for either catalog or directory objects.

Combined TEMPLATE and LISTDEF

If you want a utility that processes a dynamic list of DB2 objects, thatis a list which may increase or decrease over time, you can useLISTDEF and LIST.

As many online utilities require dataset allocations for each objectthey process, the number (and the parameters) of these allocationsmust be dynamic, too. That cannot be done with ordinary DDstatements, but that is exactly what templates support: a dynamicnumber of dataset allocations, fitting to the object or to the list ofobjects processed by a utility.

In summary, the usage of LISTDEF/LIST often requires the usage ofTEMPLATE:

���

����./����0121343.10

���

������������

������%������������ ����������������������������*��

�����������������������!����!�����!������!��������!"�������

�������������������������������������������

��

Storing LISTDEF and TEMPLATE statements in a dataset

Instead of using SYSIN to provide your LISTDEF and TEMPLATEstatements, you can store these statements in library datasets. Whenusing these datasets in your utility jobs, the default DD names arerespectively SYSLISTD and SYSTEMPL:

����������������#�5�������%���������������

Page 12: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 12

����������������#�5������������������������

������������

5 �����������������

����������������������������������������

��

With MYHLQ.LISTDEF(LD01):

������%������������ ��������������������*���������������������

And MYHLQ.TEMPLATE(TP01):

���������������������!����!�����!������!�����!"�������!��� ����

OPTIONS(PREVIEW)

In order to offer a complete and manageable solution when dealingwith dynamic utility jobs, another utility control statement, OPTIONS,is provided to complement the functions offered by LISTDEF/LISTand TEMPLATE.

Specifying OPTIONS(PREVIEW) will expand the list definitionsand the template definitions and report them to you.

Sample output:

���� ����������� � ��$�� �� ��������%��� �������� �����������

���� �&��������� � ��$�������������*���

���� ����������� � ��$�����������������������������������*��������

���� ��'&������� �����$����������������������������� ���% ���

���� �&��������� � ��$�������������

�����������!������!����!�����!"�������!#� ��!��� ����

���� ��'&������� "����$������������������������������ ���% ���

���� �&��������� � ��$���������������������� ������� ������������

���� ���-������� ��**�$������������

���������������������� ������� �������� �����)�

���� ���6������� ��**�$�����������*�� �������#�������%������ ����

���� �&��������� � ��$���������������������� ������� ������������

���� ���-������� ��**�$������������

���������������������� ������� �������� �����)�

���� ���6������� ��**�$�����������*�� �������#�������%������ ����

���� ����������� ����$� ��������� ��������������#��#������� ��

����)

Conclusion

The benefits of these new utility control statements are evident: thedevelopment and maintenance of the jobs is easier; and as changes are

Page 13: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

13© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

reflected automatically, they require less user activity and also reducethe possibility of errors.

NEW UNLOAD UTILITY

UNLOAD is a new utility that delivers better performance and moreflexibility than DSNTIAUL.

It supports both tablespace and image copy as input and allowsunloading of multiple partitions in parallel.

You can provide field selection for the unloaded data and the orderingand formatting options via SQL-like syntax.

UNLOAD also provides for record sampling and character encoding.By sampling, you can reduce the number of rows to be unloaded. Thisunloaded data can then be used, for example, to fill a test table. Youcan also specify a limit of rows to be unloaded, or both.

With the SHRLEVEL CHANGE option, unloading tablespaces doesnot affect your SQL applications, as used to be the case with REORGUNLOAD EXTERNAL. And unloading directly from copy datasetsdoes not touch the data in the tablespace at all.

SHRLEVEL REFERENCE or CHANGE option

This option specifies the type of access to the tablespace or thepartition allowed to other processes while the data is being unloaded.

For SHRLEVEL CHANGE, uncommitted rows, if they exist, will beunloaded.

For SHRLEVEL REFERENCE, the UNLOAD utility drains writerson the tablespace; when data is unloaded from multiple partitions, thedrain lock will be obtained for all selected partitions in the UTILINITphase.

Unloading certain rows only

Sampling

Within the FROM TABLE clause, you can specify the percentage ofrows to be unloaded.

Page 14: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 14

Limit rows to be unloaded

You can specify the maximum number of rows to be unloaded froma table using the LIMIT parameter.

UNLOAD JCL sample���������������� �������������������

���

������������������������������������������������� ������������

����������������������7�������

���

������ �#���������������������������������������� ���������� �#

����������������������7�������

���

���������������

� ���������������������� ������� �����#���*���#����

��������%������������������������������������

���������#�����������7��������,��

��

Then, you get the following result:

���� ��������� � ��$�� �� ��������%��� �������� �����������

���� �&������� � ��$� ���������������������� ������� ���#���*���#����

���� &����$�������� ����$���%��������������������������������������#��

���� &����$�������� ����$�����������7��������,��

���� ������$�������� ���$����������������#�����������#���%��������

������������������

���� �&'������� ����$� �������#��������������$�� ������%�������

����������%���������������������������

���� �&�������� ����$� �������#��������������$�� ������%�������

����������%������������������� ������� �

���� �&�������� ����$� �������#����������������������������+��+��

���� ���������� ����$� ��������� ��������������#��#������� ��������

Unloading from copy datasets

The advantages when unloading from copy datasets are:

• You do not touch the user data in the tablespace, so you do notdegrade the performance of the SQL applications.

• You can unload the data even if the tablespace is stopped.

The JCL to copy an image copy should look like:

���������������� �������������������

���

Page 15: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

15© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

������������������������������������������������� ������������

����������������������7�������

���

������ �#���������������������������������������� ���������� �#�

����������������������7�������

���

���������������

� ����������������������������

��������%���������������������

��������%�������������������������������������� )���'&�

��

Then, you get the following SYSOUT:

���� ����������� � ��$�� �� ��������%��� �������� �����������

���� �&��������� � ��$�� ����������������������������

���� &����$�������� ����$���%���������������������

���� &����$�������� ����$���%������

������������������������������� )���'&�

���� �&'�������� ����$� �������#��������������$�� ������%�������

��������(�%��������������������

���� �&��������� ����$� �������#��������������$�� ������%�������

��������(�%�������������������������

���� �&��������� ����$� �������#����������������������������+��+��

���� ����������� ����$� ��������� ��������������#��#������� ��

�����

ONLINE REORG ENHANCEMENTS

The major improvement is the new FASTSWITCH keyword.

This keyword for ONLINE REORG basically replaces theapproximately three-second outage associated with the renaming oforiginal and shadow dataset copies with a memory-speed switch ofMVS catalog entries.

In the SWITCH phase, all datasets involved in the online REORG areno longer renamed, because this can be very time consuming. Instead,the catalog and the directory are updated to point to the shadowdatasets rather than to the original datasets.

Prior to DB2 710

In the UTILINIT phase, shadow objects of the tablespace (or itspartitions) and for the index spaces (or their partitions) are created.Strictly speaking, this is not true, because these shadow objects arenot reflected in the catalog. What it means is that new shadow

Page 16: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 16

datasets are created, one for each dataset of the original objects (ortheir partitions). The dataset names of these shadow datasets differfrom the original dataset names insofar as their fifth qualifier, alsoreferred to as instance node, is ‘S0001’ rather than ‘I0001’. In theSWITCH phase, DB2 renames the original datasets and the shadowdatasets. More specifically, the instance node of the original datasets,‘I0001’, is renamed to a temporary one, ‘T0001’; afterwards, the fifthqualifier of the shadow dataset, ‘S0001’, is renamed to ‘I0001’.

During these renames, which take about two seconds each, SQLapplications cannot access the tablespace. After the SWITCH phase,the applications can resume their processing on the new ‘I0001’datasets.

In the UTILTERM phase, the datasets with ‘T0001’ are deletedbecause they are not needed any more.

DB2 710 : Fast SWITCH

A revised alternative to the processing is performed to speed up theSWITCH phase, thus making the phase less open to data access byothers:

• Invocation of AMS to rename the datasets is eliminated.

• An optional process, the Fast SWITCH, takes place:

– In the UTILINIT phase, DB2 creates shadow datasets. Thefifth qualifier of these datasets is now ‘J0001’.

– In the SWITCH phase, DB2 updates the catalog and theobject descriptor (OBD) from ‘I’ to ‘J’ to indicate that theshadow object has become the active or valid databaseobject. During that time, SQL applications cannot access thetablespace.

– After the SWITCH phase, the SQL applications can resumetheir processing, now on the new ‘J0001’ datasets.

– In the UTILTERM phase, DB2 deletes the obsolete originaldatasets with the instance node ‘I0001’.

Page 17: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

17© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

COPYTOCOPY UTILITY

DB2 710 introduces a new utility, COPYTOCOPY. It provides youwith the opportunity to make additional full or incremental imagecopies, duly recorded in SYSIBM.SYSCOPY, from a full orincremental image copy that was taken by the COPY utility.

This applies to tablespaces or indexes and includes inline copies madeby the REORG or LOAD utility.

Starting with either the local primary or recovery site primary copy,COPYTOCOPY can make up to three copies of one or more of thefollowing types of copy:

• Local primary

• Local back-up

• Recovery site primary

• Recovery site back-up.

The copies are used by the RECOVER utility when recovering atablespace or index space to the most recent time or to a previous time.These copies can also be used by MERGECOPY, UNLOAD, andpossibly a subsequent COPYTOCOPY execution.

An example of the COPYTOCOPY statement is:

����������������������������%�������% ���������*�������4899�

STATISTICS HISTORY

DB2 710 offers better elapsed time reporting and statistics forperformance evaluations over time. It lets you keep a history ofstatistics, allowing for better proactive performance analysiscapabilities and better object monitoring.

With these improvements, you can monitor growth over time and(with the help of additional information) determine whether objectsneed to change.

Statistics history is supported via nine new catalog tables. TheRUNSTATS, REORG, LOAD, and REBUILD utilities use the new

Page 18: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 18

keyword HISTORY to update the statistics history. And you candelete old statistics from the catalog history tables using the newMODIFY STATISTICS utility.

The new catalog tables that support historical statistics include:

• SYSIBM.SYSCOLDIST_HIST

• SYSIBM.SYSCOLUMNS_HIST

• SYSIBM.SYSINDEXPART_HIST

• SYSIBM.SYSINDEXES_HIST

• SYSIBM.SYSINDEXSTATS_HIST

• SYSIBM.SYSLOBSTATS_HIST

• SYSIBM.SYSTABLEPART_HIST

• SYSIBM.SYSTABLES_HIST

• SYSIBM.SYSTABSTATS_HIST

The new RUNSTAT syntax looks like:

���

���������������� �������������������

���

���������������

���������%���������� ������������������� ������� �

�������������������� ������������������� ������� �

���� ����������������������������#�����������

�������%������������������������������������������

��

This job produces the following SYSOUT:

���� ����������� � ��$�� �� ��������%��� �������� �����������

���� �&��������� � ��$�������%�������� ������������������� ������� �

��� ������������������� ������� �

���� ��'&������� �����$�������%��������������������� ���% ���

���� �&��������� � ��$�� ��������������������������#�����������

���� ��''������� � ���$��������������������+����������

������ ������� �

���� �����$�������� � ���$����������������������� ������%��

������ ������� ��� ���% �

���� �����$�������� � ���$�������������������� ������%��

�������������� �#�� ���% �

Page 19: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

19© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

���� �����$�������� � ���$����������������������� ������%��

������ ������� ��� ���% �

���� �����$�������� �����$�� ������������������������������$�-$��$

���&��)-��(''�(

���� ��''������� � ���$��������������������+����������

������ ������� �

���� �����$�������� � ���$����������������������� ������%��

������ ������� ��� ���% �

���� �����$�������� � ���$���������������������� ������%��

���������������� ��� ���% �

���� �����$�������� � ���$���������������������� ������%��

����������*�� ����� ���% �

���� �����$�������� � ���$����������������������� ������%��

������ ������� ��� ���% �

���� �����$�������� �����$�� ������������������������������$�-$��$

���&��&-�'(66�-

���� �&��������� � ��$������%��������������������������������������

���� ��''������� � ���$��������������������+����������

������ ������� �

���� �'�6��$�������� �����$�)��������������������:#���������������������

���� �'�(��$�������� �����$�)�����������������:#���������������������

���� �'����$�������� �����$�����%������������#������������� ���% ���

���� ��''������� � ���$��������������������+����������

������ ������� �

���� �'�6��$�������� �����$�)��������������������:#���������������������

���� �'�(��$�������� �����$�(�����������������:#���������������������

���� �'����$�������� �����$�����%������������#������������� ���% ���

���� ����������� ����$� ��������� ��������������#��#������� ��

�����

Systems Programmer(France) © Xephon 2002

Data tool for database management

INTRODUCTION

I have created an integrated tool called ‘DB2 Data Toolkit’. It carriesout a series of functions and uses some enhancements introduced withDB2 V5. The tool can be used in several ways, depending on yourneeds.

The procedure can:

• Replicate data between two or more databases.

Page 20: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 20

• Transfer data between DB2 located in different sites, bytransferring a sequential dataset (dump ADRDSSU) that is apackage containing all you need to rebuild the data environment.

• Clone the database data and bind statement.

• Download and archive the database and supply all you need forthe restore environment.

• Back up data and archive on tape in an automatic procedure. Thedata can be restored in any DB2 with at least DB2 V5.

PROCEDURE DESCRIPTION

The functions described are realized by a series of batch proceduresthat are described below:

• Unload data with reorg unload external function. This process isrealized with the Reorg utility in order to ensure good performanceduring the download.

• Update target creator in SYSPUNCH with a new load creatorname.

• Copy all SYSPUNCH cards in a sequential dataset for a fastediting change.

• Overwrite the SYSPUNCH sequential dataset.

• Load data. During this phase you can choose whether or not toreuse your VSAM DB2 dataset in order to save time.

• Start tablespace in read/write mode.

• Build all bind statements (plan/package) from DB2 catalog.

• Back-up output from the unload job, in order to have a trace ofunloaded data.

• Create a report of the selected objects.

• Dump all we have created (data, job, bind statements, reports,etc) with ADRSSU. The sequential file created can be retained orexported into another DB2 environment in a different subarea.

Page 21: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

21© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

• Delete all work areas.

PARAMETER DESCRIPTION

The following parameters describe how you can customize the REXXEXEC batch procedure:

• Subsys – DB2 subsystem name.

• Dbname – database name.

• Creunl – unload table creator.

• Tsubsys – target DB2 subsystem.

• TDBname – target database name.

• Creloa – load table creator.

• ReusVS – reuse VSAM dataset.

• Ownerb – bind owner.

• Full – type of unload.

• Maxdd – max number of DD for job.

• KeepTime – time to keep back-up.

• Autosub Submit – unload/dump/delete.

• Jobname – jobname.

• Catnam DB2 – catalog creator.

CHECKLIST FOR INSTALLATION

Follow these steps to install the components of the REXX procedure:

• Allocate a USER.LIBRARY

• Copy all REXX, macro, PROC, and JCL into theUSER.LIBRARY:

– REXX: $DB2UN00, $DB2UN01, $DB2UN02, $DB2UN03,$DB2UN04, $DB2UN05, $DB2UN06, $DB2PAR0,$DB2ALL0, $DB2TBNA, $DB2RC00, $DB2FOR0,$DB2OUBK, $DB2BIND, $DB2SDSF.

Page 22: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 22

– Macro: $MDB2018, $MDB2021, $MDB2023, $MDB2024,$MDB2025, $MDB2026, $MDB2027, $MDB2031,$MDB2039, $MDB2040.

– Proc: DB2REXX1.

– Sample job: $DB2UN00.

• Customize $DB2PAR0 REXX for the global environment, settinghighlighted variables.

• Customize proc DB2REXX1 according your environment.

• Customize job $DB2UN00 according your environment.

• Create a member IEBDDIN in the user.library and insert thestring:

����� ����� ������������

The sample job and parameter are customized for a DB2 subsystemname equal to DSNZ and the test environment is DB2 V5 in anOS/390 V8 environment.

$DB2UN00 REXX EXEC

��������

�����$�������������������212��//;�</=����42.2>43.1�������������������$��

�����$��=?@AB3��212�203�!��A>=213��212�CA1@� .;/29��D13=.2;�<E.?1A/.�$��

2=>�F2=4A.�G�F2=4���1=2.0;213�F2=4A.���������

.F2=4�����C/=90�F2=4��G��EH080����C/=9�F2=4����G���.243����C/=9�F2=4���

=3E.;����C/=9�F2=4�'�G��0EH080���C/=9�F2=4�)��G����.243���C/=9�F2=4�&�

=3;/2����C/=9�F2=4� �G��3E0*�����C/=9�F2=4�6��G��C.3=H����C/=9�F2=4�(�

%E;;������C/=9�F2=4�-�G��2D99�����C/=9�F2=4����G733F�A43��C/=9�F2=4����

�E1/0EH���C/=9�F2=4����G"/H.243���C/=9�F2=4��'�G21.24����C/=9�F2=4��)�

�����I���301�A.FE1�F2=24313=0����������������I��

�A<�.F2=4�J��)�1@3.�9/

����028����G�028����G�028��KKKKKKKK�

����028��KKKKKKKK���2=24313=�01=A.>�A0�A.?/4F;313�LLLL�

����028��KKKKKKKK������������F2=4A.

����028��KKKKKKKK��G�028����G�028����G�3DA1�G�3.9

�A<�%E;;��������1@3.�%E;;���./

�A<�%E;;�M��./�!�%E;;�M��830�1@3.�9/

����028����G�028����G�028��KKKKKKKK�

����028��KKKKKKKK��=/.>�% ����<E;;��B2=A2H;3�LLLLL�

����028��KKKKKKKK��F3?A<8�+������������������������

����028��KKKKKKKK��G�028����G�028����G�3DA1�G�3.9

Page 23: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

23© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

�A<��3E0*��������1@3.��3E0*����830

�A<��3E0*��M��./�!��3E0*��M��830�1@3.�9/

����028����G�028����G�028��KKKKKKKK�

����028��KKKKKKKK��=/.>��3E0*���3E0*���B2=A2H;3��LLLLL�

����028��KKKKKKKK��F3?A<8�+������������������������

����028��KKKKKKKK��G�028����G�028����G�3DA1�G3.9

�A<�%E;;���830�!��C.3=H�������1@3.�9/

����028����G�028����G�028��KKKKKKKK�

����028��KKKKKKKK�%/=��=?@AB3��%E;;�830��A.?=3203��C.3=H�B2=A2H;3��

����028��KKKKKKKK��G�028����G�028����G�3DA1�G�3.9

�A<��2D99��������1@3.��2D99����(�

�A<��2D99�K�(��1@3.�9/

����028����G�028����G�028��KKKKKKKK�

����028��KKKKKKKK��@3�42DA4E4�.E4H3=�/<� .;/29�</=�2�N/H�A0�(��LLLLL�

����028��KKKKKKKK��G�028����G�028����G�3DA1�G�3.9

�A<�733F1A43�������1@3.�733F1A43������

�A<�733F1A43�M������!�733F1A43�M����'�!��

����733F1A43�M���� �!�733F1A43�M������!��

����733F1A43�M����)�!�733F1A43�M���' �!��

����733F1A43�M���)(�!�733F1A43�M��� ��1@3.�9/

����028����G�028����G�028��KKKKKKKK�

����028��KKKKKKKK��=/.>�733F�A43�B2A2H;3�LLLLLL���

����028��KKKKKKKK�������0F3?A<8�+���������'��� �������)��' ��)(�� ��

����028��KKKKKKKK��G�028����G�028����G�3DA1�G�3.9

�A<��=3E.;�M������!�=3;/2���������O��

�����=3E.;��������!�=3;/2�M�������1@3.�9/

����028����G�028����G�028��KKKKKKKK�

����028��KKKKKKKK� .;/29�2.9��/29�?=321/=�4E01�H3�H/1@�>AB3.�</=�1@3���

����028��KKKKKKKK�EF9213�/<�?=321/=�A.�080/E.?@�92120310���������������

����028��KKKKKKKK��G�028����G�028����G�3DA1�G�3.9

�A<��=3E.;�M������!�=3;/2�M�������!��

�����=3E.;����=3;/2��1@3.�9/

����028����G�028����G�028��KKKKKKKK�

����028��KKKKKKKK�=3E.;�2.9�=3;/2�4E01�H3�9A<<3=3.1��

����028��KKKKKKKK��G�028����G�028����G�3DA1�G�3.9

�A<��E1/0EH�������1@3.��E1/0EH���./

�A<��E1/0EH���830�!�%E;;���./�1@3.�9/

����028����G�028����G�028��KKKKKKKK�

����028��KKKKKKKK�%E;;�2.9��E1/0EH�F2=24313=�2=3�A.?/4F21AH;3�LLLL�

����028��KKKKKKKK��G�028����G�028����G�3DA1�G�3.9

�A<��E1/0EH�M��./�!��E1/0EH�M��830�1@3.�9/

����028����G�028����G�028��KKKKKKKK�

����028��KKKKKKKK��=/.>��E1/0EH�B2=A2H;3�LLLLL�

����028��KKKKKKKK��F3?A<8�+�����������������������

����028��KKKKKKKK��G�028����G�028����G�3DA1�G�3.9

�A<����.243�������1@3.����.243�����.243

�A<�"/H.243��������1@3.�9/

����"/H.243����0EH01=���.243�����OO0EH01=���.243�)�)�

����"/H.243����1=2.0;213�"/H.243��P������

�����"/H.243���0EH01=����.243�����OO0EH01=����.243�)�)�

�����"/H.243���1=2.0;213��"/H.243��P�������G��3.9

�3;03�9/

Page 24: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 24

����;"/H.243���;3.>1@�"/H.243�

����A<�;"/H.243�K� �1@3.�9/

�����028����G�028����G�028��KKKKKKKK�

�����028��KKKKKKKK�1@3�"/H.243�B2=A2H;3�428�H3�42D�0AD�?2=2?13=0�;/.>LL�

�����028��KKKKKKKK��G�028����G�028����G�3DA1�G�3.9�G�3.9

�A<�?21.24�������1@3.�?21.24���������

�A<��0EH080�������1@3.��0EH080����EH080

�����I���2=24313=0�200A>.43.1����������������I��

�?2;;�Q9H�F2=���EH080�G�A<�C/=9�=30E;1������--�1@3.�3DA1

�P;F2=��C/=9�=30E;1����G�P2??.��C/=9�=30E;1����G�P?;200��C/=9�=30E;1�'�

�P40>?;2���C/=9�=30E;1�)�GP=3>A/.����C/=9�=30E;1�&��GP40>;B;��

C/=9�=30E;1� �

�P./1A<����C/=9�=30E;1�6�GPE03=������C/=9�=30E;1�(��GPE.A192��

C/=9�=30E;1�-�

�PE.A112���C/=9�=30E;1����GP30E.A1���C/=9�=30E;1����GPF=1�����

C/=9�=30E;1����

�P@AC/=R���C/=9�=30E;1��'�GP9H�B3=���C/=9�=30E;1��)�GP?10EH0��

C/=9�=30E;1��&�

�P;AH=3DD��C/=9�=30E;1�� �GPF2=4;AH��C/=9�=30E;1��6�GPF=/?;AH�

C/=9�=30E;1��(�

�PN?;;AH���C/=9�=30E;1��-�GP=3F/=1���C/=9�=30E;1��S�GP;AH3D3?�

C/=9�=30E;1����

�PA0F13.E��C/=9�=30E;1����GPA0FF3.E��C/=9�=30E;1��'�GPA0F43.E�

C/=9�=30E;1��)�

�PA0F0;AH��C/=9�=30E;1��&�GPF;A;A.R��C/=9�=30E;1�� �GP0AH4;.R�

C/=9�=30E;1��6�

�P0/=1;AH��C/=9�=30E;1��(�GP@A;B;����C/=9�=30E;1��-�GP=E.;AH��

C/=9�=30E;1�'S�

�P90.;/29��C/=9�=30E;1�'��GP13F�F>4��C/=9�=30E;1�'��GP13F�F;.�

C/=9�=30E;1�''�

�PE.;/F>4��C/=9�=30E;1�')�GPE.;/F;.��C/=9�=30E;1�'&�GP9E.;/F>�

C/=9�=30E;1�' �

�P9E.;/F;��C/=9�=30E;1�'6�GP90.F=/?��C/=9�=30E;1�'(�

�����I����/=R�2=320�A.A1A2;AT21A/.�����������I��

�H;R���������G/RE.;/���/<<�G01F�������S�G<E;;01F���S�G.N/H��������

�.N/H�����SS�G.N/H�����SS��G.N/H�����SS�G?101S�����S�G1301212���830

�11=2?R0���S�G?1=010����S��G1?8;0�����S�GU?������S�GUD��������S�GU8����S

�UF��������6�G�N.2����!��� ��V�GP./1A<����!��� ��V

�A3H.�����OO0EH01=���.243�����OO0EH01=���.243�)���

�9212���0EH01=�9213�0��6���V�V0EH01=�9213�0��&���V�V0EH01=�9213�0����)�

�/=2����1A43��

�����I����������<A;3�2;;/?21A/.��������������I��

��028����G�/E19010A.��P@AC/=R���0EH080�����.243��Q��� �SS���������

��F=42;;/?���0EH080���/E19010A.��S�&���<�H�(S��6-�S�08010A.F�830�

��?2;;�Q9H�2;;S�F=42;;/?�G�A<�C/=9�=30E;1������--�1@3.�3DA1

0R����������������0EH080�����������������������������������������������

0R����� �����������P9E.;/F>���������P9E.;/F;����������P=E.;AH�����$����

0R�'���������P=E.;AH�������������5�������������������������������������

0R�)�������������������������������������������������������������������

�0R�S�)�G�N/HC���08010A.F�G�?2;;��=A13�3?

�����I�����������<A;3�2;;/?21A/.�������������I��

Page 25: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

25© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

�/E190F=1��P@AC/=R���0EH080�����.243��Q��� �SS����������

�F=42;;/?���0EH080���/E190F=1��S����&�<�H�2��������S�080F=A.1�830�

�?2;;�Q9H�2;;S�F=42;;/?�G�A<�C/=9�=30E;1������--�1@3.�3DA1

�����I�������SS�<A;3�2;;/?21A/.�������������I��

�/E190=3?��P@AC/=R���0EH080�����.243��Q��� �SS������SS�

�F=42;;/?���0EH080���/E190=3?��S��&�)&�<�H�S�S�080=3?SS�830�

�?2;;�Q9H�2;;S�F=42;;/?�G�A<�C/=9�=30E;1������--�1@3.�3DA1

�����I������ �#�9E448�<A;3�2;;/?21A/.�������I��

�W2;;/?�9E448�<�080FE.?@�X

�����I��������<A;3�2;;/?21A/.����������������I��

�/E190A.��P@AC/=R���0EH080�����.243��Q��� �SS�������

�F=42;;/?���0EH080���/E190A.��S�&���<�H�(S��6-�S�080A.�830�

�?2;;�Q9H�2;;S�F=42;;/?�G�A<�C/=9�=30E;1������--�1@3.�3DA1

0R������������������������������������������������������������������

0R������������� ������� Y�������#������������������������������������

0R�'����������� ����������������$�������������������������������������

0R�)�������������������������*�������������������������:�#����������

0R�&������������������������������������������������������������������

0R� ����������%����*���.243�: �����������������������������������������

0R�6������ ��������������������������������*�������������������������

0R�(����������������������������������:�#���������������������������

0R�-������������������������������������������������������������������

0R����������������������������������������G���������������������������

�0R�����G�N/HC���080A.�G�?2;;��=A13�3?

�����I��2;;���������������������������������I��

�DD�/E11=2F�1=F9H�����G�299=300�10/�Z3D��Z/E19010A.Z�Z�G�DD�/E11=2F�/<<�

�����I���=A.1�����/E1FE1���������������������I��

�DD�/E11=2F�1=F9E448���G�299=300�10/�ZF=A.1/<<���Z/E190F=1Z����?;200���Z

�DD�/E11=2F�/<<�

�A<�=?�K���1@3.�9/

����2.2;A0A���0EH01=�1=F9H�������(�

����03;3?1

�����I������0EH080134�./1�2?1AB3�������������I��

�������C@3.�2.2;A0A��������������1@3.�9/

����������0EH0���?3.13=�0EH080� �

���������028��KKKKKKKK���G�028��KKKKKKKK�

���������028��KKKKKKKK����@3�����0EH080134�IK�0EH0�JI�A0�./1�2?1AB3�LLL�

���������028��KKKKKKKK��G�028��KKKKKKKK�

���������028����G�028����G�?2;;�%=33��G�3DA1�G�3.9

�����I������0EH080134�./1�93<A.39�/.���������I��

�������C@3.�2.2;A0A��������������1@3.�9/

����������0EH0���?3.13=�0EH080� ��G�028��KKKKKKKK��G�028��KKKKKKKK�

��028��KKKKKKKK���@3�����0EH080134�$K��0EH0��J$�A0�./1�93<A.39�/.��P;F2=

����������028��KKKKKKKK��G�028��KKKKKKKK�

����������028����G�028�����G�?2;;�%=33��G�3DA1�G�3.9

�������/1@3=CA03

����������028��KKKKKKKK��G�028��KKKKKKKK�

����������028��KKKKKKKK�� .F=39A?12H;3�3==/=�LLLLL������������������

����������028��KKKKKKKK������������/.12?1�8/E=��EFF/=1�012<<�������

����������028��KKKKKKKK��G�028��KKKKKKKK�

�������������U2�����1/�1=F9H�����G�028�1=F9H���U2�G�3.9

Page 26: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 26

����������3DA1�G�3.9�G�3.9

�3;03�9/

�����I���12=1�F=/?300������������������������I��

����DD�/E11=2F�1=F=329����

�������Z3D3?A/���9A0R=�080F=A.1��0134�080F=A.1��<A.A0Z

����DD�/E11=2F�/<<�

�����I��*3=A<8��3;3?1������������������������I��

����9/�UH�����1/�080F=A.1��

�������/RE.;/���C/=9�080F=A.1�UH���

�������A<�/RE.;/��������)-&���1@3.�9/

����������/RE.;/���830�G�/R=3?���C/=9�080F=A.1�UH�&��G�3.9�G�3.9

�����I������2??300��7��12=1�F=/?300����������I��

����A<�/RE.;/���830�1@3.�9/

�������A<�/R=3?�K���1@3.�9/�G�?2;;��;;/?���G�?2;;��;2H/���G�3.9

�������3;03�9/

����������028����G�028��KKKKKKKK��G�028��KKKKKKKK�

����������028��KKKKKKKK�������3?/=9�</E.9��OOOOOO���

����������028��KKKKKKKK��G�028��KKKKKKKK�

����������028����G�?2;;�%=33��G�3DA1�G�3.9�G�3.9

����3;03�9/

�������028����G�028����G�028��KKKKKKKK��G�028��KKKKKKKK�

�������028�������2??300�7���*3=A<8�1@3�080/E1��PE03=��</=�2.2;803�1@3

<2A;E=3�=320/.�LL�

�������028��KKKKKKKK��G�028��KKKKKKKK��G�028���

�������9/�UH�����1/�080F=A.1���G�028�080F=A.1�UH�G�3.9

�������?2;;�%=33��G�3.9�G�3.9�G�?2;;�%=33

�3DA1

��;2H/���+

�����I���329�3D1=2?139��3?/=90���������������I��

����DD�/E11=2F�1=F=329����

�������Z3D3?A/���9A0R=�080=3?����0134�080=3?����<A.A0Z

����DD�/E11=2F�/<<�

����A<�=?�K���1@3.�9/

�������9/�U2�����1/�1=F=329�����G�028�1=F=329���U2�G�3.9

�������028�����G�028����G�028��KKKKKKKK�

�������028��KKKKKKKK����==/=�=329A.>�<A;3�Z�/E190=3?�Z�����

�������028��KKKKKKKK������=?���*3=A<8���������������������

�������028��KKKKKKKK��G�028����G�028����G�3DA1�G�3.9

����028���

����028���������������������������������������������������������������

����028�������������������������������������������������1A43����������

����028�����������HEA;9A.>�����F=/?39E=3������������������������������

����028���������������������������������������������������������������

����028���������������������������C2A1�F;3203�������������������������

����028���������������������������������������������������������������

����028���������������������������������������������������������������

����028���

����C3;2H�&����080=3?��������&�,����G�C3;2H&�����080=3?�������&��,���

����C3;2H6&����080=3?�������6&�,����G�C3;2H�����080=3?����

�������U9�����1/�080=3?����

�������1=RF�����G�1=R0�����G�./1=21���080=3?�����G�01F���01F�Y��

�������<E;;01F��<E;;01F�Y��

Page 27: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

27© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

�������P.12H;3���D�9�9�D�?�9�0EH01=�080=3?���U9�)-������

�������P10.243���01=AF�0EH01=�080=3?���U9�&��(��

�����I���EA;9�90.243�=/E1A.3�����������������I��

�������./43���H;R�G�?2;;�Q9H�1H.2�P10.243

�������A<�C/=9�=30E;1������--�1@3.�3DA1

�������./43���C/=9�=30E;1���

�����$I��C=A13�@3293=�N/H���������������������I��

�������A<�1301212���830�1@3.�9/�G�?101����?101��Y��

0R�������"/H.243OO.N/H���"�����P2??.����� .;/29��21A���������P?;200���

0R���������������������P40>?;2�� �����PE03=����������P=3>A/.����������

0R�'���������������*�����P40>;B;�������%���P./1A<

0R�)����"�������������------�������----��������������������������������

0R�&������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$����������������

0R� ������$$$$$$$$$��� �.�;�/�2�9�������2�1�2���$$$$$$$����������������

0R�6������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$����������������

0R�(����"�������������������#�������P90.;/29

0R�-�������������"�������������PF=/?;AH������������������������������

����������0R���-

����������A<�%E;;���830�1@3.�9/

0R���������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$���������������

0R�������������.N/H������������7"�%����������������������������������

0R������������������������� �������������������������������������������

0R��'������������������������#�����������������������������������������

0R��)�������������������/E190=3F��������.N/H���������������������������

�������������0R����)�G�3.9

����������N/HC���%� ���G�Z2;;/?�92��Z/E190E.;Z���<�ZN/HCZ��4/9�=3E03Z

����������2;;��=A13�3?

0R��������"/H.243OO.N/H���"�����P2??.������/29��21A���������P?;200����

0R���������������������P40>?;2�� �����PE03=����������P=3>A/.����������

0R�'���������������*�����P40>;B;�������%���P./1A<

0R�)����"�������������------�������----��������������������������������

0R�&������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$����������������

0R� ������$$$$$$$��������/�2�9������2�1�2�����$$$$$$$$$����������������

0R�6�����$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$����������������

0R�(����"�������������������#�������P90.;/29

0R�-�������������"�������������PF=/?;AH������������������������������

����������0R���-

����������N/HC���%�����G�Z2;;/?�92��Z/E190;/2Z���<�ZN/HCZ��4/9�=3E03Z

����������2;;��=A13�3?

0R�������PE03=OO=A>@1�.N/H������"�����P2??.������3;��=R�

�=320���������P?;200���

0R���������������������P40>?;2�� �����PE03=����������P=3>A/.����������

0R�'���������������*�����P40>;B;�������%���P./1A<

0R�)����"�������������------�������----��������������������������������

0R�&������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$����������������

0R� ������$$$$$$$����3;313��9212$031��9A����/�=�R���$$$����������������

0R�6������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$����������������

0R�(����������7�����������������������������������������������������

0R�-��������������������� ��������������������������������������������

0R���������������������������������������������������������������������

����������0R�����

����������N/HC���%�����G�Z2;;/?�92��Z/E19093;Z���<�ZN/HCZ��4/9�=3E03Z

Page 28: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 28

����������2;;��=A13�3?�G�N.24/9���A3H.�OO�.N/H�

0R�������N.24/9��"�����P2??.�����/F8��80FE.?@���������P?;200���������

0R���������������������P40>?;2�� �����PE03=����������P=3>A/.����������

����������A<�?101�������1@3.

0R�'���������������*�����P40>;B;�������%���P./1A<

����������3;03

0R�'���������������*�����P40>;B;�������%���P./1A<������ ��#������������

0R�)����"�������������------�������----��������������������������������

0R�&������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$����������������

0R� ������$$$���3H>3.3=�9A0F�4/9�</=�080FE.?@�?/F8��$$$����������������

0R�6������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$����������������

0R�(�������������"�������������PF=/?;AH������������������������������

0R�-������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$����������������

����������A<�?101������!�%E;;���830�1@3.�9/

0R�����������������������������������������������������������������

0R�������������������������������������������������������������������

0R�������������������Q��������0EH080�����.243���DDDDDD����7�Q��� �����

0R��'������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$���������������

�������������U8����'�G�3.9

����������3;03�U8���-

����������U8���U8�Y��

0R�U8����������������������������������������������������������������

����������U8���U8�Y��

0R�U8���������������������������������������������������������������

����������U8���U8�Y��

0R�U8���������������������� �������������������������������������������

����������U8���U8�Y��

0R�U8������� ��������������!����������#��������������������������������

����������U8���U8�Y��

0R�U8������� ���������������/E1904/9�����������������������������������

����������U8���U8�Y��

0R�U8�������������������!����������������������������������������������

����������U8���U8�Y��

0R�U8������������������� ����������������������������������������������

����������U8���U8�Y��

0R�U8������������������������������������������������������������������

����������0R���U8

����������N/HC���%�����G�Z2;;/?�92��Z/E190A3HZ���<�ZN/HCZ��4/9�=3E03Z

����������2;;��=A13�3?�G�1301212�������

����������A<�%E;;���830�1@3.�9/

�����I��A.FE1�2=?@AB3�/E1FE1� .;/29����������I��

0R�����������������Y��������������������������������������������������

0R�����Q��� ��'��/E190=3F�� ����=A>@1�.N/H�)��������"/H.243OO.N/H������

�������������0R����

�������������N/HC���%��� �G�Z2;;/?�92��Z/E1900/EZ���<�ZN/HCZ��4/9�=3E03Z

�������������2;;��=A13�3?�G�3.9�G�3.9

�����I���13F�� ������������������������������I��

�������E1A;A9��� OO��.243OO0EH01=�1A43��������� �

�������<E;;01F���=A>@1�<E;;01F�&�����

0R��������$$$$$$$$$$$$$$$��<E;;01F��$$$$$$$$$$$$$$$$$$$$$$$������������

�������A<�%E;;���830�!�01F�����1@3.�9/

0R����������������%��������.N/H������5�����#��������������������������

Page 29: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

29© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

����������U8����

����������3.9

�������3;03

����������U8�����G�U8���U8�Y��

0R�U8���� ����01F���������P90.F=/?����������0EH080���E1A;A9����

����������U8���U8�Y��

0R�U8�������� �#�����������P@AC/=R�����.243���./43��� �#�������������

����������U8���U8�Y��

0R�U8�������������� �����P30E.A1�����������������������7��&����������

����������U8���U8�Y��

0R�U8����������������������P@AC/=R�����.243���./43��������������������

�����I��%A;;$EF��2H;30F2?3�A.</=421A/.�������I��

�������9/�U3�����1/�P.12H;3

����������P?=321/=�����01=AF�0EH01=�080=3?���U9���(��

����������P1H;.243�����01=AF�0EH01=�080=3?���U9�����(��

����������P10.243������01=AF�0EH01=�080=3?���U9�&��(��

����������PB?21.243����01=AF�0EH01=�080=3?���U9�&-�(��

����������PF2=1A1A/.���D�9�9�D�?�9�0EH01=�080=3?���U9� 6������

����������P3.?/9A.>����01=AF�0EH01=�080=3?���U9� -����

����������P9HA9��������D�9�9�D�?�9�0EH01=�080=3?���U9�6�������

����������PF0A9��������D�9�9�D�?�9�0EH01=�080=3?���U9�6�������

����������P/HA9��������D�9�9�D�?�9�0EH01=�080=3?���U9�6)������

����������P012101A43���01=AF�0EH01=�080=3?���U9�6 �� ��

����������P?=3213910���01=AF�0EH01=�080=3?���U9������ ��

����������P2;13=3910���01=AF�0EH01=�080=3?���U9���(�� ��

����������P?2=9��������?�D�0EH01=�080=3?���U9��-�)��

����������A<�P?2=9��M���%%%%%%%%��1@3.�9/

�������������P?2=9�������D�9�9�D�?�9�0EH01=�080=3?���U9��-�)����

�������������P?2=9=3?;���D�9�9�D�?�9�0EH01=�080=3?���U9�''�)����

�������������P9A<<0121���9�D�?�9�0EH01=�080=3?���U9�'6� ���

�������������;01210������;3.>1@�P9A<<0121�

�������������3.9

����������3;03�9/

�������������P?2=9���$��G�P?2=9=3?;�����G�P9A<<0121�����

�������������;01210���;3.>1@�P9A<<0121��G�3.9

����������A<�P?2=9���$��1@3.�9/

�������������U?���U?�Y���G�C=����;3<1�P?=321/=���P1H;.243��6�����

�������������NR�U?��KKKKKKKK��C=���@20�./�����B2;E3�OOOOO���G��3.9

��A4F;����

�����I��/4FE13���������0F2?3���������������I��

����������C1=R���P?2=9=3?;�,�&����

����������A<�C1=R�J��&�1@3.�C1=R����&

����������1=RF���1=RF�Y�C1=R�G�U9���U9�Y���G�?2;;�*3=�;2H

�����I���E.01210�/;93=�1@2.�/.3�928����������I��

����������A<�P9A<<0121�K�-�1@3.�?1=010���?1=010�Y��

����������3.9��������U3��.9���

�������U9���U9�$����G�1=R0���1=RF�,���

�������11=2?R0���11=2?R0�Y�1=RF�Y�&�G�U8���U8�Y��

0R�U8����

�����P30E.A1�����������������������7���1=RF���1=R0��������

�������U8���U8�Y��

0R�U8������������������������������������������������������������������

Page 30: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 30

�������U8���U8�Y��

0R�U8�����������������������.243���P10.243��������� �����������������

�������U8���U8�Y��

0R�U8�������� ��������������������������������������������������������

�������U8���U8�Y��

0R�U8������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$���������������

�������U8���U8�Y��

0R�U8���� ������01F������������������������������������������������

�������U8���U8�Y��

0R�U8����������������������������������������������������������������

�������U8���U8�Y��

0R�U8���������������Q��� ����Y����������������������������������������

�������U8���U8�Y��

0R�U8����0EH080�����.243���./43���=3E.;���=3;/2����3E0*��������������

�������A<�01F���42D99�O�%E;;01F���080=3?�����1@3.�9/

����������U8���U8�Y��

0R�U8������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$��������������

����������3.9�G�0R���U8

�������N/HC���%� ���G�Z2;;/?�92��Z/E190E.;Z���<�ZN/HCZ��4/9�=3E03Z

�������2;;��=A13�3?

�����I���13F���������������������������������I��

�������E1A;A9����OO��.243OO0EH01=�1A43��������� �

0R��������$$$$$$$$$$$$$$$��<E;;01F��$$$$$$$$$$$$$$$$$$$$$$$������������

0R�����������01F���������P90.F=/?�����������0EH080���E1A;A9����

0R�'�����������������������#������������������������������������������

0R�)�������������������P@AC/=R�����.243���./43

0R�&������������������������#������������������������������������������

0R� �������������������P@AC/=R�����.243���./43��� �#������������������

�������0R���

�������A<�01F���42D99�1@3.�9/

0R�6������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$����������������

����������0R���6�G�3.9

�������N/HC���%�����G�Z2;;/?�92��Z/E190;/2Z���<�ZN/HCZ��4/9�=3E03Z

�������2;;��=A13�3?

�����$$$$$$$���13F��A3H>3.3=�9A0F�4/9������������$$$$$$$��

�������03;3?1

����������C@3.�<E;;01F�����1@3.�9/

0R����������01F��������������P@AC/=R�����.243���./43��� �#��������

0R������������������������#��������������������������������������������

�������������3.9

����������C@3.�U9���080=3?�����1@3.�9/

0R����������01F��������������P@AC/=R�����.243���./43��� �#��������

0R�������������������������������������������������������������������

�������������3.9

����������/1@3=CA03

Editor's note: the code for this article will be concluded in the nextissue.

Giuseppe RendanoDB2 Systems Programmer (Italy) © Xephon 2002

Page 31: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

31© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

Explaining the UDB DB2 Governor

This article discusses running the UDB DB2 Governor (V7.2) onmid-range systems (NT and Unix). It covers mainly EnterpriseEdition (EE) systems, but discusses what you need to do to run theGovernor on an Extended Enterprise Edition (EEE) system.

WHY USE A GOVERNOR?

The main reason for using a Governor is to stop runaway processes/extremely long-running queries from grinding your system to a halt.The DB2 Governor is the ideal tool for this. One thing the DB2Governor cannot do is educate end users! It should only be implementedin association with end user education, otherwise you will hit thecommon problem of users submitting the same query two, three, oreven four times when their original request is ‘governed’, making anyperformance problems even worse!

HOW DOES THE DB2 GOVERNOR WORK?

The DB2 Governor comes bundled together with UDB DB2. It is areactive tool not a pro-active one. What I mean by this is that it doesnot look at a piece of SQL and determine how long it will take to run,how many rows it will read, etc, and then decide whether the SQLexceeds certain limits, but, rather, it monitors executing SQL to seewhether it exceeds any boundaries that you have specified. Theseboundaries can be based on CPU time used (Unix systems only), rowsread, rows selected, number of locks taken, idle time, and UOW time.They can be made to apply to application names and/or userids (notgroups), and you also define what action is to take place if any of theseboundaries are crossed.

ARE THERE ANY PRE-REQUISITES?

On NT, before you can start the DB2 Governor task, you have to makesure that the DB2 Governor service is installed. You can tell if it isalready installed by going to Start/Settings/Control Panel/Services.

Page 32: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 32

If you can see a DB2 Governor process, then it is installed. Otherwise,you need to install the DB2 Governor service as follows:

������9H�=3>>B�A

/R

where <x> is the drive you installed DB2 on.

(>db2reggv u will un-register the DB2 Governor service.)

The db2reggv program is in the <x>/Program Files/sqllib/bindirectory.

On Unix, there isn’t a DB2 Governor service that you have to installbefore using the DB2 Governor task.

HOW TO START THE DB2 GOVERNOR TASK

The DB2 Governor task needs a configuration file to start from, andneeds to write information to a log file. Both of these files have to bespecified at DB2 Governor start-up time. Assume that a configurationfile (samp01.txt) exists in the <x>:\db2gov directory on an NTsystem, and you want to start the DB2 Governor for the sampledatabase, then the command to start the DB2 Governor is:

K?9�JDK+[9H�>/B

KJDK+[9H�>/BK9H�>/B�012=1�024F;3�024FS��1D1���[��[��[��[9H�>/B[;/>�1D1

Or, if you are not in the <x>:\db2gov directory, you can issue:

KJDK+K9H�>/B�012=1�024F;3�JDK+[9H�>/B[024FS��1D1

��[��[��[��[9H�>/B[;/>�1D1

On NT, the default file location for the logs is x:\ProgramFiles\sqllib\log.

On Unix systems the command to start the DB2 Governor would be(assuming you have created the config01 file in the db2gov directory,which you also need to create):

P?9��@/43�9H�A.01��9H�>/B

P�9H�>/B�012=1�024F;3�?/.<A>S������������9H�>/B�;/>'

9H�>/B+��12=1A.>�9H�>/B9�</=�9212H203�024F;3

(Because the default path for the log is /home/<instance-name>/sqllib/log.)

Page 33: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

33© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

On a Unix EEE system, the command to start the DB2 Governorwould be:

�@/43�9H�A.01��9H�>/BK9H�>/B�012=1�J��������K�./93.E4�J��K�J��� �K�J���K

where:

• <database> is the database name.

• <num> is the node number on which to start the DB2 Governor.This is the node number in the home/<instance-name>/sqllib/db2nodes.cfg file.

• <config> is the configuration file.

• <log> is the log file. The number of the database partition isappended to the log file name (see example below).

For example, suppose we have a database sample, spread over threenodes (0 to 2), in the db2inst1 instance, then, to start the DB2Governor, issue:

�@/43�9H�A.01��9H�>/BP9H�>/B�012=1�024F;3�?/.<A>S���������9H�>/B�;/>)

080F=/9+�9H�>/B+��12=1A.>�9H�>/B9�</=�9212H203�024F;3�/.�./93�S

080F=/9+�9H�>/B+�*2;A921A.>�?/.<A>E=21A/.�<A;3

080F=/9+�9H�>/B�012=1�024F;3�����?/4F;3139�/R

080F=/9+�9H�>/B+��12=1A.>�9H�>/B9�</=�9212H203�024F;3�/.�./93��

080F=/9+�9H�>/B+�*2;A921A.>�?/.<A>E=21A/.�<A;3

080F=/9+�9H�>/B�012=1�024F;3�����?/4F;3139�/R

080F=/9+�9H�>/B+��12=1A.>�9H�>/B9�</=�9212H203�024F;3�/.�./93��

080F=/9+�9H�>/B+�*2;A921A.>�?/.<A>E=21A/.�<A;3

080F=/9+�9H�>/B�012=1�024F;3�����?/4F;3139�/R

The above command will write the log files to the db2gov directory,which can be seen if you do an ls command:

�@/43�9H�A.01��9H�>/BP;0

?/.<A>S���;/>)�S����;/>)������;/>)��

(Note the partition suffix on each of the log files.)

To stop the DB2 Governor on an EEE system, use the usual command:

�@/43�9H�A.01��9H�>/BP9H�>/B�01/F�024F;3

080F=/9+�9H�>/B+��1/FFA.>�9H�>/B9�</=�9212H203�024F;3�/.�./93�S

080F=/9+�9H�>/B�01/F�024F;3�./93.E4�����?/4F;3139�/R

Page 34: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 34

080F=/9+�9H�>/B+��1/FFA.>�9H�>/B9�</=�9212H203�024F;3�/.�./93��

080F=/9+�9H�>/B�01/F�024F;3�./93.E4�����?/4F;3139�/R

080F=/9+�9H�>/B+��1/FFA.>�9H�>/B9�</=�9212H203�024F;3�/.�./93��

080F=/9+�9H�>/B�01/F�024F;3�./93.E4�����?/4F;3139�/R

To just start the DB2 Governor on one node:

�@/43�9H�A.01��9H�>/BP9H�>/B�012=1�024F;3�./93.E4���?/.<A>S���������

9H�>/B�;/>)

9H�>/B+��12=1A.>�9H�>/B9�</=�9212H203�024F;3�/.�./93��

9H�>/B+�*2;A921A.>�?/.<A>E=21A/.�<A;3

If you start the DB2 Governor on only one node, then it operates ononly that one node, ie only SQL run from that node will be governed.To ensure that you were running on that node, you would have to issuean EXPORT DB2NODE command, as shown below:

P3DF/=1����������

P9H��13=4A.213

P9H��J����K

You stop it in the usual way:

�@/43�9H�A.01��9H�>/BP9H�>/B�01/F�024F;3

HOW CAN YOU TELL WHETHER THE DB2 GOVERNOR IS ACTIVE

The only way I have found to tell whether the DB2 Governor is activeis to try to start it again. If it is already running you will get thefollowing message:

9H�>/B9+���*�SS6����/B3=./=�2;=3298�<;2>>39�20�=E..A.>����<�A1�A0�./1

=E..A.>��E03���9H�>/B�01/F��1/�?;32.�EF�

HOW TO STOP THE DB2 GOVERNOR

To stop the DB2 Governor:

��� ���� �����������������

This applies to both NT and Unix EE and EEE systems.

You don’t need to be in the directory containing the configuration fileto stop the DB2 Governor.

Page 35: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

35© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

DB2 GOVERNOR PROCESSING

When the DB2 Governor task is invoked, the first thing it does is tosee whether the configuration has changed since the last time it wasread. In this way you can make changes to the configuration filewithout having to stop/start the DB2 Governor.

The DB2 Governor uses a snapshot to get the information about allrunning applications. Once the DB2 Governor has this snapshotinformation, it compares it with the values in the configuration fileand, if a condition is met, takes whatever action is necessary. Once ithas finished processing, it sleeps for the time indicated in theconfiguration file (interval), wakes up, and starts the process all overagain.

DB2 GOVERNOR LOGGING

The DB2 Governor logs every action it takes to the log file specifiedat start-up time. If there was an error in the configuration file, this iswritten back to the screen from where you issued the start command.

WHAT DOES THE DB2 GOVERNOR LOG CONTAIN?

On start-up you will see the following entries in the DB2 Governorlog:

P�?21�;/>'

�SS�$S6$�&$���''��)����S�������������212H203���������

�SS�$S6$�&$���''��)����S�����%�����/.<A>����@/43�9H�A.01��9H�>/B�

?/.<A>S�

Every time a condition is tripped, an entry is written to the log:

�SS�$S6$�&$���'6�������S�%���������2FF;.243��9H�HF��2E1@A9��#�����

2FF;A9��������9H�A.01��S��S�&�''6�S��?//=9�S��;A.3�&����/C0=329�(

�SS�$S6$�&$���'6��'����S��� ��������*7

������9H�A.01��S��S�&�

''6�S�����9H�HF�����������������SS�$S6$�&$���'6��S����������S����������S

WHAT CONFIGURATION FILE ARE YOU RUNNING FROM?

To find out what configuration file you are running from, look in theDB2 Governor log file and search for READCFG. You will see a linelike:

8888$44$99$@@�44�00����S�����%�����/.<A>���+[9H�>/B[024FS��1D1

Page 36: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 36

CONTENTS OF THE CONFIGURATION FILE

The admin guide gives a full description of what the configuration fileshould contain. The important thing to remember is that the applnameis case sensitive (everything else isn’t). An example of a configurationfile is:

A.13=B2;��G

9H.243�������G

2??/E.1��SG

930?Z�@A0�A0�=E;3�Z

1A43�SS+SS��'+&-

2E1@A9�E03=S�

031;A4A1

?FE�$�

=/C0=329�'

=/C003;�$�

;/?R0�$�

A9;3�$�

E/C1A43�$�

2?1A/.�</=?3�G

930?Z�@A0�A0�=E;3�Z

�������

�������

The first three lines of the configuration file define which database thesections apply to, how often the DB2 Governor task should wake upand process the configuration file (interval – default 120 seconds),and when accounting records are written (account – no default). Theinterval value is specified in seconds, and the account value isspecified in minutes. The account value cannot be less than theinterval value. A snapshot is taken at every interval.

Resource limits can be set to apply to:

• time (certain time periods,00:00 to 23:59) – if you do not specifyanything, then the rule is valid for 24 hours.

• authid (certain users) – separate multiple authids with a comma.If authid does not appear, then the rule applies to all authids. Youcannot specify groups.

• applname (certain applications) – specifies the name of the .exefile that makes the connection to the database. Separate multiple

Page 37: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

37© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

names with a comma. If the clause does not appear, then the ruleapplies to all applications. This is case-sensitive.

Resource limits may be set on:

• cpu (CPU time) – total number of CPU seconds that theapplication can use (not available on Windows).

• rowsread (rows read) – total number of rows read to satisfy thequery (including catalog reads etc).

• rowssel (rows selected) – total number of rows returned to theapplication.

• locks (number of locks held) – total number of locks the applicationcan hold.

• idle (connect time) – the number of idle seconds allowed for aconnection before an action is taken.

• uowtime (elapsed time) – total number of seconds that the unit ofwork can run for.

For each of the above, if you put ‘-1’ (without the quotes), then thereis no limit on that particular parameter.

Action can be:

• Force – to force the agent that is serving the application.

• Priority – can be –20 to +20 (but not +0 – if you want zero, thenput just 0).

• Schedule – to change the scheduling priority of the user.

If you put the action as priority 0 (action priority 0;) then nothinghappens to any offending query, but the fact that the query exceededa limit in the configuration file is recorded in the logs. This allows youto build up a historical picture, about which queries are selecting themost rows perhaps, or are taking excessive amounts of locks.

Comments should be enclosed within curly brackets, {}.

In an EEE environment, the configuration file must be able to be seenfrom each machine.

Page 38: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 38

What happens if more than one rule applies to an application?

You can have as many rules as you like in the configuration file, andseveral can monitor the same application. This situation can get verymessy. Basically, the rule furthest down the file is the rule that will beused (providing the limit is not set to –1). If it is, then the values inprevious rules are used in combination with the last rule. This is allexplained in the admin guide, but I would recommend that, wherepossible, you have only one rule per application.

THE DB2 GOVERNOR LOG ANALYZER

To look at what the DB2 Governor has been doing, you can either lookat the log file directly, or you can use the db2govlg utility. Thecommand is as follows:

P9H�>/B;>�J����� ������K�=3?18F3�J����������K

For example:

?+[E03=K9H�>/B;>���[��[��[��[9H�>/B[;/>(�1D1

(The above assumes that the log is in the C:\db2gov directory. Don’tforget that the default log directory on NT is C:\PROGRAMFILES\SQLLIB\DB2\log, so you have to point it to the c:\db2govdirectory.)

The different <record type> values are:

• STARTe – the DB2 Governor was started.

• READCFGe – the configuration file was read.

• STOPe – the DB2 Governor was stopped.

• FORCEe – an application was forced.

• NICEe – the priority of an application was changed.

• ERRORe – basically means the DB2 Governor has stopped.

• WARNING

• ACCOUNTe – indicates what area broke a CPU usage rule.

Page 39: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

39© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

To just see when the configuration file was read, you would issue(assuming that the log file was called log8 in the c:\db2gov directory):

+[9H�>/BK9H�>/B;>���[��[��[��[9H�>/B[;/>(�1D1�=3?18F3�=329?<>

�SS�$S6$S�$�-�)'�S�����S�����%�����/.<A>���+[9H�>/B[024FS��1D1

�SS�$S6$S�$�-�))�&S����S�����%�����/.<A>���+[9H�>/B[024FS��1D1

�SS�$S6$S�$�-�)&�'6����S�����%�����/.<A>���+[9H�>/B[024FS��1D1

�SS�$S6$S�$�-�&S�' ����S�����%�����/.<A>���+[9H�>/B[024FS��1D1

�SS�$S6$S�$�-�&(��-����S�����%�����/.<A>���+[9H�>/B[024FS��1D1

�SS�$S6$S�$�S�S��')����S�����%�����/.<A>���+[9H�>/B[024FS��1D1

�SS�$S6$S�$�S��S�'6����S�����%�����/.<A>���+[9H�>/B[024FS��1D1

If you want to see when/why a user was forced off, then issue:

+[9H�>/BK9H�>/B;>���[��[��[��[9H�>/B[;/>(�1D1�=3?18F3�</=?3

�SS�$S6$S�$�-�)-�S ����S�%���������2FF;.243��9H�HF�3D3��2E1@A9�� ���S��

2FF;A9������������S��SS��()-S'��?//=9�S��;A.3�)����/C0=329�(

�SS�$S6$S�$�S�S��')����S�%���������2FF;.243��9H�HF�3D3��2E1@A9�� ���S��

2FF;A9������������S��SS��(&S)���?//=9�S��;A.3�)����/C0=329�(('

You can store the information from the db2govlg utility in DB2 tables.On Unix systems you can pipe the output from the utility to DB2tables. On NT you can write a script to read the output and insert therows into the DB2 tables. This to me seems the only reason to use thelog analyzer rather than just browse the log file!

DEPLOYMENT STRATEGY

If you want to capture historical data, then the DB2 Governor shouldbe stopped/started daily at midnight, and the log file renamed tocontain the date stamp. If you put the action as ‘priority 0’, then youcan see what violations occurred without actually impacting anyusers.

POSSIBLE ERROR MESSAGES

On NT you may see the error message: GOV1062N. It could meanthat the Governor daemon is not started!

+[9H�>/BK9H�>/B�012=1�024F;3�024S��?<>�024;/>�1D1

�F3.�B3.1�+�@3�080134�?2../1�<A.9�1@3�<A;3�0F3?A<A39�

9H�>/B+���*�S ���� .2H;3�1/�012=1�>/B3=./=�21�./93�ZSZ��=?���Z�Z�

Page 40: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 40

If you get this message (and the config file is there!), make sure thatthe DB2 Governor daemon is in service. If it isn’t, you have to registerthe DB2 Governor using the db2reggv command.

CONCLUSION

The DB2 Governor is an excellent tool for controlling resource usageon a system. It should only be introduced in conjunction with usereducation into the impact on system resources of badly written/longrunning SQL. Only then will everyone feel that there is a win/winoutcome.

FURTHER READING

For further reading see: SC09-2840-00, Administration Guide –Performance – Chapter 9.

C LeonardFreelance Consultant (UK) © Xephon 2002

Leveraging mainframe data using a datawarehouse

The author has written seven articles for DB2 Update on using DB2for data warehousing and believes it is the only practical technologyfor leveraging mainframe data, particularly if some of that data is inVSAM, IMS, Informix, Oracle, SQL Server, or Sybase files.

Data warehouse is a concept not a product. It is the compiling,assembling, and consolidating of application data common to usercommunities at a single logical point. Typical uses include ad hoc and‘what if’ queries, data matching, trend analysis, and other informationfunctions. Warehouse data is generally extracted from OLTP databasesthat are optimized for transaction processing. Data warehouses areoptimized for information processing (see DB2 Update, Issue 83,September 1999).

Page 41: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

41© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

DB2 is a relational database based on the pioneering work of Dr TedCodd. The key to a successful relational data warehouse is to abandonnormalization and use a star schema that minimizes the quantity ofjoins required to answer queries. Star schemas have two table typesof fact and dimension. Fact is at the star centre containing columnsto be measured, like sales and units. Dimension is at the star pointscontaining measuring columns, such as date and location.

Star schemas provide better performance, as does using little knownfeatures like simple tablespace and setting PCTFREE and FREEPAGEto 0. Simple tablespace allows DBAs to mix rows of multiple tablessuch as FACT and DIM in a single table thereby avoiding a physicalI/O, when doing joins. A PCTFREE and FREEPAGE of 0 reducestable maintenance overhead. This is possible because a data warehouseis read-only (see DB2 Update, Issue 86, December 1999).

IBM is a pioneer in data warehousing. It began making extensiveimprovements when it included OLAP (On Line Analytical Processing)in DB2 UDB V6 with major updates in V7. OLAP provides ranking,row numbering, and existing column function data, as a scalar valuein a query result table. OLAP can satisfy a high percentage of useranalytical requests without resorting to external software or hardware(see DB2 Update, Issue 102, April 2001). V7.1 lets users model theirbusiness as a multidimensional cube whose typical dimensions aregeography, product, and time. DB2 OLAP Server uses Essbase(Hyperion Solutions Corporation) as its multidimensional engine,but can store data in DB2, allowing it to perform relational managementfunctions such as back-up and recovery. Any OLAP application canbe assigned to DB2 using a star schema.

Cube software allows users to ask reporting questions (what happenedwhen and where), do planning (what if we did this), and forecast(what next). Software provides drill-down to details, drill-up tosummaries or global views, pivot or slice-and-dice for differentperspectives, and crosstabs for displaying data summaries based ontheir characteristics (see DB2 Update, Issue 103, May 2001). DB2’senhanced SQL with new join and GROUP BY features can answermany cube queries without needing multidimensional software (see

Page 42: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 42

DB2 Update: Issue 97, November 2000; Issue 98, December 2000;and Issue 100, February 2001).

IBM added DB2 Warehouse Manager (DB2WM) to DB2 OLAPServer for OS/390 V7.1 (see DB2 Update, Issue 105, July 2001). IBMmakes DBA tasks easier by:

1 Simplifying prototyping, development, and deployment of a datawarehouse.

2 Allowing a data centre to govern queries, analyse costs, manageresources, and track usage.

3 Helping users find, understand, and access their data.

4 Providing more flexible tools and techniques to build, manage,and access the data warehouse.

5 Allowing IBM’s expanded SQL to answer common user queries.

DB2WM can get data from lots of places, including:

1 Any DB2 family.

2 Oracle, Sybase, Informix, and SQL Server (IBM is not willing togive up any database market, particularly to Microsoft).

3 Flat files (two-dimensional array).

4 Data Joiner.

5 And, for very old timers who thought IMS and VSAM were deadand buried, the Classic Connect Interface!

IBM enhanced Data Guide renaming it Information Catalog. Itscapabilities include:

1 Helping users find, understand, and access their data by providing:

– Data described in user business terms.

– User-friendly search engine.

– User-friendly communication between user and contentowner.

Page 43: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

43© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

– Access tool initiation.

2 Information sharing your way by providing:

– Support for any information object.

– Support for almost anything including databases, queries,Web pages, etc.

– Category grouping.

– Correct object metadata.

– Properties of almost anything.

– Support of almost any user authority.

3 Synchronization of information objects:

– Automatic population with Data Warehouse Center.

– Metadata interchange with most popular access toolsincluding QMF, DB2 OLAP, Brio, Business Objects, Cognos,Hyperion, etc.

IBM made it easy to connect to IC by providing access to:

1 Windows (IBM does not want to, but has no choice) or a Webbrowser (IBM hopes for Navigator).

2 Almost any form of distribution including workgroups or acentral repository.

3 Storage by any DB2 family.

4 Selected automatic population.

DB2WM provides additional functionality to let data warehousesbetter satisfy their objective of providing users with timely andaccurate information for improving their bottom line. AdditionalUDB V7 performance and SQL enhancements allow DB2 starschema relational databases to be increasingly effective datawarehouses (see DB2 Update, Issue 105, July 2001).

IBM’s next major enhancement was Intelligent Miner for Data (IMD)

Page 44: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 44

and Intelligent Miner Scoring (IM Scoring). Usually, the major datawarehouse problem lies in providing useful information to users. Itprobably is the reason that IBM developed IMD as a DB2 extensionfor data mining. IBM’s definition is, “The process of extracting valid,useful, unknown, and comprehensive information from data, andusing it to make business decisions”. The keyword is ‘unknown’.OLAP works with known data (see DB2 Update: Issue 102, April2001, and Issue 105, July 2001). and is verification-driven analysis,while data mining (DM) is discovery-driven, not needing humanassistance or input.

DM techniques include:

• Association – a counting algorithm that determines the probabilityof multiple items occurring in a transaction by analysing pasttransactions. Often used for market basket analysis (7-11presumably found that beer and diapers are often sold together onMonday nights during American football seasons.) Other usesinclude item placement planning and promotional sales planning.

• Sequential patterns – an association variation, where transactionsof specific people are individually analysed instead of transactionsin general. Often used by direct marketers to design specially-targeted advertising.

• Clustering – a segmentation procedure that divides a databaseinto subsets (clusters) with each cluster member containingsimilar properties. Uses either demographics or IBM’s NeuralNetwork Utility (a family of tools incorporating fuzzy logic rules– see DB2 Update: Issue 87, January 2000; Issue 89, March2000; and Issue 94, August 2000). Its uses include cross-marketing, cross-selling, and customizing marketing plans fordifferent customer types.

• Classification – an automatic process for creating model classesfrom record sets based on their characteristics. Often used fordeveloping specific promotional plans for identifiable customerclasses.

There are more sophisticated techniques and frequently techniquesare combined.

Page 45: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

45© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

IMD is client/server whose clients can be AIX, OS/2, Windows NT,95, or 2000. Clients can manipulate the data with visualization tools,or build a DM operation to run on the server with results returned foranalysis. Servers can be OS/390, AIX, OS/400, Solaris, and WindowsNT or 2000. Servers do the mining and processing functions storingthe data and mining results. Mining can be performed directly onDB2, flat files, or any data source accessible by DataJoiner. A high-speed extract utility can import data into DB2 UDB from Oracle andSybase. IMD can use parallel processing (see DB2 update, Issue 107,September 2001). IMD also runs on Oracle8i Version 8.1.6 or later!International firms will be pleased that IMD is available in Brazilian,Chinese, English, French, German, Hungarian, Italian, Japanese,Korean, Russian, or Spanish.

IM Scoring workflow is:

• Data miners create model output as a PMML (Predictive ModelMark-up Language) file, forwarding it and the variable creationlogic to IT.

• The database programmer or DBA stores in DB2 using BLOB forthe model logic.

• SQL is used to execute the variable creation logic.

• The database programmer or DBA applies the modelling logicusing IM Scoring functions to create a scored data set.

• The domain expert and data miner verifies output. Any debuggingis done.

There are many advantages:

• The programmer or DBA can access model logic using a standardSQL API. This allows dynamic updating as business ruleschange.

• More complex algorithms can be used including factor analysis,linear regression, principal component analysis, univariate curvefitting regression, etc.

• IT can create SQL scripts that are managed and scheduled usingstandard DBA tools.

Page 46: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 46

• Real-time and batch mode applications can be enabled byallowing them to access the database containing the model logic.

• Model variables do not have to be created in advance.

• SQL view can be used, so only model scores and record identifiersneed outputting. Another view advantage is that it requires onlya single database scan, allowing IT to manage its computingresources more efficiently.

• State-of-the-art GUI for visualization.

PMML is an eXtensible Mark-up Language (XML) used to providea vendor-independent method of defining predictive models. TheData Mining Group (DMG) is PMML’s sponsoring and governingbody. Its Web site (http://www.dmg.org/) provides PMML syntax.DMG states, “…PMML is an XML-based language which providesa quick and easy way for companies to define predictive models andshare models between compliant vendors’ models. PMML providesapplications a vendor-independent method of defining models so thatproprietary issues and incompatibilities are no longer a barrier toexchange of applications between applications. …Previously (beforePMML) this was virtually impossible.”

I believe the most significant PMML technique, out of the dozenavailable, is Naïve Bayes Model. Reverend Thomas Bayes, whosevocation was mathematics, had his paper on Bayes Theorem publishedposthumously in 1763! It remained an unproven obscure statisticaltheorem, because his complex equations required computing powernot available until the late 1980s. Bayes Theorem allows scientists tocombine new data with their prior knowledge on how the universeworks. Assume new-born babies who have never seen a sunrise. Theirpriority is fifty per cent for sunrise tomorrow and two-thirds for theday after. After fifty years, the probability of the sun rising is a near-certainty.

Several major organizations are now using Bayesian networksincluding:

• The US Navy, for identifying incoming enemy fire andrecommending which weapons should be used for defence.

Page 47: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

47© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

• Pfizer, for conducting ‘humane’ clinical drug trials. Bayesianmethods allow them to alter the dosage during the trial, insteadof giving control groups placebos.

• General Electric, for pinpointing emerging problems in their jetengines.

• NCR, for selecting which products or services to display on theirATMs, as users wait for their transactions to complete.

Bill Gates has established a Bayesian research team of twenty plus.Their first product was MS Office Assistant, which employs Bayesianmethods to make suggestions to users based on their previous work.The next Bayesian product is rumoured to be a virtual secretary thatwill analyse incoming e-mails and phone calls to determine responsepriority.

I believe Bayesian networks will provide organizations with substantialimprovement in their ability to make accurate predictions. FuzzySELECT (see DB2 Update, Issue 87, January 2000) lets users askfuzzy questions such as, “Which customers have high income andlive around Port Dickson?” Bayesian techniques will allow users topredict what those customers are likely to buy.

DATA WAREHOUSE SUMMARY

IBM’s initial foray into data warehousing was supporting star and itsvariants in DB2, even though they violate Codd’s normalizationrules. They became serious when they included OLAP in DB2 UDBV6, allowing star schemas as an alternative. Another importantenhancement was the addition of DB2 Warehouse Manager to DB2OLAP, providing DBAs with simplified procedures and extensiveconnectability. IBM’s renamed Information Catalog provides userswith many options including metadata interchange with most popularaccess tools. IBM has had QMF for its query language from day one.It became obsolete when IBM released Intelligent Miner for Data withIntelligent Miner Scoring using PMML. IBM has made an all-outcommitment to PMML, so it can become the leader in accesslanguages.

Page 48: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 48

I suspect that many readers wondered about my statement that datawarehousing is the only practical way to leverage mainframe data.The following should convince sceptics:

1 A DBA designs a star or variant schema for the user requirements.

2 S/he uses simple tablespaces and other features to maximizeperformance.

3 The data can be retrieved from almost anything including anyDB2 family, Informix, Oracle, SQL Server, Sybase, flat files,VSAM, IMS, and any other file available to DataJoiner.

4 The Information Catalog can be connected by Windows, anyWeb browser, workgroups, or central repository. Any DB2 familycan store it and use automatic population.

5 Metadata interchange with Brio, Business Objects, Cognos,DB2 OLAP, Hyperion, QMF, and many more.

6 Advanced query techniques using Intelligent Miner for Data(IMD) and Intelligent Miner Scoring (DB2IMS).

7 IMD is client/server whose clients can be AIX, OS/2, WindowsNT, 95, or 2000. Servers can be AIX, OS/390, OS/400, Solaris,or Windows NT or 2000.

8 DB2IMS uses PMML, which allows seamless interchange withany PMML model developed on any computer using any software.

9 PMML has sophisticated query techniques including statistics,taxonomies, and hierarchies, Tree Model, Naïve Bayes Model,General Regression Model, Association Rules Model, NeuralNetwork Model, and Clustering Model.

WEB-ENABLING

The only practical way to Web-enable is WebSphere. It has threeeditions – Standard, Advanced, and Enterprise. This article deals onlywith Enterprise, because DB2 V7.1+ runs under OS/390 on

Page 49: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

49© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

mainframes. Mainframes are used for heavy transaction volumes,which in turn require Enterprise. Enterprise provides:

• Dynamic Web content generation using Enterprise JavaBeans,XML, and XSL; and bean-managed and container managedpersistence with EJB and container services.

• Reusable business logic and portable data for rapid sitedeployment.

• Usage analysers and reporting tools.

• Apache-based HTTP server among others.

• Database connection pooling for dynamic JDBC access to DB2,Oracle, and SQL Server.

• Tivoli-ready modules.

• XML parser utilizing the latest W#C XML 1.0 specifications.

• XSL parser for transforming XML data into formatted HTML.

• Lightweight Directory Access Protocol (LDAP).

• Common Object Request Broker Architecture (CORBA) andEJB.

• Control and protection.

Simple Web-based application architectures are ‘three-tier’ comprisinga ‘thin-client’, where the Web browser executes; a ‘middle-tier’,where the Web server and application server operate; and a ‘back-end’ tier that contains the enterprise logic and database servers.

Mainframe Web applications usually employ distributed client/serverapplications (‘n-tier’) because they have a ‘client-tier’ that usesdistributed objects encapsulating the business logic and ‘back-end’enterprise data. Distributed objects can be clients of other distributedobjects. ‘n-tier’ typically requires richer server interaction. A standardtechnique is to use client Java applets that communicate to anapplication server with Internet Inter-ORB Protocol (IIOP) or RemoteMethod Interface (RMI) over IIOP.

Page 50: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

© 2002. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (303) 410 9344, fax (303) 438 0290. 50

Enterprise relational data can be accessed by a Java Data BaseConnect (JDBC) API or SQLJ(ava) API. SQLJ is based on the ANSIX.3.135 SQLJ standard. It runs on top of DB2 JDBC drivers providingJava classes, translator (converts DB2 code to Java), and runtime/customization tools.

DB2 JDBC driver supports type 2 (application driver support) andtype 3 (applet/net driver). A JDBC requests flows to DB2 CLI to theDB2 Server via the DB2 Client Application Enabler (CAE). Testsindicate that type 2 provides better performance.

The data warehouse, or data mart subset(s), will probably providemost of the data, although some applications such as customer servicecall centres may use only the data warehouse. Transaction applications,such as e-business, require access to OLTP applications. Webmasterslike to design Web pages that are hit so often that they say ouch! Thisillustrates a critical difference between data warehousing andtransaction applications. Data warehouse queries are unpredictableand can require massive computer power to answer. Transactionsystems follow a defined thread, even if there are many branches. Adata warehouse cannot be directly used as input for a transactionapplication because it may provide unacceptable response time fortransaction users such as surfers. Any Webmaster will tell you that adelay of a second can cause the surfer to surf somewhere else. So, ruleone is that the data warehouse or data mart subset must be replicatedfor the Web page.

SUMMARY

The best way to leverage mainframe data is to collect it in a datawarehouse. Cleansing and verification routines have vetted the data,assuring users it is correct and usable. WebSphere is the best way toWeb-enhance using data warehouse historical data and OLTP currentdata. The data warehouse must be replicated to provide acceptableresponse time to the Web users.

References:

Page 51: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

51© 2002. Reproduction prohibited. Please inform Xephon of any infringement.

• Servlet and JSP Programming with IBM WebSphere Studio andVisualAge for Java, SG24-5755.

• The Universal Connectivity Guide to DB2, SG24-4894.

Web sites:

• WebSphere – http://www.ibm.com/software/webservers/appserv.

• Servlets – http://www.software.ibm.com/ebusiness/pm.html#Servlets/.

• JSP – http://www.software.ibm.com/ebusiness/pm.html#Java.Server.Pages/.

• JavaBeans – http://www.javasoft.com/beans/docs.

• Enterprise JB – http://www.java.sun.com/products/ejb/.

• Connectors – http://www.software.ibm.com/ebusiness/connectors.html/.

• XML – http://www.software.ibm.com/xml/.

• CORBA – http://www.omg.org/.

• RMI – http://www.java.sun.com/products/jdk/rmi/index.html/.

• IIOP – http://www.whatis.com/iiop.htm/.

• JNDI – http://www.java.sun.com/products/jndi/index.html/.

• JDBC – http://www.java.sun.com/products/jdbc/index.html/.

• JMS – http://www.java.sun.com/products/jms/index.html/.

• JTA – http://www.java.sun.com/products/jta/index.html/.

• SQLJ – http://www.sqlj.org/.

• DB2 Java – http://www.ibm.com/software/data/db2/java/.

Eric Garrigue VeselyPrincipal/AnalystWorkbench Consulting (Malaysia) © Xephon 2002

Page 52: DB2 Feb title2 - CBT Tape Home Page - MVS Freeware

HiT Software has launched its DB2Motion,which replicates iSeries and AS/400application data to Microsoft SQL Serverand Oracle application environments,providing near real-time mirroring of iSerieschanges.

The DB2Motion Enterprise Manager runs ona Windows client and allows administrationfunctions with wizards, enablingadministrators to define destination SQLServer or Oracle tables.

For further information contact:HiT Software, 4020 Moorpark Avenue,Suite 100, San Jose, CA 95117, USA.Tel: (408) 345 4001.URL: http://www.hitsw.com.

* * *

IBM has announced Version 1.2 of its TivoliData Protection for Enterprise StorageServer (ESS) Databases back-up recoverysoftware, which now provides online back-up for DB2 and exploits the ESS disksubsystem with its new FlashCopy function.

The software, which is also available forOracle databases, is said to virtually eliminateback-up-related performance impacts,downtime, and user disruption on theproduction host.

It’s aimed at sites with expanding back-upwindows or who need 24x7 application anddatabase availability. Working with TivoliStorage Manager, it promises consistent andreliable unattended online back-up andrecovery of databases.

Key features include automated, high-performance backup through exploitation of

the FlashCopy function of IBM’s EnterpriseStorage Server, virtually no back-up-relateddowntime of applications and databases,compliance and integration with Oracle andDB2 UDB databases, automated schedulingwith Tivoli Storage Manager scheduler, andcentralized control.

For further information contact your localIBM representative.URL: http://www.tivoli.com/products.

* * *

JD Edwards has begun shipping itsOneWorld Xe collaborative commerceapplications on IBM’s DB2 UniversalDatabase for Unix and Microsoft Windows2000 platforms. The new implementationspromise exclusive DB2 optimization andconfiguration tools. Also, DB2 will nowbecome JD Edwards’ internal developmentand maintenance platform.

The ERP company reckons that, comparedwith other available databases, DB2 offers allof the features and functions of a leadingdatabase, and is less expensive to purchase,implement, and maintain. It is also easier toinstall, upgrade, configure, and tune.

It adds that it will support DB2 on a widevariety of platforms, including AIX, SunSolaris, HP-UX, and Windows 2000environments, as well as providing continuedsupport for DB2 on iSeries running OS/400.

For further information contact:JD Edwards, One Technology Way, Denver,CO 80237, USA.Tel: (303) 334 4000.URL: http://www.jdedwardsnews.com.

DB2 news

� xephon


Recommended