Sie sind auf Seite 1von 23

IBM Software Group

Lesson 7: Data Movement


(DB2 on Campus Lecture Series)

Raul F. Chong
IBM Toronto Laboratory

2005 IBM Corporation

IBM Software Group | DB2 Information Management Software

Agenda
Data movement overview
Export
Import
Load & Set Integrity
db2move
db2look

IBM Software Group | DB2 Information Management Software

Agenda
Data movement overview
Export
Import
Load & Set Integrity
db2move
db2look

IBM Software Group | DB2 Information Management Software

Data Movement Tools


Database B

Database A
File
Import

Export

ASC
DEL
WSF
IXF

Load
Set Integrity

IBM Software Group | DB2 Information Management Software

Data Movement Tools


EXPORT, IMPORT, LOAD
IXF, DEL, ASC

db2move
Easily export/import/load/copy set of tables & data (IXF)

db2look
Extracts:
DDL
permissions
database statistics
Tablespace characteristics

IBM Software Group | DB2 Information Management Software

Agenda
Data movement overview
Export
Import
Load & Set Integrity
db2move
db2look

IBM Software Group | DB2 Information Management Software

EXPORT
Export data based on SQL Statement

EXPORT TO employee.ixf of IXF


SELECT * FROM employee
FETCH FIRST 10 ROWS ONLY

IBM Software Group | DB2 Information Management Software

Launching the EXPORT Table Dialog

Control Center > (expand) All Databases folder > (select) Tables Folder > (right-click) Table > Export
8

IBM Software Group | DB2 Information Management Software

Agenda
Data movement overview
Export
Import
Load & Set Integrity
db2move
db2look

IBM Software Group | DB2 Information Management Software

IMPORT
High-speed SQL INSERT
Activates triggers
All Constraints enforced immediately
Uses BUFFERPOOL

IMPORT FROM employee.ixf OF IXF


REPLACE_CREATE
INTO employee_copy

10

IBM Software Group | DB2 Information Management Software

Launching the IMPORT Dialog

Control Center > (expand) All Databases folder > (select) Tables Folder > (right-click) Table > Import
11

IBM Software Group | DB2 Information Management Software

Agenda
Data movement overview
Export
Import
Load & Set Integrity
db2move
db2look

12

IBM Software Group | DB2 Information Management Software

LOAD
Very High Speed, low level data loader
separate LOAD, BUILD, DELETE phases
Uses utility heap (UTIL_HEAP_SZ)
Does NOT use bufferpool and does NOT activate triggers
Constraints enforced as separate step, may define
EXCEPTION tables
online LOAD supported

LOAD FROM employee.ixf OF IXF


REPLACE INTO employee_copy
SET INTEGRITY FOR employee_copy
ALL IMMEDIATE UNCHECKED
13

IBM Software Group | DB2 Information Management Software

Launching the LOAD Wizard

Control Center > (expand) All Databases folder > (select) Tables Folder > (right-click) Table > Load
14

IBM Software Group | DB2 Information Management Software

Launching the SET INTEGRITY Dialog

Control Center > (expand) All Databases folder > (select) Tables Folder > (right-click) Table > Set Integrity
15

IBM Software Group | DB2 Information Management Software

Agenda
Data movement overview
Export
Import
Load & Set Integrity
db2move
db2look

16

IBM Software Group | DB2 Information Management Software

db2move

db2move sample export

17

IBM Software Group | DB2 Information Management Software

Agenda
Data movement overview
Export
Import
Load & Set Integrity
db2move
db2look

18

IBM Software Group | DB2 Information Management Software

db2look
Extract DDL, tablespace info, and statistics to script
Too many options to describe, see db2look -h for
details
Example:
db2look -d sample -l -e -o sample.ddl

output file
database name

layout
(tablespaces
& bufferpools)

extract DDL

19

IBM Software Group | DB2 Information Management Software

db2look: Extracting DDL From Control Center

Control Center > (expand) All Databases folder > (right-click) Database > (select) Generate DDL
20

IBM Software Group | DB2 Information Management Software

Extraction Options

21

IBM Software Group | DB2 Information Management Software

QuickLab #8 Extracting DDL


In this QuickLab, you will use Control Center and
Development Center to extract database object
DDL for the EXPRESS database
Refer to the handout for the QuickLab #8
instructions

22

IBM Software Group | DB2 Information Management Software

Whats Next?
Lesson 1

Installation & the DB2 editions

Lesson 2

The DB2 Environment

Lesson 3

Tools & scripting

Lesson 4

The DB2 architecture

Lesson 5

Client connectivity

Lesson 6

Working with data objects

Lesson 7

Data movement

Lesson 8

Security

Lesson 9

Backup & recovery

Lesson 10

Maintenance

COMPLETED!

23

Das könnte Ihnen auch gefallen