DB2 Developers Guide
A Solutions-Oriented Approach to Learning the Foundation and Capabilities of DB2 for z/OS, Sixth Edition
Craig S. Mullins
IBM Press
Pearson plc
Upper Saddle River, NJ Boston Indianapolis San Francisco
New York Toronto Montreal London Munich Paris Madrid
Cape Town Sydney Tokyo Singapore Mexico City
ibmpressbooks.com
The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.
Copyright 2012 by International Business Machines Corporation. All rights reserved.
Note to U.S. Government Users: Documentation related to restricted right. Use, duplication, or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corporation.
IBM Press Program Managers: Steven M. Stansel, Ellice Uffer
Cover design: IBM Corporation
Associate Publisher: Dave Dusthimer
Marketing Manager: Stephane Nakib
Executive Editor: Mary Beth Ray
Publicist: Andrea Bledsoe
Editorial Assistant: Vanessa Evans
Senior Development Editor: Christopher Cleveland
Technical Reviewers: Willie Favero, Chuck Kosin
Managing Editor: Kristy Hart
Senior Project Editor: Lori Lyons
Copy Editor: Apostrophe Editing Services
Indexer: Brad Herriman
Compositor: Nonie Ratcliff
Proofreaders: Katherine Ruiz, Chrissy White/Language Logistics, LLC
Manufacturing Buyer: Dan Uhrig
Published by Pearson plc
Publishing as IBM Press
IBM Press offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact
U. S. Corporate and Government Sales
1-800-382-3419
.
For sales outside the U. S., please contact
International Sales
.
The following terms are trademarks of International Business Machines Corporation in many jurisdictions worldwide:
IBM, IBM Press, DB2, z/OS, pureXML, Informix, CICS, IMS, Parallel Sysplex, Optim, MQSeries. pureXML, DS6000, DS8000, FlashCopy, OS/390, QMF, MVS, DB2 Universal Database, DB2 Extenders, developerWorks, RACF, WebSphere, DB2 Connect, OMEGAMON, pureQuery, Redbooks, VTAM, Resource Measurement Facility, GDPS, System z, Distributed Relational Database Architecture, iSeries, AS/400, AIX, zSeries, InfoSphere, Cognos, SPSS, Clarity, and OpenPages. Netezza is a registered trademark of IBM International Group B.V., an IBM Company. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at Copyright and trademark information at www.ibm.com/legal/copytrade.shtml.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both. Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates. UNIX is a registered trademark of The Open Group in the United States and other countries. Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
Other company, product, or service names may be trademarks or service marks of others.
Library of Congress Cataloging-in-Publication Data
Mullins, Craig.
Db2 developers guide : a solutions-oriented approach to learning the foundation and
capabilities of Db2 for z/OS / Craig S. Mullins. 6th ed.
p. cm.
Includes index.
ISBN 978-0-13-283642-5 (pbk.)
1. Database management. 2. IBM Database 2. I. Title.
QA76.9.D3M84 2012
005.7565dc23
2012006815
All rights reserved. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to:
Pearson Education, Inc
Rights and Contracts Department
501 Boylston Street, Suite 900
Boston, MA 02116
Fax (617) 671 3447
ISBN-13: 978-0-13-3283642-5
ISBN-10: 0-13-283642-4
Text printed in the United States on recycled paper at Edwards Brothers Malloy, Ann Arbor, Michigan.
First printing May 2012
Accolades for DB2 Developers Guide
Once youve picked up and read DB2 Developers Guide, you will know why people on the DB2 List Serve forum refer to this book as the BIBLE. You will find that the DB2 Developers Guide is a comprehensive guide for both the beginner and experienced in DB2 and relational database technology...I cannot say enough about the DB2 Developers Guide.
Troy Coleman
Data Administration Newsletter
DB2 Developers Guide has the potential to pay for itself many times over if you follow its useful design and performance advice. If you use DB2 in your workplace, the most recent edition of DB2 Developers Guide should definitely be on your bookshelf. Read it to save yourself an enormous amount of pain and suffering.
Ron Shirey
Relational Database Journal
...the book is not only the size of a small encyclopedia, it is also just about as comprehensive.
Books & Bytes News & Reviews
DB2 Developers Guide is a must buy for both inexperienced and DB2 experts alike. I am amazed at the amount of information Craig covers in the DB2 Developers Guide.
Chris Foot
Data Administration Newsletter
DB2 Developers Guide is a complete reference for the DB2 professional. It is a perfect tool for finding the options available to the DB2 developer, and steering you to the right method.
Gregory Amov
Computing News & Review
DB2 Developers Guide presents literally everything programmers and DBAs need to know about advanced DB2... This is an excellent book... It is chock full of DB2 technical information, design and tuning approaches, and database administration guidelines... In an organized and coherent way, Mullins seems to have dumped his entire DB2 life experience into DB2 Developers Guide.
Jonathon Sayles
Relational Database Journal
Enormous amount of priceless information. I dont think there has ever been any other publication that managed to cover so much. And the book is not just a developers guidethe book is The DB2 professionals guide.
Daniela Guentcheva
On amazon.com
With more than 25 years experience as an application developer on IBM mainframes, including 15 years with DB2, I thought that there was little I didnt know until reading Craig Mullins book. It goes into the depth required (and beyond) for professional developers and even deeper into the domain of the DBAs territory.
Keith A. Marsh
On amazon.com
This book is dedicated to my mom, Donna Mullins,
and to the memory of my father, Giles R. Mullins.
Without the constant support and guidance my parents provided,
I would not have the success I enjoy today.
Preface: A Short History of DB2 for z/OS
Lets go back in time...almost three decades ago...back to the wild and woolly 1980s! And watch as our favorite DBMS, DB2, grows up over time.
Version 1 Release 1 was announced on June 7, 1983. And it became generally available on Tuesday, April 2, 1985. I wonder if it was ready on April 1st but not released because of April Fools Day? Initial DB2 development focused on the basics of making a relational DBMS work. Early releases of DB2 were viewed by many as an information center DBMS, not for production work like IMS.