Your SlideShare is downloading. ×
Introduction to the new mainfame
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Introduction to the new mainfame

1,744
views

Published on


0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,744
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
31
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Introduction to the new mainfame Chapter 12: Databases © Copyright IBM Corp., 2005. All rights reserved.
  • 2. Introduction to the new mainframe Objectives In this chapter, you will learn: • DB2 concepts • The DB2 system structure • DB2 for z/OS architecture • How to invoke SQL on z/OS • Application programming with DB2 • Managing DB2 • IMS-DB © Copyright IBM Corp., 2005. All rights reserved.
  • 3. Introduction to the new mainframe Key terms in this chapter • unit of work • DBMS • SPUFI • SQLJ • SYSADM • EXPLAIN • view • modified source © Copyright IBM Corp., 2005. All rights reserved.
  • 4. Introduction to the new mainframe DB2 Concepts: Data Structures Storage group VSAM VSAM LDS LDS Data base Table Space Views Table Index Space Index © Copyright IBM Corp., 2005. All rights reserved.
  • 5. Introduction to the new mainframe Schema structures • User-defined Data Type (UDT) • User-defined Function (UDF) • Triggers • Large Object (LOB) • Stored Procedure © Copyright IBM Corp., 2005. All rights reserved.
  • 6. Introduction to the new mainframe System Structure Catalog and Directory: stores ALL DB2 information Buffer Pool Active and Archive Logs Bootstrap data set (BSDS) © Copyright IBM Corp., 2005. All rights reserved.
  • 7. Introduction to the new mainframe DB2 for z/OS Architecture DB2 Address Spaces • System Service address space (SSAS) • Database Service address space (DBAS) • Internal Resource Lock Manager (IRLM) DB2 Attachment Facilities • CICS • IMS • TSO © Copyright IBM Corp., 2005. All rights reserved.
  • 8. Introduction to the new mainframe Invoke SQL on z/OS: SPUFI First you need to create the output file (if not existing) Select option 1 to enter SPUFI © Copyright IBM Corp., 2005. All rights reserved.
  • 9. Introduction to the new mainframe Invoke SQL on z/OS: SPUFI (continued) 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.
  • 10. Introduction to the new mainframe Invoke SQL on z/OS: SPUFI (continued) Enter the SQL statement you want to execute. Press F3 to return to the previous screen (to execute the SQL). © Copyright IBM Corp., 2005. All rights reserved.
  • 11. Introduction to the new mainframe Invoke SQL on z/OS: SPUFI (continued) 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.
  • 12. Introduction to the new mainframe Invoke SQL on z/OS: SPUFI (continued) F8 brings the rest of the results on your screen © Copyright IBM Corp., 2005. All rights reserved.
  • 13. Introduction to the new mainframe Invoke SQL on z/OS: SPUFI (continued) © Copyright IBM Corp., 2005. All rights reserved.
  • 14. Introduction to the new mainframe Application Programming: the flow Source Program Modified Precompile DBRM Source Compile Include Bind Member DCLGEN Object Package Module Linkedit Bind Load RUN Plan Module © Copyright IBM Corp., 2005. All rights reserved.
  • 15. Introduction to the new mainframe Get the access path: EXPLAIN EXPLAIN ALL SET QUERYNO = 1 SELECT EMPNO, LASTNAME FROM EMP WHERE LASTNAME = 'MILLER'; -The query is NOT executed -The access path is placed in userid.PLAN_TABLE, if it exists © Copyright IBM Corp., 2005. All rights reserved.
  • 16. Introduction to the new mainframe Other development options • ODBC • JAVA • SQLJ • JDBC • XML • XML Column Access • XML Collection Access © Copyright IBM Corp., 2005. All rights reserved.
  • 17. Introduction to the new mainframe Managing DB2: System Administration Installation System Object Management System and Disaster Recovery Monitoring System Performance © Copyright IBM Corp., 2005. All rights reserved.
  • 18. Introduction to the new mainframe Managing DB2: Database Administration Creation and management of DB2 objects Execution of utilities: • Data Organization • Backup and recovery • Data Consistency Commands © Copyright IBM Corp., 2005. All rights reserved.
  • 19. Introduction to the new mainframe Functions of the IMS DM A DBMS provides: • A single copy of data for access by multiple users • Maintenance of integrity across all updates • Minimization of HW and OS access method dependencies • Reduction of data redundancy © Copyright IBM Corp., 2005. All rights reserved.
  • 20. Introduction to the new mainframe Implementation of IMS Databases Depending on user requirements Technologies : • IMS DB or DL/I or DL1 or Full Function Database • IMS DEDB or Data Entry DB or Fast Path Database • IMS Main storage database (MSDB) • IBM DB2 Database Recovery Control (DBRC) © Copyright IBM Corp., 2005. All rights reserved.
  • 21. Introduction to the new mainframe Structure of IMS DB Subsystem Network Control Region IMS System IMS Message Logs Address Queues Space IMS Libraries Fast Patch DBs Dependent DLI MPP IFP BMP Java DBRC Java Region Separate Batch Region Message Address Address Application Application Application Processing Program Program Program Processing Space Space Full Function DBs RECONs Application Region Address Space System Address Space Up to 99 in total © Copyright IBM Corp., 2005. All rights reserved.
  • 22. Introduction to the new mainframe Databases used by IMS: Database basics Access paths Normalization within IMS • Unique entities • One occurrence only • No many-to-many relationships © Copyright IBM Corp., 2005. All rights reserved.
  • 23. Introduction to the new mainframe Databases used by IMS: DB Model Sequence to access the segments ROOT (1) Segment A2 Segment B2 (8) (14) Segment A1 Segment D3 Segment B1 (2) (9) (10) Segment D2 Segment E3 Segment G2 (4) (7) (12) Segment D1 Segment E2 Segment G1 Segment H1 (3) (6) (11) (13) Segment E1 (5) © Copyright IBM Corp., 2005. All rights reserved.
  • 24. 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.
  • 25. 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 example: Checkpoint calls, Sync call © Copyright IBM Corp., 2005. All rights reserved.
  • 26. Introduction to the new mainframe Program Structure DLI modules PCB-Mask E Call info IO AREA E N from DLI X T Segments I R to/from T y databases Application Program PROGRAM ENTRY DEFINE PCB AREAS GET INPUT RECORDS FROM INPUT FILE CALLS TO DL/I DB FUNCTIONS RETRIEVE INSERT REPLACE DELETE CHECK STATUS CODES PUT OUTPUT RECORDS TERMINATION © Copyright IBM Corp., 2005. All rights reserved.
  • 27. Introduction to the new mainframe IMS and the World Wide Web Message flow in IMS transactions 1,2 3 4,5 NCP VTAM IMS MPP 8,9 7 6 3270 Terminal © Copyright IBM Corp., 2005. All rights reserved.
  • 28. Introduction to the new mainframe IMS and the World Wide Web Message flow between Web browser and Web server 1,2 3 4,5 Web CGI TCP/IP TCP/IP Server Program 8,9 7 6 Web Browser © Copyright IBM Corp., 2005. All rights reserved.
  • 29. Introduction to the new mainframe IMS and the World Wide Web Message flow IMS transaction and Web server CGI programs 1,2 3 4,5 NCP VTAM IMS MPP 8,9 7 6 3270 Terminal Program to Program Communications 1,2 3 4,5 Web CGI TCP/IP TCP/IP Server Program 8,9 7 6 Web Browser © Copyright IBM Corp., 2005. All rights reserved.
  • 30. Introduction to the new mainframe Summary In this chapter, you learned: • Some DB2 concepts • The DB2 system structure • DB2 for z/OS architecture • How to invoke SQL on z/OS • Application programming with DB2 • Managing DB2 • IMS-DB © Copyright IBM Corp., 2005. All rights reserved.
  • 31. Introduction to the new mainfame Database Exercises © Copyright IBM Corp., 2005. All rights reserved.
  • 32. Introduction to the new mainframe DB2 Interactive © Copyright IBM Corp., 2005. All rights reserved.
  • 33. Introduction to the new mainframe Default panel 1 © Copyright IBM Corp., 2005. All rights reserved.
  • 34. Introduction to the new mainframe Default panel 2 © Copyright IBM Corp., 2005. All rights reserved.
  • 35. Introduction to the new mainframe DCLGEN © Copyright IBM Corp., 2005. All rights reserved.
  • 36. Introduction to the new mainframe Do the exercise • Do the DCLGEN • Execute the SQL (change it if you want) • Change the program • Execute the job © Copyright IBM Corp., 2005. All rights reserved.
  • 37. Introduction to the new mainframe Execute from TSO Allocate your datasets first (1) Change your parameters and press enter (2) 1 2 2 © Copyright IBM Corp., 2005. All rights reserved.
  • 38. Introduction to the new mainframe Execute from TSO (continued): results © Copyright IBM Corp., 2005. All rights reserved.