IBM DB2 for z/OS Administration Basics

Preview:

Citation preview

Multiple user connectivity

› Allows and manages more than one user connection to

the database and access to data at any given time.

Data integrity

› Internal locking ensures the risk of data corruption is

eliminated.

Recoverability

› The ability to recover data to a previous point in time or to

a current state when needed.

Security

› Controls access to data and resources by allowing only

authorized users access to certain data under specific

circumstances.

DB2 Objects

DB2 Utilities

Restrictive States

Administration

Stogroup

Database

Tablespace

Tables

Indexes

Views

It is a collection of direct access volume all of the same device type

The option is defined as a part of table space definitions

When a given space needs to be extended ,

storage is acquired from the appropriate stogroup.

Example

> For NON SMS Managed:

CREATE STOGROUP DSN8G910 VOLUMES (ABC005,DEF008)

VCAT DSNCAT;

> For SMS Managed:

CREATE STOGROUP DSN8G910 VOLUMES (*) VCAT

DSNCAT;

A collection of logically related objects – like

tablespaces, indexspaces, tables etc.

Not a physical kind of object

A STOGROUP & BUFFER POOL must be defined

for each database.

In a given database, all the spaces need not

have the same STOGROUP.

Table Table

Index

Index

Tablespace

Tablespace

Storage Groups

Table

› Example:

Create database DSN8D91P with storage group as

DSN8G910 and Bufferpool as BP8K1

CREATE DATABASE DSN8D91P STOGROUP DSN8G910

BUFFERPOOL BP8K1;

Logical address space on secondary storage to hold one or more tables.

Three types of table spaces are :

- Simple

- Partitioned

- Segmented

Simple

One or more table per tablespace

Space is composed of pages

Each page can contain rows of many tables

Example:

CREATE TABLESPACE Tablespacename

In Databasename

USING STOGROUP Sgname

PRIQTY mmm SECQTY nn

ERASE NO

LOCKSIZE ANY

BUFFERPOOL BP0

Segment 1 Segment 2 Segment 3

Table 1 Table 2 Table 1

> Segmented table spaces can contain one or more tables

> Space is divided into same-size segments

> Each segment contains rows from only one table

Example: CREATE TABLESPACE Tablespacename

In Databasename

USING STOGROUP Sgname

PRIQTY mmm SECQTY nn

ERASE NO

LOCKSIZE ANY

BUFFERPOOL BP0

SEGSIZE 32

Note: SEGSIZE from 4 to 64(in multiples of 4) indicates the number

of pages per segment.

Partitioned table spaces divide the data into several separate data sets, or partitions.

A partitioned table space can have only one table. Up to 4,096 partitions of up to 64GB each are allowed.

Each partition can have different characteristics, such as volume placement and free space.

Part 1 Part 2 Part 3 Part 4

> Primarily used for very large tables.

> Only one table in a partitioned table space

> Individual partitions can be independently recovered and

reorganized.

> Different partitions can be stored on different storage

groups for efficient access

› Example: CREATE TABLESPACE Tablespacename

In Databasename

NUMPARTS 2

(PART 1

USING STOGROUP Sgname

PRIQTY mmm SECQTY nn

FREEPAGE 5

PCTFREE 10)

(PART 1

USING STOGROUP Sgname

PRIQTY mmm SECQTY nn

FREEPAGE 5

PCTFREE 10)

LOCKSIZE ANY

BUFFERPOOL BP0;

A table is a collection of rows and columns.

The data is stored in form of rows and columns.

Example:

CREATE TABLE DSN8910.DEPT (

DEPTNO CHAR(3) NOT NULL,

DEPTNAME VARCHAR(36) NOT NULL,

MGRNO CHAR(6) ,

ADMRDEPT CHAR(3) NOT NULL,

LOCATION CHAR(16) ,

PRIMARY KEY(DEPTNO) ) IN DSN8D91A.DSN8S91D;

> Indexes are ordered sets of pointers associated

with a table.

> Indexes are based on the values of one or more

columns in the table.

> Each table can have one or more indexes, and

indexes can also be used to enforce uniqueness in

the data values.

> Indexes are used to improve performance when

accessing data.

> If an index is used, large scans of data can be

avoided.

› Example: CREATE UNIQUE INDEX DSN8910.XDEPT1 ON

DSN8910.DEPT (DEPTNO ASC)

USING STOGROUP DSN8G910

PRIQTY 512 SECQTY 64

ERASE NO BUFFERPOOL BP1;

Views can be very practical ways of simplifying queries by reducing the number of different tables.

Views can also hide sensitive data from users who don’t need access to it.

Example:

CREATE VIEW EMP_VIEW AS

SELECT EMPNO,NAME,DEPT,JOB

FROM EMP

Unload

Load

Reorg

Runstats

Copy

Unload rows from an entire table space or select specific partitions or tables to unload.

Can also select columns by using the field specification list.

If a table space is partitioned, you can unload all of the selected partitions into a single data set or you can unload each partition in parallel into physically distinct data sets.

The output records that the UNLOAD utility writes are compatible as input to the LOAD utility

Authorization Required:

› Ownership of the tables

› SELECT privilege on the tables

› DBADM authority for the database.

› SYSADM authority

› SYSCTRL authority (catalog tables only)

Execution Phases:

› UTILINIT Performs initialization.

› UNLOAD Unloads records to sequential data sets. One pass through the

input data set is made. If UNLOAD is processing a table space

or partition, DB2 takes internal commits. These commits

provide commit points at which the utility can be restarted in

case operation should halt in this phase.

› UTILTERM Performs cleanup.

Termination or restart of UNLOAD

› If you terminate UNLOAD by using the TERM UTILITY

command during the unload phase, the output records

are not erased.

› You can restart the UNLOAD job at the partition level or at

the table space level when data is unloaded from multiple

table spaces by using the LIST option.

› When you restart a terminated UNLOAD job, processing

begins with the table spaces or partitions that had not yet

been completed.

Sample Unload Job //STEP1 EXEC DSNUPROC,UID='SMPLUNLD',UTPROC='',SYSTEM='DSN'

//SYSREC DD DSN=USERID.SMPLUNLD.SYSREC,

// DISP=(NEW,CATLG,CATLG),

// UNIT=SYSDA,SPACE=(TRK,(2,1))

//SYSPUNCH DD DSN=USERID.SMPLUNLD.SYSPUNCH,

// DISP=(NEW,CATLG,CATLG),

// UNIT=SYSDA,SPACE=(TRK,(1,1))

//SYSPRINT DD SYSOUT=*

//SYSIN DD *

UNLOAD TABLESPACE DSN8D91A.DSN8S81E

FROM TABLE DSN8910.EMP

WHEN (WORKDEPT = 'D11' AND SALARY > 25000)

The LOAD utility loads records into the tables and builds or extends any indexes that are defined on them.

If the table space already contains data, you can choose whether you want to add the new data to the existing data or replace the existing data.

LOAD DATA generates one or more of the following forms of output: › A loaded table space or partition.

› A discard file of rejected records.

Authorization Required

› Ownership of the table

› LOAD privilege for the database

› SYSCTRL or SYSADM authority

› STATS privilege for the database is required if STATISTICS

keyword is specified

Note -

LOAD operates on a table space level, so you must have

authority for all tables in the table space when you perform LOAD.

Execution Phases

UTILINIT

▪ Performs Initialization

▪ RELOAD

▪ Loads record types and writes temporary file records for

indexes and foreign keys.

▪ RELOAD makes one pass through the sequential input

data set.

▪ Check constraints are checked for each row.

▪ Internal commits provide commit points at which to

restart in case operation should halt in this phase.

› SORT

Sorts temporary file records before creating indexes or

validating referential constraints, if indexes or foreign

keys exist.

SORT passes the sorted keys in memory to the BUILD

phase, which builds the indexes.

BUILD

Creates indexes from temporary file records for all

indexes that are defined on the loaded tables.

▪ SORTBLD ▪ Performs all activities that normally occur in both the

SORT and BUILD phases, if you specify a parallel index build.

INDEXVAL ▪ Corrects unique index violations or index evaluation

errors from the information in SYSERR, if any exist.

▪ ENFORCE • Checks referential constraints

• Information about violations of referential constraints is stored in SYSERR.

DISCARD

▪ Copies records that cause errors from the input data set

to the discard data set.

▪ REPORT

▪ Generates a summary report, if you specified ENFORCE

CONSTRAINT or if load index validation is performed. The

report is sent to SYSPRINT.

▪ UTILTERM

• Performs cleanup.

Replacing Data with LOAD

Use LOAD REPLACE to replace data in a table

space that has one or more tables.

Example : LOAD DATA REPLACE

INTO TABLE DSN8910.DEPT

( DEPTNO POSITION (1) CHAR(3),

DEPTNAME POSITION (5) VARCHAR,

LOCATION POSITION (48) CHAR(16) )

ENFORCE NO

Adding more data to a table or partition

RESUME keyword specifies whether data is to be loaded into an empty or a non-empty table space.

RESUME NO loads records into an empty table space.

RESUME YES loads records into a non-empty table space.

Example: LOAD DATA

RESUME YES INTO TABLE DSN8910.DEPT

(DEPTNO POSITION (1:3) CHAR(3), DEPTNAME POSITION (4:39) CHAR(36), LOCATION POSITION (49:64) CHAR(16))

Termination of LOAD

You can terminate a LOAD utility job using TERM

UTILITY command.

Termination …..

› During the reload phase:

The records are not erased.

The table space remains in RECOVER-pending status,

and indexes remain in the REBUILD-pending status.

Termination during the sort or build phases

▪ Indexes that are not yet built remain in the REBUILD-

pending status.

If the LOAD job terminates during the RELOAD,

SORT, BUILD, or SORTBLD phases

▪ Both RESTART and RESTART(PHASE) phases restart from the

beginning of the RELOAD phase.

Restart of LOAD

› You can restart LOAD at its last commit point

(RESTART(CURRENT))

› Or at the beginning of the phase during which

operation ceased (RESTART(PHASE)).

Reorganizes a table space to improve access

performance and to reclaim fragmented space.

You can determine when to run REORG for non-

LOB table spaces by using the OFFPOSLIMIT or

INDREFLIMIT catalog query options.

If you specify the REPORTONLY option, REORG

produces a report that indicates whether a REORG

is recommended without actually performing the

REORG.

Authorization Required

› REORG privilege for the database

› DBADM or DBCTRL authority for the database. If the object

on which the utility operates is in an implicitly created

database, DBADM authority on the implicitly created

database or DSNDB04 is required.

› SYSCTRL authority

› SYSADM authority

Execution Phases

UTILINIT

▪ Performs initialization and setup.

▪ UNLOAD

▪ Unloads the table space and sorts data if a clustering

index exists and the utility job includes either the

SORTDATA or SHRLEVEL CHANGE options.

▪ RELOAD • Reloads data from the sequential data set into the table

space. The utility also updates table and table space

statistics.

SORT ▪ Sorts index keys. The sorted keys are passed in memory to

the BUILD phase.

BUILD

▪ Builds indexes and updates index statistics.

▪ SORTBLD

▪ If parallel index build occurs, all activities that normally

occur in both the SORT and BUILD phases occur in the

SORTBLD phase instead.

▪ LOG

▪ Processes the log iteratively and appends changed pages

to the full image copies. This phase occurs only if you

specify SHRLEVEL CHANGE or SHRLEVEL REFERENCE PART x.

› SWITCH

Switches access to shadow copy of table space or

partition. This phase occurs only if you specify SHRLEVEL

REFERENCE or CHANGE.

› UTILTERM

Performs cleanup.

Termination of REORG Tablespace › If utility is terminated at UNLOAD Phase, objects have

not been changed, so you can rerun the job.

› If it is terminated at the RELOAD phase,

For SHRLEVEL NONE – the data records are not erased. The table space and indexes remain in RECOVER-pending status. After you recover the table space, rerun the REORG job.

For SHRLEVEL REFERENCE or CHANGE – the data records are reloaded into shadow objects, so the original objects have not been affected by REORG. You can rerun the job.

› Terminated at SORT, BUILD or LOG phases For SHRLEVEL NONE – the indexes that are not yet built

remain in RECOVER-pending status. You can run REORG with the SORTDATA option, or you can run REBUILD INDEX to rebuild those indexes.

For SHRLEVEL REFERENCE or CHANGE – objects have

not been affected by REORG. You can rerun the job.

› If you terminate during the SWITCH phase All data sets that were renamed to their shadow

counterparts are renamed to their original names, you can rerun the job or it goes in recover pending status.

Example //STEP1 EXEC DSNUPROC,UID=’IUJLU101.REORG’,

// UTPROC=’’,

// SYSTEM=’DSN’

//UTPRINT DD SYSOUT=*

//UNLD DD DSN=IUJ.REORG.STEP1.UNLD,DISP=(MOD,DELETE,CATLG),

// UNIT=SYSDA,SPACE=(CYL,(20,20),,,ROUND)

//SORTWK01 DD DSN=IUJ.REORG.STEP1.SORTWK01,DISP=(MOD,DELETE,CATLG),

// UNIT=SYSDA,SPACE=(CYL,(20,20),,,ROUND)

//SORTWK02 DD DSN=IUJ101.REORG.STEP1.SORTWK02,

// DISP=(MOD,DELETE,CATLG),UNIT=SYSDA,SPACE=(CYL,(20,20),,,ROUND)

//SYSIN DD *

REORG TABLESPACE (DSN8D81A.DSN8S81D) UNLDDN (UNLD)

The RUNSTATS utility gathers summary information about the characteristics of data in table spaces, indexes, and partitions.

DB2 records these statistics in the DB2 catalog and uses them to select access paths to data during the bind process.

RUNSTATS TABLESPACE gathers statistics on a table space and, optionally, on tables, indexes or columns

RUNSTATS INDEX gathers statistics only on indexes.

Authorization Required

› STATS privilege for the database

› DBADM, DBCTRL, or DBMAINT authority for the

database

› SYSCTRL or SYSADM authority

Execution Phases

› UTILINIT

Performs initialization

RUNSTATS

Scans table space or index and updates catalog.

UTILTERM

Performs cleanup

Sample RUNSTATS control statements

//STEP1 EXEC DSNUPROC,UID='IUJQU225.RUNSTA',TIME=1440,

// UTPROC='',

// SYSTEM='DSN'

//UTPRINT DD SYSOUT=*

//SYSIN DD *

RUNSTATS TABLESPACE DSN8D91A.DSN8S91E

UPDATE ALL

SHRLEVEL CHANGE

Updating index statistics RUNSTATS INDEX (DSN8910.XEMPL1)

Output from a RUNSTATS job on a

catalog table space and its indexes: DSNU000I DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = DSNTEX

DSNU050I DSNUGUTC - RUNSTATS TABLESPACE DSNDB06.SYSDBASE INDEX(ALL)

DSNU610I # DSNUSUTP - SYSTABLEPART CATALOG UPDATE FOR DSNDB06.SYSDBASE SUCCESSFUL

DSNU610I # DSNUSUTS - SYSTABLESPACE CATALOG UPDATE FOR DSNDB06.SYSDBASE SUCCESSFUL

DSNU610I # DSNUSUTB - SYSTABLES CATALOG UPDATE FOR SYSIBM.SYSTABLESPACE SUCCESSFUL

When to use RUNSTATS › After a table is loaded

› After an index is physically created

› After a table space is reorganized if inline statistics were not collected

› After running extensive updates, deletions, or insertions in a table space

› After running any of the following utilities without collecting inline statistics: RECOVER TABLESPACE, REBUILD INDEX, or REORG INDEX

› After running the ALTER TABLE ROTATE PARTITION statement run RUNSTATS with REORG .

Used for taking Image Copies of –

› table space

› table space partition

› data set of a linear table space

› index space, or index space partition

Types:

› Full image copy,

copy of all pages in a table space, partition,

data set, or index space.

› Incremental image copy

copy only of those data pages that have

been modified since the last use of the COPY

utility and system pages.

Authorization required

› IMAGCOPY privilege for the database

› DBADM, DBCTRL, or DBMAINT authority for the

database

› SYSCTRL or SYSADM authority

Note:

An ID with installation SYSOPR authority can

also execute COPY, but only on a table space

in the DSNDB01 or DSNDB06 database.

Execution phases

› UTILINIT

Performs initialization and setup

› REPORT

Reports for CHANGELIMIT option

› COPY

Copies

› UTILTERM

Performs cleanup

Making a full image copy

//STEP1 EXEC DSNUPROC,UID='IUJMU111.COPYTS',

// UTPROC='',

// SYSTEM='DSN'

//SYSCOPY DD

DSN=COPY001F.IFDY01,UNIT=SYSDA,VOL=SER=CPY01I,

// SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)

//SYSIN DD *

COPY TABLESPACE DSN8D91A.DSN8S91E

/*

Making incremental copies

› FULL NO option in the following COPY control

statement specifies that COPY is to make

incremental image copies

Example: COPY TABLESPACE DSN8D91A.DSN8S91E SHRLEVEL

CHANGE FULL NO

REBUILD INDEX

› reconstructs indexes or index partitions from the

table that they reference.

› Authorization:

RECOVERDB privilege for the database

DBADM or DBCTRL

SYSCTRL or SYSADM

› Execution Phases:

UTILINIT

Performs initialization and setup.

UNLOAD

Unloads index entries.

SORT

Sorts unloaded index entries.

BUILD

Builds indexes.

SORTBLD

Sorts and builds a table space for parallel index build

processing.

UTILTERM

Performs cleanup.

› Sample Job: //STEP1 EXEC DSNUPROC,UID=’IUIQU2UT.RBLD1’,TIME=1440,

// UTPROC=’’,

// SYSTEM=’DSN’

//SYSREC DD

DSN=IUIQU2UT.RBLD1.STEP1.SYSREC,DISP=(MOD,DELETE,CATLG),

// UNIT=SYSDA,SPACE=(8000,(20,20),,,ROUND)

//SYSIN DD *

REBUILD INDEX (DSN8910.XDEPT1)

/*

Note: To Rebuild all indexes of a table space we can specify INDEX(ALL)

Ex: REBUILD INDEX (ALL) TABLESPACE DSN8D91A.DSN8S91E

The online RECOVER utility recovers data to the current state

or to a previous point in time by restoring a copy and then

applying log records.

The RECOVER utility recovers an entire table space, index

space, a partition or data set, pages within an error range, or

a single page.

You can recover data from image copies of an object or

from a system-level backup records that contain changes to

the object.

› Authorization Required:

RECOVERDB privilege for the database

DBADM or DBCTRL authority for the database.

SYSCTRL or SYSADM authority

If you make image copies by table space, you can recover

the entire table space, or you can recover a data set or

partition from the table space.

The following RECOVER statement specifies that the utility is to

recover table space IAS9TS in database IAS9DB:

Example:

RECOVER TABLESPACE IAS9DB.IAS9TS

CHECK PENDING STATUS (CHKP)

› indicates that an object might be in an

inconsistent state and must be checked.

› Following utilities set the CHECK-pending status

on a table space if referential integrity

constraints are encountered:

LOAD with ENFORCE NO

RECOVER to a point in time

CHECK LOB

CHECK PENDING STATUS (CHKP)

› Corrective Action:

Check and correct referential integrity constraints using the CHECK DATA utility.

Run CHECK INDEX on the index.

Use the CHECK LOB utility to check the LOB table space.

COPY-pending status (COPY)

› indicates that the affected object must be

copied.

› Corrective Action:

Copy the affected table space.

Copy the affected index.

REBUILD-pending status (RBDP)

› indicates that the affected index or index

partition is broken and must be rebuilt from the

data.

› Corrective Action:

Run the REBUILD utility on the affected index

partition.

RECOVER-pending status (RECP)

› indicates that a table space or table space

partition is broken and must be recovered

› Corrective Action:

Run the RECOVER utility on the affected object.

Recover the partition.

Use LOAD REPLACE for the table space or partition.

Use REPAIR SET TABLESPACE or INDEX with NORCVRPEND on

the table space or partition.

Start the database that contains the table space or

index space with ACCESS FORCE.

REORG-pending status (REORP)

› indicates that a table space partition definition

has changed and the affected partitions must

be reorganized before the data is accessible.

› Corrective Action:

Run the REORG TABLESPACE utility with SHRLEVEL NONE.

Use LOAD REPLACE for the entire table space.

-START DB2

› START DB2 initializes the DB2 subsystem.

› Authorization

None is required. However, the command can be

executed only from a z/OS console with the START

command capability.

› Example:

-DB2P START DB2

-STOP DB2

› stops the DB2 subsystem

› Authorization

STOPALL privilege

SYSOPR authority

SYSCTRL authority

SYSADM authority

› Example:

-DB2P STOP DB2

› -STOP DB2 MODE(QUIESCE)

When you issue the STOP DB2 MODE(QUIESCE)

command, current threads can run to completion, and

new threads can be allocated to an application that is

running.

› -STOP DB2 MODE(FORCE)

no new threads are allocated, and work on existing

threads is rolled back.

-DISPLAY THREAD (DB2)

› displays current status information about DB2

threads.

› Authorization:

DISPLAY privilege

SYSOPR authority

SYSCTRL authority

SYSADM authority

-DB2P DISPLAY THD(*)

Token ID

-CANCEL THREAD (token)

› cancels processing for specific local or

distributed threads.

› Authorization:

SYSOPR authority

SYSCTRL authority

SYSADM authority

-DB2P CAN THD(Token id)

-DISPLAY UTILITY (DB2)

› displays the status of utility jobs

› Authorization Required:

None

› Example:

-DB2P DISPLAY UTILITY (*)

DSNU100I -DB1G DSNUGDIS USER = SYSADM

MEMBER = DB2P

UTILID = RUNTS

PROCESSING UTILITY STATEMENT 1

UTILITY = RUNSTATS

PHASE = RUNSTATS

COUNT = 0

STATUS = STOPPED

-TERM UTILITY (DB2)

› terminates execution of a DB2 utility job step and

releases all resources associated with the step

› Authorization

DBMAINT authority

DBCTRL authority

DBADM authority

SYSOPR authority

SYSCTRL authority

SYSADM authority

› Example:

Terminate all utility jobs for which you are

authorized.

-TERM UTILITY (*)

Terminate all utility jobs whose utility ID begins

with SMITH.

-TERM UTILITY (SMITH*)

START DATABASE

› Makes a database or individual partitions

available.

STOP DATABASE

› Makes a database or individual partitions

unavailable after existing users have quiesced.

Starting an object with a specific status

Status Access Remarks

RW Read-write This is the

default value.

RO Read only You cannot

change the

data.

UT Utility only The object is

available only to

the DB2 utilities.

› Example: -START DATABASE (DSN8D91A) SPACENAM(TEMPTS)

-START DATABASE (DSN8D91A) SPACENAM(*)

ACCESS(RO)

The system responds with this message:

DSN9022I - DSNTDDIS ’-START DATABASE’ NORMAL

COMPLETION

STOP DATABASE command has several options that

you can use to control how the database stops.

› -STOP DATABASE (*)

Stops all databases for which you have STOPDB

authorization, except the DB2 directory (DSNDB01), the

DB2 catalog (DSNDB06), or the DB2 work file database

(called DSNDB07).

› -STOP DATABASE (dbname)

Stops a database and closes all of the data sets of the

table spaces and index spaces in the database.

› -STOP DATABASE (dbname) SPACENAM (*)

Stops and closes all of the data sets of the table spaces

and index spaces in the database. The status of the

named database does not change.

› -STOP DATABASE (dbname) SPACENAM (space-

name, ...)

Stops and closes the data sets of the named table

space or index space.

› Use the command DISPLAY DATABASE to obtain

information about the status of databases and

the table spaces and index spaces within each

database.

› If applicable, the output also includes

information about physical I/O errors for those

objects.

-DISPLAY DATABASE (dbname)

› An example of such a restriction is when the

table space is placed in COPY-pending status.

That status makes a table space or partition

unavailable until an image copy of the object is

taken.

Note:

These restrictions are a necessary part of protecting the

integrity of the data. If you start an object that has restrictions,

the data in the object might not be reliable.

› A table might contain test data whose

consistency is not critical.

› In those cases, start the objects by using the

ACCESS(FORCE) option of the START

DATABASE command.

-START DATABASE (DSN8D91A) SPACENAM (DSN8S91E)

ACCESS(FORCE)

Use the DISPLAY DATABASE command to

determine which programs are holding locks on an

object.

› Syntax:

-DISPLAY DATABASE(Dbname) SPACENAM(Tsname) LOCKS

Buffer pools are database objects used to cache

database data pages in memory.

Buffer pools are areas of virtual storage that

temporarily store pages of table spaces or indexes

If an object's data page is placed in a buffer pool,

physical input/output (I/O) access to disks will be

avoided.

Use the DISPLAY BUFFERPOOL command, which

displays the current status for one or more active or

inactive buffer pools.

› Example:

-DISPLAY BUFFERPOOL(BP0)

ALTER BUFFERPOOL alters attributes for active or

inactive buffer pools.

Authorization:

› SYSOPR authority

› SYSCTRL authority

› SYSADM authority

› Example:

-ALTER BUFFERPOOL(BP0) VPSIZE(2000)

The DB2 Catalog is the central repository for DB2

object and user meta data.

DB2 is constantly referring to that meta data as it

processes applications and queries.

Are updated by DB2 operations and SQL INSERT,

UPDATE and DELETE on some of the tables

Are used by DB2 to obtain information about the

system. Can be queried using SQL

�The tables in the DSNDB06 database

› Record information about

�objects

�authorization

�plans/packages/stored procedures

�recovery (image copy, REORG, etc.)

�statistics

�string translation

SYSIBM.SYSCOPY table

The SYSIBM.SYSCOPY table contains information

needed for recovery.

SYSIBM.SYSDATABASE table

The SYSIBM.SYSDATABASE table contains one row

for each database, except for database DSNDB01.

SYSIBM.SYSDBAUTH table

The SYSIBM.SYSDBAUTH table records the privileges

that are held by users over databases.

SYSIBM.SYSPLANAUTH table

The SYSIBM.SYSPLANAUTH table records the

privileges that are held by users over application

plans.

SYSIBM.SYSSTOGROUP table

The SYSIBM.SYSSTOGROUP table contains one row

for each storage group.

SYSIBM.SYSTABAUTH table

The SYSIBM.SYSTABAUTH table records the privileges

that users hold on tables and views.

SYSIBM.SYSTABLES table

The SYSIBM.SYSTABLES table contains one row for

each table, view, or alias.

SYSIBM.SYSTABLESPACE table

The SYSIBM.SYSTABLESPACE table contains one row

for each table space.

SYSIBM.SYSTABLESPACESTATS table

The SYSIBM.SYSTABLESPACESTATS table contains

real time statistics for table spaces.

SYSIBM.SYSTABSTATS table

The SYSIBM.SYSTABSTATS table contains one row for

each partition of a partitioned table space.

SYSIBM.SYSUSERAUTH table

The SYSIBM.SYSUSERAUTH table records the system

privileges that are held by users.

SYSIBM.SYSVOLUMES table

The SYSIBM.SYSVOLUMES table contains one row for

each volume of each storage group.

The DB2 Directory contains internal control

structures such as DBDs. skeleton cursor tables, and

skeleton package tables that can be accessed

only by DB2 itself.

The information in the DB2 Directory is critical for

database access, utility processing, plan and

package execution, and logging.

SCT02 Contains the internal form of SQL statements that are contained in an

application. If you bound a plan with SQL statements in a prior

release, DB2 created a structure in SCT02.

SPT01

Skeleton package

Contains the internal form of SQL statements that are contained in a

package.

SYSSPUXA Contains the contents of a package selection.

SYSSPUXB Contains the contents of a package explain block.

SYSLGRNX

Log range

Tracks the opening and closing of table spaces, indexes, or partitions.

By tracking this information and associating it with relative byte

addresses (RBAs) as contained in the DB2 log, DB2 can reduce

recovery time by reducing the amount of log that must be scanned

for a particular table space, index, or partition.

SYSUTILX

System utilities

Contains a row for every utility job that is running. The row persists

until the utility is finished. If the utility terminates without completing,

DB2 uses the information in the row when you restart the utility.

DBD01

Database descriptor

(DBD)

Contains internal information, called database descriptors (DBDs),

about the databases that exist within the DB2 subsystem.

Each database has exactly one corresponding DBD that describes

the database, table spaces, tables, table check constraints,

indexes, and referential relationships. A DBD also contains other

information about accessing tables in the database. DB2 creates

and updates DBDs whenever their corresponding databases are

created or updated.

SYSDBDXA Contains the contents of a DBD section.

The SPUFI panel is the first panel that you need to fill

out to run the SPUFI application.

After you complete any fields on the SPUFI panel

and press Enter, those settings are saved.

When the SPUFI panel displays again, the data

entry fields on the panel contain the values that

you previously entered.

http://www-

01.ibm.com/support/knowledgecenter/SSEPEK_11.0.0/com.ibm.db2z11.doc.aps

g/src/tpc/db2z_executesqlspufi.dita

Recommended