Introduction to DB2 for Z/OS

Total Page:16

File Type:pdf, Size:1020Kb

Introduction to DB2 for Z/OS DB2 10 for z/OS Introduction to DB2 for z/OS IBM SC19-2976-15 DB2 10 for z/OS Introduction to DB2 for z/OS IBM SC19-2976-15 Notes Before using this information and the product it supports, be sure to read the general information under “Notices” at the end of this information. October 13, 2017 edition This edition applies to DB2 10 for z/OS (product number 5605-DB2), DB2 10 for z/OS Value Unit Edition (product number 5697-P31), and to any subsequent releases until otherwise indicated in new editions. Make sure you are using the correct edition for the level of the product. Specific changes are indicated by a vertical bar to the left of a change. A vertical bar to the left of a figure caption indicates that the figure has changed. Editorial changes that have no technical significance are not noted. © Copyright IBM Corporation 2001, 2017. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents About this information ............................. ix Who should read this information ............................ ix DB2 Utilities Suite for z/OS .............................. x Terminology and citations ............................... x Accessibility features for DB2 10 for z/OS ......................... x How to send your comments ............................. xi Chapter 1. What is DB2 for z/OS?......................... 1 Chapter 2. DB2 for z/OS and SQL concepts .................... 3 Submitting SQL statements to DB2 ............................ 3 Static SQL ................................... 5 Embedded dynamic SQL .............................. 5 Deferred embedded SQL .............................. 6 Interactive SQL ................................. 6 SQL Call Level Interface and Open Database Connectivity ................... 7 Java database connectivity and embedded SQL for Java .................... 7 Use of QMF for Workstation ............................. 8 DB2 Database objects overview ............................. 9 DB2 schemas and schema qualifiers ........................... 11 DB2 tables.................................... 12 DB2 keys ................................... 13 Constraints .................................. 14 DB2 columns .................................. 20 DB2 indexes .................................. 34 DB2 views.................................... 35 Aliases ..................................... 37 Triggers .................................... 38 User-defined types ................................. 39 Routines .................................... 40 Functions ................................... 40 Procedures .................................. 40 Sequences .................................... 41 DB2 system objects ................................. 42 DB2 catalog .................................. 42 DB2 directory.................................. 43 Active and archive logs .............................. 44 Bootstrap data set ................................ 45 Buffer pools .................................. 45 Data definition control support database ........................ 46 The resource limit facility.............................. 46 Work file database ................................ 47 Application processes and transactions ......................... 47 Subsystem parameters ............................... 52 Storage structures ................................. 53 DB2 databases ................................. 53 | DB2 table spaces................................. 55 DB2 index spaces ................................ 56 | DB2 hash spaces................................. 56 DB2 storage groups................................ 57 Accessing DB2 data................................. 58 Ways to select data from columns ........................... 59 How a SELECT statement works ........................... 61 SQL functions and expressions ............................ 62 Ways to filter the number of returned rows........................ 70 © Copyright IBM Corp. 2001, 2017 iii Ways to order rows................................ 78 Ways to summarize group values ........................... 81 Ways to merge lists of values ............................ 82 Ways to specify search conditions ........................... 83 Ways to join data from more than one table ....................... 85 Subqueries................................... 92 Ways to access DB2 data that is not in a table ....................... 94 Modifying DB2 data ................................ 94 Insert statements ................................ 95 Update statements ................................ 96 Merge statements ................................ 96 Delete statements ................................ 97 Truncate statements ............................... 97 Defining DB2 objects ................................ 98 Creation of tables ................................ 98 Creation of table spaces .............................. 106 Creation of indexes ............................... 122 Creation of views ................................ 141 Creation of large objects .............................. 144 Creation of databases............................... 145 Creation of relationships with referential constraints .................... 146 Creation of triggers ............................... 150 Creation of user-defined functions .......................... 151 Application processes, concurrency, and recovery ...................... 153 Locking, commit, and rollback............................ 153 Unit of work ................................. 154 Unit of recovery ................................ 154 Rolling back work ................................ 155 Packages and application plans ............................ 156 Character conversion ................................ 157 Character sets and code pages............................ 160 Coded character sets and CCSIDS .......................... 162 Determining the encoding scheme and CCSID of a string .................. 162 Expanding conversions .............................. 166 Contracting conversions .............................. 166 Distributed data ................................. 166 Connections .................................. 167 Distributed unit of work.............................. 168 Remote unit of work ............................... 171 Distributed data ................................. 173 Remote servers ................................. 174 Connectivity in distributed environments ........................ 174 Distributed data access .............................. 175 Support for high availability ............................. 186 DB2 data sharing ................................. 186 Advantages of DB2 data sharing ........................... 187 How DB2 protects data consistency in a data sharing environment ............... 195 How updates are made in a data sharing environment ................... 196 How DB2 writes changed data to disk in a data sharing environment .............. 200 Ways that other tasks are affected by data sharing ..................... 201 Ways that availability is affected by data sharing ..................... 201 pureXML .................................... 202 Chapter 3. Management of DB2 operations.................... 205 Common ways to interact with DB2 for z/OS ....................... 205 The DB2I primary option menu ............................ 207 Commands for controlling DB2 and related facilities ..................... 209 DB2 utilities ................................... 210 Management of data sets .............................. 217 Authorization and security mechanisms for data access .................... 217 How authorization IDs control data access ....................... 218 iv Introduction to DB2 for z/OS How authorization IDs hold privileges and authorities ................... 219 Ways to control access to DB2 subsystems ........................ 220 Ways to control access to data ............................ 222 Ways to control access to DB2 objects through explicit privileges and authorities ........... 223 | Row-level and column-level access control ....................... 225 Use of multilevel security to control access ....................... 225 Use of views to control access ............................ 226 Use of grant and revoke privileges to control access .................... 226 Backup, recovery, and restart ............................. 228 Backup and recovery resources and tools ........................ 230 DB2 restart .................................. 233 Regular backups and data checks........................... 233 Control of database changes and data consistency ..................... 233 Events in the recovery process............................ 236 Optimization of availability during backup and recovery ................... 237 Data encoding basics ................................ 238 Introduction to troubleshooting problems in DB2 for z/OS ................... 241 Chapter 4. DB2 performance management .................... 247 Initial steps for performance management ......................... 247 Performance objectives .............................. 247 Application design for performance .......................... 248 Origin of performance problems ........................... 248 Tools for performance analysis ........................... 249 Ways to move data efficiently through the system ...................... 250 The role of buffer pools in caching data ........................ 250 The effect of data compression on performance .....................
Recommended publications
  • Cloud Enabling CICS
    Front cover Cloud Enabling IBM CICS Discover how to quickly cloud enable a traditional IBM 3270-COBOL-VSAM application Use CICS Explorer to develop and deploy a multi-versioned application Understand the benefits of threshold policy Rufus Credle Isabel Arnold Andrew Bates Michael Baylis Pradeep Gohil Christopher Hodgins Daniel Millwood Ian J Mitchell Catherine Moxey Geoffrey Pirie Inderpal Singh Stewart Smith Matthew Webster ibm.com/redbooks International Technical Support Organization Cloud Enabling IBM CICS December 2014 SG24-8114-00 Note: Before using this information and the product it supports, read the information in “Notices” on page vii. First Edition (December 2014) This edition applies to CICS Transaction Server for z/OS version 5.1, 3270-COBOL-VSAM application. © Copyright International Business Machines Corporation 2014. All rights reserved. Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Notices . vii Trademarks . viii IBM Redbooks promotions . ix Preface . xi Authors. xii Now you can become a published author, too! . .xv Comments welcome. .xv Stay connected to IBM Redbooks . xvi Part 1. Introduction . 1 Chapter 1. Cloud enabling your CICS TS applications . 3 1.1 Did you know?. 4 1.2 Business value . 4 1.3 Solution overview . 5 1.4 Cloud computing in a CICS TS context. 6 1.5 Overview of the cloud-enabling technologies in CICS TS V5 . 11 1.5.1 Platform overview . 12 1.5.2 Application overview . 13 Chapter 2. GENAPP introduction. 15 2.1 CICS TS topology . 16 2.2 Application architecture. 17 2.2.1 GENAPP in a single managed region.
    [Show full text]
  • On-Line Computing with a Hierarchy of Processors
    University of Pennsylvania ScholarlyCommons Technical Reports (CIS) Department of Computer & Information Science December 1968 On-Line Computing With a Hierarchy of Processors Richard P. Morton University of Pennsylvania Follow this and additional works at: https://repository.upenn.edu/cis_reports Recommended Citation Richard P. Morton, "On-Line Computing With a Hierarchy of Processors", . December 1968. University of Pennsylvania Department of Computer and Information Science Technical Report No. MS-CIS-69-13. This paper is posted at ScholarlyCommons. https://repository.upenn.edu/cis_reports/804 For more information, please contact [email protected]. On-Line Computing With a Hierarchy of Processors Abstract Time shared computer systems have been based upon the two techniques of multiprogramming and swapping. Multiprogramming is based on restricting each program to a portion of the total computer memory. Swapping requires considerable overhead time for loading and unloading programs. To alleviate the size restriction due to multiprogramming, segmentation is employed, resulting in fact in vastly increased swapping. A new system architecture is proposed for time shared computing that alleviates the high overhead or program size restriction. It utilizes a hierarchy of processors, where each processor is assigned tasks on the basis of four factors: interactive requirements, frequency of use, execution time, and program length. In order to study the hierarchical approach to system architecture, the Moore School Problem Solving Facility (MSPSF) was built and used. The study of the manner of operation and the reactions of the users clarified and defined the Hierarchy of Processors system architecture. The Moore School Problem Solving Facility was implemented on second generation equipment, the IBM 7040, and therefore it is not possible to adequately compare the efficiency with third generation computers operating in a swapping mode.
    [Show full text]
  • Perl DBI API Reference
    H Perl DBI API Reference This appendix describes the Perl DBI application programming interface. The API consists of a set of methods and attributes for communicating with database servers and accessing databases from Perl scripts. The appendix also describes MySQL-specific extensions to DBI provided by DBD::mysql, the MySQL database driver. I assume here a minimum version of DBI 1.50, although most of the material applies to earlier versions as well. DBI 1.50 requires at least Perl 5.6.0 (with 5.6.1 preferred). As of DBI 1.611, the minimum Perl version is 5.8.1. I also assume a minimum version of DBD::mysql 4.00. To determine your versions of DBI and DBD::mysql (assuming that they are installed), run this program: #!/usr/bin/perl # dbi-version.pl - display DBI and DBD::mysql versions use DBI; print "DBI::VERSION: $DBI::VERSION\n"; use DBD::mysql; print "DBD::mysql::VERSION: $DBD::mysql::VERSION\n"; If you need to install the DBI software, see Appendix A , “Software Required to Use This Book.” Some DBI methods and attributes are not discussed here, either because they do not apply to MySQL or because they are experimental methods that may change as they are developed or may even be dropped. Some MySQL-specific DBD methods are not discussed because they are obsolete. For more information about new or obsolete methods, see the DBI or DBD::mysql documentation, available at http://dbi.perl.org or by running the following commands: % perldoc DBI % perldoc DBI::FAQ % perldoc DBD::mysql The examples in this appendix are only brief code fragments.
    [Show full text]
  • Accessing DB from Programming Languages
    Accessing DB from programming languages JDBCJDBC andand ODBCODBC • API (application-program interface) for a program to interact with a database server • Application makes calls to – Connect with the database server – Send SQL commands to the database server – Fetch tuples of result one-by-one into program variables • ODBC (Open Database Connectivity) works with C, C++, C#, and Visual Basic – Other API’s such as ADO.NET sit on top of ODBC • JDBC (Java Database Connectivity) works with Java JDBCJDBC • JDBC is a Java API for communicating with database systems supporting SQL. • JDBC supports a variety of features for querying and updating data, and for retrieving query results. • JDBC also supports metadata retrieval, such as querying about relations present in the database and the names and types of relation attributes. • Model for communicating with the database: – Open a connection – Create a “statement” object – Execute queries using the Statement object to send queries and fetch results – Exception mechanism to handle errors JDBCJDBC CodeCode public static void JDBCexample(String dbid, String userid, String passwd) { try { Class.forName ("oracle.jdbc.driver.OracleDriver"); Connection conn = DriverManager.getConnection( "jdbc:oracle:thin:@db.yale.edu:2000:univdb", userid, passwd); Statement stmt = conn.createStatement(); … Do Actual Work …. stmt.close(); conn.close(); } catch (SQLException sqle) { System.out.println("SQLException : " + sqle); } } JDBCJDBC CodeCode (Cont.)(Cont.) • Update to database try { stmt.executeUpdate( "insert
    [Show full text]
  • Z/OS ISPF Services Guide COMMAND NAME
    z/OS 2.4 ISPF Services Guide IBM SC19-3626-40 Note Before using this information and the product it supports, read the information in “Notices” on page 399. This edition applies to Version 2 Release 4 of z/OS (5650-ZOS) and to all subsequent releases and modifications until otherwise indicated in new editions. Last updated: 2021-06-22 © Copyright International Business Machines Corporation 1980, 2021. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Figures................................................................................................................ xv Tables................................................................................................................xvii Preface...............................................................................................................xix Who should use this document?............................................................................................................... xix What is in this document?......................................................................................................................... xix How to read the syntax diagrams..............................................................................................................xix z/OS information...............................................................................................xxiii How to send your comments to IBM...................................................................
    [Show full text]
  • OS/390 Introduction to ISPF
    z/OS Basic Skills Information Center: ISPF Course Module Module 1: Main Features of ISPF © Copyright IBM Corp., 2005. All rights reserved. z/OS Basic Skills Information Center: ISPF Course Module Introduction This module, Main Features of ISPF, introduces you to the z/OS Interactive System Productivity Facility, or ISPF, with special emphasis on the Program Development Facility, or PDF. Time to complete: 10 – 15 minutes © Copyright IBM Corp., 2005. All rights reserved. Page 2 of 15 z/OS Basic Skills Information Center: ISPF Course Module Main Features of ISPF - Objectives Upon completion of this module, you should be able to: • Describe the purpose of ISPF and its relationship to TSO • List the four major components of ISPF • Explain the function of each of the four components © Copyright IBM Corp., 2005. All rights reserved. Page 3 of 15 z/OS Basic Skills Information Center: ISPF Course Module Main Features of ISPF – Purpose of ISPF The Interactive System Productivity Facility, or ISPF, is a development tool set for the z/OS operating system. It has been used since 1975 to increase the productivity of the development of mainframe applications, because it provides an extensive set of programmer oriented facilities. © Copyright IBM Corp., 2005. All rights reserved. Page 4 of 15 z/OS Basic Skills Information Center: ISPF Course Module Main Features of ISPF – The Time Sharing Option/Extended (TSO/E) The Time Sharing Option/Extended, or TSO/E, is a base element of IBM's mainframe z/OS operating system. TSO/E allows you to communicate interactively with the MVS operating system by typing commands (one line at a time) on a computer terminal.
    [Show full text]
  • Introduction to Mainframe Networking TCP/IP Problem Determination
    z/OS Basic Skills Information Center Networking on z/OS z/OS Basic Skills Information Center Networking on z/OS Note Before using this information and the product it supports, read the information in “Notices” on page 251. This edition applies to z/OS (product number 5694-A01). We appreciate your comments about this publication. Comment on specific errors or omissions, accuracy, organization, subject matter, or completeness of this book. The comments you send should pertain to only the information in this manual or product and the way in which the information is presented. For technical questions and information about products and prices, please contact your IBM branch office, your IBM business partner, or your authorized remarketer. When you send comments to IBM, you grant IBM a nonexclusive right to use or distribute your comments in any way it believes appropriate without incurring any obligation to you. IBM or any other organizations will only use the personal information that you supply to contact you about the issues that you state on this form. Send your comments through this web site: http://publib.boulder.ibm.com/infocenter/zoslnctr/v1r7/index.jsp?topic=/com.ibm.zcontact.doc/webqs.html © Copyright IBM Corporation 2006, 2010. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Before you begin the topic about Coupling channels ...........40 networking on z/OS .........vii Open Systems Adapter (OSA) .......40 HiperSockets ..............46 The I/O cage ..............48 Part 1. Introduction to networking on the mainframe...........1 Chapter 4. Sample network configuration ............49 Chapter 1.
    [Show full text]
  • Netezza EOL: IBM IAS Is a Flawed Upgrade Path Netezza EOL: IBM IAS Is a Flawed Upgrade Path
    Author: Marc Staimer WHITE PAPER Netezza EOL: What You’re Not Being Told About IBM IAS Is a Flawed Upgrade Path Database as a Service (DBaaS) WHITE PAPER • Netezza EOL: IBM IAS Is a Flawed Upgrade Path Netezza EOL: IBM IAS Is a Flawed Upgrade Path Executive Summary It is a common technology vendor fallacy to compare their systems with their competitors by focusing on the features, functions, and specifications they have, but the other guy doesn’t. Vendors ignore the opposite while touting hardware specs that mean little. It doesn’t matter if those features, functions, and specifications provide anything meaningfully empirical to the business applications that rely on the system. It only matters if it demonstrates an advantage on paper. This is called specsmanship. It’s similar to starting an argument with proof points. The specs, features, and functions are proof points that the system can solve specific operational problems. They are the “what” that solves the problem or problems. They mean nothing by themselves. Specsmanship is defined by Wikipedia as: “inappropriate use of specifications or measurement results to establish supposed superiority of one entity over another, generally when no such superiority exists.” It’s the frequent ineffective sales process utilized by IBM. A textbook example of this is IBM’s attempt to move their Netezza users to the IBM Integrated Analytics System (IIAS). IBM is compelling their users to move away from Netezza. In the fall of 2017, IBM announced to the Enzee community (Netezza users) that they can no longer purchase or upgrade PureData System for Analytics (the most recent IBM name for its Netezza appliances), and it will end-of-life all support next year.
    [Show full text]
  • SAP Database Administration with IBM
    André Faustmann, Michael Greulich, André Siegling, Benjamin Wegner, and Ronny Zimmerman SAP® Database Administration with IBM® DB2® Bonn Boston Contents at a Glance 1 Introduction ............................................................................ 19 2 SAP System Landscapes ......................................................... 25 3 Basics and Architecture of the IBM DB2 for LUW Database ................................................................................. 71 4 Lifecycle ................................................................................. 233 5 Administration Tools Inside and Outside the SAP System .... 327 6 Backup, Restore, and Recovery .............................................. 463 7 Monitoring DB2 SAP Systems with SAP Solution Manager .................................................................................. 575 8 SAP NetWeaver Business Warehouse and IBM DB2 for LUW .................................................................................. 647 9 Common Problems and Their Solutions for DB2 Administrators ........................................................................ 697 Contents Foreword .................................................................................... 15 Acknowledgments ....................................................................... 17 1 Introduction ................................................................. 19 1.1 Who This Book Is For .................................................... 21 1.2 Focus of This Book .......................................................
    [Show full text]
  • Fortran Reference Guide
    FORTRAN REFERENCE GUIDE Version 2018 TABLE OF CONTENTS Preface............................................................................................................ xv Audience Description......................................................................................... xv Compatibility and Conformance to Standards............................................................ xv Organization................................................................................................... xvi Hardware and Software Constraints...................................................................... xvii Conventions................................................................................................... xvii Related Publications........................................................................................ xviii Chapter 1. Language Overview............................................................................... 1 1.1. Elements of a Fortran Program Unit.................................................................. 1 1.1.1. Fortran Statements................................................................................. 1 1.1.2. Free and Fixed Source............................................................................. 2 1.1.3. Statement Ordering................................................................................. 2 1.2. The Fortran Character Set.............................................................................. 3 1.3. Free Form Formatting..................................................................................
    [Show full text]
  • SPSS to Orthosim File Conversion Utility Helpfile V.1.4
    SPSS to Orthosim File Conversion Utility Helpfile v.1.4 Paul Barrett Advanced Projects R&D Ltd. Auckland New Zealand email: [email protected] Web: www.pbarrett.net 30th December, 2019 Contents 3 Table of Contents Part I Introduction 5 1 Installation Details ................................................................................................................................... 7 2 Extracting Matrices from SPSS - Cut and Paste ................................................................................................................................... 8 3 Extracting Matrices from SPSS: Orthogonal Factors - E.x..c..e..l. .E..x..p..o..r.t................................................................................................................. 17 4 Extracting Matrices from SPSS: Oblique Factors - Exce.l. .E..x..p..o..r..t...................................................................................................................... 24 5 Creating Orthogonal Factor Orthosim Files ................................................................................................................................... 32 6 Creating Oblique Factor Orthosim Files ................................................................................................................................... 41 3 Paul Barrett Part I 6 SPSS to Orthosim File Conversion Utility Helpfile v.1.4 1 Introduction SPSS-to-Orthosim converts SPSS 11/12/13/14 factor loading and factor correlation matrices into the fixed-format .vf (simple ASCII text) files
    [Show full text]
  • Database Systems Administrator FLSA: Exempt
    CLOVIS UNIFIED SCHOOL DISTRICT POSITION DESCRIPTION Position: Database Systems Administrator FLSA: Exempt Department/Site: Technology Services Salary Grade: 127 Reports to/Evaluated by: Chief Technology Officer Salary Schedule: Classified Management SUMMARY Gathers requirements and provisions servers to meet the district’s need for database storage. Installs and configures SQL Server according to the specifications of outside software vendors and/or the development group. Designs and executes a security scheme to assure safety of confidential data. Implements and manages a backup and disaster recovery plan. Monitors the health and performance of database servers and database applications. Troubleshoots database application performance issues. Automates monitoring and maintenance tasks. Maintains service pack deployment and upgrades servers in consultation with the developer group and outside vendors. Deploys and schedules SQL Server Agent tasks. Implements and manages replication topologies. Designs and deploys datamarts under the supervision of the developer group. Deploys and manages cubes for SSAS implementations. DISTINGUISHING CAREER FEATURES The Database Systems Administrator is a senior level analyst position requiring specialized education and training in the field of study typically resulting in a degree. Advancement to this position would require competency in the design and administration of relational databases designated for business, enterprise, and student information. Advancement from this position is limited to supervisory management positions. ESSENTIAL DUTIES AND RESPONSIBILITIES Implements, maintains and administers all district supported versions of Microsoft SQL as well as other DBMS as needed. Responsible for database capacity planning and involvement in server capacity planning. Responsible for verification of backups and restoration of production and test databases. Designs, implements and maintains a disaster recovery plan for critical data resources.
    [Show full text]