Top Banner
Copyright © 2006 Quest Software Breaking the DB2 Platform Barrier Comparing the Architectural Differences Between DB2 for z/OS vs. DB2 for Linux, Unix, and Windows
48

Breaking the DB2 Platform Barrier 2008

Apr 08, 2018

Download

Documents

eswerreddy
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 1/48

Copyright © 2006 Quest Software

Breaking the DB2 PlatformBarrier

Comparing the ArchitecturalDifferences Between

DB2 for z/OSvs.DB2 for Linux, Unix, and Windows

Page 2: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 2/48

1

Agenda

• Basic Components

• Terminology Differences

• Storage Management

• Object Comparisons

• Administrative Differences

Page 3: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 3/48

2

Components of DB2

z/OS• Subsystem

• VCAT/Volume

• Stogroup

• Database

• Tablespace

• Creator (Owner/ Schema)• Table

• Alias

• Synonym

• Index

• View

• Package

• Plans

LUW• Instance

• Container• N/A

• Database

• Tablespace• Schema

• Table

• Alias

• Index

• View

• Package

Page 4: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 4/48

3

Installation

z/OS LUW

• DB2 Express – Low Cost

 – Not scalable

• 2 CPU/ 4GB RAM max

• DB2 Workgroup Edition – 4 CPUs/ 16 GB RAM

• DB2 Enterprise Edition – Unlimited scalability

 – Data partitioning (DPF)

• DB2 Data WarehouseEdition

 – Additional B.I. capabilities

• DB2 for z/OS – Data Server

 – Value Unit Edition

Page 5: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 5/48

4

System Catalog

z/OS LUW• SYSIBM.xxxx

• SYSCAT – Read-only views defined for

catalog base tables

• SYSSTAT – Updateable set of views

 – Primarily used for access pathmanipulation

• SYSIBM.xxxx – optimizer related fields are

updateable

Page 6: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 6/48

5

Accessing DB2

LUWz/OS

• Control Center – Basic administration

 – Command center – Command line processor

 – Command window

 – Script center

 – Visual Explain

• Health Center – Storage

 – Memory

 – Maintenance

• Data Studio – Stored procedure management

 – UDF manager

 – SQL Builder

• DB2I – DB2 tool set (3270 based)

• SPUFI• DCLGEN

• Bind/Rebind

• Command Processor

• Utilities

• Defaults

• Control Center

• Visual Explain

• Data Studio

Page 7: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 7/48

6

Common Terms, Different Meanings

z/OS

• SMS – System Managed Storage

• Software for managing diskallocation on System z

• Extent – Physical extension of a dataset

based on a secondaryallocation.

LUW

• SMS – System Managed Space

• Type of space management forTS

• Extent – A block of pages within a

tablespace

 – Similar to SEGSIZE in z/OS

Page 8: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 8/48

7

Different Terms, Similar Meanings

z/OS

• Subsystem – Logicaldatabase environment – System databases

• DSNDB06• DSNDB01

• DSNDB04

• DSNDB07

 – Memory Structures

 – Database Configuration

• DSNZPARM

 – Many databases

LUW

• Instance – Logicaldatabase serverenvironment – Also referred to as a NODE

 – 1 to many databases

 – Database ManagerConfiguration File

Page 9: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 9/48

8

Bufferpools

z/OS

• 80 Bufferpools available

• 50 – 4K

• 10- 8, 16, & 32K respectively

• Share across subsystem

• Global Bufferpools

• Shared across data Sharing

group

LUW

• IBMDEFAULTBPautomatically created withdatabase – Additional pools created with DDL

• Hidden Bufferpools – 4k,8k,16k, & 32K

• Share only within individualdatabases

Page 10: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 10/48

9

Databases

z/OS

• Logical grouping of DB2 objects – Does not consume resources

• Many DBs in subsystem – 60K

• Metadata for all DBs stored in 1system catalog

LUW

• Logical grouping of DB2 objects• Typically 1 database/instance

• More like a z/OS Subsystem – Catalog for each database defined

within database

• SYSCATSPACE

• TEMPSPACE

• USERSPACE – Bufferpools defined in database

 – Database configuration file

Page 11: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 11/48

10

Subsystem vs. Instance

LUW

D

B

M

C

O

N

F

I

G

D

B

M

C

O

N

F

I

G

z/OS

Catalog

Log

DB2PROD

PRODDB1

PRODDB2

BP’s

Instance_1

PRODDB1Catalog DBCONFIG

Log

Catalog

Log

DBCONFIGPRODDB2

BPs

BPs

Instance_2

TESTDB1

CatalogDBCONFIG

Log

Catalog

Log

DBCONFIGTESTDB2

BPs

BPs

D

SN

Z

P

A

R

M

Catalog

Log

DB2TEST

TESTDB1

TESTDB2

BP’s

D

S

N

ZP

A

R

M

Page 12: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 12/48

11

• Volume

 – Device• Storage Group

 – Group of volumes

• Container

 – Device – Directory

 – File

LUWz/OS

Storage Management

Page 13: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 13/48

12

Volumes

Physical storage device for DB2 z/OS. A volume can contain 1 ormany table spaces or index spaces

Terminology –  DASD – Direct Access Storage Device

• logical disk drives

 –  VolSer – Volume serial. This is a name identifying the disk pack

i.e. DB2001. –  Storage Group

• Defined object

 – A logical grouping of volumes or SMS “*”

 – Can be used by more than one TS or IS

 – N/A on LUW.

Page 14: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 14/48

13

Containers

• Physical storage device for DB2 LUW

• A container is assigned to an individualtablespace –  Directory name

• SMS Only

• D:\MYTS

 –  Raw Device

• DMS Only

• E:

 –  File name

• DMS Only

• D:\SODADB\SODA.UTILITY.DMS

SMS

Directory

 /db/payroll/tbsp1/cont

DMSFile Raw Device

Page 15: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 15/48

14

Table spaces: z/OS

5 types of table spaces can be defined – Simple

• N/A as of V9

 – Segmented

 – Partitioned

 – DSSIZE (large)

 – Universal (UTS)• V9

2 types of allocation methods – VCAT

 – Stogroup

Page 16: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 16/48

15

Table spaces: z/OS

When a tablespace is created, a VSAM file is defined with the

following format:

VCAT.DSNDBC.DBNAME.TSNAME.I0001.A001VCAT.DSNDBD.DBNAME.TSNAME.I0001.A001

Where:

VCAT – Typically the subsystem nameDBNAME – Database name

TSNAME – Tablespace name

I0001 – Instance number changes with cloned tables

A001 – Partition or dataset number (A001, A002, etc.)

Page 17: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 17/48

16

Tablespaces: DB2 LUW

• 1 type of Tablespace – 3 Categories

• Regular• Temporary

• Large

• Extents

 – A unit of grouped pages• 2 – 256 pages

• Similar to SEGSIZE in z/OS

• 2 Allocation Methods –  SMS – System Managed Space

• Directory – SMS only

 –  DMS – Database Managed Space

• File

• Device

 –  AUTOMATIC

• No need to specify container info.

Page 18: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 18/48

17

Tablespaces: DB2 LUW

SMS DMS

• System Managed – No finite storage specified

• Operating System’s file managerallocates space as needed

• Good for small tables

• Cannot Add/delete containers aftercreation

• Database Managed – Space is pre-allocated

 – Better suited for large tables

 – LOBs must be DMS

 – ALTER to add containers

Add containers to TS X

Separate indexes from data X

Space allocated as needed X

High performance in heavy OLTP

X

High performance in decision support X

Ease of administration for small tables X

Flexibility of administration X

File or device containers X

Page 19: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 19/48

18

Partitioning

z/OS

• Partitioned Table Space – Single table – 1-4096 partitions

 – Partitioning Index key controls thepartition in which the data resides

 – Each partition can be on separatedevice

 – Partitions can be administeredindependently

 – Universal table space provides betterspace management

• Universal Table Spaces – Partition by Growth (PBG)

• Segmented TS• Increased space limits

• Utility parallelism

• MAXPARTITIONS

 – Range Partitioned (PBR)• Combines benefits of segmented

and partitioned tablespaces

LUW

• Table partitioning – Partitioning part of table DDL – Partitions can be in one or multiple tablespaces

 – Partitions can be rolled in/out

 – Partitions can be administered independently

• Database Partitioning – Database Partitioning Feature (DPF)

• ESE Edition only

 – Database is partitioned across multiple servers

 – Multiple tables

 – Database Partition Group controls data location

 – Database Partition Group controls data distribution

Page 20: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 20/48

19

Tables

z/OS• 1 to many tables defined in non-partitioned table spaces

 – Typically 1 to 1 however for performance, easier management

 – Tables and Indexes are independent of each other

• Except for PK which requires unique IX definition

LUW• 1 to many tables can be defined within a tablespace

 – Indexspace directly tied to table definition and can exist in same tablespace

Page 21: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 21/48

Page 22: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 22/48

21

Indexes: z/OS

Indexspace created when CREATE INDEX executed.

• No CREATE INDEXSPACE DDL like tablespaces

• Only 1 index per indexspace

• VSAM dataset name can be a little cryptic for indexesVCAT.DSNDBC.DBNAME.IXNAME.I0001.A001

VCAT.DSNDBD.DBNAME.IXNAME.I0001.A001

Where:

VCAT – Typically the subsytem name

DBNAME – Database nameIXNAME – 8 character representation of IX name

A001 – Dataset number (A001, A002, etc.)

2 types of allocation methods

• VCAT• Stogroup

Page 23: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 23/48

22

Indexes: DB2 LUW

Indexes are dependent on tables. The indexspacemust be specified when the table is created.

• All indexes for table use 1 tablespace

• Indexspace is predefined before IXs are created

• Indexes can be defined in same tablespace as table

 – Required for SMS

Page 24: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 24/48

23

Administration

Page 25: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 25/48

24

Optimizer

z/OS

• Fixed optimization• HINTS allow for some

flexibility – Mainly used to maintain old access

path

 – Must be turned on at install time – Need to modify PLAN_TABLE

• Visual Plan Hints

LUW

• More flexible than z/OS – 7 levels of optimization

 – Adjusted based on query complexity

Page 26: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 26/48

25

Optimizer Class

• DB2 Optimizer Class – Values are between 0 and 9, default is 5

• Determines the intensity used by the DB2 SQL Compiler when rewriting SQL

• Dynamic SQL can’t spend time optimizing, use lower class

• Static SQL optimizes once, use a higher class

• “dft_queryopt” database setting

• SET CURRENT QUEREY OPTIMIZATION n

Level Recommendation

0 Minimal amount of optimization. Only recommended for very simple SQL accessing well indexed tables. Onlynested loop joins and IX scans enabled.

1 Similar to 0 except Merge Scan and TS scan enabled.

2 Recommended for very complex queries which are infrequently executed in a decision support or OLAP

environment.

3 Closest to z/OS optimizer. Recommended for queries with 4 or more joins.

5 DEFAULT – Most cost effective method for mix of simple and complex queries. Optimization will be automaticallyreduced for complex dynamic SQL if optimizer determines that the resources are not necessary.

7 Same as 5 except optimization not reduced for complex dynamic SQL

9 Used to determine whether more comprehensive optimization can generate better access plan for very complex longrunning queries using large tables

Page 27: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 27/48

26

Explain Tables

• Native Tables – PLAN_TABLE

 – DSN_FUNCTION

 – DSN_STATEMENT

• Tables used by IBM Tools –  DSN_PREDICAT_TABLE

 –  DSN_STRUCT_TABLE

 –  DSN_PGROUP_TABLE

 –  DSN_PTASK_TABLE

 –  DSN_FILTER_TABLE

 –  DSN_DETCOST_TABLE

 –  DSN_SORT_TABLE

 –  DSN_SORTKEY_TABLE –  DSN_PGRANGE_TABLE

 –  DSN_VIEWREF_TABLE

 –  DSN_QUERY_TABLE

• Native Tables – EXPLAIN_INSTANCE

 – EXPLAIN_STATEMENT

 – EXPLAIN_OPERATOR

 – EXPLAIN_PREDICATE

 – EXPLAIN_OBJECT

 – EXPLAIN_ARGUMENT

 – EXPLAIN_STREAM

Page 28: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 28/48

Parallelism: z/OS

Data Sharing SYSPLEX

Coupling

Facility

z/OS SYSPLEX

DB2B

BSDS

Log

Workfile

DB

DB2A

BSDS

Log

Workfile

DB

DB2

Catalog

DASD

CPU1 CPU2

Page 29: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 29/48

Parallelism: DB2 LUW

Enterprise Extended Edition

MPP

CPU1 CPU2 CPU3 CPU4

DB

Part 0

DB

Part 1

DB

Part 3

DB

Part 2

Fast Communication Manager

Log LogLogLogData Data Data Data

Page 30: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 30/48

29

Types of Parallelism

LUW• I/O

 – Multi-container TS

• Query – Intra-partition (SMP)

• Parallelism within singlepartition

 – Inter-partition (DPF/MPP)• Parallelism across

multiple partitions

z/OS

• I/O – Partitioned TS

• CPU – Most common

 – Query processed in multipletasks in parallel acrossmachines or LPARs

• SYSPLEX

Page 31: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 31/48

30

Performance Monitoring

z/OS LUW

• Instrumentation FacilityComponent (IFC) –  Statistics

• Global statistical data

 –  Accounting

• Detail info for specific application

 –  Audit

• Table access audits

• Requires AUDIT keyword on tabledefinition

 –  Performance

• Most detailed $$$

• Only use for short periods

 –  Monitor

• Makes trace data available formonitoring applications

• Snapshot Monitor – Show status of database for an

instant in time

• Event Monitor

 – Historical status over time – 3 types

• Activity

• Threshold Violations

• Statistics

Page 32: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 32/48

31

Automated Monitoring - LUW

• Self Tuning Memory (V9)• Bufferpools

• Locklist• Package Cache• Sort Heap• Database Shared Memory

Page 33: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 33/48

32

Backup and Recovery

Page 34: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 34/48

33

Backups

z/OS LUW

• Database

• Tablespace

• Components – Backup Image

 – Incremental Copy – Backup History File

 – Active Logs

 – Archive Logs

• BACKUP SYSTEM• Tablespace

• Index

• Components – Full Image copy

 – Incremental Image Copy

 – Copy to Copy

 – Active/Archive Logs

 – BSDS

 – SYSLGRNX

Page 35: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 35/48

34

Recovery Information

z/OS LUW

SYSCOPY

• Updated – Full IC

 – Incremental IC

 – Quiesce – LOAD

 – REBUILD IX

 – RECOVER TOCOPY

 – RECOVER TOLOGPOINT

 – Reorg

• Contains – Full/Incr copy

 – Log RBA

 – Copy to Copy

Recovery History File

• Updated – Backup of full DB or TS

 – Restore of full DB or TS

 – Load of a table

 – Quiesce TS

• Contains – Part of DB which was copied

 – When DB was copied

 – Location of the copy

 – Time of last restore

L i

Page 36: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 36/48

35

Logging

z/OS LUW

• Logs apply to entire subsystem – Active

 – Archive

• Active logs are automatically

archived when full

• Dual Logging

• Defined at database –  Circular

• No roll-forward recovery

 –  Archival

• Fully recoverable

• Similar to z/OS• 3 log files

 – Active

 – Online Archived

 – Offline Archived

• On Demand Archiving

 – Close and archive an active log atany time

• Dual Logging

Ci l L i DB2 LUW

Page 37: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 37/48

36

Circular Logging: DB2 LUW

• Non-recoverable databases

• Log files are reused

• Uses active logs only – Secondary used for overflow

• Roll-forward recovery notpossible

• Default method for new DBs

1Primary

1

2“n”

3

“n”

S

E

C

O

N

D

A

R

Y

A hi l L i

Page 38: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 38/48

37

Archival Logging

• Log files not reused

• Roll Forward Recovery

Online Archival -

Contains information for

committed and externalized

transactions. Stored in theactive log subdirectory12

13

14

15

16

Active –

Contains information

For non-committed or

Non-externalized

Transactions.

Offline Archival

Files moved from active

Log subdirectory.

Usually offline media.

T f R

Page 39: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 39/48

38

Types of Recovery

LUWz/OS

• RESTORE SYSTEM – When BACKUP SYSTEM used

• Crash – DB2 restart

• Roll-Forward – IC plus log apply

 – LOGONLY

• Point in Time – IC only (TOCOPY)

 – TOLASTCOPY

 – TOLASTFULLCOPY

 – TOLOGPOINT – TORBA

• Crash – Uses logs to recover from

power interrupts or applicationABENDS

• Roll-Forward – Image copy plus log apply

 – LOCAL TIME

• More flexible than TORBA

• Version – Image copy (TOCOPY)

Common Utilities

Page 40: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 40/48

39

Common Utilities

z/OS LUW

• EXPORT

• LOAD/IMPORT• REORG

• RUNSTATS

• QUIESCE• Set Integrity

• DSNTIAUL/Fast Unload

• LOAD• REORG• RUNSTATS• QUIESCE

• CHECK DATA

Unloading Data

Page 41: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 41/48

40

Unloading Data

LUWz/OS

• DSNTIAUL – IBM sample program

• REORG UNLOAD

PAUSE• UNLOAD Utility

 – Table

 – Image Copy

• EXPORT – Accessed via Control

Center or CLP

 – Rename columns

 – Multiple output formats

Loading Data

Page 42: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 42/48

41

Loading Data

z/OS LUW

• Load – Locks single table in TS

 – Insert/Replace

 – RUNSTATS

 – Good for large amounts of data

 – READ ACCESS for rows not beingloaded Load directly from a SQLquery

• ONLINE

 –  Allow Read Access

• Import – Insert process

• Update

• Replace – Good for small amounts of data

• Load Utility – Resume/Replace

 – Log YES/NO

 – Runstats/Copy

 – Enforce Constraints

• ONLINE – SHRLEVEL CHANGE

Reorganizing Data

Page 43: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 43/48

42

Reorganizing Data

z/OS LUW

• Table

• Index

• REORGCHK – Determines when Reorg is

required

• Automated Reorganization

 – Automated REORGCHK

• Tablespace – Log Yes/No

 – Unload Pause

 – Shrlevel

• Index

Statistics

Page 44: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 44/48

43

Statistics

• RUNSTATS

 – Tablespace – Index

• RUNSTATS

 – Table

• Statistics Profile – Customized parameters for

individual tables• Automated statistics

collection – DB2 schedules RUNSTATS via

maintenance policy

z/OS LUW

• Real Time Statistics – Stored Procedure

• DNACCOX

 – V9

• DSNACCOR

 – V8

 – Monitor for

• REORG

• RUNSTATS

• Image Copy

Quiesce

Page 45: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 45/48

44

Quiesce

z/OS LUW

• Establishes point of

consistency in log – Flushes all changed pages

to disk

 – Used to avoid RI violations

• Instance or Database

level – Used for administering

maintenance

 – All objects in “QuiescedMode”

 – Only authorized users canaccess objects

 – Similar to ACCESS(MAINT)in z/OS

• UNQUIESCE

 – Removes Quiesce Mode

Checking Referential Integrity

Page 46: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 46/48

45

Checking Referential Integrity

z/OS LUW

• Check Data

 – Removes “Check Pending” flag

• Exception Tables – Contain RI violations

• Invocation – Standalone

 – Load Utility “Enforce Constraints”

• Set Integrity

 – Removes “Set Integrity Pending”state

• Exception Tables

 – Contain RI Violations• Invocation

 – Embedded in Application

 – Dynamic SQL

Page 47: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 47/48

Page 48: Breaking the DB2 Platform Barrier 2008

8/7/2019 Breaking the DB2 Platform Barrier 2008

http://slidepdf.com/reader/full/breaking-the-db2-platform-barrier-2008 48/48

Copyright © 2006 Quest Software

Thank you