SlideShare a Scribd company logo
1 of 129
Download to read offline
 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.
TableTable
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.SYSINDEXES table
The SYSIBM.SYSINDEXES table contains one row for
every index.
 SYSIBM.SYSPACKAUTH table
The SYSIBM.SYSPACKAUTH table records the
privileges that are held by users over packages.
 SYSIBM.SYSPLAN table
The SYSIBM.SYSPLAN table contains one row for
each application plan.
 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
Multiple User Database Features and Administration
Multiple User Database Features and Administration

More Related Content

What's hot

DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1ReKruiTIn.com
 
Best practices for DB2 for z/OS log based recovery
Best practices for DB2 for z/OS log based recoveryBest practices for DB2 for z/OS log based recovery
Best practices for DB2 for z/OS log based recoveryFlorence Dubois
 
IBM DB2 LUW UDB DBA Training by www.etraining.guru
IBM DB2 LUW UDB DBA Training by www.etraining.guruIBM DB2 LUW UDB DBA Training by www.etraining.guru
IBM DB2 LUW UDB DBA Training by www.etraining.guruRavikumar Nandigam
 
ALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARMALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARMIBM
 
online training for IBM DB2 LUW UDB DBA
online training for IBM DB2 LUW UDB DBAonline training for IBM DB2 LUW UDB DBA
online training for IBM DB2 LUW UDB DBARavikumar Nandigam
 
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the myths
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the mythsDB2 for z/OS and DASD-based Disaster Recovery - Blowing away the myths
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the mythsFlorence Dubois
 
Z OS IBM Utilities
Z OS IBM UtilitiesZ OS IBM Utilities
Z OS IBM Utilitieskapa rohit
 
JCL MAINFRAMES
JCL MAINFRAMESJCL MAINFRAMES
JCL MAINFRAMESkamaljune
 
Introduction of ISPF
Introduction of ISPFIntroduction of ISPF
Introduction of ISPFAnil Bharti
 
DB2 for z/OS Real Storage Monitoring, Control and Planning
DB2 for z/OS Real Storage Monitoring, Control and PlanningDB2 for z/OS Real Storage Monitoring, Control and Planning
DB2 for z/OS Real Storage Monitoring, Control and PlanningJohn Campbell
 
DB2 and storage management
DB2 and storage managementDB2 and storage management
DB2 and storage managementCraig Mullins
 
IBM DB2 LUW UDB DBA Online Training by Etraining.guru
IBM DB2 LUW UDB DBA Online Training by Etraining.guruIBM DB2 LUW UDB DBA Online Training by Etraining.guru
IBM DB2 LUW UDB DBA Online Training by Etraining.guruRavikumar Nandigam
 
Mainframe JCL Part - 1
Mainframe JCL Part - 1Mainframe JCL Part - 1
Mainframe JCL Part - 1janaki ram
 
Db2 and storage management (mullins)
Db2 and storage management (mullins)Db2 and storage management (mullins)
Db2 and storage management (mullins)Craig Mullins
 
Top jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tipsTop jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tipsjcltutorial
 

What's hot (20)

DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1
 
Best practices for DB2 for z/OS log based recovery
Best practices for DB2 for z/OS log based recoveryBest practices for DB2 for z/OS log based recovery
Best practices for DB2 for z/OS log based recovery
 
IBM DB2 LUW UDB DBA Training by www.etraining.guru
IBM DB2 LUW UDB DBA Training by www.etraining.guruIBM DB2 LUW UDB DBA Training by www.etraining.guru
IBM DB2 LUW UDB DBA Training by www.etraining.guru
 
ALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARMALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARM
 
An Hour of DB2 Tips
An Hour of DB2 TipsAn Hour of DB2 Tips
An Hour of DB2 Tips
 
online training for IBM DB2 LUW UDB DBA
online training for IBM DB2 LUW UDB DBAonline training for IBM DB2 LUW UDB DBA
online training for IBM DB2 LUW UDB DBA
 
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the myths
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the mythsDB2 for z/OS and DASD-based Disaster Recovery - Blowing away the myths
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the myths
 
Z OS IBM Utilities
Z OS IBM UtilitiesZ OS IBM Utilities
Z OS IBM Utilities
 
JCL MAINFRAMES
JCL MAINFRAMESJCL MAINFRAMES
JCL MAINFRAMES
 
Skillwise JCL
Skillwise JCLSkillwise JCL
Skillwise JCL
 
Introduction of ISPF
Introduction of ISPFIntroduction of ISPF
Introduction of ISPF
 
Mvs commands
Mvs commandsMvs commands
Mvs commands
 
DB2 for z/OS Real Storage Monitoring, Control and Planning
DB2 for z/OS Real Storage Monitoring, Control and PlanningDB2 for z/OS Real Storage Monitoring, Control and Planning
DB2 for z/OS Real Storage Monitoring, Control and Planning
 
Tso and ispf
Tso and ispfTso and ispf
Tso and ispf
 
DB2 and storage management
DB2 and storage managementDB2 and storage management
DB2 and storage management
 
IBM DB2 LUW UDB DBA Online Training by Etraining.guru
IBM DB2 LUW UDB DBA Online Training by Etraining.guruIBM DB2 LUW UDB DBA Online Training by Etraining.guru
IBM DB2 LUW UDB DBA Online Training by Etraining.guru
 
DB2 DOCUMENT
DB2 DOCUMENTDB2 DOCUMENT
DB2 DOCUMENT
 
Mainframe JCL Part - 1
Mainframe JCL Part - 1Mainframe JCL Part - 1
Mainframe JCL Part - 1
 
Db2 and storage management (mullins)
Db2 and storage management (mullins)Db2 and storage management (mullins)
Db2 and storage management (mullins)
 
Top jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tipsTop jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tips
 

Viewers also liked

Planning and executing a DB2 11 for z/OS Migration by Ian Cook
Planning and executing a DB2 11 for z/OS  Migration  by Ian Cook Planning and executing a DB2 11 for z/OS  Migration  by Ian Cook
Planning and executing a DB2 11 for z/OS Migration by Ian Cook Surekha Parekh
 
DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...
DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...
DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...John Campbell
 
DB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer ExperiencesDB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer ExperiencesJohn Campbell
 
Universal Table Spaces for DB2 10 for z/OS - IOD 2010 Seesion 1929 - favero
 Universal Table Spaces for DB2 10 for z/OS - IOD 2010 Seesion 1929 - favero Universal Table Spaces for DB2 10 for z/OS - IOD 2010 Seesion 1929 - favero
Universal Table Spaces for DB2 10 for z/OS - IOD 2010 Seesion 1929 - faveroWillie Favero
 
DB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
DB2 10 & 11 for z/OS System Performance Monitoring and OptimisationDB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
DB2 10 & 11 for z/OS System Performance Monitoring and OptimisationJohn Campbell
 
Using Release(deallocate) and Painful Lessons to be learned on DB2 locking
Using Release(deallocate) and Painful Lessons to be learned on DB2 lockingUsing Release(deallocate) and Painful Lessons to be learned on DB2 locking
Using Release(deallocate) and Painful Lessons to be learned on DB2 lockingJohn Campbell
 
Modeling Physical Systems with Modern Object Oriented Perl
Modeling Physical Systems with Modern Object Oriented PerlModeling Physical Systems with Modern Object Oriented Perl
Modeling Physical Systems with Modern Object Oriented PerlJoel Berger
 
Presentation db2 connections to db2 for z os
Presentation   db2 connections to db2 for z osPresentation   db2 connections to db2 for z os
Presentation db2 connections to db2 for z osxKinAnx
 
DB2 Accounting Reporting
DB2  Accounting ReportingDB2  Accounting Reporting
DB2 Accounting ReportingJohn Campbell
 
DB2 10 Universal Table Space - 2012-03-18 - no template
DB2 10 Universal Table Space - 2012-03-18 - no templateDB2 10 Universal Table Space - 2012-03-18 - no template
DB2 10 Universal Table Space - 2012-03-18 - no templateWillie Favero
 
Mainframe Architecture & Product Overview
Mainframe Architecture & Product OverviewMainframe Architecture & Product Overview
Mainframe Architecture & Product Overviewabhi1112
 
S108 - 1 Billion Smartphones a year and counting – How is your CICS connected?
S108 - 1 Billion Smartphones a year and counting – How is your CICS connected?S108 - 1 Billion Smartphones a year and counting – How is your CICS connected?
S108 - 1 Billion Smartphones a year and counting – How is your CICS connected?nick_garrod
 
S3 l5 db2 - process model
S3 l5   db2 - process modelS3 l5   db2 - process model
S3 l5 db2 - process modelMohammad Khan
 
Application trends db2 day 2015 jorn
Application trends   db2 day 2015 jornApplication trends   db2 day 2015 jorn
Application trends db2 day 2015 jornPeter Schouboe
 
DB2 Systems Programming Tools of the Trade NA07B03
DB2 Systems Programming Tools of the Trade NA07B03DB2 Systems Programming Tools of the Trade NA07B03
DB2 Systems Programming Tools of the Trade NA07B03Linda Hagedorn
 
DB2 Data Sharing Performance for Beginners
DB2 Data Sharing Performance for BeginnersDB2 Data Sharing Performance for Beginners
DB2 Data Sharing Performance for BeginnersMartin Packer
 
Libro blanco espesantes essd
Libro blanco espesantes essdLibro blanco espesantes essd
Libro blanco espesantes essdLoluca Tascón
 

Viewers also liked (20)

Planning and executing a DB2 11 for z/OS Migration by Ian Cook
Planning and executing a DB2 11 for z/OS  Migration  by Ian Cook Planning and executing a DB2 11 for z/OS  Migration  by Ian Cook
Planning and executing a DB2 11 for z/OS Migration by Ian Cook
 
DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...
DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...
DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...
 
DB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer ExperiencesDB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer Experiences
 
Universal Table Spaces for DB2 10 for z/OS - IOD 2010 Seesion 1929 - favero
 Universal Table Spaces for DB2 10 for z/OS - IOD 2010 Seesion 1929 - favero Universal Table Spaces for DB2 10 for z/OS - IOD 2010 Seesion 1929 - favero
Universal Table Spaces for DB2 10 for z/OS - IOD 2010 Seesion 1929 - favero
 
DB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
DB2 10 & 11 for z/OS System Performance Monitoring and OptimisationDB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
DB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
 
Using Release(deallocate) and Painful Lessons to be learned on DB2 locking
Using Release(deallocate) and Painful Lessons to be learned on DB2 lockingUsing Release(deallocate) and Painful Lessons to be learned on DB2 locking
Using Release(deallocate) and Painful Lessons to be learned on DB2 locking
 
Modeling Physical Systems with Modern Object Oriented Perl
Modeling Physical Systems with Modern Object Oriented PerlModeling Physical Systems with Modern Object Oriented Perl
Modeling Physical Systems with Modern Object Oriented Perl
 
Presentation db2 connections to db2 for z os
Presentation   db2 connections to db2 for z osPresentation   db2 connections to db2 for z os
Presentation db2 connections to db2 for z os
 
DB2 Accounting Reporting
DB2  Accounting ReportingDB2  Accounting Reporting
DB2 Accounting Reporting
 
DB2 10 Universal Table Space - 2012-03-18 - no template
DB2 10 Universal Table Space - 2012-03-18 - no templateDB2 10 Universal Table Space - 2012-03-18 - no template
DB2 10 Universal Table Space - 2012-03-18 - no template
 
Database storage engines
Database storage enginesDatabase storage engines
Database storage engines
 
Partitioning
PartitioningPartitioning
Partitioning
 
Mainframe Architecture & Product Overview
Mainframe Architecture & Product OverviewMainframe Architecture & Product Overview
Mainframe Architecture & Product Overview
 
S108 - 1 Billion Smartphones a year and counting – How is your CICS connected?
S108 - 1 Billion Smartphones a year and counting – How is your CICS connected?S108 - 1 Billion Smartphones a year and counting – How is your CICS connected?
S108 - 1 Billion Smartphones a year and counting – How is your CICS connected?
 
S3 l5 db2 - process model
S3 l5   db2 - process modelS3 l5   db2 - process model
S3 l5 db2 - process model
 
Application trends db2 day 2015 jorn
Application trends   db2 day 2015 jornApplication trends   db2 day 2015 jorn
Application trends db2 day 2015 jorn
 
Summary session 5
Summary session 5Summary session 5
Summary session 5
 
DB2 Systems Programming Tools of the Trade NA07B03
DB2 Systems Programming Tools of the Trade NA07B03DB2 Systems Programming Tools of the Trade NA07B03
DB2 Systems Programming Tools of the Trade NA07B03
 
DB2 Data Sharing Performance for Beginners
DB2 Data Sharing Performance for BeginnersDB2 Data Sharing Performance for Beginners
DB2 Data Sharing Performance for Beginners
 
Libro blanco espesantes essd
Libro blanco espesantes essdLibro blanco espesantes essd
Libro blanco espesantes essd
 

Similar to Multiple User Database Features and Administration

OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...Alex Zaballa
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...Alex Zaballa
 
Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008paulguerin
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slidesmetsarin
 
dbs class 7.ppt
dbs class 7.pptdbs class 7.ppt
dbs class 7.pptMARasheed3
 
Basics on SQL queries
Basics on SQL queriesBasics on SQL queries
Basics on SQL queriesKnoldus Inc.
 
Mohan Testing
Mohan TestingMohan Testing
Mohan Testingsmittal81
 
Relational Database Language.pptx
Relational Database Language.pptxRelational Database Language.pptx
Relational Database Language.pptxSheethal Aji Mani
 
Things you should know about Oracle truncate
Things you should know about Oracle truncateThings you should know about Oracle truncate
Things you should know about Oracle truncateKazuhiro Takahashi
 
SQL Server 2008 Performance Enhancements
SQL Server 2008 Performance EnhancementsSQL Server 2008 Performance Enhancements
SQL Server 2008 Performance Enhancementsinfusiondev
 
Clase 11 manejo tablas modificada
Clase 11 manejo tablas   modificadaClase 11 manejo tablas   modificada
Clase 11 manejo tablas modificadaTitiushko Jazz
 
Clase 11 manejo tablas modificada
Clase 11 manejo tablas   modificadaClase 11 manejo tablas   modificada
Clase 11 manejo tablas modificadaTitiushko Jazz
 
database-stucture-and-space-managment.ppt
database-stucture-and-space-managment.pptdatabase-stucture-and-space-managment.ppt
database-stucture-and-space-managment.pptIftikhar70
 
database-stucture-and-space-managment.ppt
database-stucture-and-space-managment.pptdatabase-stucture-and-space-managment.ppt
database-stucture-and-space-managment.pptsubbu998029
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAiougVizagChapter
 
Sql coding-standard-sqlserver
Sql coding-standard-sqlserverSql coding-standard-sqlserver
Sql coding-standard-sqlserverlochaaaa
 

Similar to Multiple User Database Features and Administration (20)

OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
 
Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
 
dbs class 7.ppt
dbs class 7.pptdbs class 7.ppt
dbs class 7.ppt
 
Basics on SQL queries
Basics on SQL queriesBasics on SQL queries
Basics on SQL queries
 
ADBMS Unit-II c
ADBMS Unit-II cADBMS Unit-II c
ADBMS Unit-II c
 
Mohan Testing
Mohan TestingMohan Testing
Mohan Testing
 
Relational Database Language.pptx
Relational Database Language.pptxRelational Database Language.pptx
Relational Database Language.pptx
 
Sql for dbaspresentation
Sql for dbaspresentationSql for dbaspresentation
Sql for dbaspresentation
 
DB2 TABLESPACES
DB2 TABLESPACESDB2 TABLESPACES
DB2 TABLESPACES
 
Things you should know about Oracle truncate
Things you should know about Oracle truncateThings you should know about Oracle truncate
Things you should know about Oracle truncate
 
SQL Server 2008 Performance Enhancements
SQL Server 2008 Performance EnhancementsSQL Server 2008 Performance Enhancements
SQL Server 2008 Performance Enhancements
 
PostgreSQL Terminology
PostgreSQL TerminologyPostgreSQL Terminology
PostgreSQL Terminology
 
Clase 11 manejo tablas modificada
Clase 11 manejo tablas   modificadaClase 11 manejo tablas   modificada
Clase 11 manejo tablas modificada
 
Clase 11 manejo tablas modificada
Clase 11 manejo tablas   modificadaClase 11 manejo tablas   modificada
Clase 11 manejo tablas modificada
 
database-stucture-and-space-managment.ppt
database-stucture-and-space-managment.pptdatabase-stucture-and-space-managment.ppt
database-stucture-and-space-managment.ppt
 
database-stucture-and-space-managment.ppt
database-stucture-and-space-managment.pptdatabase-stucture-and-space-managment.ppt
database-stucture-and-space-managment.ppt
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
 
Sql coding-standard-sqlserver
Sql coding-standard-sqlserverSql coding-standard-sqlserver
Sql coding-standard-sqlserver
 

Recently uploaded

Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 

Recently uploaded (20)

Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 

Multiple User Database Features and Administration

  • 1.
  • 2.  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.
  • 3.  DB2 Objects  DB2 Utilities  Restrictive States  Administration
  • 4.
  • 5.  Stogroup  Database  Tablespace  Tables  Indexes  Views
  • 6.  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.
  • 7.  Example > For NON SMS Managed: CREATE STOGROUP DSN8G910 VOLUMES (ABC005,DEF008) VCAT DSNCAT; > For SMS Managed: CREATE STOGROUP DSN8G910 VOLUMES (*) VCAT DSNCAT;
  • 8.  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.
  • 10.
  • 11. › Example: Create database DSN8D91P with storage group as DSN8G910 and Bufferpool as BP8K1 CREATE DATABASE DSN8D91P STOGROUP DSN8G910 BUFFERPOOL BP8K1;
  • 12.  Logical address space on secondary storage to hold one or more tables.  Three types of table spaces are : - Simple - Partitioned - Segmented
  • 13.  Simple  One or more table per tablespace  Space is composed of pages  Each page can contain rows of many tables
  • 14.  Example: CREATE TABLESPACE Tablespacename In Databasename USING STOGROUP Sgname PRIQTY mmm SECQTY nn ERASE NO LOCKSIZE ANY BUFFERPOOL BP0
  • 15. 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
  • 16.  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.
  • 17.  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.
  • 18. 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
  • 19. › 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;
  • 20.  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;
  • 21. > 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.
  • 22. › Example: CREATE UNIQUE INDEX DSN8910.XDEPT1 ON DSN8910.DEPT (DEPTNO ASC) USING STOGROUP DSN8G910 PRIQTY 512 SECQTY 64 ERASE NO BUFFERPOOL BP1;
  • 23.  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
  • 24.
  • 25.
  • 26.  Unload  Load  Reorg  Runstats  Copy
  • 27.  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
  • 28.  Authorization Required: › Ownership of the tables › SELECT privilege on the tables › DBADM authority for the database. › SYSADM authority › SYSCTRL authority (catalog tables only)
  • 29.  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.
  • 30.  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.
  • 31. 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)
  • 32.  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.
  • 33.  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.
  • 34.  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.
  • 35. › 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.
  • 36. ▪ 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.
  • 37.  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.
  • 38.  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
  • 39.  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))
  • 40.  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.
  • 41.  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.
  • 42.  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)).
  • 43.
  • 44.  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.
  • 45.  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
  • 46.  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.
  • 47.  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.
  • 48. › 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.
  • 49.
  • 50.  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.
  • 51. › 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.
  • 52.  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)
  • 53.  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.
  • 54.  Authorization Required › STATS privilege for the database › DBADM, DBCTRL, or DBMAINT authority for the database › SYSCTRL or SYSADM authority
  • 55.  Execution Phases › UTILINIT Performs initialization  RUNSTATS  Scans table space or index and updates catalog.  UTILTERM  Performs cleanup
  • 56.  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)
  • 57.  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
  • 58.  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 .
  • 59.  Used for taking Image Copies of – › table space › table space partition › data set of a linear table space › index space, or index space partition
  • 60.  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.
  • 61.  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.
  • 62.  Execution phases › UTILINIT  Performs initialization and setup › REPORT  Reports for CHANGELIMIT option › COPY  Copies › UTILTERM  Performs cleanup
  • 63.  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 /*
  • 64.  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
  • 65.  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
  • 66. › Execution Phases:  UTILINIT  Performs initialization and setup.  UNLOAD  Unloads index entries.  SORT  Sorts unloaded index entries.  BUILD  Builds indexes.
  • 67.  SORTBLD  Sorts and builds a table space for parallel index build processing.  UTILTERM  Performs cleanup.
  • 68. › 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
  • 69.  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.
  • 70. › Authorization Required:  RECOVERDB privilege for the database  DBADM or DBCTRL authority for the database.  SYSCTRL or SYSADM authority
  • 71.  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
  • 72.
  • 73.  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
  • 74.  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.
  • 75.  COPY-pending status (COPY) › indicates that the affected object must be copied. › Corrective Action:  Copy the affected table space.  Copy the affected index.
  • 76.  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.
  • 77.  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.
  • 78.  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.
  • 79.
  • 80.  -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
  • 81.
  • 82.  -STOP DB2 › stops the DB2 subsystem › Authorization  STOPALL privilege  SYSOPR authority  SYSCTRL authority  SYSADM authority › Example:  -DB2P STOP DB2
  • 83. › -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.
  • 84.  -DISPLAY THREAD (DB2) › displays current status information about DB2 threads. › Authorization:  DISPLAY privilege  SYSOPR authority  SYSCTRL authority  SYSADM authority
  • 86.  -CANCEL THREAD (token) › cancels processing for specific local or distributed threads. › Authorization:  SYSOPR authority  SYSCTRL authority  SYSADM authority
  • 88.  -DISPLAY UTILITY (DB2) › displays the status of utility jobs › Authorization Required:  None
  • 89. › 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
  • 90.  -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
  • 91. › 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*)
  • 92.  START DATABASE › Makes a database or individual partitions available.  STOP DATABASE › Makes a database or individual partitions unavailable after existing users have quiesced.
  • 93.  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.
  • 94. › Example:  -START DATABASE (DSN8D91A) SPACENAM(TEMPTS)  -START DATABASE (DSN8D91A) SPACENAM(*) ACCESS(RO) The system responds with this message: DSN9022I - DSNTDDIS ’-START DATABASE’ NORMAL COMPLETION
  • 95.  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).
  • 96. › -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.
  • 97. › 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)
  • 98.
  • 99.
  • 100. › 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.
  • 101. › 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)
  • 102.  Use the DISPLAY DATABASE command to determine which programs are holding locks on an object. › Syntax: -DISPLAY DATABASE(Dbname) SPACENAM(Tsname) LOCKS
  • 103.
  • 104.  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.
  • 105.
  • 106.  Use the DISPLAY BUFFERPOOL command, which displays the current status for one or more active or inactive buffer pools. › Example:  -DISPLAY BUFFERPOOL(BP0)
  • 107.
  • 108.  ALTER BUFFERPOOL alters attributes for active or inactive buffer pools.  Authorization: › SYSOPR authority › SYSCTRL authority › SYSADM authority › Example: -ALTER BUFFERPOOL(BP0) VPSIZE(2000)
  • 109.
  • 110.  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
  • 111.  The tables in the DSNDB06 database › Record information about  objects  authorization  plans/packages/stored procedures  recovery (image copy, REORG, etc.)  statistics  string translation
  • 112.  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.
  • 113.  SYSIBM.SYSINDEXES table The SYSIBM.SYSINDEXES table contains one row for every index.  SYSIBM.SYSPACKAUTH table The SYSIBM.SYSPACKAUTH table records the privileges that are held by users over packages.  SYSIBM.SYSPLAN table The SYSIBM.SYSPLAN table contains one row for each application plan.
  • 114.  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.
  • 115.  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.
  • 116.  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.
  • 117.  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.
  • 118. 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.
  • 119. 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.
  • 120.
  • 121.  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.
  • 122.
  • 123.
  • 124.
  • 125.
  • 126.