db2 components & basics 1

Upload: abdul-gafar

Post on 07-Apr-2018

229 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Db2 Components & Basics 1

    1/18

    Copyright IBM Corporation 2007

    Unit Objectives

    After completing this unit, you should be able to describe the maincomponents of a DB2 environment and the roles they play:

    Users

    Data

    Programs (Static, Dynamic)

    System

  • 8/6/2019 Db2 Components & Basics 1

    2/18

    Copyright IBM Corporation 2007

    What Is DB2 for z/OS?

    Relational Data Base Management System (RDBMS)

    Data base consists of tablesSimple conceptsDynamic relationships

    Structured query language (SQL)

    High levelData Manipulation Language (DML)Data Definition Language (DDL)Data Control Language (DCL)

    User specifies WHAT not HOW

    RDBMS facilitiesIntegrityDynamic definition of DB2 objectsActive catalog

    Recovery / restartContinuous operationsSecurityInteractive tools

  • 8/6/2019 Db2 Components & Basics 1

    3/18

    Copyright IBM Corporation 2007

    The Users View

    000010 Chris I Haas A00 3978 1965-01-01

    000020 Mike L Thomson B01 3476 1973-10-10

    000030 Sally A Kwain C01 4738 1975-04-05

    000060 Irving F Stern D11 6423 1973-09-14

    ...

    000050 John B Geyer E01 6542 1972-02-02

    A00 Spiffy Computer Ser. Div. 000010 ...

    B01 Planning 000020

    C01 Information Center 000030

    D11 Manufacturing System 000060...

    D01 Development Center ?

    QMF / SPUFI

    SELECT LASTNAMEFROM EMPWHERE EMPNO = 000050

    Result Data : Geyer

  • 8/6/2019 Db2 Components & Basics 1

    4/18 Copyright IBM Corporation 2007

    Another Kind of User

    000010 Chris I Haas A00 3978 1965-01-01000020 Mike L Thomson B01 3476 1973-10-10

    000030 Sally A Kwain C01 4738 1975-04-05

    000060 Irving F Stern D11 6423 1973-09-14

    ...

    000050 John B Geyer E01 6542 1972-02-02

    A00 Spiffy Computer Ser. Div. 000010 ...

    B01 Planning 000020

    C01 Information Center 000030

    D11 Manufacturing System 000060

    ...

    D01 Development Center ?

    EMP NR ? EMP NR ?

    000050

    LASTNAME :

    Geyer

    GET ...MOVE ...

    SELECT LASTNAMEFROM EMPWHERE EMPNO = :EMPNO

  • 8/6/2019 Db2 Components & Basics 1

    5/18 Copyright IBM Corporation 2007

    The Static Programs View000010 Chris I Haas A00 3978 1965-01-01

    000020 Mike L Thomson B01 3476 1973-10-10

    000030 Sally A Kwain C01 4738 1975-04-05

    000060 Irving F Stern D11 6423 1973-09-14

    ...

    000050 John B Geyer E01 6542 1972-02-02EMP NR ?

    EMP NR ?

    000050

    LASTNAME :

    Geyer

    SELECT LASTNAMEFROM EMPWHERE EMPNO = :EMPNO

    PUT

    GET

    MOVE

    EXECUTE

    PUT

    A00 Spiffy Computer Ser. Div. 000010 ...

    B01 Planning 000020

    C01 Information Center 000030

    D11 Manufacturing System 000060

    ...

    D01 Development Center ?

    VSAM

    SEQUENTIALDATA SET

    DL/1

  • 8/6/2019 Db2 Components & Basics 1

    6/18 Copyright IBM Corporation 2007

    The Dynamic Programs View000010 Chris I Haas A00 3978 1965-01-01

    000020 Mike L Thomson B01 3476 1973-10-10

    000030 Sally A Kwain C01 4738 1975-04-05

    000060 Irving F Stern D11 6423 1973-09-14

    ...

    000050 John B Geyer E01 6542 1972-02-02ENTER SQL:

    SELECT ...FROM EMPWHERE ...

    Geyer

    PUT

    GET

    EXECUTE

    PUT

    A00 Spiffy Computer Ser. Div. 000010 ...

    B01 Planning 000020

    C01 Information Center 000030

    D11 Manufacturing System 000060

    ...

    D01 Development Center ?

    VSAM

    SEQUENTIALDATA SET

    DL/1

  • 8/6/2019 Db2 Components & Basics 1

    7/18 Copyright IBM Corporation 2007

    UPDATE B

    Logical Unit of Work

    UPDATE A

    COMMIT

    A 2000 1000 1000 1000

    B 3000 3000 4000 4000

    UPDATE BUPDATE A

    ROLLBACK

    A 2000 1000 1000 2000

    B 3000 3000 4000 3000

    A program transfers $1000 from account A to account B

    A Program's Responsibility -A Logical Unit of Work

  • 8/6/2019 Db2 Components & Basics 1

    8/18 Copyright IBM Corporation 2007

    The Systems View

    DB2 receives MANY requestsfrom MANY user programs toaccess potentially the SAME data

    Besides USER PROGRAMS,DB2 also receives requests fromUTILITIES

    Utility

    Trx2

    Prog2

    TSO

    Trx1

    CICS

    Trxb

    Trxa

    IMSDB2

    Utility

    BATCH

    Prog1

    WebSphereApplicationServer

    Appl2

    Appl1

    DistributedApplications

  • 8/6/2019 Db2 Components & Basics 1

    9/18 Copyright IBM Corporation 2007

    Utilities

    COPY

    SEQUENTIALDATASETLOAD

    REORG

    Work at the OBJECT level

    Run in BATCH

    Compete with user programs for resources

    Specify your requirements usingCONTROL STATEMENTS mostly

    IMAGE COPY

  • 8/6/2019 Db2 Components & Basics 1

    10/18 Copyright IBM Corporation 2007

    DB2s Responsibilities - SECURITY

    DB2 must verify whether a request is LEGITIMATE

    GRANT SELECTON TABLE T1TO JAN, PIERRE ;

    GRANT UPDATE ONTABLE T1 TO JAN ;

    Table User Select Update

    T1 Jan Y YT1 Pierre Y N

    DB2 CATALOG

    DB2UPDATET1 SET ...

    SELECT ...

    FROM T1 Jan

    PierreSTOP

    OK

  • 8/6/2019 Db2 Components & Basics 1

    11/18 Copyright IBM Corporation 2007

    Data integrity and concurrency

    Prog1 Prog2

    .

    .

    .

    UPDATE

    COMMIT

    SELECTOK

    Row

    RELEASELOCK

    SHAREDLOCK

    ... WAIT ...

    EXCLUSIVELOCK

    DB2 must maintain data integrity and alsoprovide maximum concurrency

    STOP

    1

    2

    3

    4

    EMPLOYEE Table

    DB2 S t L D t S t

  • 8/6/2019 Db2 Components & Basics 1

    12/18 Copyright IBM Corporation 2007

    DB2 System Log Data Set

    LOG

    DATASETX X X

    Program

    UPDATE

    INSERT

    COMMIT

    DB2

    Data Buffer

    X

    ASYNC

    X

    DATA

    XXX

    Log Buffer

    before after

    SYNC

    COPY/RECOVER Utiliti

  • 8/6/2019 Db2 Components & Basics 1

    13/18

    Copyright IBM Corporation 2007

    COPY/RECOVER Utilities

    Log Time

    UPDATE UPDATE DELETE

    IMAGE COPY

    RECOVER

    DISKCRASH

    COPY

    DB2 R ibiliti PERFORMANCE

  • 8/6/2019 Db2 Components & Basics 1

    14/18

    Copyright IBM Corporation 2007

    DB2s Responsibilities - PERFORMANCE

    Program DB2

    WHAT

    LoadModule

    AccessPathEXECUTION

    CatalogStatistics

    BIND

    HOW

    Optimizer

    DB2 must translate a users or programsSQL request into ACCESS STRATEGIES

    DB2 R ibiliti METADATA

  • 8/6/2019 Db2 Components & Basics 1

    15/18

    Copyright IBM Corporation 2007

    DB2

    CATALOG

    Data

    Definitions

    Security

    Definitions

    Recovery

    Information

    SystemAdministrator

    DatabaseAdministrator

    ApplicationProgrammer

    S Q L

    DB2s Responsibilities - METADATA

    DB2 uses a centralized CATALOG and DIRECTORY

    DB2 for z/OS Data Sharing

  • 8/6/2019 Db2 Components & Basics 1

    16/18

    Copyright IBM Corporation 2007

    Improved availability

    Huge queries feasible

    SYSPLEX hardware requiredSingle shared catalog

    z/OS

    DB2 DB2 DB2

    DB2 SHAREDDASD

    DB2

    DB2 DB2 DB2

    Incremental processing growth

    Configuration flexibility

    Dynamic workload balancing

    DB2 for z/OS Data Sharing

    z/OS z/OS

    z/OS z/OS

    z/OS z/OSz/OS

    Roles and Interfaces in DB2

  • 8/6/2019 Db2 Components & Basics 1

    17/18

    Copyright IBM Corporation 2007

    Roles and Interfaces in DB2

    FunctionalDesigner

    Programmer

    TechnicalDesigner

    DatabaseAdministrator

    SystemAdministration

    SecurityAdministrator

    DataAdministrator

    CapacityPlanner

    z/OSSysprog

    CICS/IMSSysprog

    TP

    Specialist

    Operations

    Unit Summary

  • 8/6/2019 Db2 Components & Basics 1

    18/18

    Copyright IBM Corporation 2007

    Unit Summary

    Having completed this unit, you should be able to describe the maincomponents of a DB2 environment and the roles they play:

    Users

    Data

    Programs (Static, Dynamic)

    System