System I DB
System I DB
Zakaria Ansori
[email protected]
2
i want an i. © 2007 IBM Corporation
IBM System i
Two Interfaces
Data Description
Specifications
(DDS)
Library
Native
Object Type =
SQL *FILE
STRSQL
Schema
*LIB
Strategic
3
i want an i. © 2007 IBM Corporation
IBM System i
row record
column field
log journal
4
i want an i. © 2007 IBM Corporation
IBM System i
Terminology
5
i want an i. © 2007 IBM Corporation
IBM System i
Physical/Logical Files
Schema/Database/Library
Physical
Filea
Files (data)
Fileb
Filec
selection Filed
projection
union Filee
join
Logical Files
(INDEXES)
(no data)
File_x File_y
Open
Data
Paths
(ODP)
Application
Program
6
i want an i. © 2007 IBM Corporation
IBM System i
Member-1
Member-2
Member-n
iSeries
Unique
7
i want an i. © 2007 IBM Corporation
IBM System i
File Members
Display Physical File Member
File Member
Display Physical File . . . . . . : CUSTOMERS Library . . . . : ERPDATA
File . . . . . . : CUSTOMERS Library CUSTCDT
Member .. .. .. .. .: : ERPDATA Record . . . . . : 1
Member . . . . . : SECOND Control
Record . ........:. 1 Column . . . . . : 1
Control . . . . . Find .. .. .. .. .. .: . 1
Column
Find . . . . . . . *...+....1....+....2....+....3....+....4....+....5....+....6
938472Henning G K4859 Elm Ave DallasTX7521750003003700000000
*...+....1....+....2....+....3....+....4....+....5....+....6
918374Davon 839283Jones
A C249 North St LondonTX7521750003003700000000 B D21B NW 135 StClay NY1304104001010000000000
833245Lee 392859Vine
D S21B NW 135 StClay NY1304104001010000000000 S SPO Box 79 BrotonVT0504607001043900000000
123859Jenner T PPO Box 79 938485Johnson J A3 Alpine Way Helen GA3054599992398750003350
BrotonVT0504607001043900000000
345485James 397267Tyron
S A3 Alpine Way Helen GA3054599992398750003350 W E13 Myrtle Dr HectorNY1484110001000000000000
389572Stevens K L208 Snow PassDenverCO8022604001005875000150
393457Peters D A13 Myrtle Dr HectorNY1484110001000000000000
323472Wang 846283Alison J S787 Lake Dr Isle MN5634250003001000000000
C M208 Snow PassDenverCO8022604001005875000150
475938Doe
889900Hoover E J787 Lake Dr SydneyMN5634250003001000000000 J W59 Archer Rd SutterCA9568507002025000010000
693829Thomas A N3 Dove CircleCasperWY8260999992000000000000
423438HumphreyH W59 Archer Rd SutterCA9568507002025000010000
593029WilliamsE D485 SE 2 Ave DallasTX7521802001002500000000
693829Thomas A N3 Dove CircleCasperWY8260999992000000000000
192837Lee
593029WilliamsE D485 SE 2 Ave BangorTX7521802001002500000000 F L5963 Oak St HectorNY1484107002048950000050
192837Lee 583990Abraham M T392 Mill St Isle MN5634299993050000000000
F L5963 Oak St ForestNY1484107002048950000050
583990Abraham M T392 Mill St IslandMN5634299993050000000000 ****** END OF DATA ******
****** END OF DATA ******
Members
8
i want an i. © 2007 IBM Corporation
IBM System i
Members
DSPFD Command
9
i want an i. © 2007 IBM Corporation
IBM System i
– Change Dataspace
– Save
– Restore
File Member Information Cursor data
DSPFD Command
10
i want an i. © 2007 IBM Corporation
IBM System i
LIBRARYX/DBFILE
Dataspace
Cursor data
data
data
DSPFFD Command
Members
(Green Screen)
11
i want an i. © 2007 IBM Corporation
IBM System i
12
i want an i. © 2007 IBM Corporation
IBM System i
13
i want an i. © 2007 IBM Corporation
IBM System i
OS/400
14
i want an i. © 2007 IBM Corporation
IBM System i
object-A
object-B
object-C
15
i want an i. © 2007 IBM Corporation
IBM System i
16
i want an i. © 2007 IBM Corporation
IBM System i
Deleted Records
Through DBMS Support (DB2 UDB)
– REUSEDLT = *YES
– Flagged by DB2 UDB
– Records not made available to applications on *READ
– Parameter REUSEDLT in CRTPF/CHGPF
– *YES
Space freed by deletion of a record is available for additions (new records)
– *NO
Space is not freed when a record is flagged for deletion
– Space "freed" by record deletion
– File "compression" possible
– Reorganize Physical File Mbr (RGZPFM command)
File
17
i want an i. © 2007 IBM Corporation
IBM System i
Memory
Disk
Data
18
i want an i. © 2007 IBM Corporation
IBM System i
Client
SQL/ISQL Query/400 OPNQRYF Access
Native Query Manager File Transfer
I/O ODBC
(record) OS/400
Query
Component Query APIs
Data Management
Database
19
i want an i. © 2007 IBM Corporation
IBM System i
Data Access
Software interacting with DB2 UDB/400
– Applications
– High Level Languages
– Application Packages
– iSeries Query Tools
– GUI
– iSeries Access for Windows (5722-XE1)
– iSeries Navigator
– Character-based interface
– Query Manager (5722-QU1)
– DB2 Query Manager (5722-ST1)
– OS/400 Commands
Copy File (CPYF)
Create Duplicate Object (CRTDUPOBJ)
Display File (DSPPFM)
– Non-IBM Tools
20
i want an i. © 2007 IBM Corporation
IBM System i
SQL Packaging
Database Manager
SQL parser and runtime support
Query Management
Several SQL APIs No Charge
Call Level Interface
Performance Tools
RUNSQLSTM
21
i want an i. © 2007 IBM Corporation
IBM System i
Programming Interfaces
CLI, ODBC
Net.Data
RUNSQLSTM
22
i want an i. © 2007 IBM Corporation
IBM System i
JDBC
CLI*
Embedded
DRDA AIX
Native/DDM
JDBC iSeries Toolbox JDBC DB2
DRDA DB2 Connect
DB2 Information Integrator
UDB
Linux for
JDBC
ODBC
iSeries Toolbox JDBC iSeries
DB2 Connect
DRDA iSeries ODBC
Windows
JDBC iSeries Access
ODBC DB2 Connect
OLE DB DB2 Information Integrator
.NET
DRDA
* OS/400 PASE only supports CLI
23
i want an i. © 2007 IBM Corporation
IBM System i
Maybe...
Consider...
Database Analyst or Architect (not administrator)
Technical issues of moving to a data-centric world
Business logic moving into the database
More data, used in more places, by more clients
24
i want an i. © 2007 IBM Corporation
IBM System i
Database Skill/Tasks
UNIX/Wintel DBA Tasks DB2 UDB for iSeries
Manage DASD Space Allocation Completely Automated
Review Table Space Allocations and Extents Completely Automated
Review and Balance Indexes Completely Automated
Application Rebinding Completely Automated
Maintain Database Integrity Completely Automated
Update Database Statistics Completely Automated
Synchronized OS and DB User Security Completely Automated
Reload Data for Hardware and Software Completely Automated
Upgrades
Load Data into Data Base Integrated Utility (Parallel)
Build and Manage DB Backup and Recovery Integrated GUI
Create and Review Indexes for Tables Integrated GUI
Performance Analysis and Tuning (DB and Integrated GUI
System)
Create and Maintain DB Schema Integrated GUI, DB2 OLAP,
and 3rd Party Tools (ERwin,S-Designer)
Automated DB Performance Profiling insure/SQL
Advanced DB Performance Analysis and Tuning insure/SQL
Data Replication and Consolidation Multiple IBM and 3rd Party Products
25
i want an i. © 2007 IBM Corporation
IBM System i
26
i want an i. © 2007 IBM Corporation
IBM System i
REFERENTIAL INTEGRITY
27
i want an i. © 2007 IBM Corporation
IBM System i
28
i want an i. © 2007 IBM Corporation
IBM System i
TRIGGERS
29
i want an i. © 2007 IBM Corporation
IBM System i
30
i want an i. © 2007 IBM Corporation
IBM System i
Trigger
Application-independent Triggers:
•Written once; used by many •Enforce business rules
Activated by database manager when •Enforce data validation and audit trail
operations performed on database •Preserve data consistency
•'Fired' by specified database Triggers versus Stored Procedures
operations and take action written •Triggers invoked by database events
in trigger •Stored procedures invoked by application
•Interface-independent CALL
DB2/400
SENDFAX
4711
program
5436
4711
31
i want an i. © 2007 IBM Corporation
IBM System i
32
i want an i. © 2007 IBM Corporation
IBM System i
33
i want an i. © 2007 IBM Corporation
IBM System i
Journaling
34
i want an i. © 2007 IBM Corporation
IBM System i
35
i want an i. © 2007 IBM Corporation