Professional Documents
Culture Documents
1. Products...........................................................................................................................................................2
1.1. DB2 Everyplace.......................................................................................................................................3
1.2. DB2 Express............................................................................................................................................3
1.3. DB2 Express-C........................................................................................................................................4
1.4. DB2 Personal Edition..............................................................................................................................4
1.5. DB2 Workgroup Server Edition..............................................................................................................4
1.6. DB2 Enterprise Server Edition................................................................................................................5
1.7. DB2 DWE (Data Warehouse Server Edition).........................................................................................6
1.8. DB2 Personal Developers Edition...........................................................................................................7
1.9. DB2 Universal Developers Edition.........................................................................................................7
1.10. DB2 Universal Developers Edition.....................................................................................................7
1.11. DB2 for i5 / OS....................................................................................................................................8
1.12. DB2 for z /OS......................................................................................................................................8
1.13. Other DB2 Products.............................................................................................................................8
1.13.1. DB2 Clients.....................................................................................................................................8
1.13.2. DB2 Connect. Win, Linux, UNIX, Mobile Apps, WS, & DB to iOS, zOS Svr/DB....................8
1.13.3. DB2 Extenders (user-defined datatypes and functions)..................................................................9
2. Concepts........................................................................................................................................................10
2.1. Servers, Instances and DBs. (hierarchical)............................................................................................10
2.2. Managing Instances...............................................................................................................................10
2.3. Creating DB2 9 Database. DB created via Wizard (in Control Center) or command (CLP)...............10
2.4. DB Objects.............................................................................................................................................11
2.5. Database Concurrency...........................................................................................................................11
2.5.1. Causes for DB Inconsistency:........................................................................................................11
2.5.2. Isolation Levels..............................................................................................................................11
2.6. LOCKS..................................................................................................................................................11
2.6.1. Lock attributes...............................................................................................................................12
2.6.2. Lock states (or modes)...................................................................................................................13
2.6.3. Locks & Performance....................................................................................................................14
2.7. Security..................................................................................................................................................14
2.7.1. Authentication................................................................................................................................14
2.7.2. Authority – after authentication.....................................................................................................14
2.7.3. DB Privileges.................................................................................................................................14
2.7.4. Object Privileges............................................................................................................................14
2.8. DWE vs OLTP Performance.................................................................................................................15
1
DB2 Family Introduction - Products
1. Products
DB2 Everyplace
DB2 Express
DB2 Express-C
DB2 Personal Edition
DB2 Workgroup Server Edition
DB2 Enterprise Server Edition
DB2 Data Warehouse Edition
DB2Personal Developers Edition
DB2 Universal Developers Edition
DB2 Enterprise Developers Edition
DB2 for i5/OS
DB2 for z/OS
2
DB2 Family Introduction - Products
3
DB2 Family Introduction - Products
4
DB2 Family Introduction - Products
5
DB2 Family Introduction - Products
6
DB2 Family Introduction - Products
7
DB2 Family Introduction - Products
DB2 Client. DB2 Runtime Client, Plus tools for c/s config, dba, app development
Configuration Assistant.
Control Center / other dba graphical tools (Linux & Windows Only)
First Steps for New Users
Applicatin Development Tools
8
DB2 Family Introduction - Products
1.13.2. DB2 Connect. Win, Linux, UNIX, Mobile Apps, WS, & DB to iOS, zOS Svr/DB
DB2 Connect Personal Edition
DB2 Connect Enterprise Edition
o Connects multiple users / workstations to mainframe / mini computer servers.
o Licensing based on concurrent users - not practical for multi-tier apps or web apps – std
client-server uses
DB2 Connect App Server Edition
o DB2 Connect EE function
o Licensing based on # CPUs connecting to RDBM (mainframe or minicomputer).
DB2 Connect Unlimited Edition.
o DB2 Connect EE function
o Licensing based on Millions of Service Units (MSUs) per hour Hi access to enterprise
data
Note: client communications to iOS, zOS – access DB2 or non-DB2 resources
Note: DB2v9 new XML features. XML datatype, new storage techniques for XML hierarchical
data, indexing to speed retrieval, SQL/XML enhancements, including native XQuery Support,
new capabilities for validating XML data, managing, changing XML Schemas.
9
DB2 Family Introduction - Concepts
2. Concepts
2.3. Creating DB2 9 Database. DB created via Wizard (in Control Center) or command (CLP)
What Happens when DB created
Directories / Subdirectories created.
Files needed for management, monitoring & db recovery are created
Buffer Pool created (IBMDEFAULTBP)
2 tablespaces, and temp tablespace created (SYSCATSPACE, USERSPACE1, TEMPSPACE1)
o Database Managed TS (DMS)
o System Managed TS (SMS)
o Automatic managed TS
system catalog tables and views are created. (Contains SQL for constraints but NOT views)
DB is cataloged in system and local db directories (LIST DATABASE DIRCTORY cmd)
DB configuration file is initialized
4 schemas are created: SYSIBM, SYSCAT, SYSSTAT, SYSFUN (SYSIBM user owns all)
Set of utility programs bound to DB
Authorities & privileges granted to users
10
DB2 Family Introduction - Concepts
Configuration Advisor launched (Performance tuning)
2.4. DB Objects
Schemas (CREATE SCHEMA . AUTHORIZATION <sql statement >
Tables
o constraints
o XML cols
o Identity Columns
o Partitioned Tables
Views.
Indexes.
Aliases (Synonyms)
Declared Temporary Tables
Sequences.
Triggers
User-defined data types
o Distinct – std types, with checks, etc CREATE DISTINCT TYPE
o Structured – created by user – for typed tables CREATE TYPE
User-defined functions
Stored Procedures
o SQL stored procedures
o External stored procedures (C/C++, Java, COBOL)
Packages
Nonrepeat
Lost Dirty able
Isolatin Levels Updates Reads Reads Phantoms
Repeatable Read N N N N
Read Stability N N N N
Cursor Stability N N Y Y
Uncommitted Read N Y Y Y
11
DB2 Family Introduction - Concepts
2.6. LOCKS
Mechanism to associate a data resource with a single transaction, for sole purpose of controlling how other
transactions interact with that resource wile it is associated with transaction that has it locked. Transaction
“holds” or “owns” the lock
12
DB2 Family Introduction - Concepts
Intent None (IN). TS, Tbl. Owner can read all (uncommitted) Other xactions can read, None
data, but cannot modify. Read-only modify. No delete
tables.
Intent Share TS, Tbl. Owner can read all (except Other xactions can read, Share (S) or Next Key
(IS). uncommitted) data, but can not modify Share (NS) lock - for
modify. no intent to modify.(not each row read
select for update, update, insert)
next key Share Row Owner can read all (except Other xactions can read, None
(NS) uncommitted) data, , but cannot NOT modify
modify. Used in place of share lock
(S) under isolation states of RS or
CS
Share (S) Tbl, Row Owner can read all (except Other xactions can read, individual rows, if tbl
uncommitted) data, but can not NOT modify not share locked
modify. no intent to modify .(not
select for update, update, insert)
running under RR isolation level
Intent Exclusive TS, Tbl. Owner can read all (except Other xactions can read S or NS lock acq for
(IX) uncommitted) data. For intent to & modify each row read. U and
modify .(select for update, update, X lock for each row to
insert) be updated
Share w/Intent Tbls Owner can read & modify all Other xactions can read X lock for each row to
Exclusive (SIX) (except uncommitted) data. NOT modify be updated
Typically for a S lock, acquiring X
lock (or vice-versa)
Update (U) Tbl, Row Owner can modify all (except Other xactions can read U tbl lock, X lock for
uncommitted) data. But can not NOT modify each row to be
read. For insert, update, delete updated
Next Key Weak Tbl, Row Owner can read all (except Other xactions can read None
Exclusive (NW) uncommitted) data. But can not & NOT modify
modify. Typically acq for next avail
row of a table when row inserted
into any index (not catalog)
Exclusive (X) Tbl, Row Owner can read & modify all xactions using UR iso lvl rows X locked, if table
(except uncommitted) data. read all (uncommitted), is not X locked
Typically xactions that select but can not modify.
(retrieve), then update,insert, delete Others NOT read, NOT
modify
Weak Exclusive Row Owner can read & modify all xactions using UR iso lvl None
(WE) (except uncommitted) data. read all (uncommitted),
Typically when ,insert row (non- but can not modify.
catalog/system table) Others NOT read, NOT
modify
Super Exclusive TS, Tbl. Owner can read & modify all xactions NOT read, NOT None
(Z) (except uncommitted) data. modify
Typically for alter, drop table.
Create / drop index or REORG
utility
13
DB2 Family Introduction - Concepts
2.7. Security
Controlling Database Access. Combination of external security services and internal Access Control
Level 1: Controls access to DB Instance
Level 2: Controls to DB itself
Level 3: Controls access to data and data objects in DB
2.7.1. Authentication
External Service (o/s, add-on product or none (Win95/98/ME – user / pwd)
Verifies User.
Note: DBADM, SYSADM only privs that are allowed to access all data from all users. SYSADM at
Instance level, and DBADM at individual DB level
Note: SYSADM, SYSCTRL can create / drop DB (only ones)
2.7.3. DB Privileges
CONNECT
QUIESCE_
IMPLICIT_SCHEMA.
CREATETAB
BINDADD
CREATE_EXTERNAL_ROUTINE.
CREATE_NOT_FENCED_ROUTINE.
14
DB2 Family Introduction - Concepts
2.8. DWE vs OLTP Performance
DWE
o Performance. Optimized for queries – Indexing (multiple indexes for performance)
o Scalability – h/w and s/w
o Availability – 24x7x365
o Admin – flexible, extensible, min admin costs of hi-vol RDBMS
OLTP
o Hi-Perf Hi thruput (100’s / sec, sub-sec user response). Simple sql limit rows), simple
transactions. Min I/O, optimize CPU Util, eliminate sort, improve concurrency
o Hi Vol. Large volume of data, lots of concurrent users to 1000’s)
o HA 24x7x365
15