Introduction to the new mainframe Chapter 13 b

Introduction to the new mainframe Chapter 13 b Understanding Database Managers - IMS on z/OS © Copyright IBM Corp. , 2005. All rights reserved. Contains Animation jkettner@us. ibm. com Sept. 2006

Introduction to the new mainframe Chapter 13 b objectives Be able to: Explain IMS processing. List common DB 2 data structures. Compose simple SQL queries to run on z/OS. Give an overview of application programming with DB 2. What the IMS components are The structure of the IMS DB subsystem © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Key terms in this chapter bind DBMS EXPLAIN modified source SPUFI SQL SYSADM view © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe What is a database A Database is a collection of related data organized in a way that can be processed by application programs A database management system (DBMS) consist of a set of licensed programs that define and maintain the structure of the database. © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Entities Attributes Relationships What is a database example entity Note: An attribute is always dependent on an entity – it has no meaning by itself { one-to-one one-to-many-to-many Note: Relationships can be recursive © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Why use a database? • • • Reduce programming effort Manage data more efficiently Easy to separate confidential/sensitive info Provide a greater level of security Access & update simultaneously Ensure consistency Provide backup and recovery Utilities to monitor and tune Structure change does not impact existing developments © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Role of the database administrator What usually is the DBA not responsible for? © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Databases: terminology summary Ø Entities Ø Data attributes Ø Entity relationships Ø Application functions Ø Access paths © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Databases on z/OS Ø Hierarchical databases, such as IMS Ø Relational database management system (RDBMS), such as DB 2 Is VSAM considered a database ? © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Information Management System / Data Base ICS/DLI © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Is IMS sill strategic…. here are facts on usage IMS manages a large percentage of world’s Corporate Data • Over 95% of Fortune 1000 companies use IMS • IMS manages over 15 million gigabytes of Production Data • $2. 5 trillion (USD) per day is transferred through IMS by one customer IMS processes over 50 billion transactions per day • IMS serves over 200 million uses every day • IMS processes over 120 million transactions per day for one customer • IMS can process 21, 000 transactions per second ( > 1 billion per day) using IMS data sharing and shared queues • A single IMS has processed over 6000 transactions per second over a single TCP/IP connection One large IMS Customer has operated over 3000 days without an outage 24 x 7 www. illuminata. com © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Functions of the IMS database manager A DBMS provides: • • Multiple-user access to a single copy of data Integrity for all updates Minimal hardware and OS access method dependencies Reduced data redundancy © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe The IMS Database q A IMS Database is a group of related database records q A database record is a single hierarchy of related segments q A segment is a group of related fields q A field is a single piece of data Ø It can be used as a key to order segments Ø It can be used as a qualifier for searching Ø It may only have meaning to applications q IMS database always look like hierarchies © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe IMS Hierarchical DB : Relationships & sequence Position within the hierarchy A database record can contain a max of 255 types of segments © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe IMS Hierarchical data structure Segment is the smallest structure of the IMS DB which can retrieve data containing related fields. Segment Format Prefix Data See next slide © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe IMS Segment types and their relationships Rules for queries Data is dependent are highly structured. on the existence Fixed relationships of other types of data provides the speed. © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Implementation of IMS Databases Depending on user' requirements Technologies : • IMS DB or DL/I or DL 1 or Full Function Database • IMS DEDB or Data Entry DB or Fast Path Database • IMS Main storage database (MSDB) • IBM DB 2 Database Recovery Control (DBRC) © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Structure of IMS Subsystem Message queues Provides interface to z/OS for operations of IMS System Controls, schedules and dispatches the application programs in Dependent Regions Provides interface to SNA network for IMS TM functions Provides OTMA for access to non-SNA networks Provides the ODBA interface for DB 2 UDB for z/OS © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe IMS Common System Services Provides data integrity Restart and Commands Recovery Issuing IMS Provides Security Running IMS supplied utility programs Running Manages IMS supplied or user-written exit routines Application Programs Defining. Provides the services you wantfor within the definition facilities operating IMS process Provides Diagnostic and Performance information Provides interfaces to other z/OS Subsytems © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Overview of IMS System IMS Environments DB/DC DBCTL DCCTL Batch Logging Restart Recovery Extends the Controls Full-Function Loads the application Database accesscapability by an of programs and holds on-line program utilities and handles for IMS it to wait for messages physical I/O for programs recovery Operations Manager Fast Path “Special” Processing Configuration Resource Manager Application Pgms. for DB batch processing - Also access to non-IMS resources Instrumentation & Diagnostic Mgr. Structured Call Interface (SCI) ani * * * { Common Services Layer Single Point of Control Administer one or more IMS’ © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Internal Resource Lock Manager This is delivered as an integral part of IMS, but…YOU DO NOT have to install it (use it) UNLESS you perform block level or sysplex data sharing. DXRJPROC © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe IMS Uses Many Physical Access Methods BASIC Sequential Access Method (BSAM) Queued Sequential Access Method (QSAM) Overflow Sequential Access Method (OSAM) Virtual Storage Access Method (VSAM) NOTE: IMS VERSION 9 OPERATES IN A VIRTUAL MACHINE (VM) BUT FOR A NON-PRODUCTION ENVIRONMENT © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Supported Programming Languages • ADA • COBOL for S/390 and VM • Enterprise COBOL for z/OS and OS/390 • High Level Assembler for MVS, VM, and VSE • IBM SDK for z/OS J 2 EE v 1. 3. 1 and above • PL/I for z/OS and S/390 • TSO/E REXX • VS Pascal • Websphere Developer for z/OS • z/OS C/C++ COBOL JAVA © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Database Type HDAM PHDAM HIDAM PHIDAM HISAM SHISAM GSAM DEDB Logical Organization - Hierarchical Direct Access Method - Partitioned Hierarchical Direct Access Method - Hierarchical Indexed Direct Access Method - Partitioned Hierarchical Indexed Direct Access Method - Hierarchical Indexed Sequential Access Method - Simple Hierarchical Indexed Sequential Access Method - Generalized Sequential Access Method - Data Entry Database (fast path) Requires vigilant space monitoring ! © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Databases used by IMS: Database basics Access paths Normalization within IMS • Unique entities • 1 occurrence only • No many-to-many relationships © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Databases used by IMS: DB Model Sequence to access the segments © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Databases used by IMS: DB model Additional access paths to segments • Logical relationships • Secondary indices © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Application programming overview Program is subroutine of IMS region controller • Needs a program specification block (PSB) • Uses services: • Send/receive message from terminals • Access db • Issue IMS commands • Issue IMS service calls e. g. Checkpoint calls, Sync call © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Accessing IMS using DL/I calls DL/I is a standard interface to IMS functions Calls to DL/I: CALL ‘CBLTDLI’ USING function, PCB-name, I/O-Area, SSA 1…SSAn GET UNIQUE GET NEXT GET HOLD UNIQUE GET HOLD NEXT INSERT DELETE REPLACE © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe IMS Application PCB Structure Application Program Mask written in COBOL Linkage Section 01 PCBNAME. 02 DB-NAME 02 SEG-LEVEL 02 STATUS-CODE 02 PROC-OPTIONS 02 RESERVE-DLI 02 SEG-NME-FB 02 LENGTH-FB-KEY 02 NUM-SENS-SEG 02 KEY-FB-AREA PIX X(8). PIC XX. PIX XX. PIC XXX. PIC S 9(5). PIC x(8). PIC s 9(5). PIC S 9(5) PIC x(3) Application Data Structure Which DL 1 segments & what access 2 types of PCBs DB & DC y lit i t U Pgms located in PSBLIB PSB Before executing an app program, you must describe that program and its use of logical data structures via PSB © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Structure of an IMS Application Program DL/I Modules Defiined in program’s Data declaration section entry AIB or PCB Mask Call info From DL/I I/O Area Segments to and from databases PROGRAM ENTRY DEFINE AIB or PCB AREAS GET INPUT RECORS FROM INPUT FILE CALLS TO DL/I DB FUNCTIONS RETRIEVE INSERT REPLACE DELETE CHECK STATUS CODES PUT OUTPUT RECORDS exit TERMINATION © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Program Structure © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe IMS & the World Wide Web Message flow in IMS transaction © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe IMS & the World Wide Web Message flow IMS transaction & Web Server CGI Programs © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe IMS & the World Wide Web Message flow between Web Browser & Web Server © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe Hierarchical Departmental Database Dept Student Database Student Course Billing One-to-Many Enroll Logical “static” relationship Department Database Dept ID Dept Name Chairman Budget Code HIST History J. B. Hunt L 72 MATH Mathematics T. Z. Turner A 04 BIOL Biology J. H. Kettner A 53 Alt. K ey Student Database Student ID Student Name Address Major 1234777 Jones, Bill 121 N. Main HIST 1234888 Smith, Jill 225 Baker Physics 1234999 Brown, Joe 77 Sunset Info Tech Alt. K Course Database ey Course # Course Title Descrip Instructor Dept ID HI-445 History 321 Survey Jenkins HIST MH-778 Algebra 301 Freshman Watson MATH BI-112 Bio 340 Advanced Sinclair BIOL Dynamic Relationships One-to-Many Prim. Key Relational © Copyright IBM Corp. , 2005. All rights reserved.

Introduction to the new mainframe A database comparison: IMS (Hierarchical): Analogy Segment = Table • Data is relatively static • Data requests or Segment Search Arguments (SSAs) may be complex to construct, but once written they are very efficient (Very Fast Retrieval) • Navigational : need to know the structure to get to the right data DB 2 (Relational): • Used for data searches that may run only once or few times and then change * • Easy to code request for data • Change in structure : no impact on existing application • Non-Navigational : no need to know the structure to get to the right data (just tablename and columnname(s)) * Resource intensive due to operands within query make requests slower © Copyright IBM Corp. , 2005. All rights reserved.
- Slides: 38