DB2 UDB® Database
                         Design and Administration (V8)
                         Course No.       1193

...
Table of Contents

1.	 DB2	UDB®	Overview                                                                           •    Co...
5.	 Index	Design	and	Creation                                                             8.	 Databases,	Tablespaces	And	S...
9.	 Security                                                                             11.	 Expanding	Your	DB2Horizons
 ...
14.	 The	UDB	LOAD	Process	and	Utilities                                                          •    PUNSTATS Parameters
...
•   DSN1LOGP Notes                                                                   18.	 UDB®	Standalone	Utilities
    • ...
20.	 DB2	Administration
      •   Schema Evolution
      •   DBA Enhancements
      •   Version 8 Partitioning
      •   P...
Upcoming SlideShare
Loading in...5
×

DB2 UDB

250

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
250
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

DB2 UDB

  1. 1. DB2 UDB® Database Design and Administration (V8) Course No. 1193 Description This course uses a combination of lecture and hands-on workshops to enable participants to create and administer objects in a DB2 UDB® for Z/OS Version 8 or Version 8 environment. The course also examines how to execute all UDB’s utilities including LOAD, CHECK DATA, COPY, QUIESCE, REORG, RECOVER, RUNSTATS, and UNLOAD. Audience This course is recommended for Database Administrators, Systems Administrators or Application Developers who are responsible for creating, modifying, or maintaining DB2 UDB® objects. Prerequisites A working knowledge of relational database objects is required. Objectives • Use the DB2 UDB® catalog to obtain information about database objects • Perform the physical design of a database • Preserve referential integrity and check constraints • Use proper indexing • Select the correct tablespace types • Create all DB2 UDB® objects • Alter certain DB2 UDB® object characteristics • Understand basic DB2 UDB® performance considerations • Administer a DB2 UDB® database using all DB2 UDB® utilities and Operator commands • Load tables using the LOAD utility • Develop and implement a backup/recovery strategy • Reorganize a tablespace using several different strategies • Unload data from DB2 UDB® • Process multiple objects effectively Major Topics • DB2 UDB® Overview • DB2 UDB® Security • SQL Overview • DB2 UDB® Triggers • The UDB Catalog • DB2 UDB® Locking and Performance • DB2 UDB® Table Design and Creation • The DB2 UDB® Command Interface • DB2 UDB® Index Design and Creation • DB2 UDB® LOAD Utility • DB2 UDB® Referential Integrity • DB2 UDB® Backup and Recovery • DB2 UDB® Views, Synonyms, and Aliases • DB2 UDB® REORG and UNLOAD ©2007-09 | Keane, Inc. • DB2 UDB® Storegroups, • Multi-object Processing Databases, and Tablespaces • Standalone Utilities Duration 5 days info@keane.com Australia | Canada | China | France | India | New Zealand | Singapore | Switzerland | UAE | UK | USA www.keane.com/education/
  2. 2. Table of Contents 1. DB2 UDB® Overview • Column Authorizations • What DB2 UDB® Is • Package Authorizations • How DB2 Interfaces with Applications • Plan Authorizations • Components of DB2 UDB® Database • DB2 UDB® Directory Catalog Query Tools • DB2 UDB® “World” Example 4. Table Design and Creation • String Data Types • Logical Design • Binary Data Types • Physical Design • Numeric Data Types • A Simple Data Model • Date/Time Data Types • Transforming Data Model to Physical Design • Attribute Qualifiers • Transforming Many–to-Many Relationships • Check Constraints • Transforming Complex Relationships • DB2 UDB® “World” Example • Normalization • Relationships • Intentional Denormalization • A View • Denormalization Techniques • Views • Identifying Denormalization Opportunities • ‘Special’ Data Types • Table Creation Process Naming the Table • Table/View names • Defining the Columns • Synonyms and Aliases A DB2 UDB® Sybsystem • Numeric Data Types 2. SQL Overview • Character/Graphic Data Types • SQL • Date/Time Data Types • SQL Syntax Rules • LOB Data Types • DDL, DCL, DML • Special Data Types • Static SQL • The ROWID Datatype • Dynamic SQL • The AS IDENTITY Datatype Modifier • Mainframe Dynamic SQL • Null/Default Characteristic • Workstation Access – The Control Center • Placing A Table In A Database • Table Limits 3. The DB2 UDB® Catalog • Tables As Related To Tablespaces • DB2 UDB® System Tables Column Constraints • Contents of Catalog • Constraints At The Table Level • Database: SYSDATABASE • Column Constraints • Tables: SYSDATABASE • Deleting a Table with DROP Columns: SYSCOLUMNS • DROP/ReCREATEing A Table • Indexes: SYSINDEXES • Restricting DROP • Tablespaces and Partitions: • ALTERing A Table SYSTABLESPACE and SYSTABLEPART • Sample ALTER Commands • Stored Procedures: SYSROUTINES • Creating a Table Like Another • Trigger: SYSTRIGGERS • Renaming a Table • Authorizations: Overview • Global Temporary Tables • Resource Authorizations • System-Wide Authorizations • Database Authorizations • Table Authorizations info@keane.com Australia | Canada | China | France | India | New Zealand | Singapore | Switzerland | UAE | UK | USA www.keane.com/education/
  3. 3. 5. Index Design and Creation 8. Databases, Tablespaces And Storage Groups • Index Benefits • Definitions • Index Costs • Storage Groups • Required Indexes • Databases • Optional Indexes • Databases and Bufferpools • CREATE Index DDL • Databases and Characters Sets • CREATE INDEX Parameters • CREATE DATABASE • Index Structure • Creating Tablespaces • Altering Index Characteristics • CREATE Simple/Segmented Tablespace DDL • Dropping Indexes • Tablespace Types • Drop/ReCREATE INDEX • Simple vs. Segmented Tablespaces • Estimating Space for Indexes • Segmented Tablespaces • Non-Unique Index Space Estimation • Multiple Tables per Tablespace 6. Referential Integrity • Implicit vs. Explicit Tablespace Creation • Definition of R.I. • CREATE Tablespace Parameters • R.I. Rules • Dataset Naming Convention • Delete Rules • Altering Simple Segmented Tablespaces • Notes on R.I. • Partitioning Your Data • Creating Tables and Indexes with RI • Partitioned Tablespace Advantages • FK Indexes • Partitioning Drawbacks • Implementing R.I. with DDL • Partitioned Tablespaces • CREATE vs. ALTER for R.I. • ‘Normal’ Partitioned Tablespaces • Recursive relationships • Customizing Partitions • Cyclic Relationships • CREATE ‘Normal’ Partitioned Tablespace DDL • Application-Enforced R.I. • ‘Normal’ Partitioned Tablespace Sample DDL • Finishing the ‘Normal’ Partition CREATE Process 7. Views, Synonyms & Aliases • The Partitioning Index • Definitions • Indexes on Partitioned Data • Why Views? • Partitioning and Index Datasets • Column Subset Views • Rebalancing Data Within Partitions • Row Subset Views • Gigantic Partitioned Tablespaces • Changing Columns Names Via Views • Gigantic Partitioned Tablespace DDL • Hiding Complex SQL with View • Managing LOB Data • Updatability of Views • Estimating Space for Tables and Tablespaces • Views WITH CHECK OPTION • Physical structures • Views WITH CASCADED CHECK OPTION • Manually Managing VSAM Files (VCAT) • Synonyms and Aliases • CREATE Synonym • CREATE Alias info@keane.com Australia | Canada | China | France | India | New Zealand | Singapore | Switzerland | UAE | UK | USA www.keane.com/education/
  4. 4. 9. Security 11. Expanding Your DB2Horizons • Obtaining Your UDB Identity • BLOBs • AUTHIDs • CLOBs • Sources of Authorization • DBCLOBs • GRANT DCL • LOB Locators • REVOKE DCL • Using LOBs in A Program • System Privileges • Using LOB Locators in a Program • Resource Privileges • LOB Functions • Databases Privileges • Other Large Object Facts • Table Privileges • Stored Procedures • Plan/Package Privileges • Stored Procedures in the Catalog • Other Privileges • Stored Procedure Considerations • Administrative Groups • Dynamic SQL in Programs • System Administrative Groups • Data Sharing • Database Administrative Groups • Batch SQL 10. DB2® Triggers, User Defined • DSNTIAUL Example Function & User defined Types 12. DB2® Locking and Performance • What’s a Trigger? • Locking • Why Do We need Triggers? • SQL Performance Factors • Some Common Uses of Triggers • Access Paths and EXPLAIN • Trigger Definition – Name, Activation Time, • Catalog Tables Updated by RUNSTATS Triggering Event, Base Table, Granularity • Access Paths and EXPLAIN • Activation Time and Granularity • EXPLAIN • Trigger Definition – Mode • Access Paths and EXPLAIN • Triggers: Transition Variables & Tables • Taking Control With Optimization • Referencing Transition Variables • Trigger Definition – Conditions, Action 13. UDB® Utilities Overview • Common DB2® Utilities • Calling Procedures from Triggers • DB2® Objects • Functions from Triggers Unconditionally • Common DB2® Commands • Calling User Defined Functions from Triggers Conditionally • Displaying Objects • Signaling Error Conditions from Triggers • DISPLAY Database • Dropping a Trigger • Other Options • Order of Multiple Triggers • DB2I Option 7 • Trigger Cascading • Status Codes • Trigger and Referential Constraints • START Database • User Defined Functions • STOP Database • Types of UDFs • Logical/Physical Design for Lab • Creating UDFs • UDFs Shipped with DB2 • DAYNAME • MONTHNAME • UDT info@keane.com Australia | Canada | China | France | India | New Zealand | Singapore | Switzerland | UAE | UK | USA www.keane.com/education/
  5. 5. 14. The UDB LOAD Process and Utilities • PUNSTATS Parameters • Alternatives for Loading Tables • Removing Historical Statistics • Application Program Load Algorithm • RUNSTATS Correlated Statistics • Application Program vs. LOAD Utility • Removing “Pending” Statuses after LOADing • Load Capabilities • “Parent” CHKP Events • LOAD Overview • “Child” CHKP Events • LOAD JCL • Removing CHKP Status • LOAD JCL Components • The Check Data Utility • LOAD Schematic • Removing Erroneous Data Using • Utility Phases the Check Data Utility • Load Phases 15. UDB® COPY and RECOVER Utilities • LOAD Control Statement • Summary of Recover-Related Utilities • LOADing a File That Matches • Important Recovery Factors the Table Definition • Recovery and R.I. • LOADing a File That Does Not • Developing a Backup/Recover Strategy Match the Table definition • Your Backup Strategy • LOAD Statement Notes • Effective Backup/Recovery • COBOL Datatypes vs. Load Datatypes • The COPY Utility • The DB2I Utility Panel • Specifying Objects to COPY • Utility IDs • COPY Parameters – DD Names • Tracking Utilities • COPY Parameters – Performance • LOAD Return Codes/Abends • COPY Parameter – Automating • Logical/Physical Design for Lab the COPY Type Decision • Lab DDL – Customers Table • Copying a List of Objects • Load Control Statement Options • COPY – Other Notes • LOAD – Append vs. Overlay • Image Copies in SYSCOPY • High Performance LOAD – Logging • Recovery Enhancement Utilities • High Performance LOAD – R.I. • The QUIESCE Utility • LOAD Discard Limits • QUIESCE Parameters • LOADing Partitions In Parallel • The REPORT Utility • LOAD – Compressed Data • The Modify RECOVERY Utility • LOADing Only Selected Input Records • The Modify Utilities • Massaging Data As It Is Loaded • The RECOVER Utility • Combining LOAD Parameters • Point-In-Time Recovery • LOADing More Than One Table • What Makes Recovery Necessary? • Overriding Default DD Names • The RECOVER Utility • High Performance LOAD – Parallel Index Build • Eight Steps to Recovery • Creating an Image Copy When LOADing • RECOVER Parameters • Preformatting Pages with LOAD • RECOVER Parameters – Performance • LOADing Data Extracted by REORG • Controlling the Recovery Point • Gathering Statistics When LOADing • Tablespace Recovery Example • LOAD Enhancements • Notes on RECOVER • LOAD Performance Tips • Rebuilding An Index Using REBUILD INDEX • Gathering Statistics Via RUNSTATS Statements • Notes on Point-In-Time Recovery info@keane.com Australia | Canada | China | France | India | New Zealand | Singapore | Switzerland | UAE | UK | USA www.keane.com/education/
  6. 6. • DSN1LOGP Notes 18. UDB® Standalone Utilities • The COPYTOCOPY Utility • DSN1COMP – Estimate Compression • The MERGECOPY Utility • DSN1COPY – COPY A VSAM File • Stacking Image Copies on Tape • DSN1LOGP – Print The Recovery Log 16. UDB® REORG and UNLOAD Utilities • DSN1LOGP Notes • The REORG Utility • DSN1PRNT – Print A DB2 Data File • Reasons to REORG 19. DB2 Utilities • Off-Line vs. Online REORG • V8 Utilities • Statistics That May Drive REORG • Enhancements to existing utilities • REORG Schematic • LOAD/UNLOAD will write/read delimited files • Off-line REORG Phases • LOAD/UNLOAD Restrictions • REORG Datasets • Usage Notes • REORG Parameters – Type of REORG • UNLOAD using DELIMITED • REORG Parameters – Performance • Usage Notes. • REORG Parameters – Unloading Only • Loading from a spreadsheet. • REORG Parameters – Autoinitiation • RUNSTATS relaxed restrictions • RESTART and enhancements • Return Codes/Abends and Restartablity • RUNSTATS COLGROUP Example • Online REORG Phases • RUNSTATS REPORT NO UPDATE NONE Example • Online REORG • REPAIR changed to support new features • Online REORG – REFERENCE Considerations • REPAIR VERSIONS • Online Considerations • COPY enhanced to support all system pages • Online REORG Mapping Table • REORG/REBUILD enhancements • REORG INDEX • REORG . . . REBALANCE • REORG INDEX – Parameters • REORG . . . SCOPE PENDING • CHECK INDEX • REBUILD . . . SCOPE PENDING • The UNLOAD Utility • Changes To Defaults • UNLOAD Control Statement • Changes to support DPSIs • UNLOAD Parameters • Changes to stand-alone utilities • BACKUP/RESTORE SYSTEM 17. Multiple Object/Dataset Processing • Additional Enhancements • LISTDEF’s Purpose • Utilities That Support LISTDEF • LISTDEF Syntax • LISTDEF Processing • Using LISTs With Utilities • TEMPLATE’s Purpose • Utilities That Support TEMPLATE • TEMPLATE Syntax • TEMPLATE Variables • Other TEMPLATE Options • OPTIONS’s Purpose • OPTIONS Syntax info@keane.com Australia | Canada | China | France | India | New Zealand | Singapore | Switzerland | UAE | UK | USA www.keane.com/education/
  7. 7. 20. DB2 Administration • Schema Evolution • DBA Enhancements • Version 8 Partitioning • Prior Release Partition Design • Create Index Before V8 • Logical Partitions Before V8 • Version 8 index architecture • Index Controlled Partitioning • Table Controlled Partitioning • Convert To Table Controlled Partitioning • Index Classification • Clustering Index • Example • Partitioned Index • Example • Non-partitioned indexes • Example • Partitioning Index • Example • Secondary Index • DPSI Utility Considerations • DPSI Query Considerations • Maximum Tablespace size • System Administration Considerations Appendix Limit in DB2® for Z/OS About Keane Keane partners with businesses and government agencies to optimize IT investments by delivering exceptional evolution, operation, and maintenance of mission-critical systems and business processes. A US company with a large offshore capability, Keane combines local knowledge and local senior leadership with scalable global delivery that results in low-risk, actionable, cost-effective services and solutions – and a partnership that feels like an extension of your organization. In business since 1965, Keane is an agile, full-service IT services firm headquartered in the United States with approximately 12,000 employees globally. For more information on Keane’s services, solutions, products, and locations, please visit www.keane.com. info@keane.com Australia | Canada | China | France | India | New Zealand | Singapore | Switzerland | UAE | UK | USA www.keane.com/education/

×