Escolar Documentos
Profissional Documentos
Cultura Documentos
Chapter 12 objectives
Be able to:
Explain the role of DB2 in online transaction
processing.
List common DB2 data structures.
Compose simple SQL queries to run on z/OS.
Give an overview of application programming with
DB2.
What the IMS components are
The structure of the IMS DB subsystem
SPUFI
SQL
SYSADM
view
DB2 Concepts:
Data
Storage
groupStructures
VSAM
LDS
VSAM
LDS
Data base
Table Space
Views
Table
Index Space
Index
Copyright IBM Corp., 2005. All rights reserved.
Schema structures
User-defined Data Type (UDT)
User-defined Function (UDF)
Triggers
Large Object (LOB)
Stored Procedure
System Structure
Catalog & Directory: stores ALL DB2 information
Buffer Pool
Active and Archive Logs
Bootstrap data set (BSDS)
First
you
create
Invoke
SQL
onneed
z/OS:toSPUFI
Enter the input and output dataset, if they are not yet in place.
Change the member of the PDS, if you want to enter a new SQL
Defaults are set to NO from YES.
Copyright IBM Corp., 2005. All rights reserved.
When you get back to this screen, the edit input is put to *.
Press ENTER to execute the SQL and to see the output.
Copyright IBM Corp., 2005. All rights reserved.
Modified
Source
Precompile
DBRM
Compile
Include
Member
Bind
Object
Module
DCLGEN
Bind
Linkedit
Load
Module
Package
RUN
Plan
Copyright IBM Corp., 2005. All rights reserved.
Get the
access path:
EXPLAIN
ALLEXPLAIN
SET QUERYNO
=1
SELECT EMPNO, LASTNAME
FROM EMP
WHERE LASTNAME = 'MILLER';
Commands
Control
Region
Address
Space
IMS System
IMS Message
Queues
Logs
IMS Libraries
DLI
Separate
Address
Space
DBRC
Region
RECONs
Dependent
Region
Address
Space
MPP
IFP
BMP
Application
Program
Application
Program
Application
Program
Java
Message
Processing
Java
Batch
Processing
Access paths
Normalization within IMS
Unique entities
1 occurrence only
No many-to-many relationships
ROOT
(1)
Segment A2
(8)
Segment A1
(2)
Segment B2
(14)
Segment D3
(9)
Segment B1
(10)
Segment D2
(4)
Segment E3
(7)
Segment G2
(12)
Segment D1
(3)
Segment E2
(6)
Segment G1
(11)
Segment H1
(13)
Segment E1
(5)
Copyright IBM Corp., 2005. All rights reserved.
Program Structure
DLI modules
PCB-Mask
E
N
T
R
y
Call info
from DLI
IO AREA
Segments
to/from
databases
Application Program
PROGRAM ENTRY
DEFINE PCB AREAS
GET INPUT RECORDS FROM INPUT FILE
CALLS TO DL/I DB FUNCTIONS
RETRIEVE
INSERT
REPLACE
DELETE
E
X
I
T
1,2
NCP
8,9
4,5
MPP
IMS
VTAM
3270 Terminal
1,2
TCP/IP
8,9
4,5
CGI
Program
Web
Server
TCP/IP
Web Browser
flow IMS
transaction
& Web Server CGI Programs
IMS Message
& the World
Wide
Web
1,2
NCP
MPP
IMS
VTAM
8,9
4,5
3270 Terminal
Program to Program
Communications
1,2
TCP/IP
8,9
4,5
CGI
Program
Web
Server
TCP/IP
Web Browser
Copyright IBM Corp., 2005. All rights reserved.
Summary
The relational database is the predominant approach to data
organization in today's business world.
IBMs DB2 implements such relational principles as primary keys,
referential integrity, a language to access the database (SQL), nulls,
and normalized design.
In a relational database, the most fundamental structure is the table
with columns and rows.
Summary (continued)
The only way to access the data in DB2 databases is with SQL.
On the mainframe, SPUFI is a tool used to enter SQL statements.
The DBRM performs a bind process that determines the access path
and stores this executable SQL code in a package.
SQL can handle both static and dynamic statements, and EXPLAIN can
be used to find out what access path the optimizer chose for the
SQL.