Anda di halaman 1dari 13

DB2 Universal

Database
DB2 Training class 01
Database Structures
Network Structures (e.g. IDMS)
Many to Many relationships
Complex structure using Pointers
Best for Keeping storage
Hierarchical Structures (e.g. IMS DB)
One to Many Relationships
Inverted Tree like tructure
Best for storing parent and child type entities
Relational Structures (e.g. DB2)
One to Many! Many to One
Best for ease of data retrieval
Data and Database
Data " Collection of facts suita#le for communications

$ Database is a collection of interrelated data items! stored


once and organi%ed in a form for easy retrieval&

$ Database Management System is a collection of


programs for storing organi%ing! selecting! modifying! and
extracting data from a data#ase&
able is a collection of related data entries and it consists of
columns and ro's&
Introduction to DB2
DB2! formally called ($T$B$) *! 'as #orn on M+ in
,-./& In ,-.0! (B* arrived on the Personal Computer
$long the 'ay the name changed from (B* to (B* for
Common ervers and then #ecame (B* 1niversal (ata#ase&
DB2 9 is the latest release of IBM2s popular data management
soft'are for distri#uted systems
(B* runs on a 'ide variety of platforms 3$I4! 5P614! 7inux!
olaris! 8indo's! i9:O! and %:O;! and several editions are
availa#le6each of 'hich has #een designed to meet a specific
#usiness need collectively kno' as DB2 !amily
File Vs Databases
(ata more redundant
(uplicate data
(ata insecure
<o control over data
Threat to Integrity
7ack of in#uilt recovery
features
7ack of data 7ocks
Redundancy avoided
Minimi%e (uplicates
ecurity provided
=ield level sensitivity
Consistency of data
(ata 7ogging! Commits >
Roll#acks
$utomatic locks
DB2 Objects
(B* consists t'o different type of o#?ects

System "b#ects " o#?ects that are controlled and used #y


(B*&

DB2 $atalog

DB2 %irectory

&cti'e (og

Boot stra) %ataset

Bu**er )ools

Data "b#ects " o#?ects that are created and used #y the
users&
DB2 Data Objects
DB2 Data Objects
Storage +rou) It is a collection of direct access volumes! all
of the same device type
Database $ collection of logically related o#?ects like ta#le
spaces! index spaces! ta#les etc& a storage group and #uffer pool
must #e defined for each data#ase
able S)ace 7ogical address space on the secondary storage to
hold one or more ta#les& It is the storage unit for recovery and
reorgani%ing purpose Three types

imple

egmented

Partitioned
DB2 Data Objects
Sim)le able S)aces can contain more than one stored ta#les
i&e& $ single page can contain ro's from all the ta#les

toring more than one ta#les might ena#le faster retrieval for
?oins using the ta#les #ut creates locking pro#lem
Segmente% able S)ace contain more than one stored ta#les!
#ut in a segmented space& a segment consists of a logically
contiguous set of pages and no page is allo'ed to contain
records from more than one ta#le&

e@uential access to a particular ta#le is more efficient& 7ock


ta#le! lock the ta#le #ut not the entire ta#le space
,artitione% able S)ace primarily used for very large ta#les&
Only one ta#le in a partitioned ta#le space
DB2 Data Objects
Schemas are o#?ects that are used to logically classify and
group other o#?ects in the data#ase&

=our schemas that are automatically created 'hen a


data#ase is created6AIBM! AC$T! AT$T! and
A=1<& The default schema! 'hich is usually the user I(
of the individual 'ho created the o#?ect&
$ able is a collection of ro's and columns !Ta#les present
data as a collection of unordered ro's 'ith a fixed num#er of
columnsB

)ach column contains values of the same data type or one


of its su#types! and each ro' contains a set of values for
each column availa#le&
DB2 Data Objects
-iews are used to provide a different 'ay of looking at the data
stored in one or more #ase ta#les&

$lthough vie's look similar to #ase ta#les! they do not


contain real data& Instead! vie's refer to data stored in other
#ase ta#les&
$n In%e. is an o#?ect that contains an ordered set of pointers
that refer to ro's in a #ase ta#le& )ach index is #ased upon one
or more columns in the #ase ta#le it refers to 3kno'n as keys;&

They provide a fast! efficient method for locating specific


ro's! It is important to keep in mind that 'hen the
1<IC1) clause is used! it is possi#le to have an index key
that contains one 3and only one; <177 value&
DB2 Data Objects
$n &lias/Synonym is simply an alternate name:nicknames for a
ta#le or vie'& Once created! they can #e referenced the same
'ay the ta#le or vie'&
Di**erence between &lias an% Synonym
ynonym is )ri'ate ob#ect only the user 'ho created can access
it and A$(M authority is not needed 'here as $lias is a
global ob#ect! accessi#le #y anyone! re@uired si%ed authority or
privilege
1sed in local en'ironment to hide high level @ualifier! alias is
%istribute% en'ironment
8hen #ase ta#le is dropped synonyms are %ro))e% 'here alias
are not
Thank ou

Anda mungkin juga menyukai