Top Banner
Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall
17

Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

Jan 02, 2016

Download

Documents

Dwight Ford
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

Chapter 15Relational Implementation

with DB2

David M. Kroenke

Database Processing

© 2000 Prentice Hall

Page 2: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

Chapter 15

© 2000 Prentice Hall

DB2

“Database2; DBMS product licensed by IBM intended primarily for large IBM mainframes”

Page 411

Page 3: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

KDK Relations

Figure 15-16 © 2000 Prentice Hall

Page 4: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

Chapter 15

© 2000 Prentice Hall

Key Features of DB2

• Implements a relational DBMS• Runs on IBM’s MVS operating system• Uses SQL to perform operations• Well suited to a multi-user environment• Robust recovery systems

• Uses DB2 Data Definition Language

Page 424

Page 5: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

Chapter 15

© 2000 Prentice Hall

DB2 Data Definition Language

• TABLE stores data• VIEW virtual table• TABLE SPACE a collection of one or

more VSAM data sets (standard nondatabase IBM mainframe files)

• INDEX overhead data used to speed sorting and retrieving data

Page 425

Page 6: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

Chapter 15

© 2000 Prentice Hall

DB2 Data Definition Language

• INDEX SPACES area of disk storage where DB2 stores an index

• DATA BASES a collection of DB2 tables and indexes and the storage areas that hold them

• STORAGE GROUPS a group of disk volumes on which DB2 allocates space for user data bases

Page 425

Page 7: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

DB2 Data Types

Figure 15-24 © 2000 Prentice Hall

Page 8: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

Chapter 15

© 2000 Prentice Hall

Using DB2

• Create Tables, Views, and Indexes• Delete Tables and Views• Use DB2 SQL to Manipulate Data• Use SQL Statements in the

Procedure Division

Page 428

Page 9: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

Chapter 15

© 2000 Prentice Hall

DB2 Concurrent Processing

“implemented through shared locks (allow other applications to read the data) and exclusive locks (prevent all other applications from accessing the data)”

Page 435

Page 10: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

Chapter 15

© 2000 Prentice Hall

DB2 Concurrent Processing Issues

• COMMIT and ROLLBACK• DEADLOCK

Page 437

Page 11: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

Chapter 15

© 2000 Prentice Hall

DB2 Backup and Recovery Issues

• Before-images• After-images• Backing up only pages in a table

space that have been modified since the latest backup

Page 437

Page 12: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

Chapter 15

© 2000 Prentice Hall

DB2 Security Issues

• Views• Limiting Access to DB2 Resources• Identifying Users

Page 438

Page 13: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

Relational Implementation

Figure 15-29 © 2000 Prentice Hall

Page 14: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

Table Description

s

Figure 15-30© 2000 Prentice Hall

Page 15: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

Interactive DB2

Statements

Figure 15-32© 2000 Prentice Hall

Page 16: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

DB2 Queries

Figure 15-32

© 2000 Prentice Hall

Page 17: Chapter 15 Relational Implementation with DB2 David M. Kroenke Database Processing © 2000 Prentice Hall.

COBOL Program

Figure 15-33a

© 2000 Prentice Hall