Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Schedule
◆ Day 1:
◆ FirstSession : DB2 Objects
◆ Second Session : Program Preparation
◆ Day 2:
◆ First
Session: Utilities
◆ Second Session:
◆ Day 3: DBA Case study
◆ Day 4 : DBA Case study completion
Topics Covered
◆ DB2 Objects
◆ Program preparation & effective SQL
coding
◆ Performance Issues
◆ Utilities: Data and Application
Recovery and Backup
◆ DB2 Security
Day 1:
◆ DB2 Objects
◆ Program preparation
◆ Effective SQL coding
Overview of DB2 Objects
◆ System Structures
◆ DB2 catalog (DSNDB06)
◆ DB2 directory (DSNDB01)
◆ Active and Archive Logs
◆ Bootstrap Dataset BSDS
◆ Buffer pools
◆ Communication Database
◆ DDCS
◆ RLF database
Overview of DB2 Objects
◆ Db2 data structures
◆ Databases
◆ Storage Groups
◆ Tablespaces
◆ Tables
◆ Indexes
◆ Views
DB2 physical organization
DB2 Tablespaces
Logical Representation
Physical
Representation
DB2 Transformation
Pages
SPACE
• A Page is either 4K or 32K
FOOTER
◆ A data record does not
span pages
Data Records
Simple Tablespaces
101 1 104
102 3 102
103 4 103
104 2
KEY Position
Indexes : Terminology
Root Node
*2 5 *
Intermediate Nodes
*8 *1 7 * *3 3 *4 0 *
*1 *3 *8 *9 *1 1 *1 7 *1 9 *2 1 *2 5 *2 8 *3 1 *3 3 *3 5 *3 8 *4 0 *4 6 *5 1 *5 5
Leaf Nodes
Pointing to
Data Pages
Clustering Index
*2 5 *
*8 *1 7 * *3 3 *4 0 *
*1 *3 *8 *9 *1 1 *1 7 *1 9 *2 1 *2 5 *2 8 *3 1 *3 3 *3 5 *3 8 *4 0 *4 6 *5 1 *5 5
Data
Pages
Non-Clustered Index Scan
*2 5 *
*8 *1 7 * *3 3 *4 0 *
*1 *3 *8 *9 *1 1 *1 7 *1 9 *2 1 *2 5 *2 8 *3 1 *3 3 *3 5 *3 8 *4 0 *4 6 *5 1 *5 5
Data
Pages
Stogroup
SG2
SG1
DEV001 DEV002
DEV003 DEV004
SG3
Database
Tablespace
Table Table
Tablespace
Table
Index
Index
Storage Groups
Bufferpools
◆ Syntax:
CREATE STOGROUP stogroup-name
VOLUMES (vol1, vol2, ...)
VCAT catalog-name
[PASSWORD password]
CREATE STOGROUP TRG1T01
VOLUMES (DBPK01, DBPK02)
VCAT DBZ2TRG
DDL - ALTER Storage Group
◆ Syntax:
ALTER STOGROUP stogroup-name
ADD VOLUMES (vol4, vol5, ...)
REMOVE VOLUMES (vol1, vol2, ...)
[PASSWORD password]
ALTER STOGROUP TRG1T01
ADD VOLUMES (DBPK03)
REMOVE VOLUMES (DBPK01)
DDL - CREATE Database
◆ Syntax:
CREATE DATABASE database-name
[STOGROUP stogroup-name]
[BUFFERPOOL bufferpool-name]
◆ specified in KB
DDL - CREATE TABLESPACE
Parameters
◆ ERASE:
◆ Indicates whether the DB2 defined data
sets are to be erased when tablespace is
dropped
◆ LOCKSIZE:
◆ Indicates type of locking (Page /
Tablespace / Table / DB2 decided)
◆ LOCKMAX:
◆ Indicates max no of page or row locks
DDL - CREATE TABLESPACE
Parameters
◆ BUFFERPOOL:
◆ Buffer pool to be associated with
tablespace
◆ Default value is default buffer pool of
database
◆ CLOSE:
◆ Indicates whether data sets associated
with tablespace should be closed when
there are no current users of tablespace
DDL - CREATE TABLESPACE
Parameters
◆ FREEPAGE:
◆ Specified number of pages after which a
completely empty page is available
◆ Default is FREEPAGE 0
◆ PCTFREE:
◆ Specifies percentage of each page
available for future inserts
DDL - CREATE TABLESPACE
Parameters
◆ COMPRESS YES/NO: