DB2-PPT-2-DB2 Objects V1.0
DB2-PPT-2-DB2 Objects V1.0
DB2-PPT-2-DB2 Objects V1.0
“ DB2 OBJECTS“
Session 2
Nagaraju Domala
Session 2 - Objectives
Nagaraju Domala
DB2 TYPES OF OBJECTS
STORAGE
RECOVERY
DATABASE
SYSTEM
Nagaraju Domala
DB2 TYPES OF OBJECTS -
STORAGE
STORAGE : Storage objects control where data is
physically stored and how data is moved between
storage and memory during normal operation.
Nagaraju Domala
DB2 TYPES OF OBJECTS -
Recovery
RECOVERY : Recovery objects consists of
transaction log files and recovery history files.
Nagaraju Domala
DB2 TYPES OF OBJECTS -
Database
DATABASE : known as data objects - are used
to logically store and manipulate data, as well as
control how all user data ( & some system data)
is organized).
Nagaraju Domala
DB2 TYPES OF OBJECTS -
System
SYSTEM : System objects consists of registry
variables, instance configuration files and individual
database configuration files.
Nagaraju Domala
DATABASE OBJECTS
(PHYSICAL & LOGICAL)
Nagaraju Domala
STORAGE
GROUP
Nagaraju Domala
STORAGE GROUP
Nagaraju Domala
DATABASE
- Tables
- Table spaces
- Indexes
- Index spaces
Nagaraju Domala
TABLE SPACE
Nagaraju Domala
TABLE SPACE
No limit to the no. of table spaces in a database.
Nagaraju Domala
TABLE SPACE PAGE
Nagaraju Domala
Page - Diagram
Row 2 ID
Page Footer
Nagaraju Domala
Simple Table Space
Advantages :
Nagaraju Domala
Disadvantages
Nagaraju Domala
Simple Table space - Diagram
Nagaraju Domala
Segmented Table
Space
Table space is divided into segments.
Segment size 4 pages to 64 pages ( Multiple of 4).
Each segment can have rows of only one table.
Segment Tables
Advantages :
1. Like single table space - can contain more than one table
2. Single page contains rows of a single table
3. Supports variable length records (rows).
4. Efficient table scan.
5. Efficient recovery, reorganization.
Nagaraju Domala
Segmented Table space - Diagram
Nagaraju Domala
Partitioned Table Space
Partition Table
Nagaraju Domala
Partitioned Table Space
Advantages :
Disadvantages :
Nagaraju Domala
Partitioned Table space - Diagram
PARTITION 1 PARTITION 2
Nagaraju Domala
TABLE SPACE TYPES
ONE TABLE
Nagaraju Domala
PARTITIONED TABLE SPACE
Nagaraju Domala
RECOMMENDATIONS
STANDARD CHOICE
• SEGMENTED TABLE SPACE
Nagaraju Domala
CREATE TABLESPACE
NUMPARTS 3
NOT BOTH
- NUMBER OF PARTITIONS -------------------
Nagaraju Domala
CREATE TABLESPACE
BUFFERPOOL BPO
DETERMINES PAGE SIZE
USING STOGROUP SG1
PRE-DEFINED LIST OF
STORAGE GROUP VOLUMES
PRIQTY 52 SECQTY 20
PRIMARY/SECONDARY AMOUNTS,
IN KB
Nagaraju Domala
CREATE TABLESPACE
Nagaraju Domala
LOCKSIZE PAGE
IN
USE
AVAILABLE
Nagaraju Domala
LOCKSIZE ANY
Nagaraju Domala
Buffer Pool
Nagaraju Domala
TABLES
Nagaraju Domala
TABLES
Nagaraju Domala
TABLES
Nagaraju Domala
INDEX SPACE
INDEX
Contains the RID of the rows in table in an order
Nagaraju Domala
VIEWS
Nagaraju Domala
Alias & Synonyms
Nagaraju Domala
INDEX
Nagaraju Domala
CREATE DATABASE
DB3
Nagaraju Domala
CREATE TABLE SPACE
Nagaraju Domala
CREATE TABLE
EMP
TS2 TS3
TS1
DB3
Nagaraju Domala