Documente Academic
Documente Profesional
Documente Cultură
Intelligence
Data
Centre
Cloud
Mobility
Student Manual
Comunidad de Madrid
UNIN EUROPEA
FONDO SOCIAL EUROPEO
El Fondo Social Europeo invierte en tu futuro
EDUCATION
S
V5.4.0.3
cover
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Front cover
Student Exercises
pr
Ex
cl
ERC 7.0
Student Exercises
Trademarks
The reader should recognize that the following terms, which appear in the content of this
training document, are official trademarks of IBM or other companies:
IBM is a registered trademark of International Business Machines Corporation.
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
The following are trademarks of International Business Machines Corporation in the United
States, or other countries, or both:
AIX
DRDA
Notes
QMF
z/OS
CICS
IMS
OS/390
RACF
zSeries
DB2
Lotus
Parallel Sysplex
RETAIN
1-2-3
Java and all Java-based trademarks and logos are trademarks of Sun Microsystems, Inc.
in the United States, other countries, or both.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or
both.
Windows is a trademark of Microsoft Corporation in the United States, other countries, or
both.
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Ex
cl
Other product and service names might be trademarks of IBM or other companies.
pr
The information contained in this document has not been submitted to any formal IBM test and is distributed on an as is basis without
any warranty either express or implied. The use of this information or the implementation of any of these techniques is a customer
responsibility and depends on the customers ability to evaluate and integrate them into the customers operational environment. While
each item may have been reviewed by IBM for accuracy in a specific situation, there is no guarantee that the same or similar results will
result elsewhere. Customers attempting to adapt these techniques to their own environments do so at their own risk.
V5.4.0.3
Student Exercises
Contents
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Exercises description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
2-1
2-2
2-3
2-4
2-5
2-6
2-7
cl
pr
Ex
TOC
Contents
iii
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Student Exercises
iv
V5.4.0.3
Student Exercises
Trademarks
The reader should recognize that the following terms, which appear in the content of this
training document, are official trademarks of IBM or other companies:
IBM is a registered trademark of International Business Machines Corporation.
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
The following are trademarks of International Business Machines Corporation in the United
States, or other countries, or both:
AIX
DRDA
Notes
QMF
z/OS
CICS
IMS
OS/390
RACF
zSeries
DB2
Lotus
Parallel Sysplex
RETAIN
1-2-3
Java and all Java-based trademarks and logos are trademarks of Sun Microsystems, Inc.
in the United States, other countries, or both.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or
both.
Windows is a trademark of Microsoft Corporation in the United States, other countries, or
both.
UNIX is a registered trademark of The Open Group in the United States and other
countries.
cl
Other product and service names might be trademarks of IBM or other companies.
pr
Ex
TMK
Trademarks
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Student Exercises
vi
V5.4.0.3
Student Exercises
Exercises description
Exercise instructions
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Use the information you have learned in the unit presentation to work
through each exercise. You should also make use of your Student
Notebook and the DB2 manuals.
Note
Your instructor will assign each team a 2-digit team ID, for example, 21, 22, and so on.
cl
For those who are experienced and fast, optional lab steps are
provided, which are sometimes a bit more challenging. But the
majority of students should concentrate on performing the normal lab
steps. These are totally sufficient to meet the course objectives. And
these students should be careful not to waste their time with these
optional steps at the expense of the important labs for each unit.
pr
Ex
pref
Exercises description
vii
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Logging on (1 of 3)
Figure 1. Logging on (1 of 3)
CV8317.0
Notes:
cl
Your Personal Communications session will already be configured with the host name
mopedvm2.ilsvpn.ibm.com and you should see the screen above.
We shall be accessing the IBM Training system MOPEDVM2 in Montpellier via the Internet.
Ex
The Aventail client software will enable you to access this system and this software should
already be running on your PC.
pr
On the command line, type the designated z/OS system assigned to your lab, such as
MVSDI11, and press Enter.
viii
V5.4.0.3
Student Exercises
pref
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Logging on (2 of 3)
Figure 2. Logging on (2 of 3)
CV8317.0
Notes:
Type TSO followed by space, followed by your TSO user ID. Your TSO userid will be
allocated by your instructor and will be something like, for example, TSOUB01.
pr
Ex
cl
Press Enter.
Exercises description
ix
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Logging on (3 of 3)
Figure 3. Logging on (3 of 3)
CV8317.0
Notes:
cl
Ex
pr
Press Enter.
V5.4.0.3
Student Exercises
pref
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
CV8317.0
Notes:
cl
Ex
- Check via DB2I option D that your DB2 name is set to the correct subsystem
identifier.
Option 3.4 will take you to your partitioned data set and the skeleton members.
pr
- Each team is provided with a partitioned data set named userid.CV83.CNTL which
contains the edited skeleton members used in the machine exercises.
Exercises description
xi
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Student Exercises
xii
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
You should also be familiar with the type of information held in the DB2
catalog for databases and table spaces.
1-1
Student Exercises
Exercise instructions
Note
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Throughout these exercises, search for ?? within the PDS members provided for each
problem and replace any ?? with your team ID. Not all members will contain ??.
Creating a database
The name of the default buffer pool to be used for table spaces created within
the database should be BP1.
The name of the default buffer pool to be used for indexes created within the
database should be BP2.
The name of the default storage group to be used to support the DASD space
requirements for table spaces and indexes created within the database should
be WWV83??S, where ?? represents your team ID. This storage group has
already been created for you.
When creating the following table spaces, do not specify any other than the requested
options:
__ 2. Create a segmented table space named TSLOCN in your database.
cl
Ex
__ 4. Create a range partitioned universal table space named TSEMPL in your database.
TSEMPL should contain 3 partitions. SEGSIZE, if required, should be 4.
pr
1-2
V5.4.0.3
Student Exercises
EXempty
__ 6. Execute member L1QUERY1 using SPUFI. By referring to DB2 Catalog Tables topic
in Appendix "Additional Information for DB2 SQL" of the SQL Reference manual
(SYSIBM.SYSDATABASE), explain the meaning of the values held for each column.
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
__ 7. Execute member L1QUERY2 using SPUFI. By referring to DB2 Catalog Tables topic
in Appendix "Additional Information for DB2 SQL" of the SQL Reference manual
(SYSIBM.SYSTABLESPACE), explain the meaning of the values held for each
column.
__ 8. Execute member L1QUERY3 using SPUFI. By referring to DB2 Catalog Tables topic
in Appendix "Additional Information for DB2 SQL" of the SQL Reference manual
(SYSIBM.SYSTABLEPART), explain the meaning of the values held for each
column.
Optional Labs
Which volumes are recorded in the DB2 catalog for the storage group you use?
_________________________
If explicit volumes are defined, can you be sure that the data sets of your table
spaces are stored on these? ________ Why?
__________________________________________________________
__________________________________________________________
__ 10. What are the names of the VSAM clusters of your table space TSEMPL?
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
__ 11. On which volume does the data set of partition 1 of table space TSEMPL reside?
___________
cl
__ 12. Execute the statement provided in member L1CREATE. Why does the CREATE
TABLESPACE statement fail?
Ex
a. You try to answer this question almost on your own, with a few hints only.
pr
a. Few hints: Inspect the DB2 address space which issues messages. Or
inspect the syslog. Which reason is given?
__________________________________
Is that really the reason, in other words, is there really a difference to the
previous CREATE TABLESPACE statements, which were successful? What
else could be the reason?
1-3
Student Exercises
b. More hints: First follow the previous section Few hints. Use SDSF and
inspect either the DB2 master address space (ssnnMSTR) or the SYSLOG.
In either case, in order to find the error message(s), look for a portion of the
data set name you intended to define (containing db name and ts name):
WWV83ZZD.TEST??A.
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Determine from the DB2 catalog the vcat specifications used for TEST??A
__________ and for the other, previously created table spaces: ____________.
Test via ISPF 3.4 whether an alias for these two high-level qualifiers exist at all
(by entering their name in the dsname level field). DB2 can only create a data
set if an alias has been defined for the high-level qualifier or if DB2 is allowed to
update the z/OS master catalog (not recommended, and not allowed on our
system).
pr
Ex
cl
End of exercise
1-4
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
Be familiar with the type of information held in the DB2 catalog for
tables
2-1
Student Exercises
Table LOCATION
LOCATION
Null
LOCID
ADDRESS
CITY
POSTAL_CODE
Data Type
(Length)
CHAR(10)
CHAR(30)
CHAR(30)
CHAR(15)
Description
NO
NO
NO
NO
COUNTRY
CHAR(30)
NO
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Column Name
CV8317.0
Notes:
The six tables which you will create in this exercise are described on this and the following
pages. Take time to browse these pages before you start the exercise. The exercise
instructions begin on page 2-8.
pr
Ex
cl
2-2
V5.4.0.3
Student Exercises
EXempty
Table DEPARTMENT
DEPARTMENT
Data Type
(Length)
DEPTNO
CHAR(3)
SUPERIOR_DEPTNO CHAR(3)
Null
Description
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Column Name
MGRNO
NAME
CV8317.0
Notes:
pr
Ex
cl
2-3
Student Exercises
Table EMPLOYEE
EMPLOYEE
Data Type
(Length)
CHAR(6)
CHAR(20)
CHAR(1)
CHAR(1)
DATE
CHAR(4)
DATE
CHAR(20)
SMALLINT
DECIMAL(9,2)
DECIMAL(9,2)
DECIMAL(9,2)
CHAR(3)
CHAR(10)
VARCHAR(50)
Null
Description
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Column Name
EMPNO
FIRST_NAME
MIDDLE_INITIAL
SEX
BIRTHDATE
PHONE
HIRING_DATE
JOB
EDUCATION
SALARY
BONUS
COMMISSION
DEPTNO
LOCID
LAST_NAME
NO
NO
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
CV8317.0
Notes:
pr
Ex
cl
2-4
V5.4.0.3
Student Exercises
EXempty
Table PROJECT
PROJECT
Data Type
(Length)
CHAR(6)
CHAR(3)
CHAR(6)
DECIMAL(5,2)
DATE
DATE
VARCHAR(50)
Null
Description
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Column Name
PROJNO
DEPTNO
EMPNO
STAFFING
START_DATE
END_DATE
NAME
NO
NO
NO
YES
YES
YES
NO
CV8317.0
Notes:
pr
Ex
cl
2-5
Student Exercises
Null
Description
NO
NO
Data Type
(Length)
CHAR(6)
CHAR(6)
SMALLINT
Null
Description
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Column Name
PROJNO
EMPNO
ACTIVITY
Column Name
PROJNO
EMPNO
SEQNO
CODE
TIME_SPENT
START_DATE
END_DATE
NO
NO
NO
CV8317.0
Notes:
The rows in the ON_PROJECT table describe which employees have been assigned to
which projects independently of activities. Not all employees assigned to a project have
activities for the project.
pr
Ex
cl
Each row of the ACTIVITY table describes an activity performed by an employee for a
project.
2-6
V5.4.0.3
Student Exercises
EXempty
Table spaces
TYPE
TABLES
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
TABLE SPACE
SEGMENTED
(SEGSIZE 4)
TSLOCN
RANGE PARTITIONED
(NUMPARTS 3 and
SEGSIZE 4)
PARTITION BY GROWTH
(MAXPARTITIONS 5
and SEGSIZE 32)
TSEMPL
TSDEPT
SEGMENTED
(SEGSIZE 4)
TSPROJ
LOCATION
EMPLOYEE
DEPARTMENT
1. PROJECT
2. ON_PROJECT
3. ACTIVITY
CV8317.0
Notes:
cl
Ex
- ON_PROJECT
pr
- ACTIVITY
2-7
Student Exercises
Exercise instructions
Note
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Throughout the exercise, search for ?? within the pdf member provided for each problem
and replace any ?? with your team ID. Not all members will contain ??.
Creating tables
__ 1. Member L2LOCN contains an SQL statement to create the LOCATION table. Edit
the member and specify that the table should be created in table space TSLOCN in
your database.
__ 2. Execute the statement using SPUFI. SQLCODE 0 should be returned.
__ 5. Member L2PROJ contains an SQL statement to create the PROJECT table. Edit the
member and specify that the table should be created in table space TSPROJ in your
database.
__ 6. Execute the statement using SPUFI. SQLCODE 0 should be returned.
cl
__ 9. Member L2ACTY contains an SQL statement to create the ACTIVITY table. Edit the
member and specify that the table should be created in table space TSPROJ in your
database.
Ex
pr
__ 11. Create an SQL statement to create the EMPLOYEE table. The name, data type,
length, and null attribute for each column are shown in the visual on Table
EMPLOYEE on page 2-4. Take care to make sure that you specify the columns
correctly. In addition, specify a table check constraint, which ensures that column
SEX can only have a value of 'F' or 'M'.
Enable table-controlled partitioning using EMPNO as the key column and specify
the limit key values for the three partitions as follows:
'000150' for partition 1
'000230' for partition 2
2-8
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
__ 13. Execute member L2QUERY1 using SPUFI. By referring to DB2 Catalog Tables topic
in Appendix "Additional Information for DB2 SQL" of the SQL Reference manual
(SYSIBM.SYSTABLES), explain the meaning of the values held for each column.
__ 14. Execute member L2QUERY2 using SPUFI. By referring to DB2 Catalog Tables topic
in Appendix "Additional Information for DB2 SQL" of the SQL Reference manual
(SYSIBM.SYSTABLESPACE), explain the meaning of the values held for each
column.
__ 15. Execute member L2QUERY3 using SPUFI. By referring to DB2 Catalog Tables topic
in Appendix "Additional Information for DB2 SQL" of the SQL Reference manual
(SYSIBM.SYSCOLUMNS), explain the meaning of the values held for each column.
Optional labs
__ 16. Query the two catalog tables which document the check constraint you have
defined.
__ 17. Query the appropriate catalog table to verify the external and internal limit keys for
your table-controlled partition table.
pr
Ex
cl
End of exercise
2-9
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Student Exercises
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
3-1
Student Exercises
Exercise instructions
Note
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Throughout the exercise, search for ?? within the pdf member provided for each problem
and replace any ?? with your team ID. Not all members will contain ??.
__ 1. Examine member L301 which contains an SQL statement to create view V1. A table
called EMP has already been created for you to use in this exercise and the table
has been loaded with data. The definition of EMP is the same as table EMPLOYEE
which is documented on page 2-4.
__ 2. Execute member L301 using SPUFI. SQLCODE 0 should be returned.
__ 3. Execute member L302 using SPUFI and examine the rows returned by each query.
__ 4. Examine member L303 which inserts two rows into table EMP using view V1. Note
that the first row inserted has a SALARY column value less than 20000, and the
second row inserted has a SALARY column value greater than 20000.
__ 5. Execute member L303 using SPUFI. Why are both INSERTs successful?
__ 6. Execute member L302 using SPUFI and examine the rows returned by each query.
__ 7. Execute member L304 using SPUFI. Why is the row deleted?
__ 8. Execute member L305 using SPUFI. Why is the row not found?
__ 9. Execute member L302 using SPUFI and examine the rows returned by each query.
Notice that the row with a SERIAL_NUMBER of 000360 is not returned by the first
query.
cl
__ 10. Execute member L306 using SPUFI. Why is the row updated?
__ 11. Execute member L307 using SPUFI. Why is the row not found?
Ex
__ 12. Execute member L302 using SPUFI and examine the rows returned by each query.
Notice that the row with a SERIAL_NUMBER of 000260 is no longer returned by the
first query.
pr
__ 13. Examine member L308 which contains an SQL statement to create view V2. Notice
that the view definition contains the WITH CHECK OPTION clause.
__ 14. Execute member L308 using SPUFI. SQLCODE 0 should be returned.
__ 15. Execute member L309 using SPUFI. Why does the second INSERT fail?
__ 16. Execute member L310 using SPUFI. Why does the second UPDATE fail?
3-2
V5.4.0.3
Student Exercises
EXempty
__ 17. Examine member L311 which contains an SQL statement to create view V3. Notice
that the view definition does not include column EDUCATION.
__ 18. Execute member L311 using SPUFI. SQLCODE 0 should be returned.
__ 19. Execute member L312 using SPUFI. Why does the INSERT fail?
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
__ 20. Execute member L3QUERY1 using SPUFI. By referring to DB2 Catalog Tables topic
in Appendix "Additional Information for DB2 SQL" of the SQL Reference manual
(SYSIBM.SYSTABAUTH), explain the meaning of the values held for each column.
pr
Ex
cl
End of exercise
3-3
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Student Exercises
3-4
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
- Partitioning
- Partitioned
pr
Ex
cl
Be familiar with the type of information held in the DB2 catalog for
indexes
4-1
Student Exercises
Exercise instructions
Creating indexes
Index Name
Key Columns
LOCATION
IXLOCN1
LOCID
Unique
Clustering
Yes
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Table Name
DEPARTMENT
IXDEPT1
DEPTNO
DEPARTMENT
IXDEPT2
MGRNO
DEPARTMENT
IXDEPT3
SUPERIOR_DEPTNO
EMPLOYEE
IXEMPL1
EMPNO
EMPLOYEE
IXEMPL2
DEPTNO
EMPLOYEE
IXEMPL3
LOCID
PROJECT
IXPROJ1
PROJNO
PROJECT
IXPROJ2
DEPTNO
PROJECT
IXPROJ3
EMPNO
ON_PROJECT
IXONPR1
PROJNO,EMPNO
ON_PROJECT
IXONPR2
EMPNO
ACTIVITY
IXACTY1
PROJNO,EMPNO,SEQNO
ACTIVITY
IXACTY2
EMPNO
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
cl
__ 1. Create CREATE INDEX statements to define the first 4 indexes listed in the above
table. For each index, specify only the attributes which are stated in the table. All
indexes should be defined as ascending (which is the default). Execute the
statements using SPUFI.
Ex
__ 2. In contrast to working interactively using SPUFI, perform this step in batch: Submit
the job containing the DB2 sample program DSNTEP2 (in member L4CREATE) to
create the remaining 10 indexes listed in the above table. Thereby ensure that:
__ a. The index IXEMPL1 consists of as many data sets as its underlying table space.
pr
__ b. DB2 tries to store the EMPLOYEE data according to the sequence of this index
IXEMPL1.
__ c. The index IXONPR1 is defined as requested.
Use SDSF to see the job output and check for successful execution.
4-2
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
__ 4. Execute member L4QUERY2 using SPUFI. By referring to DB2 Catalog Tables topic
in Appendix "Additional Information for DB2 SQL" of the SQL Reference manual
(table SYSIBM.SYSINDEXPART), explain the meaning of the values held for the
selected columns.
__ 5. Execute member L4QUERY3 using SPUFI. By referring to DB2 Catalog Tables topic
in Appendix "Additional Information for DB2 SQL" of the SQL Reference manual
(table SYSIBM.SYSKEYS), explain the meaning of the values held for the selected
columns.
Optional labs:
__ 6. Using DB2I, option 7, display the status of your database and its table spaces and
index spaces via the DB2 command -DISPLAY DATABASE (..).
__ 7. List the VSAM clusters of your table spaces and index spaces.
pr
Ex
cl
End of exercise
4-3
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Student Exercises
4-4
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
Be familiar with the type of information held in the DB2 catalog for a
referential structure.
5-1
Student Exercises
Referential structure
LOCATION
LOCID
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
NA
EMPLOYEE
DEPTNO
LOCID
EMPNO
SN
NA
DEPARTMENT
PROJECT
SN
SUPERIOR_
DEPTNO
PROJNO
DEPTNO
MGRNO
NA
NA
DEPTNO
EMPNO
C
ON_PROJECT
PROJNO
EMPNO
ACTIVITY
PROJNO
EMPNO
SEQNO
CV8317.0
Notes:
The visual shows the referential structure which will be defined in this exercise. The
primary keys are shown by the dark boxes, and each arrow points from a primary key to a
foreign key. The notation used for the referential delete rules is as follows:
cl
Ex
pr
Take time to study the visual before you start the exercise. The exercise instructions begin
on the next page.
5-2
V5.4.0.3
Student Exercises
EXempty
Exercise instructions
Defining primary keys
Primary Key Columns
LOCATION
LOCID
LOCID
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Parent Table
DEPARTMENT
DEPTNO
DEPTNO
EMPLOYEE
EMPNO
EMPNO
PROJECT
PROJNO
PROJNO
ON_PROJECT
PROJNO,EMPNO
PROJNO_EMPNO
ACTIVITY
PROJNO,EMPNO,SEQNO
PROJNO_EMPNO_SEQNO
__ 1. Create ALTER TABLE statements to define the primary key for each of the tables
listed above. Make sure that you remember to specify the Primary Key Constraint
Name. Execute the statements using SPUFI.
pr
Ex
cl
5-3
Student Exercises
Referential
Constraint
Name
Delete Rule
DEPARTMENT
DEPARTMENT
SUPERIOR_DEPTNO
DD
NO ACTION
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Parent Table
EMPLOYEE
DEPARTMENT
MGRNO
ED
SET NULL
LOCATION
EMPLOYEE
LOCID
LE
NO ACTION
DEPARTMENT
EMPLOYEE
DEPTNO
DE
SET NULL
DEPARTMENT
PROJECT
DEPTNO
DP
NO ACTION
EMPLOYEE
PROJECT
EMPNO
EP
NO ACTION
EMPLOYEE
ON_PROJECT
EMPNO
EO
CASCADE
PROJECT
ON_PROJECT
PROJNO
PO
CASCADE
ON_PROJECT
ACTIVITY
PROJNO,EMPNO
OA
CASCADE
__ 2. Create ALTER TABLE statements to define the first 2 foreign keys listed in the
above table (that is, where DEPARTMENT is the dependent table). Make sure that
you remember to specify the referential constraint name. Execute the statements
using SPUFI.
__ 3. Execute member L5ALTER using SPUFI to define the remaining 7 foreign keys
listed in the above table. Edit this member to ensure that the foreign key on
ACTIVITY is defined as requested.
Ex
cl
__ 4. Execute member L5QUERY1 using SPUFI. By referring to DB2 Catalog Tables topic
in Appendix "Additional Information for DB2 SQL" of the SQL Reference manual
(tables SYSIBM.SYSTABCONST, SYSIBM.SYSKEYCOLUSE, and
SYSIBM.SYSRELS), explain the meaning of the values held for the selected
columns.
pr
Optional lab
__ 5. In which catalog table exists one row per foreign key column? ________________
Query this table for your foreign key columns. How many rows pertain to your 9
referential relationships? ___ Why? ___________________________________
End of exercise
5-4
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
- CHECK DATA
pr
Ex
cl
- UNLOAD
6-1
Student Exercises
Exercise instructions
Note
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Throughout the exercise, search for ?? within the pdf member provided for each problem
and replace any ?? with your team ID. Not all members will contain ??.
LOCID
001:010
ADDRESS
011:040
CITY
041:070
POSTAL_CODE
071:085
COUNTRY
086:115
cl
We are now going to use DB2 Interactive (DB2I) to build a LOAD utility job to load the
LOCATION table.
Ex
pr
Copy the JOB statement present in member $JC in your CV83.CNTL data set.
Press Enter.
6-2
V5.4.0.3
Student Exercises
EXempty
DB2 UTILITIES
SSID: DSNB
===>
Select from the following:
1 FUNCTION ===> EDITJCL
2 JOB ID
===> userid
3 UTILITY ===> LOAD
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
5 RESTART ===> NO
Fill in field 1 as shown. Choosing this option means that you want to view the JCL
before submitting the utility job.
Fill in field 2 with the value of your TSO userid.
Fill in field 3 with the name of the utility you want to run, which is LOAD.
Fill in field 4 as shown. This is the name of the data set and member which contains
your LOAD utility control statement.
cl
Press Enter.
pr
Ex
You will now be presented with the Data Set Names panel shown on the next page.
6-3
Student Exercises
SSID: DB26
===>
Enter data set name for LOAD, REORG TABLESPACE, or UNLOAD:
1 RECDSN
===> CV83.TSLOCN.DATA
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Enter output data sets for local/current site for COPY, MERGECOPY,
LOAD, or REORG TABLESPACE:
3 COPYDSN ===>
4 COPYDSN2 ===>
Enter output data sets for recovery site for COPY, LOAD, or REORG
TABLESPACE:
5 RCPYDSN1 ===>
6 RCPYDSN2 ===>
Enter output data sets for REORG or UNLOAD
7 PUNCHDSN ===>
F1=HELP
F7=UP
F2=SPLIT
F8=DOWN
F3=END
F9=SWAP
F4=RETURN
F10=LEFT
F5=RFIND
F11=RIGHT
F6=RCHANGE
F12=RETRIEVE
Fill in field 1 as shown. This is the name of the data set which contains the records to be
loaded.
Fill in field 2 as shown. This is the name of the data set to be used for discard
processing.
Blank out fields 3, 4, 5, 6, and 7.
Press Enter.
After you have viewed the utility job, specify SUBMIT on the editor command line to
submit the job.
cl
pr
Ex
The utility should end with return code 0. Use SDSF to view the utility output.
6-4
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
__ 3. How does the LOAD utility know when to set the MGRNO column value for a row to
NULL?
__ 4. How does the LOAD utility know the length of the input data for column NAME?
__ 5. Should the control statement specify ENFORCE CONSTRAINTS (which is the
default) or ENFORCE NO? Edit member L6TSDEPT accordingly.
__ 6. Using DB2I, prepare a utility job to load the DEPARTMENT table. The name of the
data set which contains the records to be loaded is CV83.TSDEPT.DATA, and the
name of the data set to be used for discard processing is CV83.TSDEPT.DISCARD.
__ 7. Submit the utility job. The utility should end with return code 4.
__ 8. Use SDSF to view the utility output. Why were two rows deleted during the
INDEXVAL phase? Has table space TSDEPT been placed in a pending state?
__ 9. Select DB2 COMMANDS on the DB2I panel.
__ 10. Execute a -DISPLAY DATABASE command to confirm that table space TSDEPT has
been placed in a pending status. The pending status will be corrected in Steps 15
to 23.
__ 11. The utility control statement to load the EMPLOYEE table is supplied in member
L6TSEMPL. Why can the control statement specify (by default) ENFORCE
CONSTRAINTS?
cl
__ 12. Using DB2I, prepare a utility job to load the EMPLOYEE table. The name of the data
set which contains the records to be loaded is CV83.TSEMPL.DATA, and the name
of the data set to be used for discard processing is CV83.TSEMPL.DISCARD.
__ 13. Submit the utility job. The utility should end with return code 4.
pr
Ex
__ 14. Use SDSF to view the utility output. Why were three rows discarded during the
RELOAD phase? Why were three rows deleted during the ENFORCE phase?
6-5
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
__ 15. Recall that table space TSDEPT is in check pending state. You should run the
CHECK DATA utility to remove the check pending state. However, before running
the CHECK DATA utility against table space TSDEPT, you need to create exception
tables for the dependent tables. Edit member L6EXCEPT, change all occurrences of
?? to your team ID, and make a note of the names of the exception tables. Execute
the statements using SPUFI. SQLCODE 0 should be returned.
__ 16. Create a member which contains a CHECK DATA utility control statement to check
table space TSDEPT. Specify the DELETE NO option.
__ 17. Using DB2I, prepare a utility job to run the CHECK DATA utility, and submit the utility
job. The utility should end with return code 4.
__ 18. Use SDSF to view the utility output. Has table space TSDEPT remained in check
pending status? How many rows has CHECK DATA found to be invalid, and why?
__ 19. Execute member L6SELECT using SPUFI to query the contents of the exception
tables for DEPARTMENT and EMPLOYEE.
__ 20. Create a member which contains a CHECK DATA utility control statement to check
table space TSDEPT. Specify the DELETE YES option.
__ 21. Using DB2I, prepare a utility job to run the CHECK DATA utility and submit the utility
job. The utility should end with return code 4.
__ 22. Use SDSF to view the utility output. Verify that table space TSDEPT is no longer in
check pending status. How many rows has CHECK DATA deleted from table
DEPARTMENT, and why?
cl
__ 23. Execute member L6SELECT using SPUFI to query the contents of the exception
tables for DEPARTMENT and EMPLOYEE. Try to explain why CHECK DATA
deleted the rows which are listed for the second run of the utility.
Ex
pr
__ 24. Using DB2I, prepare a utility job to load the PROJECT table. The utility control
statement is supplied in member L6TSPRJ1. The name of the data set which
contains the records to be loaded is CV83.TSPROJ.DATA1, and the name of the
data set to be used for discard processing is CV83.TSPROJ.DISCARD1.
__ 25. What is the purpose of using the keyword STATISTICS in the LOAD utility control
statement when loading the PROJECT table?
__ 26. Submit the utility job. The utility should end with return code 0.
__ 27. Use SDSF to view the utility output.
6-6
V5.4.0.3
Student Exercises
EXempty
__ 28. Using DB2I, prepare a utility job to load the ON_PROJECT and ACTIVITY tables.
The utility control statement is supplied in member L6TSPRJ2. The name of the
data set which contains the records to be loaded is CV83.TSPROJ.DATA2, and the
name of the data set to be used for discard processing is
CV83.TSPROJ.DISCARD2.
__ 29. Submit the utility job. The utility should end with return code 8.
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
__ 31. Why did the utility fail? Edit member L6TSPRJ2 and add an option so that the LOAD
utility adds to the existing data already present in table space TSPROJ.
__ 32. Submit the utility job. The utility should end with return code 0.
__ 33. Use SDSF to view the utility output.
a. Can the REPLACE option of the LOAD utility be used to replace the existing data for
the ON_PROJECT and ACTIVITY tables while preserving the data for the
PROJECT table?
b. How was the use of REPLACE option appropriate when the PROJECT table data
was loaded?
c. Assuming you have reset the ACTIVITY table, can you repeat steps 28 to 30 to load
the ON_PROJECT and ACTIVITY tables?
cl
__ 34. Create a partition by growth universal table space named TSNEWDEP in your
database. The maximum data set size should be 1 GB and TSNEWDEP should be
able to grow up to a maximum of 5 partitions. Also, specify that you want 99 percent
of each page to be left as free space and every other page should be a page of free
space when the table space or partition is loaded or reorganized. Create table
NEWDEPT which is identical to your table DEPARTMENT, but without any primary
or foreign keys, in the table space TSNEWDEP in your database. Use member
L6PBG1.
Ex
__ 35. Examine the catalog tables to note the important information for table space
TSNEWDEP in your database. Use member L6PBG2.
__ 36. How many partitions are created?
pr
Determine this from the catalog table information and also using ISPF 3.4 by using
DBDSNB.DSNBB*.WWV83??D.TSNEWDEP (where ?? is your team-id) to narrow
the search.
__ 37. Using DB2I, prepare and run a utility job to load the NEWDEPT table. The utility
control statement is in member L6PBG3. The name of the data set which contains
6-7
Student Exercises
the records to be loaded is CV83.TSNEWDEP.DATA, and the name of the data set
to be used for discard processing is CV83.TSNEWDEP.DISCARD.
Please be patient as it will take a few minutes to complete.
__ 38. After the successful completion of the LOAD utility, how many partitions do you see?
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Determine this from the utility output messages and also using ISPF 3.4 by using
DBDSNB.DSNBB*.WWV83??D.TSNEWDEP (where ?? is your team-id) to narrow
the search.
__ 39. Drop the table space TSNEWDEP in your database. Use member L6PBG4.
Unloading data
__ 40. Create a member called L6UNLOAD in your CV83.CNTL library with an UNLOAD
utility control statement to unload data in EBCDIC from the table space TSPROJ.
__ 41. Try to unload from TSPROJ in delimited format (at least from table PROJECT). Use
the default characters for column delimiter, string delimiter, and decimal point. In
order not to override the previous data sets, specify new names for the unload and
punch data sets.
Examine what these data sets contain after the UNLOAD utility completes
successfully.
__ a. To this end, create a view which lists the department by employees, and the
manager who is responsible for this department:
pr
Ex
cl
---------+---------+---------+---------+----EMPNO
LAST_NAME
DEPTNO MGRNO
MGRNAME
---------+---------+---------+---------+----000010 HAAS
A00
000010 HAAS
000110 LUCCHESI
A00
000010 HAAS
000120 O'CONNELL
A00
000010 HAAS
000020 THOMPSON
B01
000020 THOMPSON
000030 KWAN
C01
000030 KWAN
....
(You may create the view on your own or use the member L6VIEW provided.)
__ b. Use the DB2 sample program DSNTIAUL for unloading; see member L6TIAUL.
Add a second query involving a join into the same job. (Each SQL statement
must end with a semicolon.) DSNTIAUL generates separate output data sets per
6-8
V5.4.0.3
Student Exercises
query and one additional data set with pertinent LOAD statements. Specify some
meaningful output data set names (the provided DDNAMEs are fixed).
EXempty
__ c. Inspect the three output data sets. Can you use the generated LOAD statements
without modification? ____ Why? ___________________________________
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
__ 43. In order to consolidate what you learned about the data page structure, use the DB2
stand-alone utility DSN1PRNT to print the contents of your table space TSDEPT.
(Hint: use provided member L6PRINT.) Provide DSN1PRNT parameters in the form:
PARM='PRINT(f,l),EBCDIC,FORMAT', where f, l are the numbers of the first and
last page respectively to print (f,l in hexadecimal format).
__ a. What did you specify for SYSUT1? _________________________________
__ b. Which values did you use for f, l? ____, ____
__ g. Verify what you found out by comparing it with the number of rows (= ________)
in the table space TSDEPT by selecting from its tables.
__ h. According to the DSN1PRNT output, what is the OBID of the table (PGSOBD) to
which the rows belong? _______ Compare this with the OBID of the table in
TSDEPT, as recorded in the DB2 catalog.
Find the prefix of the first two rows. What are the row lengths (PGSLTH)?
_____,_____ Why different? ______________________________________
__ j.
Insert a row with maximal length (use member L6INSERT). What is the length of
the row according to the DB2 catalog? ______ Stop and start the table space,
then issue the DSN1PRNT job again. What is the length of the newly-inserted
record according to the job output? ______ Why different?
Ex
cl
__ i.
pr
End of exercise
6-9
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Student Exercises
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
1. When and how should I retrieve statistics about a table space and
its indexes and store these statistics in the catalog?
2. When and how should I reorganize a table space?
pr
Ex
cl
Run the RUNSTATS and the REORG utilities and use a variety of
their respective options
7-1
Student Exercises
Exercise instructions
Note
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Throughout the exercise, search for ?? within the provided pdf member for each problem
and replace any ?? with your team ID. Not all members will contain ??.
__ 1. Examine member L7QUERY1. Execute the statement using SPUFI. What is the
query doing? By referring to DB2 catalog tables section in the Appendix of SQL
Reference explain the meaning of the values held for each column, and complete
the following table:
Table 1: SYSIBM.SYSTABLESPACESTATS Real-Time Statistics for table space
TSPROJ
TOTALROWS
STATSINSERTS
STATSDELETES
STATSUPDATES
STATSMASSDELETE
Refer to the solution of Exercise 6 and look at the LOAD output for all tables in table
space TSPROJ.
Ex
cl
__ 4. Based on the values in table 1, would you recommend to run RUNSTATS on table
space TSPROJ, if your rule of thumb is to run RUNSTATS if at least 20% of the table
space content has changed?
pr
__ 5. Before running RUNSTATS, let us do another change to the content of one of the
tables in table space TSPROJ. First, examine member L7UPDATE, then execute
this member using SPUFI. What type of disorganization might this introduce into the
table space?
__ 6. The previous step contained a query after the UPDATE statement. According to the
result of that query, did any values change compared to table 1? Why not? When
will STATSUPDATES reflect the 120 rows updated by query L7UPDATE? Be
patient, it could take several minutes for STATSUPDATES to reflect the change. The
time it takes depends on the interval STATSINT set in zparm.
7-2
V5.4.0.3
Student Exercises
EXempty
Table 2: SYSIBM.SYSTABLESPACESTATS Real-Time Statistics for table space
TSPROJ
TOTALROWS
STATSINSERTS
STATSDELETES
STATSUPDATES
STATSMASSDELETE
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
STATSINSERTS
STATSDELETES
STATSUPDATES
STATSMASSDELETE
Perform a RUNSTATS
__ a. Update the DB2 catalog tables with all statistics for table space TSPROJ and all
indexes.
__ c. Allow read and write applications to execute while the utility is running.
__ 9. Using DB2I, prepare a utility job to run the RUNSTATS utility and submit the utility
job. The utility should end with return code 0.
cl
__ 10. Use SDSF to view the utility output. By referring to the RUNSTATS report and to
DB2 Catalog Tables topic in Appendix "Additional Information for DB2 SQL" of the
SQL Reference, complete the following tables and explain the meaning of the
values held for each column in these tables:
Table 4: SYSIBM.SYSTABLEPART Catalog Statistics
Ex
CARDF
NEARINDREF
FARINDREF
pr
Index Name
NEAROFFPOSF
FAROFFPOSF
LEAFFAR
IXPROJ3
IXPROJ1
IXPROJ2
7-3
Student Exercises
CARDF
NEAROFFPOSF
FAROFFPOSF
LEAFFAR
IXONPR2
IXONPR1
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
IXACTY1
IXACTY2
__ 11. Execute L7QUERY1 to cross-check with the real-time statistics to see if you get the
same values. By the way, why are STATSINSERTS and STATSUPDATES now 0?
Table 6: SYSIBM.SYSTABLESPACESTATS Real-Time Statistics for table space
TSPROJ
TOTALROWS
STATSINSERTS
STATSDELETES
STATSUPDATES
STATSMASSDELETE
__ 13. Why is the data for the PROJECT table still reported as being well-clustered even
though a number of rows in the PROJECT table have overflowed?
You can use the real-time statistics counters for determining whether to perform a REORG.
However, you will now learn how to use the catalog statistics, gathered by running the
RUNSTATS utility, to determine if there is a need to perform reorganization of table space
TSPROJ in your database.
cl
__ 14. Prepare a REORG TABLESPACE utility control statement to reorganize table space
TSPROJ. Specify an OFFPOSLIMIT and INDREFLIMIT of 15. Also specify that a
REORG should not be performed but that the utility should report whether or not a
REORG is recommended.
Ex
__ 15. Using DB2I, prepare a utility job to run the REORG TABLESPACE utility. The name
of the unload data set (field 1 of the Data Set Names panel) should be
CV83.TSPROJ.UNLOAD. All other fields on the Data Set Names panel should be
blanked out.
pr
__ 16. Submit the utility job. The utility should end with return code 1. Use SDSF to view
the utility output. Why does the utility end with return code 1?
__ 17. Modify your REORG TABLESPACE utility control statement and specify an
OFFPOSLIMIT and INDREFLIMIT of 10. Again, a REORG should not be performed
but the utility should report whether or not a REORG is recommended.
7-4
V5.4.0.3
Student Exercises
EXempty
__ 18. Submit the utility job. The utility should end with return code 2. Use SDSF to view
the utility output. Which REORG limit has been met?
__ 19. Modify your REORG TABLESPACE utility control statement again so that a REORG
is performed if the OFFPOSLIMIT or INDREFLIMIT of 10 is exceeded. In addition,
specify that REORG should gather statistics for table space TSPROJ and all
indexes. The job output should contain the statistics figures.
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
__ 20. Submit the utility job and use SDSF to view the utility output. The utility should end
with return code 2. By referring to the REORG report, complete the following tables:
Table 7: SYSIBM.SYSTABLEPART Catalog Statistics
CARDF
NEARINDREF
FARINDREF
CARDF
NEAROFFPOSF
FAROFFPOSF
LEAFFAR
IXPROJ3
IXPROJ1
IXPRPOJ2
IXONPR2
IXONPR1
IXACTY1
IXACTY2
pr
Ex
cl
7-5
Student Exercises
Optional steps:
__ 22. Calculate how much space is needed for TSPROJ:
__ a. Determine how many segments are needed just for the PROJECT table alone.
Then determine the total number of pages needed for TSPROJ.
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
__ b. Calculate the number of tracks needed (on a 3390 volume, a track can store
48 KB).
__ c. For such a small table space, the actual space allocated greatly depends on the
environment, such as the zparm TSQTY. Here, 1 cylinder (= 15 tracks) is
allocated.
Verify this by executing the IDCAMS command LISTCAT.
(Use member L7LISTC.)
__ a. Simulating a typing error, enlarge the primary allocation for the index IXLOCN1
on LOCATION to the extreme value 999999999.
__ b. Try to reorganize the TSLOCN table space. (The job will of course fail because
of the index space.) Check whether you can still retrieve data from the
LOCATION table. Display the status of the database and of the REORG utility.
Which phases of the REORG have been completed?
______________________________ Check whether the unloaded data exists.
__ c. Correct the problem and restart the utility. Be sure to change neither the utility ID
nor the utility control statement nor the sysrec data set name. Which REORG
phases are performed by this second job?
Note that there is no need to specify RESTART. When the job is submitted, DB2
automatically figures out if it is normal execution or restart. If it is restart, it also
figures out if it should be phase restart or current restart.
Ex
cl
______________________________________________________________
Again, check the status of the database and verify that you can query the data.
pr
End of exercise
7-6
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
Run the RECOVER utility in its basic form and explain its job output
8-1
Student Exercises
Exercise instructions
Running the COPY utility
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
__ 1. Create a COPY utility control statement to create a local primary and a local backup
FULL image copy of table space TSEMPL. Specify SYSCOPY for the local primary
DDNAME and SYSCOPY2 for the local backup DDNAME. (These are the
DDNAMEs generated by the Data Set Names panel of DB2I.)
__ 2. Using DB2I, prepare a utility job to run the COPY utility. The image copy data sets
should be named CV83.TSEMPL.FIC1A for the local primary (field 3 of the Data Set
Names panel) and CV83.TSEMPL.FIC1B for the local backup (field 4 of the Data Set
Names panel). All other fields on the Data Set Names panel should be blanked out.
__ 3. Submit the utility job and use SDSF to view the utility output. The utility should end
with return code 0.
__ 4. Execute member L8UPDATE using SPUFI. This UPDATE statement updates one
row in partition 1 and one row in partition 3.
__ 5. Create a COPY utility control statement to create a local primary and a local backup
INCREMENTAL image copy of table space TSEMPL. Specify SYSCOPY for the
local primary DDNAME and SYSCOPY2 for the local backup DDNAME. (These are
the DDNAMEs generated by the Data Set Names panel of DB2I.)
__ 6. Using DB2I, prepare a utility job to run the COPY utility. The image copy data sets
should be named CV83.TSEMPL.IIC1A for the local primary (field 3 of the Data Set
Names panel) and CV83.TSEMPL.IIC1B for the local backup (field 4 of the Data Set
Names panel). All other fields on the Data Set Names panel should be blanked out.
__ 7. Submit the utility job and use SDSF to view the utility output. The utility should end
with return code 0.
__ 8. Execute member L8UPDATE using SPUFI.
cl
pr
Ex
__ 10. Execute member L8QUERY1 using SPUFI. By referring to DB2 Catalog Tables topic
in Appendix "Additional Information for DB2 SQL" of the SQL Reference manual
(SYSIBM.SYSCOPY), explain the meaning of the values held for each column.
8-2
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
__ 13. Submit the utility job and use SDSF to view the utility output. The utility should end
with return code 0.
__ 14. Which image copies are used by the RECOVER utility?
__ 15. Why must the RECOVER utility apply log records after restoring the image copies?
__ 16. Delete image copy CV83.TSEMPL.IIC1A
__ 17. Submit the RECOVER utility job again, and use SDSF to view the utility output. The
utility should end with return code 0.
__ 18. Explain the response of the RECOVER utility.
__ 19. Delete image copy CV83.TSEMPL.IIC1B
__ 20. Submit the RECOVER utility job again, and use SDSF to view the utility output. The
utility should end with return code 0.
__ 21. Explain the response of the RECOVER utility.
__ 22. Why must the RECOVER utility now apply an additional range of log records?
Optional labs
__ 23. Simulate an I/O error for a single partition of table space TSEMPL itself (rather than
for copy data sets) and recover the table space partition. More precisely:
__ a. Copy only the first partition of TSEMPL. The name of the copy data set should be
userid.CV83.TSEMPL.PART1.FCOPY1.
__ b. Determine the volumes the individual table space partitions reside on (use
member L8LISTC, then look for VOLSER): ________, ________, ________
Ex
cl
__ c. In order to simulate an I/O error, try to delete the VSAM cluster of the first
partition (use member L8DELC). Why does the job fail? ________________
Who is the current user? __________
pr
__ e. Now a substitution of the defect volume is needed, either by altering the DB2
storage group or by asking the SMS colleagues to replace the volume.
(Remember, we know the volume which is defective.) As this depends on
individual circumstances, we skip this step, pretending the volume has been
replaced.
__ f.
Recover only the first partition of TSEMPL. Which copy data set is used?
___________________________________________________
8-3
Student Exercises
__ 24. In the optional lab on DSN1PRNT (Exercise 6, Step 43(j)), you were asked to
perform the following steps: run DSN1PRNT, insert a new row, stop the table space,
start the table space, run DSN1PRNT again, and observe the difference in the job
outputs.
Why should you stop and then restart the table space? _____________________
________________________________________________________________
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
You may check what happens if you run the second DSN1PRNT directly after the
INSERT, without stopping and starting the table space.
__ a. Use the appropriate utility to retrieve all recovery information DB2 has stored for
the table space TSLOCN.
__ b. Delete some old SYSCOPY entries for this table space.
pr
Ex
cl
End of exercise
8-4
V5.4.0.3
Student Exercises
EXempty
Exercise 9. Security
What this exercise is about
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
Exercise 9. Security
9-1
Student Exercises
Exercise instructions
Note
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
__ 1. Attempt to SELECT data from your neighbor's EMPLOYEE table. What happens?
__ 2. Ask your neighbor to GRANT you the SELECT privilege on their EMPLOYEE table.
__ 3. Attempt to SELECT data from your neighbor's EMPLOYEE table. What happens
this time?
__ 4. Attempt to DELETE data from your neighbor's EMPLOYEE table. What happens?
The value of your Primary Authid and Current SQLID are each contained in a DB2 special
register called USER and CURRENT SQLID respectively.
__ 5. Determine the value of your Primary Authid and Current SQLID by executing
member L9AUTHID using SPUFI.
__ 6. Is it possible to determine your Secondary Authids using SQL? ________
Execute the TSO command LISTUSER (TSO LU) which lists the RACF group(s) to
which you belong (you are connected to). If the list contains more than one group,
note your so-called default group: ______________. You will use this group in the
following exercises.
(The Connection Exit Routine assigns these groups as your Secondary Authids.)
Ex
cl
__ 7. Use SQL to change your Current SQLID to something different from your Primary
Authid. Remember your Current SQLID can only be changed to either your Primary
Authid or to one of your Secondary Authids.
pr
Certain privileges have been granted on database WWV83XXD (note: XX is really XX) to your
Secondary Authid but not to your Primary Authid. (In the following, use your default
Secondary Authid.)
__ 9. Query the appropriate DB2 catalog tables to determine:
__ a. Which Authid is the owner (creator) of this database.
9-2
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Before performing the next part of the exercise, you should read the description of the
privilege set required to create a table which is documented in the SQL Reference manual.
Refer to the section which describes the CREATE TABLE statement and then read the
information under heading Authorization. (Note that the manual uses the term
SQL authorization ID rather than Current SQLID.)
__ 10. Member L9CRE1 sets your Current SQLID to your Primary Authid and attempts to
create an implicitly qualified table in database WWV83XXD. Execute the member using
SPUFI.
__ 11. What happens and why?
__ 12. Member L9CRE2 sets your Current SQLID to your Secondary Authid and attempts
to create an implicitly qualified table in database WWV83XXD. Execute the member
using SPUFI.
__ 13. What happens and why?
__ 14. Member L9CRE3 sets your Current SQLID to your Primary Authid and attempts to
create an explicitly qualified table in database WWV83XXD. The explicit qualifier is your
Secondary Authid. Execute the member using SPUFI.
__ 15. What happens, and why?
__ 16. Member L9CRE4 sets your Current SQLID to your Secondary Authid and attempts
to create an explicitly qualified table in database WWV83XXD. The explicit qualifier is
your Primary Authid. Edit this member, change xxxxxxx to your Primary Authid, and
then execute the member using SPUFI.
cl
Ex
__ 18. Set your Current SQLID to your Primary Authid, and try to SELECT data from table
sauthid.T??A, which you created earlier (where sauthid is your Secondary Authid
and ?? is your team ID).
pr
__ 19. Why is the SELECT successful, even though your Primary Authid does not have
SELECT privilege on table sauthid.T??A?
__ 20. Query the appropriate DB2 catalog table to determine:
__ a. Which Authid owns tables T??A and T??B (where ?? is your team ID).
__ b. Which Schema is used for tables T??A and T??B (where ?? is your team ID).
Copyright IBM Corp. 1993, 2011
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Exercise 9. Security
9-3
Student Exercises
__ 21. Query the appropriate DB2 catalog table to determine which of your Authids has the
privilege to query DB2 catalog table SYSIBM.SYSTABLES.
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
End of exercise
9-4
V5.4.0.3
Student Exercises
EXempty
Exercise 10.Locking
What this exercise is about
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
10-1
Student Exercises
Exercise instructions
Retrieving locking information from the DB2 catalog
__ 1. Query the relevant DB2 catalog tables to determine:
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
__ c. Whether any application packages exist that require a repeatable read capability.
__ 2. Try to execute a SELECT against table WWCV831.DEPARTMENT and wait to see what
happens. What is the reason code you receive? ____________________
Look it up in the Codes manual and explain what it means.
_______________________________________________________________
__ 3. Execute member LAQUERY1 using SPUFI. Note down the name of the database
and table space for table WWCV831.DEPARTMENT. Also note down the object ID (OBID
column value) of the table.
__ 4. Use the appropriate DB2 command to display any locks that are held on the table
space. Look up message DSNT397I in the Messages manual, and use the
information to explain the output of the DISPLAY command.
__ a. Who is holding a lock on the table space, and what is the mode of the lock?
__ b. Who is holding a lock on the table, and what is the mode of the lock?
__ c. When will the locks be freed?
cl
Ex
__ e. Query catalog table SYSIBM.SYSTABLESPACE to find out what lock size was
specified for the table space.
pr
__ 5. Use the appropriate DB2 command to display any locks that are held on table space
WWV83YYD.TSEMPL. Again, look up message DSNT397I in the Messages manual,
and use the information to explain the output of the DISPLAY command. Are all
partitions locked? _______
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
__ 8. Run your SELECT against table WWCV831.DEPARTMENT again (see step 6 above), but
first add the SKIP LOCKED DATA option instead of WITH UR to your SELECT
statement. Explain the difference between WITH UR and SKIP LOCKED DATA.
pr
Ex
cl
End of exercise
10-3
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Student Exercises
V5.4.0.3
Student Exercises
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
EXempty
A-1
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Student Exercises
A-2
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
CREATE TABLESPACE TSDEPT
IN WWV8301D
SEGSIZE 32
MAXPARTITIONS 5;
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
CREATE TABLESPACE TSEMPL
IN WWV8301D
SEGSIZE 4
NUMPARTS 3;
Ex
cl
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
CREATE TABLESPACE TSPROJ
IN WWV8301D
SEGSIZE 4
PCTFREE 0;
pr
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
A-3
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
A-4
V5.4.0.3
Student Exercises
EXempty
Remarks: PQTY = -1 indicates that no value has been specified for the primary quantity.
The actual amount of space allocated depends on the TSQTY DSNZPARM value (here:
one cylinder if TSQTY=0).
Optional labs:
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+
SELECT *
FROM SYSIBM.SYSVOLUMES
WHERE SGNAME = 'WWV8301S'
WITH UR ;
---------+---------+---------+---------+---------+---------+---------+
SGNAME
SGCREATOR
VOLID
IBMREQD
---------+---------+---------+---------+---------+---------+---------+
WWV8301S
SYSPROG
*
N
DSNE610I NUMBER OF ROWS DISPLAYED IS 1
---------+---------+---------+---------+---------+---------+---------+
In this installation, the storage group has been defined with VOLUMES (*). That means
that SMS routines should determine the volume per data set.
No. If SMS routines (so-called ACS routines) are activated, their rules may override even
explicit volume specifications made via the DB2 command CREATE STOGROUP.
cl
We already know the high-level qualifier DBDSNB from querying SYSTABPLEPART (see
above). As we assume that the name TSEMPL will be preserved in the data set name, we
therefore search for DBDSNB.**.TSEMPL.* in ISPF 3.4 (without TSEMPL would work but
would generate a longer list):
Data Set List Utility
Ex
Option ===>
More:
P Print data set list
PV Print VTOC information
pr
A-5
Student Exercises
Row 1 of 54
Scroll ===> CSR
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
...........
Second attempt to narrow down this list (qualifying TSEMPL with its database name):
DSLIST - Data Sets Matching DBDSNB.**.WWV8301D.TSEMPL.*
Command ===>
Row 1 of 6
Scroll ===> CSR
As can be seen, the data set of partition 1 of TSEMPL resides on volume SMS012.
pr
Ex
cl
---------+---------+---------+---------+---------+---------+---------+---------+
CREATE TABLESPACE TEST01A IN WWV83ZZD ;
---------+---------+---------+---------+---------+---------+---------+---------+
DSNT408I SQLCODE = -904, ERROR: UNSUCCESSFUL EXECUTION CAUSED BY AN
UNAVAILABLE RESOURCE. REASON 00D70025, TYPE OF RESOURCE 00000220, AND
RESOURCE NAME DBV8ZZZ.DSNBBC.WWV83ZZD.TEST01A.I0001.A001
DSNT418I SQLSTATE
= 57011 SQLSTATE RETURN CODE
DSNT415I SQLERRP
= DSNXICTS SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD
= 105 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD
= X'00000069' X'00000000' X'00000000' X'FFFFFFFF'
X'00000000' X'00000000' SQL DIAGNOSTIC INFORMATION
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE618I ROLLBACK PERFORMED, SQLCODE IS 0
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
A-6
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
03.18.48 STC00436 DSNP009I -DSNB THE FOLLOWING ERROR MESSAGES WERE 316
316
RECEIVED FOR DEFINE CLUSTER ON
316
DBV8ZZZ.DSNDBC.WWV83ZZD.TEST01A.I0001.A001
316
IGD17103I CATALOG ERROR WHILE DEFINING VSAM DATA SET
316
DBV8ZZZ.DSNDBC.WWV83ZZD.TEST01A.I0001.A001
316
RETURN CODE IS 56 REASON CODE IS 6 IGG0CLFT
316
IGD306I UNEXPECTED ERROR DURING IGG0CLFT PROCESSING
316
RETURN CODE 56 REASON CODE 6
316
THE MODULE THAT DETECTED THE ERROR IS IGDVTSCU
316
SMS MODULE TRACE BACK - VTSCU VTSCT VTSCH VTSCG VTSCD VTSCC V
316
SSIRT
316
SYMPTOM RECORD CREATED, PROBLEM ID IS IGD00000
316
IGD17219I UNABLE TO CONTINUE DEFINE OF DATA SET
316
DBV8ZZZ.DSNDBC.WWV83ZZD.TEST01A.I0001.A001
316
IDC3018I SECURITY VERIFICATION FAILED
316
IDC3009I ** VSAM CATALOG RETURN CODE IS 56 - REASON CODE IS
316
IGG0CLFT-6
316
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12
The System Log produces similar error messages, that is, in these examples, SECURITY
VERIFICATION FAILED, when DB2 tries to define cluster
DBV8ZZZ.DSNBBC.WWV83ZZD.TEST01A.I0001.A001.
Query which volumes are used for the last (unsuccessful) trial and the previous
(successful) trials to create table spaces in databases WWV83ZZD or WWV8301D
respectively:
Ex
cl
---------+---------+---------+---------+---------+---------+-SELECT *
FROM SYSIBM.SYSVOLUMES
WHERE SGNAME IN (SELECT STGROUP
FROM SYSIBM.SYSDATABASE
WHERE NAME IN ('WWV8301D', 'WWV83ZZD') )
WITH UR ;
---------+---------+---------+---------+---------+---------+-SGNAME
SGCREATOR
VOLID
---------+---------+---------+---------+---------+---------+-WWV83ZZS
SYSPROG
*
WWV8301S
SYSPROG
*
DSNE610I NUMBER OF ROWS DISPLAYED IS 2
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+--
pr
A-7
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
By looking at this result, check, whether the hlq (or alias) DBV8ZZZ exists at all:
Data Set List Utility
Option ===>
More:
P Print data set list
PV Print VTOC information
cl
pr
Ex
On the other hand, if you enter the high-level qualifier DBDSNB, you see lots of entries, so
this qualifier obviously exists. This difference points to the reason why the last
CREATE TABLESPACE statement failed: DB2 can only create data sets if the aliases for
their hlq have already been defined.
A-8
V5.4.0.3
Student Exercises
EXempty
NULL,
NULL,
NULL,
NULL,
NULL)
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
CREATE TABLE DEPARTMENT
(DEPTNO
CHAR(3)
NOT NULL,
SUPERIOR_DEPTNO CHAR(3)
,
MGRNO
CHAR(6)
,
NAME
VARCHAR(50) NOT NULL)
IN WWV8301D.TSDEPT;
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
NOT NULL,
NOT NULL,
NOT NULL,
,
,
,
NOT NULL)
cl
Ex
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
NOT NULL,
NOT NULL)
pr
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
A-9
Student Exercises
NOT
NOT
NOT
NOT
NULL,
NULL,
NULL,
NULL,
,
,
)
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
CREATE TABLE EMPLOYEE
(EMPNO
CHAR(6)
NOT NULL,
FIRST_NAME
CHAR(20)
NOT NULL,
MIDDLE_INITIAL CHAR(1)
,
SEX
CHAR(1)
NOT NULL,
BIRTHDATE
DATE
,
PHONE
CHAR(4)
,
HIRING_DATE
DATE
,
JOB
CHAR(20)
,
EDUCATION
SMALLINT
NOT NULL,
SALARY
DECIMAL(9,2)
,
BONUS
DECIMAL(9,2)
,
COMMISSION
DECIMAL(9,2)
,
DEPTNO
CHAR(3)
,
LOCID
CHAR(10)
,
LAST_NAME
VARCHAR(50)
NOT NULL,
CONSTRAINT SEX CHECK(SEX IN ('M', 'F')))
PARTITION BY (EMPNO ASC)
(PARTITION 1 ENDING AT ('000150'),
PARTITION 2 ENDING AT ('000230'),
PARTITION 3 ENDING AT ('001000'))
IN WWV8301D.TSEMPL;
pr
Ex
cl
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+--NAME
TYPE DBNAME
TSNAME
COLCOUNT RECLENGTH CHECKS
STATUS
---------+---------+---------+---------+---------+---------+---------+---------+---LOCATION
DEPARTMENT
PROJECT
ON_PROJECT
ACTIVITY
EMPLOYEE
T
T
T
T
T
T
WWV8301D
WWV8301D
WWV8301D
WWV8301D
WWV8301D
WWV8301D
TSLOCN
TSDEPT
TSPROJ
TSPROJ
TSPROJ
TSEMPL
5
4
7
2
7
15
123
74
89
20
38
160
0
0
0
0
0
1
---------+---------+---------+---------+---------+---------+---------+---------+
NAME
CREATOR
DBNAME
PARTITIONS STATUS NTABLES
---------+---------+---------+---------+---------+---------+---------+---------+
TSOUB01
TSOUB01
TSOUB01
TSOUB01
cl
TSLOCN
TSDEPT
TSEMPL
TSPROJ
WWV8301D
WWV8301D
WWV8301D
WWV8301D
0 A
1 A
3 A
0 A
1
1
1
3
pr
Ex
A-11
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
PROJNO
EMPNO
SEQNO
CODE
TIME_SPENT
START_DATE
END_DATE
DEPTNO
SUPERIOR_DEPTNO
MGRNO
NAME
EMPNO
FIRST_NAME
MIDDLE_INITIAL
SEX
BIRTHDATE
PHONE
HIRING_DATE
JOB
EDUCATION
SALARY
BONUS
COMMISSION
DEPTNO
LOCID
LAST_NAME
LOCID
ADDRESS
CITY
POSTAL_CODE
COUNTRY
PROJNO
EMPNO
PROJNO
DEPTNO
EMPNO
STAFFING
START_DATE
END_DATE
NAME
1
2
3
4
5
6
7
1
2
3
4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
1
2
3
4
5
1
2
1
2
3
4
5
6
7
CHAR
CHAR
SMALLINT
SMALLINT
DECIMAL
DATE
DATE
CHAR
CHAR
CHAR
VARCHAR
CHAR
CHAR
CHAR
CHAR
DATE
CHAR
DATE
CHAR
SMALLINT
DECIMAL
DECIMAL
DECIMAL
CHAR
CHAR
VARCHAR
CHAR
CHAR
CHAR
CHAR
CHAR
CHAR
CHAR
CHAR
CHAR
CHAR
DECIMAL
DATE
DATE
VARCHAR
6
6
2
2
5
4
4
3
3
6
50
6
20
1
1
4
4
4
20
2
9
9
9
3
10
50
10
30
30
15
30
6
6
6
3
6
5
4
4
50
0
0
0
0
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2
2
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0
0
0
N
N
N
N
Y
Y
Y
N
Y
Y
N
N
N
Y
N
Y
Y
Y
Y
N
Y
Y
Y
Y
Y
N
N
N
N
N
N
N
N
N
N
N
Y
Y
Y
N
V5.4.0.3
Student Exercises
EXempty
Optional labs:
Step 16: Catalog information on check constraints
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+
SELECT TBOWNER, CREATOR, TBNAME, CHECKNAME, CHECKCONDITION
FROM SYSIBM.SYSCHECKS
WHERE TBOWNER = 'TSOUB01'
AND TBNAME = 'EMPLOYEE'
WITH UR ;
---------+---------+---------+---------+---------+---------+---------+
TBOWNER
CREATOR
TBNAME
CHECKNAME
CHECKCONDI
---------+---------+---------+---------+---------+---------+---------+
TSOUB01
TSOUB01
EMPLOYEE
SEX
SEX IN ('M', 'F')
DSNE610I NUMBER OF ROWS DISPLAYED IS 1
---------+---------+---------+---------+---------+---------+---------+
---------+---------+---------+---------+---------+---------+---------+
SELECT TBOWNER, TBNAME, CHECKNAME, COLNAME
FROM SYSIBM.SYSCHECKDEP
WHERE TBOWNER = 'TSOUB01'
AND TBNAME = 'EMPLOYEE'
WITH UR ;
---------+---------+---------+---------+---------+---------+---------+
TBOWNER
TBNAME
CHECKNAME
COLNAME
---------+---------+---------+---------+---------+---------+---------+
TSOUB01
EMPLOYEE
SEX
SEX
DSNE610I NUMBER OF ROWS DISPLAYED IS 1
---------+---------+---------+---------+---------+---------+---------+
pr
Ex
cl
---------+---------+---------+---------+---------+---------+---------+---------+
SELECT PARTITION, TSNAME, DBNAME, LIMITKEY, LIMITKEY_INTERNAL
FROM SYSIBM.SYSTABLEPART P
WHERE DBNAME = 'WWV8301D' AND TSNAME = 'TSEMPL'
WITH UR ;
---------+---------+---------+---------+---------+---------+---------+---------+
PARTITION TSNAME
DBNAME
LIMITKEY
LIMITKEY_INTERNAL
---------+---------+---------+---------+---------+---------+---------+---------+
1 TSEMPL
WWV8301D
'000150'
000150
2 TSEMPL
WWV8301D
'000230'
000230
3 TSEMPL
WWV8301D
'001000'
001000
DSNE610I NUMBER OF ROWS DISPLAYED IS 3
---------+---------+---------+---------+---------+---------+---------+---------+
Remark:
Since table-controlled partitioning is used, LIMITKEY_INTERNAL is filled with values.
Copyright IBM Corp. 1993, 2011
A-13
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Student Exercises
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
CREATE VIEW V1
AS SELECT EMPNO AS SERIAL_NUMBER, SALARY,
FIRST_NAME, LAST_NAME, SEX, EDUCATION
FROM
EMP
WHERE SALARY < 20000
pr
Ex
cl
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
A-15
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
000200
27740.00 DAVID
000210
18270.00 WILLIAM
000220
29840.00 JENNIFER
000230
22180.00 JAMES
000240
28760.00 SALVATORE
000250
19180.00 DANIEL
000260
17250.00 SYBIL
000270
27380.00 MARIA
000280
26250.00 ETHEL
000290
15340.00 JOHN
000300
17750.00 PHILIP
000310
15900.00 MAUDE
000320
19950.00 RAMLAL
000330
25370.00 WING
000340
23840.00 JASON
DSNE610I NUMBER OF ROWS DISPLAYED IS 32
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE615I NUMBER OF ROWS AFFECTED IS 1
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
INSERT INTO V1
(SERIAL_NUMBER,
SALARY, FIRST_NAME, LAST_NAME, SEX, EDUCATION)
VALUES('000360', 50000, 'RINGO', 'STARR','M', 22)
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE615I NUMBER OF ROWS AFFECTED IS 1
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
pr
Ex
cl
Rows inserted through view V1 do not have to conform to the definition of V1.
A-17
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
000200
27740.00 DAVID
000210
18270.00 WILLIAM
000220
29840.00 JENNIFER
000230
22180.00 JAMES
000240
28760.00 SALVATORE
000250
19180.00 DANIEL
000260
17250.00 SYBIL
000270
27380.00 MARIA
000280
26250.00 ETHEL
000290
15340.00 JOHN
000300
17750.00 PHILIP
000310
15900.00 MAUDE
000320
19950.00 RAMLAL
000330
25370.00 WING
000340
23840.00 JASON
000350
15000.00 GEORGE
000360
50000.00 RINGO
DSNE610I NUMBER OF ROWS DISPLAYED IS 34
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE615I NUMBER OF ROWS AFFECTED IS 1
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
The row with a serial number of 000350 satisfies the definition of view V1.
DELETE FROM V1
WHERE SERIAL_NUMBER = '000360'
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+---------+---------+
pr
Ex
cl
The row with a serial number of 000360 does not satisfy the definition of view V1.
A-19
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
000200
27740.00 DAVID
000210
18270.00 WILLIAM
000220
29840.00 JENNIFER
000230
22180.00 JAMES
000240
28760.00 SALVATORE
000250
19180.00 DANIEL
000260
17250.00 SYBIL
000270
27380.00 MARIA
000280
26250.00 ETHEL
000290
15340.00 JOHN
000300
17750.00 PHILIP
000310
15900.00 MAUDE
000320
19950.00 RAMLAL
000330
25370.00 WING
000340
23840.00 JASON
000360
50000.00 RINGO
DSNE610I NUMBER OF ROWS DISPLAYED IS 33
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE615I NUMBER OF ROWS AFFECTED IS 1
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
The row with a serial number of 000260 satisfies the definition of view V1.
UPDATE V1
SET SALARY = SALARY - 5000
WHERE SERIAL_NUMBER = '000260'
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+---------+---------+
pr
Ex
cl
The row with a serial number of 000260 does not satisfy the definition of view V1.
A-21
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
000200
27740.00 DAVID
000210
18270.00 WILLIAM
000220
29840.00 JENNIFER
000230
22180.00 JAMES
000240
28760.00 SALVATORE
000250
19180.00 DANIEL
000260
22250.00 SYBIL
000270
27380.00 MARIA
000280
26250.00 ETHEL
000290
15340.00 JOHN
000300
17750.00 PHILIP
000310
15900.00 MAUDE
000320
19950.00 RAMLAL
000330
25370.00 WING
000340
23840.00 JASON
000360
50000.00 RINGO
DSNE610I NUMBER OF ROWS DISPLAYED IS 33
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
CREATE VIEW V2
AS SELECT EMPNO AS SERIAL_NUMBER, SALARY,
FIRST_NAME, LAST_NAME, SEX, EDUCATION
FROM
EMP
WHERE SALARY < 20000
WITH CHECK OPTION
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
INSERT INTO V2
(SERIAL_NUMBER,
SALARY, FIRST_NAME, LAST_NAME, SEX, EDUCATION)
VALUES('000370', 15000, 'LIAM', 'GALLAGHER','M', 22);
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE615I NUMBER OF ROWS AFFECTED IS 1
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
INSERT INTO V2
(SERIAL_NUMBER,
SALARY, FIRST_NAME, LAST_NAME, SEX, EDUCATION)
VALUES('000380', 50000, 'NOEL', 'GALLAGHER','M', 22)
pr
Ex
cl
---------+---------+---------+---------+---------+---------+---------+---------+
DSNT408I SQLCODE = -161, ERROR: THE INSERT OR UPDATE IS NOT ALLOWED BECAUSE A
RESULTING ROW DOES NOT SATISFY THE VIEW DEFINITION
DSNT418I SQLSTATE
= 44000 SQLSTATE RETURN CODE
DSNT415I SQLERRP
= DSNXRSVW SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD
= -160 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD
= X'FFFFFF60' X'00000000' X'00000000' X'FFFFFFFF'
X'00000000' X'00000000' SQL DIAGNOSTIC INFORMATION
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE618I ROLLBACK PERFORMED, SQLCODE IS 0
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
A-23
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE615I NUMBER OF ROWS AFFECTED IS 1
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
UPDATE V2
SET SALARY = SALARY + 5000
WHERE SERIAL_NUMBER = '000290'
---------+---------+---------+---------+---------+---------+---------+---------+
DSNT408I SQLCODE = -161, ERROR: THE INSERT OR UPDATE IS NOT ALLOWED BECAUSE A
RESULTING ROW DOES NOT SATISFY THE VIEW DEFINITION
DSNT418I SQLSTATE
= 44000 SQLSTATE RETURN CODE
DSNT415I SQLERRP
= DSNXRSVW SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD
= -160 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD
= X'FFFFFF60' X'00000000' X'00000000' X'FFFFFFFF'
X'00000000' X'00000000' SQL DIAGNOSTIC INFORMATION
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE618I ROLLBACK PERFORMED, SQLCODE IS 0
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
CREATE VIEW V3
AS SELECT EMPNO AS SERIAL_NUMBER, SALARY,
FIRST_NAME, LAST_NAME, SEX
FROM
EMP
WHERE SALARY < 20000
pr
Ex
cl
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
DSNT408I SQLCODE = -551, ERROR: TSOUB01 DOES NOT HAVE THE PRIVILEGE TO PERFORM
OPERATION INSERT ON OBJECT TSOUB01.V3
DSNT418I SQLSTATE
= 42501 SQLSTATE RETURN CODE
DSNT415I SQLERRP
= DSNXOIN SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD
= -600 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD
= X'FFFFFDA8' X'00000000' X'00000000' X'FFFFFFFF'
X'00000000' X'00000000' SQL DIAGNOSTIC INFORMATION
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE618I ROLLBACK PERFORMED, SQLCODE IS 0
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
The insert fails because the definition of view V3 does not include non-nullable column
EDUCATION.
G
G
G
cl
TSOUB01
TSOUB01
TSOUB01
G
G
G
G
G
G
G
G
Ex
pr
The owner of view V3 does not have INSERT privilege on V3 because the definition of V3
does not include non-nullable column EDUCATION.
A-25
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Student Exercises
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
CREATE INDEX IXDEPT2
ON DEPARTMENT(MGRNO);
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
CREATE INDEX IXDEPT3
ON DEPARTMENT(SUPERIOR_DEPTNO);
pr
Ex
cl
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
A-27
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
cl
Ex
pr
V5.4.0.3
Student Exercises
EXempty
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
A-29
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+---------+
NAME
TBNAME
DBNAME
UNIQUERULE CLUSTERING INDEXSPACE BPOOL
PIECESIZE
---------+---------+---------+---------+---------+---------+---------+---------+---------+
IXACTY1
IXACTY2
IXDEPT1
IXDEPT2
IXDEPT3
IXEMPL1
IXEMPL2
IXEMPL3
IXLOCN1
IXONPR1
IXONPR2
IXPROJ1
IXPROJ2
IXPROJ3
ACTIVITY
ACTIVITY
DEPARTMENT
DEPARTMENT
DEPARTMENT
EMPLOYEE
EMPLOYEE
EMPLOYEE
LOCATION
ON_PROJECT
ON_PROJECT
PROJECT
PROJECT
PROJECT
WWV8301D
WWV8301D
WWV8301D
WWV8301D
WWV8301D
WWV8301D
WWV8301D
WWV8301D
WWV8301D
WWV8301D
WWV8301D
WWV8301D
WWV8301D
WWV8301D
U
D
U
D
D
U
D
D
U
U
D
U
D
D
N
N
Y
N
N
Y
N
N
N
N
Y
N
N
Y
IXACTY1
IXACTY2
IXDEPT1
IXDEPT2
IXDEPT3
IXEMPL1
IXEMPL2
IXEMPL3
IXLOCN1
IXONPR1
IXONPR2
IXPROJ1
IXPROJ2
IXPROJ3
BP2
BP2
BP2
BP2
BP2
BP2
BP2
BP2
BP2
BP2
BP2
BP2
BP2
BP2
2097152
2097152
4194304
4194304
4194304
0
4194304
4194304
2097152
2097152
2097152
2097152
2097152
2097152
pr
Ex
cl
V5.4.0.3
Student Exercises
---------+---------+---------+---------+---------+---------+---------+
SELECT SUBSTR(IXNAME,1,8) AS IXNAME,
PARTITION,
SUBSTR(CHAR(PQTY),1,4) AS PQTY,
SUBSTR(STORNAME,1,8) AS STORNAME,
SUBSTR(VCATNAME,1,8) AS VCATNAME,
SUBSTR(LIMITKEY,1,6) AS LIMITKEY,
FREEPAGE, PCTFREE
FROM SYSIBM.SYSINDEXPART IP
WHERE IXCREATOR = USER
AND IXNAME NOT IN ('IXLAB3')
ORDER BY IXNAME, PARTITION
WITH UR ;
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
EXempty
---------+---------+---------+---------+---------+---------+---------+---------+
IXNAME
PARTITION PQTY STORNAME
VCATNAME
LIMITKEY FREEPAGE PCTFREE
---------+---------+---------+---------+---------+---------+---------+---------+
IXACTY1
0
-1
WWV8301S
DBDSNB
......
0
10
IXACTY2
0
-1
WWV8301S
DBDSNB
......
0
10
IXDEPT1
0
-1
WWV8301S
DBDSNB
......
0
10
IXDEPT2
0
-1
WWV8301S
DBDSNB
......
0
10
IXDEPT3
0
-1
WWV8301S
DBDSNB
......
0
10
IXEMPL1
1
-1
WWV8301S
DBDSNB
......
0
10
IXEMPL1
2
-1
WWV8301S
DBDSNB
......
0
10
IXEMPL1
3
-1
WWV8301S
DBDSNB
......
0
10
IXEMPL2
0
-1
WWV8301S
DBDSNB
......
0
10
IXEMPL3
0
-1
WWV8301S
DBDSNB
......
0
10
IXLOCN1
0
-1
WWV8301S
DBDSNB
......
0
10
IXONPR1
0
-1
WWV8301S
DBDSNB
......
0
10
IXONPR2
0
-1
WWV8301S
DBDSNB
......
0
10
IXPROJ1
0
-1
WWV8301S
DBDSNB
......
0
10
IXPROJ2
0
-1
WWV8301S
DBDSNB
......
0
10
IXPROJ3
0
-1
WWV8301S
DBDSNB
......
0
10
DSNE610I NUMBER OF ROWS DISPLAYED IS 16
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+---------+---------+
cl
Remarks:
Ex
LIMITKEY is x20, a Unicode blank; the column is defined as varchar(512) for bit data.
Therefore the correct expression would be: SUBSTR(CAST(CAST(LIMITKEY AS
VARCHAR(512) CCSID 1208) AS VARCHAR(512) CCSID EBCDIC),1,4) AS LIMITKEY,
which would eliminate the dotted output column. Similarly, other columns, like IXNAME,
should be retrieved via SUBSTRING(IXNAME,1,8,CODEUNITS16) AS IXNAME.
pr
PQTY = -1 indicates that no value has been specified for the primary quantity.
The actual amount of space allocated depends on the IXQTY DSNZPARM value (one
cylinder if IXQTY=0.
A-31
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
IXNAME
COLNAME
COLSEQ
COLNO ORDERING
---------+---------+---------+---------+---------+---------+---------+---------+
IXACTY1
IXACTY1
IXACTY1
IXACTY2
IXDEPT1
IXDEPT2
IXDEPT3
IXEMPL1
IXEMPL2
IXEMPL3
IXLOCN1
IXONPR1
IXONPR1
IXONPR2
IXPROJ1
IXPROJ2
IXPROJ3
PROJNO
EMPNO
SEQNO
EMPNO
DEPTNO
MGRNO
SUPERIOR_DEPTNO
EMPNO
DEPTNO
LOCID
LOCID
PROJNO
EMPNO
EMPNO
PROJNO
DEPTNO
EMPNO
1
2
3
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
2
3
2
1
3
2
1
13
14
1
1
2
2
1
2
3
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
pr
Ex
cl
V5.4.0.3
Student Exercises
EXempty
SSID: DSNB
===>
Position cursor on the command line you want to execute and press ENTER
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
A-33
Student Exercises
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
IXONPR2 IX
RW
IXPROJ1 IX
RW
IXPROJ2 IX
RW
IXPROJ3 IX
RW
******* DISPLAY OF DATABASE WWV8301D ENDED
**********************
DSN9022I -DSNB DSNTDDIS 'DISPLAY DATABASE' NORMAL COMPLETION
***
V5.4.0.3
Student Exercises
EXempty
Row 1 of 44
Scroll ===> PAGE
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
A-35
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Student Exercises
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Ex
cl
pr
A-37
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
V5.4.0.3
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
EXempty
cl
pr
Ex
A-39
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
CONSTNAME
TBNAME
TYPE IXNAME
COLCOUNT
---------+---------+---------+---------+---------+---------+---------+---------+
LOCID
DEPTNO
EMPNO
PROJNO
PROJNO_EMPNO
PROJNO_EMPNO_SEQNO
LOCATION
DEPARTMENT
EMPLOYEE
PROJECT
ON_PROJECT
ACTIVITY
P
P
P
P
P
P
IXLOCN1
IXDEPT1
IXEMPL1
IXPROJ1
IXONPR1
IXACTY1
1
1
1
1
2
3
cl
---------+---------+---------+---------+---------+---------+---------+---------+
CONSTNAME
TBNAME
COLNAME
COLSEQ
COLNO
---------+---------+---------+---------+---------+---------+---------+---------+
DEPARTMENT
EMPLOYEE
LOCATION
PROJECT
ON_PROJECT
ON_PROJECT
ACTIVITY
ACTIVITY
ACTIVITY
pr
Ex
DEPTNO
EMPNO
LOCID
PROJNO
PROJNO_EMPNO
PROJNO_EMPNO
PROJNO_EMPNO_SEQNO
PROJNO_EMPNO_SEQNO
PROJNO_EMPNO_SEQNO
DEPTNO
EMPNO
LOCID
PROJNO
PROJNO
EMPNO
PROJNO
EMPNO
SEQNO
1
1
1
1
1
2
1
2
3
1
1
1
1
1
2
1
2
3
V5.4.0.3
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
EXempty
---------+---------+---------+---------+---------+---------+---------+---------+
REFTBNAME
TBNAME
RELNAME
COLCOUNT DELETERULE
---------+---------+---------+---------+---------+---------+---------+---------+
DEPARTMENT
DEPARTMENT
DEPARTMENT
EMPLOYEE
EMPLOYEE
EMPLOYEE
LOCATION
ON_PROJECT
PROJECT
DEPARTMENT
EMPLOYEE
PROJECT
DEPARTMENT
ON_PROJECT
PROJECT
EMPLOYEE
ACTIVITY
ON_PROJECT
DD
DE
DP
ED
EO
EP
LE
OA
PO
1
1
1
1
1
1
1
2
1
A
N
A
N
C
A
A
C
C
pr
Ex
cl
---------+---------+---------+---------+---------+---------+---------+---------+
SELECT *
FROM SYSIBM.SYSFOREIGNKEYS
WHERE CREATOR = USER
WITH UR ;
;
---------+---------+---------+---------+---------+---------+---------+---------+---------+
CREATOR
TBNAME
RELNAME
COLNAME
COLNO COLSEQ
IBMREQD
---------+---------+---------+---------+---------+---------+---------+---------+---------+
TSOUB01
DEPARTMENT
DD
SUPERIOR_DEPTN
2
1
N
TSOUB01
DEPARTMENT
ED
MGRNO
3
1
N
TSOUB01
EMPLOYEE
LE
LOCID
14
1
N
TSOUB01
EMPLOYEE
DE
DEPTNO
13
1
N
TSOUB01
PROJECT
DP
DEPTNO
2
1
N
TSOUB01
PROJECT
EP
EMPNO
3
1
N
TSOUB01
ON_PROJECT
EO
EMPNO
2
1
N
TSOUB01
ON_PROJECT
PO
PROJNO
1
1
N
TSOUB01
ACTIVITY
OA
PROJNO
1
1
N
TSOUB01
ACTIVITY
OA
EMPNO
2
2
N
DSNE610I NUMBER OF ROWS DISPLAYED IS 10
DSNE612I DATA FOR COLUMN HEADER COLNAME COLUMN NUMBER 4 WAS TRUNCATED
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+---------+---------+---------+
A-41
Student Exercises
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
10 rows for 9 relationships, because the foreign key on ACTIVITY is defined on 2 columns.
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Some input records are deliberately not correct so that you see the resulting error
messages and learn how you can technically react. In reality, you may react differently:
neither ignore that some records could not be loaded, nor delete loaded records because
of orphaned foreign key values, if you were not told to do exactly that. Instead, you would,
for example:
1. Determine the reasons
2. Reset the database objects to the previous state
3. Ask for revised, error-free input.
TSOUB01.CV83.TSLOCN.DATA
===>
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+--***************************** Top of Data ************************************
US95141-B4555 BAILEY AVENUE
SAN JOSE
CA 95141
US95141-C2555 BAILEY AVENUE
SAN JOSE
CA 95141
US95193-505600 COTTLE ROAD
SAN JOSE
CA 95193
DE71083-01AM FICHTENBERG 1
HERRENBERG
D-71083
**************************** Bottom of Data **********************************
...
...
...
...
...
...
...
Step 1a: Utility control statement for loading the LOCATION table
TSOUB01.CV83.CNTL(L6TSLOCN)
pr
Ex
cl
A-43
Student Exercises
Step 1b: Job for loading the LOCATION table, generated via DB2I
TSOUB01.DSNULOA.CNTL
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
V5.4.0.3
Student Exercises
LOAD DATA
INTO TABLE LOCATION
( LOCID
POSITION ( 1: 10) CHAR(10),
ADDRESS
POSITION (11: 40) CHAR(30),
CITY
POSITION (41: 70) CHAR(30),
POSTAL_CODE POSITION (71: 85) CHAR(15),
COUNTRY
POSITION (86:115) CHAR(30) )
//
**************************** Bottom of Data *****************
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
EXempty
A-45
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
1
J E S 2 J O B L O G -- S Y S T E M D I 1 1 -- N O D E M V S D I 1 1
0
07.52.56 JOB00456 ---- FRIDAY,
26 AUG 2011 ---07.52.56 JOB00456 IRR010I USERID TSOUB01 IS ASSIGNED TO THIS JOB.
07.52.56 JOB00456 ICH70001I TSOUB01 LAST ACCESS AT 05:55:07 ON FRIDAY, AUGUST 26, 2011
07.52.56 JOB00456 $HASP373 TSOUB011 STARTED - INIT 1
- CLASS A - SYS DI11
07.52.57 JOB00456 -----TIMINGS (MINS.)----------PAGING COUNTS---07.52.57 JOB00456 -STEPNAME PROCSTEP
RC
EXCP
CONN
TCB
SRB CLOCK
SERV WORKLOAD PAGE SWAP
VIO
SWAPS
0
07.52.57 JOB00456 -UTIL
DSNUPROC
00
764
65
.00
.00
.0
309 BATCH
0
0
0
07.52.57 JOB00456 -TSOUB011 ENDED. NAME-TSOUB01 JOB
TOTAL TCB CPU TIME=
.00 TOTAL ELAPSED TIME=
.0
07.52.57 JOB00456 $HASP395 TSOUB011 ENDED
0------ JES2 JOB STATISTICS ------ 26 AUG 2011 JOB EXECUTION DATE
59 CARDS READ
273 SYSOUT PRINT RECORDS
0 SYSOUT PUNCH RECORDS
17 SYSOUT SPOOL KBYTES
0.01 MINUTES EXECUTION TIME
1
1 //TSOUB011 JOB 1CV83G26,'TSOUB01 JOB
',MSGLEVEL=(1,1),
JOB00456
//
CLASS=A,MSGCLASS=Q,NOTIFY=TSOUB01,REGION=0M
//*
//*
2 //UTIL EXEC DSNBUPRC,SYSTEM=DSNB,UID='TSOUB01',UTPROC=''
3 XXDSNUPROC PROC LIB='DBDSNB.DB2A10.SDSNLOAD',
XX
SYSTEM=DSNB,
XX
SIZE=0K,UID='',UTPROC=''
XX*
pr
cl
Ex
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
XX**********************************************************************
XX*
*
XX* PROCEDURE-NAME:
DSNBUPRC
*
XX*
*
XX* DESCRIPTIVE-NAME:
UTILITY PROCEDURE
*
XX*
*
XX* FUNCTION: THIS PROCEDURE INVOKES THE ADMF UTILITIES IN THE
*
XX*
BATCH ENVIRONMENT
*
XX*
*
XX* PROCEDURE-OWNER:
UTILITY COMPONENT
*
XX*
*
XX* COMPONENT-INVOKED:
ADMF UTILITIES (ENTRY POINT DSNUTILB).
*
XX*
*
XX* ENVIRONMENT:
BATCH
*
XX*
*
XX* INPUT:
*
XX*
PARAMETERS:
*
XX*
LIB
= THE DATA SET NAME OF THE DB2 PROGRAM LIBRARY. *
XX*
THE DEFAULT LIBRARY NAME IS PREFIX.SDSNLOAD,
*
XX*
WITH PREFIX SET DURING INSTALLATION.
*
XX*
SIZE
= THE REGION SIZE OF THE UTILITIES EXECUTION AREA.*
XX*
THE DEFAULT REGION SIZE IS 2048K.
*
XX*
SYSTEM = THE SUBSYSTEM NAME USED TO IDENTIFY THIS JOB
*
XX*
TO DB2 . THE DEFAULT IS "DSNB".
*
XX*
UID
= THE IDENTIFIER WHICH WILL DEFINE THIS UTILITY
*
XX*
JOB TO DB2. IF THE PARAMETER IS DEFAULTED OR
*
XX*
SET TO A NULL STRING, THE UTILITY FUNCTION WILL *
XX*
USE ITS DEFAULT, USERID.JOBNAME. EACH UTILITY *
XX*
WHICH HAS STARTED AND IS NOT YET TERMINATED
*
XX*
(MAY NOT BE RUNNING) MUST HAVE A UNIQUE UID.
*
XX*
UTPROC = AN OPTIONAL INDICATOR USED TO DETERMINE WHETHER *
XX*
THE USER WISHES TO INITIALLY START THE REQUESTED*
XX*
UTILITY OR TO RESTART A PREVIOUS EXECUTION OF
*
XX*
THE UTILITY. IF OMITTED, THE UTILITY WILL
*
XX*
BE INITIALLY STARTED. OTHERWISE, THE UTILITY
*
XX*
WILL BE RESTARTED BY ENTERING THE FOLLOWING
*
XX*
VALUES:
*
XX*
RESTART(PHASE) = RESTART THE UTILITY AT THE *
XX*
BEGINNING OF THE PHASE EXECUTED
*
XX*
LAST.
*
XX*
RESTART = RESTART THE UTILITY AT THE LAST
*
XX*
OR CURRENT COMMIT POINT.
*
XX*
*
XX* OUTPUT: NONE.
*
XX*
*
XX* EXTERNAL-REFERENCES: NONE.
*
XX*
*
XX* CHANGE-ACTIVITY:
*
XX*
*
XX*
*
XX**********************************************************************
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-47
XX*
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
cl
Ex
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
18 //DSNUPROC.SYSMAP DD DSN=TSOUB01.SYSMAP,
//
DISP=(MOD,DELETE,CATLG),
//
SPACE=(16384,(20,20),,,ROUND),
//
UNIT=SYSDA
19 //DSNUPROC.SYSIN
DD *
1
STMT NO. MESSAGE
2 IEFC001I PROCEDURE DSNBUPRC WAS EXPANDED USING SYSTEM LIBRARY SYS2.DB2.PROCLIB
ICH70001I TSOUB01 LAST ACCESS AT 05:55:07 ON FRIDAY, AUGUST 26, 2011
IEF236I ALLOC. FOR TSOUB011 DSNUPROC UTIL
IGD103I SMS ALLOCATED TO DDNAME STEPLIB
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF237I JES2 ALLOCATED TO UTPRINT
IEF237I JES2 ALLOCATED TO SYSUDUMP
IGD101I SMS ALLOCATED TO DDNAME (SORTWK01)
DSN (TSOUB01.SORTWK01
)
STORCLAS (BASE) MGMTCLAS (STANDARD) DATACLAS (
)
VOL SER NOS= SMS004
IGD101I SMS ALLOCATED TO DDNAME (SORTWK02)
DSN (TSOUB01.SORTWK02
)
STORCLAS (BASE) MGMTCLAS (STANDARD) DATACLAS (
)
VOL SER NOS= SMS002
IGD101I SMS ALLOCATED TO DDNAME (SORTWK03)
DSN (TSOUB01.SORTWK03
)
STORCLAS (BASE) MGMTCLAS (STANDARD) DATACLAS (
)
VOL SER NOS= SMS001
IGD101I SMS ALLOCATED TO DDNAME (SORTWK04)
DSN (TSOUB01.SORTWK04
)
STORCLAS (BASE) MGMTCLAS (STANDARD) DATACLAS (
)
VOL SER NOS= SMS002
IGD103I SMS ALLOCATED TO DDNAME SYSREC
IGD101I SMS ALLOCATED TO DDNAME (SYSDISC )
DSN (TSOUB01.CV83.TSLOCN.DISCARD
)
STORCLAS (BASE) MGMTCLAS (STANDARD) DATACLAS (
)
VOL SER NOS= SMS004
IGD101I SMS ALLOCATED TO DDNAME (SYSUT1 )
DSN (TSOUB01.SYSUT1
)
STORCLAS (BASE) MGMTCLAS (STANDARD) DATACLAS (
)
VOL SER NOS= SMS001
IGD101I SMS ALLOCATED TO DDNAME (SORTOUT )
DSN (TSOUB01.SORTOUT
)
STORCLAS (BASE) MGMTCLAS (STANDARD) DATACLAS (
)
VOL SER NOS= SMS002
IGD101I SMS ALLOCATED TO DDNAME (SYSERR )
DSN (TSOUB01.SYSERR
)
STORCLAS (BASE) MGMTCLAS (STANDARD) DATACLAS (
)
VOL SER NOS= SMS001
IGD101I SMS ALLOCATED TO DDNAME (SYSMAP )
DSN (TSOUB01.SYSMAP
)
STORCLAS (BASE) MGMTCLAS (STANDARD) DATACLAS (
)
VOL SER NOS= SMS004
IEF237I JES2 ALLOCATED TO SYSIN
IEF142I TSOUB011 DSNUPROC UTIL - STEP WAS EXECUTED - COND CODE 0000
IGD104I DBDSNB.DB2A10.SDSNLOAD
RETAINED, DDNAME=STEPLIB
IEF285I
TSOUB01.TSOUB011.JOB00456.D0000102.?
SYSOUT
IEF285I
TSOUB01.TSOUB011.JOB00456.D0000103.?
SYSOUT
IEF285I
TSOUB01.TSOUB011.JOB00456.D0000104.?
SYSOUT
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-49
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
IGD105I TSOUB01.SORTWK01
DELETED,
DDNAME=SORTWK01
IGD105I TSOUB01.SORTWK02
DELETED,
DDNAME=SORTWK02
IGD105I TSOUB01.SORTWK03
DELETED,
DDNAME=SORTWK03
IGD105I TSOUB01.SORTWK04
DELETED,
DDNAME=SORTWK04
IGD104I TSOUB01.CV83.TSLOCN.DATA
RETAINED, DDNAME=SYSREC
IGD104I TSOUB01.CV83.TSLOCN.DISCARD
RETAINED, DDNAME=SYSDISC
IGD105I TSOUB01.SYSUT1
DELETED,
DDNAME=SYSUT1
IGD105I TSOUB01.SORTOUT
DELETED,
DDNAME=SORTOUT
IGD105I TSOUB01.SYSERR
DELETED,
DDNAME=SYSERR
IGD105I TSOUB01.SYSMAP
DELETED,
DDNAME=SYSMAP
IEF285I
TSOUB01.TSOUB011.JOB00456.D0000101.?
SYSIN
IEF373I STEP/DSNUPROC/START 2011238.0752
IEF032I STEP/DSNUPROC/STOP 2011238.0752
CPU:
0 HR 00 MIN 00.06 SEC
SRB:
0 HR 00 MIN 00.00 SEC
VIRT: 1232K SYS:
292K EXT: 1575816K SYS:
11616K
IEF375I JOB/TSOUB011/START 2011238.0752
IEF033I JOB/TSOUB011/STOP 2011238.0752
CPU:
0 HR 00 MIN 00.06 SEC
SRB:
0 HR 00 MIN 00.00 SEC
1DSNU000I
238 07:52:56.36 DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = TSOUB01
DSNU1044I
238 07:52:56.42 DSNUGTIS - PROCESSING SYSIN AS EBCDIC
0DSNU050I
238 07:52:56.53 DSNUGUTC - LOAD DATA
DSNU650I -DSNB 238 07:52:56.56 DSNURWI - INTO TABLE LOCATION
DSNU650I -DSNB 238 07:52:56.56 DSNURWI (LOCID POSITION(1:10) CHAR(10),
DSNU650I -DSNB 238 07:52:56.56 DSNURWI ADDRESS POSITION(11:40) CHAR(30),
DSNU650I -DSNB 238 07:52:56.56 DSNURWI CITY POSITION(41:70) CHAR(30),
DSNU650I -DSNB 238 07:52:56.56 DSNURWI POSTAL_CODE POSITION(71:85) CHAR(15),
DSNU650I -DSNB 238 07:52:56.56 DSNURWI COUNTRY POSITION(86:115) CHAR(30))
DSNU304I -DSNB 238 07:52:56.77 DSNURWT - (RE)LOAD PHASE STATISTICS - NUMBER OF RECORDS=4 FOR TABLE TSOUB01.LOCATION
DSNU1147I -DSNB 238 07:52:56.77 DSNURWT - (RE)LOAD PHASE STATISTICS - TOTAL NUMBER OF RECORDS LOADED=4 FOR TABLESPACE
WWV8301D.TSLOCN
DSNU302I
238 07:52:56.77 DSNURILD - (RE)LOAD PHASE STATISTICS - NUMBER OF INPUT RECORDS PROCESSED=4
DSNU300I
238 07:52:56.77 DSNURILD - (RE)LOAD PHASE COMPLETE, ELAPSED TIME=00:00:00
DSNU042I
238 07:52:56.96 DSNUGSOR - SORT PHASE STATISTICS NUMBER OF RECORDS=4
ELAPSED TIME=00:00:00
DSNU349I -DSNB 238 07:52:57.01 DSNURBXA - BUILD PHASE STATISTICS - NUMBER OF KEYS=4 FOR INDEX TSOUB01.IXLOCN1
DSNU258I
238 07:52:57.02 DSNURBXD - BUILD PHASE STATISTICS - NUMBER OF INDEXES=1
DSNU259I
238 07:52:57.02 DSNURBXD - BUILD PHASE COMPLETE, ELAPSED TIME=00:00:00
DSNU010I
238 07:52:57.03 DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST RETURN CODE=0
pr
cl
Ex
Student Exercises
0
G
0
0
0
0
G
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1ICE200I
ICE201I
ICE751I
ICE143I
ICE250I
ICE000I
0
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
ICE201I
ICE751I
ICE193I
ICE089I
ICE093I
ICE156I
ICE127I
ICE128I
ICE129I
ICE130I
ICE131I
ICE132I
ICE133I
ICE235I
ICE236I
ICE750I
ICE752I
ICE751I
ICE091I
ICE080I
ICE055I
ICE054I
ICE134I
ICE253I
ICE191I
ICE165I
ICE199I
ICE299I
ICE180I
ICE188I
ICE052I
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-51
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
TSOUB01.CV83.CNTL(L6TSDEPT) - 01.00
Columns 0
===>
Scroll
***************************** Top of Data *******************
LOAD DATA ENFORCE NO
INTO TABLE DEPARTMENT
(DEPTNO
POSITION(01:03) CHAR(03)
,
SUPERIOR_DEPTNO
POSITION(05:07) CHAR(03)
NULLIF(04)=X'FF',
MGRNO
POSITION(09:14) CHAR(06)
NULLIF(08)=X'FF',
NAME
POSITION(15)
VARCHAR
)
**************************** Bottom of Data *****************
The above control statement loads the following input data (length of column NAME stored
in (15:16), for example X001C = 28 = length of SPIFFY COMPUTER SERVICE DIV.).
TSOUB01.CV83.TSDEPT.DATA
===>
***************************** Top of Data *****
----+----1----+----2----+----3----+----4----+-A00
000010 SPIFFY COMPUTER SERVICE DIV.
CFFF0000FFFFFF01EDCCCE4CDDDEECD4ECDECCC4CCE4444
100F00000000100C279668036474359025959350495B000
-----------------------------------------------
Step 3: How does the LOAD utility know when to set MGRNO column
value for a row to NULL?
The utility control statement specifies that the MGRNO column value for a row should be
set to NULL when byte 8 of the input record contains X'FF'.
cl
Step 4: How does the LOAD utility know the length of the input data for
column NAME?
Ex
The LOAD utility assumes that the first 2 bytes (15-16) of the input data for column NAME
contain the length of the input data.
pr
The control statement should specify ENFORCE NO, because one of the parent tables
(EMPLOYEE) has not been loaded yet.
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
ERROR SEVERITY :1
INPUT RECORD
:
12
DISCARD RECORD :
1
ERROR TYPE
:
DUP. KEY
RELATED ERROR
:
0
TABLE NAME
: TSOUB01.DEPARTMENT
FIELD/FANSET NAME: TSOUB01.IXDEPT1
ERROR SEVERITY :1
INPUT RECORD
:
13
DISCARD RECORD :
2
ERROR TYPE
:
DUP. KEY
RELATED ERROR
:
12
TABLE NAME
: TSOUB01.DEPARTMENT
FIELD/FANSET NAME: TSOUB01.IXDEPT1
DSNU396I
239 12:54:03.69 DSNURREP - REPORT PHASE COMPLETE, ELAPSED TIME=00:00:00
DSNU561I -DSNB 239 12:54:03.70 DSNUGSRX - TABLESPACE WWV8301D.TSDEPT PARTITION 1 IS IN CHECK PENDING
DSNU010I
239 12:54:03.72 DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST RETURN CODE=4
1DSNU000I
239
DSNU1044I
239
0DSNU050I
239
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU304I -DSNB
DSNU1147I -DSNB
WWV8301D.TSDEPT
DSNU302I
239
DSNU300I
239
DSNU042I
239
Steps 6 to 8: LOAD utility output for DEPARTMENT table - just the DB2 messages
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-53
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Yes, table space TSDEPT is placed in check pending state, as can be seen from the output
of the LOAD utility, and also from the DISPLAY DATABASE command:
pr
Ex
cl
V5.4.0.3
Student Exercises
EXempty
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
TSOUB01.CV83.CNTL(L6TSEMPL) - 01.00
Columns 00
===>
Scroll
***************************** Top of Data ********************
LOAD DATA
INTO TABLE EMPLOYEE
(EMPNO
POSITION(001:006) CHAR(06)
,
FIRST_NAME
POSITION(007:026) CHAR(20)
,
MIDDLE_INITIAL
POSITION(028:028) CHAR(01)
NULLIF(027)=X'FF',
SEX
POSITION(029:029) CHAR(01)
,
BIRTHDATE
POSITION(031:040) DATE EXTERNAL
NULLIF(030)=X'FF',
PHONE
POSITION(042:045) CHAR(04)
NULLIF(041)=X'FF',
HIRING_DATE
POSITION(047:056) DATE EXTERNAL
NULLIF(046)=X'FF',
JOB
POSITION(058:077) CHAR(20)
NULLIF(057)=X'FF',
EDUCATION
POSITION(078:079) SMALLINT
,
SALARY
POSITION(081:085) DECIMAL
NULLIF(080)=X'FF',
BONUS
POSITION(087:091) DECIMAL
NULLIF(086)=X'FF',
COMMISSION
POSITION(093:097) DECIMAL
NULLIF(092)=X'FF',
DEPTNO
POSITION(099:101) CHAR(003)
NULLIF(098)=X'FF',
LOCID
POSITION(103:112) CHAR(010)
NULLIF(102)=X'FF',
LAST_NAME
POSITION(113)
VARCHAR
)
**************************** Bottom of Data *******************
A-55
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
TSOUB01.CV83.TSEMPL.DATA
***************************** Top of Data *********
----------------------------------------------------+----8----+----9----+----0----+----1----+----2----+----F----+----F----+----F----+----F----+----F----+----8----+----9----+----0----+----1----+----2----------------------------------------------------
A00 DE71083-01 HAAS
44444010057000000000002000CFF0CCFFFFF6FF00CCCE44444
000000200250C00100C00420C01000457108300104811200000
--------------------------------------------------
B01 DE71083-01 THOMPSON
44444010042000008000003000CFF0CCFFFFF6FF00ECDDDEDD4
000000200150C00000C00300C02010457108300108386472650
Salary is stored in (81:85), for example for HAAS: X005275000C, thus 52750.00
Why can the control statement specify (by default) ENFORCE CONSTRAINTS?
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
239
239
239
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
1DSNU000I
DSNU1044I
0DSNU050I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU310I
Steps 12 to 14: LOAD utility output for EMPLOYEE table - just the DB2 messages, part 1 of 2
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-57
pr
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
239 13:01:38.45 DSNURDNP - DISCARD PHASE STATISTICS - 6 INPUT DATA SET RECORDS DISCARDED
239 13:01:38.45 DSNURDIS - DISCARD PHASE COMPLETE, ELAPSED TIME=00:00:00
239 13:01:38.48 DSNURRIS - LOAD UTILITY ERROR SUMMARY REPORT
ERROR SEVERITY :1
INPUT RECORD
:
8
DISCARD RECORD :
1
ERROR TYPE
:
CONVERSION
RELATED ERROR
:
0
TABLE NAME
: TSOUB01.EMPLOYEE
FIELD/FANSET NAME: BIRTHDATE
ERROR SEVERITY :1
INPUT RECORD
:
10
DISCARD RECORD :
2
ERROR TYPE
:
CHK. CONSTR.
RELATED ERROR
:
0
TABLE NAME
: TSOUB01.EMPLOYEE
FIELD/FANSET NAME: SEX.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ERROR SEVERITY :1
INPUT RECORD
:
12
DISCARD RECORD :
3
ERROR TYPE
:
REF. INTEG.
RELATED ERROR
:
0
TABLE NAME
: TSOUB01.EMPLOYEE
FIELD/FANSET NAME: DE
ERROR SEVERITY :1
INPUT RECORD
:
13
DISCARD RECORD :
4
ERROR TYPE
:
REF. INTEG.
RELATED ERROR
:
0
TABLE NAME
: TSOUB01.EMPLOYEE
FIELD/FANSET NAME: DE
ERROR SEVERITY :1
INPUT RECORD
:
20
DISCARD RECORD :
5
ERROR TYPE
:
CONVERSION
RELATED ERROR
:
0
TABLE NAME
: TSOUB01.EMPLOYEE
FIELD/FANSET NAME: SALARY
ERROR SEVERITY :1
INPUT RECORD
:
34
DISCARD RECORD :
6
ERROR TYPE
:
REF. INTEG.
RELATED ERROR
:
0
TABLE NAME
: TSOUB01.EMPLOYEE
FIELD/FANSET NAME: LE
DSNU396I
239 13:01:38.51 DSNURREP - REPORT PHASE COMPLETE, ELAPSED TIME=00:00:00
DSNU010I
239 13:01:38.55 DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST RETURN CODE=4
DSNU375I
DSNU376I
DSNU399I
Steps 12 to 14: LOAD utility output for EMPLOYEE table - just the DB2 messages, part 2 of 2
cl
Ex
Student Exercises
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
c. Record number 20 has a value for SALARY which causes a conversion error.
a. Record number 12 has a value for DEPTNO which does not exist in the
DEPARTMENT table and causes an RI violation (relationship DE; see
FIELD/FANSET NAME in the job output).
b. Record number 13 has a value for DEPTNO which does not exist in the
DEPARTMENT table and causes an RI violation (relationship DE; see
FIELD/FANSET NAME in the job output).
pr
Ex
cl
c. Record number 34 has a value for LOCID which does not exist in the LOCATION
table and causes an RI violation (relationship LE; see FIELD/FANSET NAME in the
job output).
A-59
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
CREATE TABLE EX_DEPARTMENT
LIKE DEPARTMENT
IN WWV8301D.TSEXCEPT;
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
COMMIT;
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
ALTER TABLE EX_DEPARTMENT
ADD RID CHAR(5);
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
ALTER TABLE EX_DEPARTMENT
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
cl
---------+---------+---------+---------+---------+---------+
CREATE TABLE EX_EMPLOYEE
Ex
LIKE EMPLOYEE
IN WWV8301D.TSEXCEPT;
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
pr
---------+---------+---------+---------+---------+---------+
COMMIT;
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
CREATE TABLE EX_PROJECT
LIKE PROJECT
IN WWV8301D.TSEXCEPT;
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
COMMIT;
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
ALTER TABLE EX_PROJECT
ADD RID CHAR(5);
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
ALTER TABLE EX_PROJECT
cl
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
Ex
IN WWV8301D.TSEXCEPT;
pr
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
COMMIT;
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
A-61
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
CREATE TABLE EX_ACTIVITY
LIKE ACTIVITY
IN WWV8301D.TSEXCEPT;
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
COMMIT;
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
ALTER TABLE EX_ACTIVITY
ADD RID CHAR(5);
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
cl
---------+---------+---------+---------+---------+---------+----
Ex
---------+---------+---------+---------+---------+---------+----
pr
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
1DSNU000I
241 01:59:07.22 DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = TSOUB01
DSNU1044I
241 01:59:07.25 DSNUGTIS - PROCESSING SYSIN AS EBCDIC
0DSNU050I
241 01:59:07.25 DSNUGUTC - CHECK DATA TABLESPACE WWV8301D.TSDEPT FOR EXCEPTION IN DEPARTMENT USE
EX_DEPARTMENT DELETE NO
DSNU726I -DSNB 241 01:59:07.26 DSNUKINP - SCOPE PENDING IS ACTIVE, BUT THE ENTIRE
TABLE SPACE 'WWV8301D.TSDEPT' MUST BE CHECKED
DSNU730I
241 01:59:07.36 DSNUKDST - CHECKING TABLE TSOUB01.DEPARTMENT
DSNU042I
241 01:59:07.48 DSNUGSOR - SORT PHASE STATISTICS NUMBER OF RECORDS=2
ELAPSED TIME=00:00:00
DSNU733I
241 01:59:07.48 DSNUKERK - ROW (RID=X'000000020A') HAS NO PARENT FOR TSOUB01.DEPARTMENT.ED
DSNU733I
241 01:59:07.48 DSNUKERK - ROW (RID=X'000000020B') HAS NO PARENT FOR TSOUB01.DEPARTMENT.DD
DSNU739I
241 01:59:07.48 DSNUKDAT - CHECK TABLE TSOUB01.DEPARTMENT COMPLETE, ELAPSED TIME=00:00:00
DSNU561I -DSNB 241 01:59:07.49 DSNUGSRX - TABLESPACE WWV8301D.TSDEPT PARTITION 1 IS IN CHECK PENDING
DSNU749I
241 01:59:07.49 DSNUK001 - CHECK DATA COMPLETE,ELAPSED TIME=00:00:00
DSNU010I
241 01:59:07.50 DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST RETURN CODE=4
Steps 16 to 18: CHECK DATA utility output (DELETE NO) - just the DB2 messages
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-63
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Yes, table space TSDEPT has remained in check pending status, as revealed by the
output of the CHECK DATA utility. As long as any rows exist in the table which violate
either check constraints or RI constraints, the table space remains in check pending
status.
2. How many rows has CHECK DATA found to be invalid, and why?
CHECK DATA found two rows to be invalid.
A row has a value for MGRNO, and EMPNO with this value does not exist in the
EMPLOYEE table, causing an RI constraint violation (ROW (RID=X'000000020A') HAS
NO PARENT FOR TSOUB01.DEPARTMENT.ED, that is, relationship ED).
pr
Ex
cl
A row has a value for SUPERIOR_DEPTNO, and DEPTNO with this value does not
exist in the DEPARTMENT table, causing an RI constraint violation (ROW
(RID=X'000000020B') HAS NO PARENT FOR TSOUB01.DEPARTMENT.DD, that is,
relationship DD).
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+
SELECT TIME(TIME) AS TIME, DEPTNO, SUPERIOR_DEPTNO, MGRNO,
SUBSTR(NAME, 1, 16) AS NAME, HEX(RID) AS RID
FROM EX_DEPARTMENT;
---------+---------+---------+---------+---------+---------+---------+
TIME
DEPTNO SUPERIOR_DEPTNO MGRNO
NAME
RID
---------+---------+---------+---------+---------+---------+---------+
01.59.07 E31
E01
000101 SOFTWARE SUPP-31 000000020A
01.59.07 E41
X01
000102 SOFTWARE SUPP-41 000000020B
DSNE610I NUMBER OF ROWS DISPLAYED IS 2
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+---------+
Remember: Columns RID [CHAR(5)] and TIME [TIMESTAMP] are additional columns.
CHECK DATA job output (see above) indicates that:
1. Row with RID ...020A has no parent for relation ED. Hence, we can conclude that
MGRNO value 000101 has no parent value in column EMPNO of table EMPLOYEE.
2. Row with RID ...020B has no parent for relation DD. Hence, we can conclude that
SUPERIOR_DEPTNO value X01 has no parent value in column DEPTNO of table
DEPARTMENT.
cl
---------+---------+---------+---------+---------+---------+---------+
SELECT TIME(TIME) AS TIME, EMPNO, DEPTNO,
SUBSTR(FIRST_NAME, 1, 10) AS FIRST_NAME,
SUBSTR(LAST_NAME, 1, 10) AS LAST_NAME,
SUBSTR(JOB, 1, 10) AS JOB, HEX(RID) AS RID
FROM EX_EMPLOYEE;
---------+---------+---------+---------+---------+---------+---------+
TIME
EMPNO
DEPTNO FIRST_NAME LAST_NAME
JOB
RID
---------+---------+---------+---------+---------+---------+---------+
DSNE610I NUMBER OF ROWS DISPLAYED IS 0
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+---------+
pr
Ex
A-65
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
1DSNU000I
241 02:11:44.27 DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = TSOUB01
DSNU1044I
241 02:11:44.29 DSNUGTIS - PROCESSING SYSIN AS EBCDIC
0DSNU050I
241 02:11:44.30 DSNUGUTC - CHECK DATA TABLESPACE WWV8301D.TSDEPT FOR EXCEPTION IN DEPARTMENT USE
EX_DEPARTMENT IN EMPLOYEE USE EX_EMPLOYEE IN PROJECT USE EX_PROJECT IN ON_PROJECT USE EX_ON_PROJECT IN ACTIVITY USE
EX_ACTIVITY DELETE YES
DSNU726I -DSNB 241 02:11:44.30 DSNUKINP - SCOPE PENDING IS ACTIVE, BUT THE ENTIRE
TABLE SPACE 'WWV8301D.TSDEPT' MUST BE CHECKED
DSNU730I
241 02:11:44.51 DSNUKDST - CHECKING TABLE TSOUB01.DEPARTMENT
DSNU042I
241 02:11:44.56 DSNUGSOR - SORT PHASE STATISTICS NUMBER OF RECORDS=2
ELAPSED TIME=00:00:00
DSNU733I
241 02:11:44.56 DSNUKERK - ROW (RID=X'000000020A') HAS NO PARENT FOR TSOUB01.DEPARTMENT.ED
DSNU733I
241 02:11:44.56 DSNUKERK - ROW (RID=X'000000020B') HAS NO PARENT FOR TSOUB01.DEPARTMENT.DD
DSNU739I
241 02:11:44.56 DSNUKDAT - CHECK TABLE TSOUB01.DEPARTMENT COMPLETE, ELAPSED TIME=00:00:00
DSNU741I -DSNB 241 02:11:44.60 DSNUKRDY - 2 ROWS DELETED FROM TABLE TSOUB01.DEPARTMENT
DSNU741I -DSNB 241 02:11:44.60 DSNUKRDY - 4 ROWS DELETED FROM TABLE TSOUB01.EMPLOYEE
DSNU749I
241 02:11:44.61 DSNUK001 - CHECK DATA COMPLETE,ELAPSED TIME=00:00:00
DSNU010I
241 02:11:44.61 DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST RETURN CODE=4
pr
cl
Ex
Student Exercises
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
As can be seen from the DISPLAY DATABASE command output, table space TSDEPT is
no longer in check pending state.
Table space TSEXCEPT is in advisory REORG-pending (AREO*) state. This means there
are no restrictions to access the data in this table space. However, there may be an impact
on performance until this table space is reorganized. For now, you can ignore this.
cl
How many rows has CHECK DATA deleted from table DEPARTMENT,
and why?
Two rows have been deleted by the CHECK DATA utility:
Ex
The DEPARTMENT row with a DEPTNO column value of E31 has been deleted
because it had an invalid MGRNO column value (000101), that is, the foreign key value
violated referential constraint 'ED'.
pr
The DEPARTMENT row with a DEPTNO column value of E41 has been deleted
because it had an invalid SUPERIOR_DEPTNO column value (X01), that is, the foreign
key value violated referential constraint 'DD'.
A-67
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+
SELECT TIME(TIME) AS TIME, DEPTNO, SUPERIOR_DEPTNO, MGRNO,
SUBSTR(NAME, 1, 16) AS NAME, HEX(RID) AS RID
FROM EX_DEPARTMENT;
---------+---------+---------+---------+---------+---------+---------+
TIME
DEPTNO SUPERIOR_DEPTNO MGRNO
NAME
RID
---------+---------+---------+---------+---------+---------+---------+
01.59.07 E31
E01
000101 SOFTWARE SUPP-31 000000020A
01.59.07 E41
X01
000102 SOFTWARE SUPP-41 000000020B
02.11.44 E31
E01
000101 SOFTWARE SUPP-31 000000020A
02.11.44 E41
X01
000102 SOFTWARE SUPP-41 000000020B
DSNE610I NUMBER OF ROWS DISPLAYED IS 4
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+---------+
The first two rows were inserted when the optional steps 16 and 17 were executed
(CHECK DATA utility with DELETE NO) and the last two rows were inserted because of executing
CHECK DATA utility with DELETE YES.
cl
Ex
All the four rows were inserted because of executing CHECK DATA utility with DELETE YES.
The deletion of the parent row with a DEPTNO column value of E31 from DEPARTMENT
table caused three dependent rows in the EMPLOYEE table to be deleted.
pr
The deletion of the parent row with a DEPTNO column value of E41 from DEPARTMENT
table caused one dependent row in the EMPLOYEE table to be deleted.
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Answer - To gather inline statistics. This eliminates the need for RUNSTATS after LOAD
Question: What is the purpose of using the keyword STATISTICS in the LOAD utility control statement when loading the PROJECT
table?
241
241
-DSNB
DSNU363I
DSNU369I
DSNU010I
-DSNB
-DSNB
-DSNB
241
241
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
DSNU349I
DSNU349I
DSNU349I
DSNU258I
DSNU259I
DSNU610I
DSNU610I
DSNU610I
DSNU620I
DSNU363I
1DSNU000I
241
DSNU1044I
241
0DSNU050I
241
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU350I -DSNB
DSNU304I -DSNB
DSNU1147I -DSNB
WWV8301D.TSPROJ
DSNU302I
241
DSNU300I
241
DSNU042I
241
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-69
241
241
241
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
-DSNB
241
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
1DSNU000I
DSNU1044I
0DSNU050I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU650I
DSNU330I
DSNU012I
Steps 28 to 30: LOAD utility output for ON_PROJECT and ACTIVITY tables (RESUME NO by default)
cl
Ex
Student Exercises
V5.4.0.3
Student Exercises
EXempty
Step 31: Why did the load of ON_PROJECT and ACTIVITY fail?
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
The utility control statement specified (by default) RESUME NO, which means that the
utility assumes that the table space is empty. If the table space is not empty and the control
statement does not specify REPLACE, the utility terminates with return code 8.
A-71
-DSNB
DSNU363I
241
241
-DSNB
DSNU363I
DSNU369I
DSNU010I
-DSNB
-DSNB
-DSNB
-DSNB
241
241
-DSNB
DSNU349I
DSNU349I
DSNU349I
DSNU349I
DSNU258I
DSNU259I
DSNU363I
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
1DSNU000I
241
DSNU1044I
241
0DSNU050I
241
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU650I -DSNB
DSNU304I -DSNB
DSNU304I -DSNB
DSNU1147I -DSNB
WWV8301D.TSPROJ
DSNU302I
241
DSNU300I
241
DSNU042I
241
Steps 31 to 33: LOAD utility output for ON_PROJECT and ACTIVITY tables (RESUME YES)
cl
Ex
Student Exercises
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
No, the REPLACE option applies to all data in a table space or partition.
b. How was the use of REPLACE option appropriate when the PROJECT table
data was loaded?
The REPLACE option was appropriate because the table space was empty. The
reason for using the REPLACE option is that, in conjunction with STATISTICS,
statistics are gathered in the catalog tables, including the real-time statistics tables.
c. Assuming you have reset the ACTIVITY table, can you repeat steps 28 to 30 to
load the ON_PROJECT and ACTIVITY tables?
pr
Ex
cl
You cannot do this unless you get rid of the data from ON_PROJECT table first by
issuing a mass DELETE statement DELETE FROM ON_PROJECT. Of course you
can do a LOAD RESUME YES of only the ACTIVITY table and there is no need to
get rid of the data from ON_PROJECT table.
A-73
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
V5.4.0.3
Student Exercises
EXempty
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
DBDSNB.DSNBBC.WWV8301D.TSNEWDEP.I0001.A001
DBDSNB.DSNBBD.WWV8301D.TSNEWDEP.I0001.A001
A-75
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
1DSNU000I
241 03:00:17.95 DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = TSOUB01
DSNU1044I
241 03:00:17.98 DSNUGTIS - PROCESSING SYSIN AS EBCDIC
0DSNU050I
241 03:00:17.98 DSNUGUTC - LOAD DATA LOG NO
DSNU650I -DSNB 241 03:00:17.98 DSNURWI - INTO TABLE NEWDEPT
DSNU650I -DSNB 241 03:00:17.98 DSNURWI (DEPTNO POSITION(1:3) CHAR(3),
DSNU650I -DSNB 241 03:00:17.98 DSNURWI SUPERIOR_DEPTNO POSITION(5:7) CHAR(3) NULLIF(4)=X'FF',
DSNU650I -DSNB 241 03:00:17.98 DSNURWI MGRNO POSITION(9:14) CHAR(6) NULLIF(8)=X'FF',
DSNU650I -DSNB 241 03:00:17.98 DSNURWI NAME POSITION(15) VARCHAR)
DSNU304I -DSNB 241 03:00:38.06 DSNURWT - (RE)LOAD PHASE STATISTICS - NUMBER OF RECORDS=150003 FOR TABLE
TSOUB01.NEWDEPT
DSNU1147I -DSNB 241 03:00:38.06 DSNURWT - (RE)LOAD PHASE STATISTICS - TOTAL NUMBER OF RECORDS LOADED=150003 FOR
TABLESPACE WWV8301D.TSNEWDEP
DSNU302I
241 03:00:38.06 DSNURILD - (RE)LOAD PHASE STATISTICS - NUMBER OF INPUT RECORDS PROCESSED=150003
DSNU300I
241 03:00:38.06 DSNURILD - (RE)LOAD PHASE COMPLETE, ELAPSED TIME=00:00:20
DSNU380I -DSNB 241 03:00:38.06 DSNUGSRX - TABLESPACE WWV8301D.TSNEWDEP PARTITION 1 IS IN COPY PENDING
DSNU380I -DSNB 241 03:00:38.06 DSNUGSRX - TABLESPACE WWV8301D.TSNEWDEP PARTITION 2 IS IN COPY PENDING
DSNU010I
241 03:00:38.06 DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST RETURN CODE=4
pr
cl
Ex
Student Exercises
V5.4.0.3
Student Exercises
EXempty
Step 38: How many partitions do you see after the LOAD utility
completes?
Note we started with one partition and after successful completion of LOAD utility, two
partitions are placed in copy pending (because of LOG NO).
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
ISPF 3.4 confirms the partition by growth universal table space has now grown to 2
partitions:
DBDSNB.DSNBBC.WWV8301D.TSNEWDEP.I0001.A001
DBDSNB.DSNBBC.WWV8301D.TSNEWDEP.I0001.A002
DBDSNB.DSNBBD.WWV8301D.TSNEWDEP.I0001.A001
DBDSNB.DSNBBD.WWV8301D.TSNEWDEP.I0001.A002
pr
Ex
cl
A-77
Student Exercises
//
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Job output:
pr
Ex
cl
1DSNU000I
241 03:26:38.92 DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = TSOUB01
DSNU1044I
241 03:26:38.95 DSNUGTIS - PROCESSING SYSIN AS EBCDIC
0DSNU050I
241 03:26:38.95 DSNUGUTC - UNLOAD TABLESPACE WWV8301D.TSPROJ
DSNU253I
241 03:26:38.99 DSNUUNLD - UNLOAD PHASE STATISTICS - NUMBER OF RECORDS
UNLOADED=290 FOR TABLE TSOUB01.PROJECT
DSNU253I
241 03:26:38.99 DSNUUNLD - UNLOAD PHASE STATISTICS - NUMBER OF RECORDS
UNLOADED=39 FOR TABLE TSOUB01.ON_PROJECT
DSNU253I
241 03:26:38.99 DSNUUNLD - UNLOAD PHASE STATISTICS - NUMBER OF RECORDS
UNLOADED=74 FOR TABLE TSOUB01.ACTIVITY
DSNU252I
241 03:26:38.99 DSNUUNLD - UNLOAD PHASE STATISTICS - NUMBER OF RECORDS
UNLOADED=403 FOR TABLESPACE WWV8301D.TSPROJ
DSNU250I
241 03:26:38.99 DSNUUNLD - UNLOAD PHASE COMPLETE, ELAPSED TIME=00:00:00
DSNU010I
241 03:26:39.00 DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST RETURN CODE=0
V5.4.0.3
Student Exercises
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
EXempty
A-79
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
BROWSE
TSOUB01.CV83.TSPROJ.UNLOAD.DATA
Line 00000000 Col 001 080
Command ===>
Scroll ===> CSR
******************************** Top of Data **********************************
..AD3100D01000010....1982-01-01.1983-02-01..ADMIN SERVICES
..MA2100D01000010.....1982-01-01.1983-02-01..WELD LINE AUTOMATION
..PL2100B01000020.....1982-01-01.1982-09-15..WELD LINE PLANNING ...
...etc
...
..AD3100000010
..MA2100000010
..MA2110000010
..PL2100000020
...
...etc
...
..AD3100000010.........1982-01-01.1982-07-01
..AD3110000070.........1982-01-01.1983-02-01
..AD3111000230.........1982-01-01.1982-03-15
..AD3111000230.........1982-03-15.1982-04-15
...
...etc
...
pr
cl
Ex
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Remark:
If you set hex on, you see the that OBID of the table is unloaded first:
here 000B for PROJECT
(similar: 000C for ON_PROJECT, 000D for ACTIVITY)
-----------------------------------------------------------------------------000001
AD3100D01000010 01/01/1982 02/01/1983 ADMIN SERVICES
00CCFFFFCFFFFFFFF00600FF4FF4FFFF0FF4FF4FFFF00CCDCD4ECDECCCE4444444444444
0B143100401000010005C001B01B1982001B02B19830E144950259593520000000000000
-----------------------------------------------------------------------------000002
MA2100D01000010
01/01/1982 02/01/1983 WELD LINE AUTOMATION
00DCFFFFCFFFFFFFF00200FF4FF4FFFF0FF4FF4FFFF01ECDC4DCDC4CEEDDCECDD4444444
0B412100401000010010C001B01B1982001B02B198304653403955014364139650000000
-----------------------------------------------------------------------------000003
PL2100B01000020
01/01/1982 09/15/1982 WELD LINE PLANNING
00DDFFFFCFFFFFFFF00100FF4FF4FFFF0FF4FF4FFFF01ECDC4DCDC4DDCDDCDC444444444
0B732100201000020000C001B01B1982015B09B198202653403955073155957000000000
------------------------------------------------------------------------------
EDIT
TSOUB01.CV83.TSPROJ.UNLOAD.DATA
Columns 00001 00072
Command ===> hex on
Scroll ===> CSR
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7-****** ***************************** Top of Data ******************************
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-81
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
1DSNU000I
241
DSNU1044I
241
0DSNU050I
241
DSNU650I -DSNB
DSNU253I
241
TSOUB01.PROJECT
DSNU252I
241
WWV8301D.TSPROJ
DSNU250I
241
DSNU010I
241
05:27:12.97 DSNUUNLD - UNLOAD PHASE COMPLETE, ELAPSED TIME=00:00:00
05:27:12.98 DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST RETURN CODE=0
05:27:12.97 DSNUUNLD - UNLOAD PHASE STATISTICS - NUMBER OF RECORDS UNLOADED=290 FOR TABLESPACE
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-83
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Note: With delimited, the OBID is not unloaded at the beginning of the record.
"AD3230","D21","000270",2.00,1982-01-01,1983-02-01,"ACCOUNT.PROGRAMMING"
"OP2011","E21","000320",1.00,1982-01-01,1983-02-01,"SCP SYSTEMS SUPPORT"
"OP2012","E21","000330",1.00,1982-01-01,1983-02-01,"APPLICATIONS SUPPORT"
"OP2013","E21","000340",1.00,1982-01-01,1983-02-01,"DB/DC SUPPORT"
"OP2063","E21","000100",4.00,1982-01-01,1983-02-01,"SYSTEMS SUPPORT"
"MA2112","D11","000150",3.00,1982-01-01,1982-12-01,"W L ROBOT DESIGN"
"MA2113","D11","000160",3.00,1982-02-15,1982-12-01,"W L PROD CONT PROGS"
"MA2111","D11","000220",2.00,1982-01-01,1982-12-01,"W L PROGRAM DESIGN"
"AD3111","D21","000230",2.00,1982-01-01,1983-02-01,"PAYROLL PROGRAMMING"
"AD3112","D21","000250",1.00,1982-01-01,1983-02-01,"PERSONNEL PROGRAMMG"
"AD3113","D21","000270",2.00,1982-01-01,1983-02-01,"ACCOUNT.PROGRAMMING"
..........................................................................
..........................................................................
..........................................................................
"MA2163","D11","000060",9.00,1982-01-01,1983-02-01,"W L PROGRAMMING"
"AD3110","D21","000070",6.00,1982-01-01,1983-02-01,"GENERAL AD SYSTEMS"
"OP1010","E11","000090",5.00,1982-01-01,1983-02-01,"OPERATION"
"OP2010","E21","000100",4.00,1982-01-01,1983-02-01,"SYSTEMS SUPPORT"
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
"AD3100","D01","000010",6.50,1982-01-01,1983-02-01,"ADMIN SERVICES"
"MA2100","D01","000010",12.00,1982-01-01,1983-02-01,"WELD LINE AUTOMATION"
"PL2100","B01","000020",1.00,1982-01-01,1982-09-15,"WELD LINE PLANNING"
..........................................................................
..........................................................................
..........................................................................
pr
Step 41: PROJECT table data unloaded in delimited format by UNLOAD utility
cl
Ex
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
X'4B'
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-85
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+
CREATE VIEW VDEPMGR AS
(SELECT E1.EMPNO, SUBSTR(E1.LAST_NAME,1,10) AS LAST_NAME,
E1.DEPTNO,
D.MGRNO, SUBSTR(E2.LAST_NAME,1,10) AS MGRNAME
FROM EMPLOYEE E1
INNER JOIN DEPARTMENT D
ON E1.DEPTNO = D.DEPTNO
INNER JOIN EMPLOYEE E2
ON D.MGRNO = E2.EMPNO) ;
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
View result:
cl
pr
Ex
000320 MEHTA
E21
000100 SPENSER
000330 LEE
E21
000100 SPENSER
000340 GOUNOT
E21
000100 SPENSER
DSNE610I NUMBER OF ROWS DISPLAYED IS 32
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
TSOUB01.CV83.CNTL(L6TIAUL) - 01.02
===>
***************************** Top of Data ***********************
//TSOUB011 JOB 1CV83G26,'TSOUB01 JOB
',MSGLEVEL=(1,1),
//
CLASS=A,MSGCLASS=Q,NOTIFY=&SYSUID,REGION=0M
//*******************************************************************
//*
*
//*******************************************************************
//DSNTIAUL EXEC PGM=IKJEFT01,DYNAMNBR=20
//STEPLIB DD DSN=DBDSNB.DB2A10.SDSNEXIT,DISP=SHR
//
DD DSN=DBDSNB.DB2A10.SDSNLOAD,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DSNB)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIB10) PARMS('SQL,10') LIB('DBDSNB.DB2A10.RUNLIB.LOAD')
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSREC00 DD DSN=&SYSUID..CV83.DSNTIAUL.SELECT00,
//
UNIT=SYSDA,SPACE=(32760,(20,20)),DISP=(,CATLG)
//SYSREC01 DD DSN=&SYSUID..CV83.DSNTIAUL.SELECT01,
//
UNIT=SYSDA,SPACE=(32760,(20,20)),DISP=(,CATLG)
//SYSPUNCH DD DSN=&SYSUID..CV83.DSNTIAUL.PUNCH,
//
UNIT=SYSDA,SPACE=(800,(15,15)),DISP=(,CATLG),
//
RECFM=FB,LRECL=120,BLKSIZE=1200
//SYSIN
DD *
SELECT * FROM TSOUB01.VDEPMGR ;
SELECT * FROM TSOUB01.LOCATION L, TSOUB01.EMPLOYEE E
WHERE E.LOCID = L.LOCID
ORDER BY L.LOCID ;
**************************** Bottom of Data *********************
cl
Job output:
pr
Ex
A-87
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
TSOUB01.CV83.DSNTIAUL.SELECT00
===>
***************************** Top of Data *****
000010HAAS
A00 000010 HAAS
000110LUCCHESI A00 000010 HAAS
000120O'CONNELL A00 000010 HAAS
000020THOMPSON B01 000020 THOMPSON
000130QUINTANA C01 000030 KWAN
000140NICHOLLS C01 000030 KWAN
........
**************************** Bottom of Data ***
pr
Ex
cl
TSOUB01.CV83.DSNTIAUL.SELECT01
...
===>
...
***************************** Top of Data **********...
DE71083-01AM FICHTENBERG 1
HERRENBERG ...
DE71083-01AM FICHTENBERG 1
HERRENBERG ...
DE71083-01AM FICHTENBERG 1
HERRENBERG ...
DE71083-01AM FICHTENBERG 1
HERRENBERG ...
US95141-B4555 BAILEY AVENUE
SAN JOSE
...
US95141-B4555 BAILEY AVENUE
SAN JOSE
...
US95141-B4555 BAILEY AVENUE
SAN JOSE
...
US95141-B4555 BAILEY AVENUE
SAN JOSE
...
..........
...
**************************** Bottom of Data ********...
V5.4.0.3
Student Exercises
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
EXempty
The generated LOAD statements need modifications: Loading into a R/O view or loading
employee fields into the LOCATION table are not possible.
A-89
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
f. 2 holes derive from LOAD department; 2 rows deleted because of unique index
violation.
2 holes derived from CHECK DATA; 2 rows deleted because of RI violations.
Note
For universal table spaces, prior to Version 10 NFM, holes consist of free space in a data
page and occur when a record is deleted. In Version 10 NFM, DB2 does not mark and
chain the pseudo deleted row as a hole, so that the content remains available to read
transactions with currently committed semantic. The four PD-REC records you see in
Page 2 of DSN1PRNT output are for the 4 rows deleted.
g. There is only one table in TSDEPT: SELECT COUNT(*) FROM DEPARTMENT yields 9.
h. OBID of the table: PGSOBD='000A'X. This equals the information in the DB2 catalog:
Ex
cl
pr
i.
j.
Insert of a row with maximal length, which is 66 according to the DB2 catalog, table
SYSIBM.SYSCOLUMNS (taking into account a 2-byte length field and 2 Null
Indicators). After stop and start TSDEPT, the new DSN1PRNT output (not depicted)
for this new row is 72. Reason: Each record has a 6-byte header.
V5.4.0.3
Student Exercises
EXempty
DSN1PRNT job
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
TSOUB01.CV83.CNTL(L6PRINT) - 01.00
Columns 00001 00072
===>
Scroll ===> CSR
//TSOUB011 JOB 1CV83G26,'TSOUB01 JOB
',MSGLEVEL=(1,1),
//
CLASS=A,MSGCLASS=Q,NOTIFY=&SYSUID,REGION=0M
//*******************************************************************
//*
*
//*******************************************************************
//STEP1
EXEC PGM=DSN1PRNT,PARM='PRINT(0,2),EBCDIC,FORMAT'
//STEPLIB DD DSN=DBDSNB.DB2A10.SDSNEXIT,DISP=SHR
//
DD DSN=DBDSNB.DB2A10.SDSNLOAD,DISP=SHR
//SYSUT1
DD DSN=DBDSNB.DSNDBC.WWV8301D.TSDEPT.I0001.A001,DISP=SHR
//SYSPRINT DD SYSOUT=*
**************************** Bottom of Data ****************************
A-91
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
/
A0
C0
E0
PAGE: # 00000001
---------------------------------------------------------------------------------------------------------------SEGMENTED SPACEMAP PAGE: PGCOMB='10'X PGLOGRBA='0000059A7752'X PGNUM='00000001'X PGFLAGS='30'X
SEGNUM='0096'X SEGFREE='0095'X SEGENT='0002'X SEGSIZE='0020'X
SEGLENT='00000001'X FOEND='N'
FIRST PART OF SEGMENTED SPACE MAP:
SEG 0001
00000000000AC0 30000000000000000000000000000000
PAGE: # 00000000
---------------------------------------------------------------------------------------------------------------HEADER PAGE: PGCOMB='00'X PGLOGRBA='0000059A6BD0'X PGNUM='00000000'X PGFLAGS='38'X
HPGOBID='011A0004'X HPGHPREF='000000B4'X HPGCATRL='00'X HPGREL='D6'X HPGZLD='00'X
HPGCATV='00'X HPGTORBA='000000000000'X HPGTSTMP='20110826021818230026'X
HPGSSNM='DSNB' HPGFOID='0003'X HPGPGSZ='1000'X HPGSGSZ='0020'X HPGPARTN='0001'X
HPGZ3PNO='000000'X HPGZNUMP='00'X HPGTBLC='0001'X HPGROID='000A'X
HPGZ4PNO='00000000'X HPGMAXL='0042'X HPGNUMCO='0004'X HPGFLAGS='010A'X
HPGFLAGS2='00'X HPGCONTM='20110826021840973762'X HPGSGNAM='WWV8301S'
HPGVCATN='DBDSNB ' HPGRBRBA='0000060B3D96'X HPGLEVEL='0000060B3D96'X
HPGPLEVL='0000059D4000'X HPGCLRSN='0000054A0C2C'X HPGSCCSI='0025'X HPGDCCSI='0000'X
HPGMCCSI='0000'X HPGDSSZ='00400000'X HPGFLAG2='00'X HPGEPOCH='0000'X
HPGRBLP='000000000000'X HPGMASSDELETETIMESTAMP='000000000000'X HPGDNUMB='01'X
HPGDNUMC='0100'X HPGDFSG='00000000'X HPGDLSG='00000000'X HPGSISP='00000000'X
FOEND='E'
SI HASH BUCKET: HPGDBKT#='01'X HPGS1BEYE='E2'X HPGS1OBI='000A'X HPGS1FSG='00000001'X
HPGS1CSG='00000001'X HPGS1LSG='00000001'X
pr
cl
Ex
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
PGSOBD='0000'X PGSBID='08'X
E11.E01.000090..OPERATIONS
PAGE: # 00000002
---------------------------------------------------------------------------------------------------------------DATA PAGE: PGCOMB='00'X PGLOGRBA='00000609E517'X PGNUM='00000002'X PGFLAGS='00'X PGFREE=3693
PGFREE='0E6D'X PGFREEP=527 PGFREEP='020F'X PGHOLE1='0000'X PGMAXID='0D'X PGNANCH=8
PGTAIL: PGIDFREE='00'X PGEND='E'
ID-MAP FOLLOWS:
01 0014 0046 0064 008C 00B4 00DA 0105 0131
09 0151 8177 819D 81C3 81E9
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-93
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Student Exercises
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
The query reads the row for table space TSPROJ in your database from the
real-time statistics catalog table SYSIBM.SYSTABLESPACESTATS.
403
STATSINSERTS
STATSDELETES
STATSUPDATES
STATSMASSDELETE
113
Yes. There are 290 rows loaded into the PROJECT table, 39 rows loaded into the
ON_PROJECT table and 74 rows loaded into the ACTIVITY table, for a total of 403
rows.
pr
Ex
cl
The LOAD REPLACE of table PROJECT contained the keyword STATISTICS. That
is why the counters STATS... have been reset to 0, as they show only what
happened since the last RUNSTATS (or inline statistics). The LOAD for tables
ON_PROJECT and ACTIVITY was a LOAD RESUME YES. The STATS... counters
are not reset and the rows added to the table space are counted as inserts. 39 for
table ON_PROJECT and 74 for table ACTIVITY, for a total of 113 inserts since the
last RUNSTATS.
A-95
Student Exercises
5. What type of disorganization might SQL statement L7UPDATE introduce into the table
space?
UPDATE PROJECT
SET NAME = 'FILLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL'
WHERE PROJNO BETWEEN 'PL2101' AND 'PL2220'
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE615I NUMBER OF ROWS AFFECTED IS 120
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
Table space TSPROJ was defined with zero free space (see exercise 1) and the
update has increased the length of 120 rows. This might require some of the
updated rows to overflow to another page.
No. DB2 externalizes the real-time statistics only after n minutes, n being a
system parameter. As the query of the real-time statistics values immediately
followed the update statement, it is extremely unlikely to see the correct values
already.
403
STATSINSERTS
STATSDELETES
STATSUPDATES
STATSMASSDELETE
113
7. After a while, execute member L7QUERY1. Is STATSUPDATES now what you expect?
Yes, after a few minutes, STATSUPDATES should be 120.
cl
STATSDELETES
STATSUPDATES
STATSMASSDELETE
113
120
pr
Ex
403
STATSINSERTS
DSNU610I
DSNU610I
DSNU614I
DSNU610I
DSNU614I
DSNU610I
DSNU614I
DSNU613I
1DSNU000I
DSNU1044I
0DSNU050I
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-97
DSNU610I
DSNU610I
DSNU618I
DSNU610I
DSNU618I
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
DSNU610I
DSNU618I
DSNU612I
cl
Ex
Student Exercises
DSNU610I
DSNU610I
DSNU618I
DSNU610I
DSNU618I
DSNU618I
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
-DSNB 241 07:35:16.74 DSNUSUIP - SYSINDEXPART CATALOG STATISTICS FOR TSOUB01.IXONPR2 PARTITION 0
CARD
= 39
CARDF
= 3.9E+01
NEAROFFPOS
= 0
NEAROFFPOSF
= 0.0E0
FAROFFPOS
= 0
FAROFFPOSF
= 0.0E0
LEAFDIST
= 0
LEAFNEAR
= 0
LEAFFAR
= 0
SPACE
= 720
SPACEF
= 7.2E+02
DSNUM
= 1
EXTENTS
= 1
P_DEL_ENT
= 0
PQTY
= -1
SQTY
= -1
-DSNB 241 07:35:16.74 DSNUSUIP - SYSINDEXPART CATALOG UPDATE FOR TSOUB01.IXONPR2 SUCCESSFUL
-DSNB 241 07:35:16.74 DSNUSUIP - SYSINDEXPART CATALOG STATISTICS FOR TSOUB01.IXONPR1 PARTITION 0
CARD
= 39
CARDF
= 3.9E+01
NEAROFFPOS
= 0
NEAROFFPOSF
= 0.0E0
FAROFFPOS
= 0
FAROFFPOSF
= 0.0E0
LEAFDIST
= 0
LEAFNEAR
= 0
LEAFFAR
= 0
SPACE
= 720
SPACEF
= 7.2E+02
DSNUM
= 1
EXTENTS
= 1
P_DEL_ENT
= 0
PQTY
= -1
SQTY
= -1
-DSNB 241 07:35:16.74 DSNUSUIP - SYSINDEXPART CATALOG UPDATE FOR TSOUB01.IXONPR1 SUCCESSFUL
-DSNB 241 07:35:16.75 DSNUSUIP - SYSINDEXPART CATALOG STATISTICS FOR TSOUB01.IXACTY1 PARTITION 0
CARD
= 74
CARDF
= 7.4E+01
NEAROFFPOS
= 0
NEAROFFPOSF
= 0.0E0
FAROFFPOS
= 0
FAROFFPOSF
= 0.0E0
LEAFDIST
= 0
LEAFNEAR
= 0
LEAFFAR
= 0
SPACE
= 720
SPACEF
= 7.2E+02
DSNUM
= 1
EXTENTS
= 1
P_DEL_ENT
= 0
PQTY
= -1
SQTY
= -1
-DSNB 241 07:35:16.75 DSNUSUIP - SYSINDEXPART CATALOG UPDATE FOR TSOUB01.IXACTY1 SUCCESSFUL
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-99
DSNU610I
DSNU610I
DSNU617I
DSNU610I
DSNU615I
DSNU610I
DSNU617I
DSNU610I
DSNU615I
DSNU618I
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
-DSNB 241 07:35:16.75 DSNUSUIP - SYSINDEXPART CATALOG STATISTICS FOR TSOUB01.IXACTY2 PARTITION 0
CARD
= 74
CARDF
= 7.4E+01
NEAROFFPOS
= 0
NEAROFFPOSF
= 0.0E0
FAROFFPOS
= 0
FAROFFPOSF
= 0.0E0
LEAFDIST
= 0
LEAFNEAR
= 0
LEAFFAR
= 0
SPACE
= 720
SPACEF
= 7.2E+02
DSNUM
= 1
EXTENTS
= 1
P_DEL_ENT
= 0
PQTY
= -1
SQTY
= -1
-DSNB 241 07:35:16.76 DSNUSUIP - SYSINDEXPART CATALOG UPDATE FOR TSOUB01.IXACTY2 SUCCESSFUL
-DSNB 241 07:35:16.76 DSNUSUCO - SYSCOLUMNS CATALOG STATISTICS FOR EMPNO
COLCARD
= 17
COLCARDF
= 1.7E+01
HIGH2KEY
= X'F0F0F0F3F3F0'
LOW2KEY
= X'F0F0F0F0F2F0'
-DSNB 241 07:35:16.76 DSNUSUCO - SYSCOLUMNS CATALOG UPDATE FOR TSOUB01.IXPROJ3 SUCCESSFUL
-DSNB 241 07:35:16.76 DSNUSUIX - SYSINDEXES CATALOG STATISTICS FOR TSOUB01.IXPROJ3
CLUSTERED
= Y
CLUSTERRATIO
= 100
CLUSTERRATIOF
= 1.0E+00
FIRSTKEYCARD
= 17
FIRSTKEYCARDF
= 1.7E+01
FULLKEYCARD
= 17
FULLKEYCARDF
= 1.7E+01
NLEAF
= 1
NLEVELS
= 2
SPACEF
= 7.2E+02
DATAREPEATFACTORF = 5.0E+00
-DSNB 241 07:35:16.76 DSNUSUIX - SYSINDEXES CATALOG UPDATE FOR TSOUB01.IXPROJ3 SUCCESSFUL
-DSNB 241 07:35:16.76 DSNUSUCO - SYSCOLUMNS CATALOG STATISTICS FOR PROJNO
COLCARD
= 290
COLCARDF
= 2.9E+02
HIGH2KEY
= X'D7D3F2F2F3F9'
LOW2KEY
= X'C1C4F3F1F1F0'
-DSNB 241 07:35:16.76 DSNUSUCO - SYSCOLUMNS CATALOG UPDATE FOR TSOUB01.IXPROJ1 SUCCESSFUL
-DSNB 241 07:35:16.76 DSNUSUIX - SYSINDEXES CATALOG STATISTICS FOR TSOUB01.IXPROJ1
CLUSTERED
= Y
CLUSTERRATIO
= 100
CLUSTERRATIOF
= 1.0E+00
FIRSTKEYCARD
= 290
FIRSTKEYCARDF
= 2.9E+02
FULLKEYCARD
= 290
FULLKEYCARDF
= 2.9E+02
NLEAF
= 2
NLEVELS
= 2
SPACEF
= 7.2E+02
DATAREPEATFACTORF = 4.0E+00
-DSNB 241 07:35:16.76 DSNUSUIX - SYSINDEXES CATALOG UPDATE FOR TSOUB01.IXPROJ1 SUCCESSFUL
pr
cl
Ex
Student Exercises
DSNU610I
DSNU610I
DSNU617I
DSNU610I
DSNU615I
DSNU610I
DSNU617I
DSNU610I
DSNU615I
DSNU610I
DSNU617I
DSNU615I
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-101
DSNU610I
DSNU610I
DSNU616I
DSNU610I
DSNU617I
DSNU610I
DSNU615I
DSNU610I
DSNU617I
DSNU615I
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
cl
Ex
Student Exercises
DSNU616I
DSNU610I
DSNU616I
DSNU610I
DSNU616I
DSNU610I
DSNU616I
DSNU616I
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-103
DSNU610I
DSNU620I
DSNU010I
DSNU610I
DSNU616I
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
DSNU616I
cl
Ex
Student Exercises
V5.4.0.3
Student Exercises
EXempty
FARINDREF
403
48
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
CARDF
CARDF
NEAROFFPOSF
FAROFFPOSF
LEAFFAR
IXPROJ3
290
IXPROJ1
290
IXPROJ2
290
IXONPR2
39
IXONPR1
39
IXACTY1
74
IXACTY2
74
STATSDELETES
STATSUPDATES
STATSMASSDELETE
cl
403
STATSINSERTS
Ex
Same values?
pr
Step 12: Have any variable length rows overflowed to another page?
Yes, RUNSTATS output states: FARINDREF is now 48
A-105
Student Exercises
Step 13: Why is the data for the PROJECT table still reported as being
well-clustered even though a number of rows in the PROJECT table
have overflowed?
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
The data for the PROJECT table is reported as well clustered (CLUSTERRATIO for
index IXPROJ3 is 100%), because index IXPROJ3 still points to where the rows were
originally located.
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
1DSNU000I
241 12:32:40.31 DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = TSOUB01
DSNU1044I
241 12:32:40.34 DSNUGTIS - PROCESSING SYSIN AS EBCDIC
0DSNU050I
241 12:32:40.34 DSNUGUTC - REORG TABLESPACE WWV8301D.TSPROJ REPORTONLY OFFPOSLIMIT 15 INDREFLIMIT 15
DSNU286I -DSNB 241 12:32:40.41 DSNURLIM - REORG TABLESPACE WWV8301D.TSPROJ OFFPOSLIMIT SYSINDEXPART ROWS
CREATOR.IXNAME: TSOUB01.IXPROJ3
CREATOR.TBNAME: TSOUB01.PROJECT
PART CARDF
FAROFFPOSF
NEAROFFPOSF
STATSTIME
0
2.9E+02
1.0E+00
0.0E+00
2011-08-29-07.35.16
CREATOR.IXNAME: TSOUB01.IXONPR2
CREATOR.TBNAME: TSOUB01.ON_PROJECT
PART CARDF
FAROFFPOSF
NEAROFFPOSF
STATSTIME
0
3.9E+01
0.0E+00
0.0E+00
2011-08-29-07.35.16
CREATOR.IXNAME: TSOUB01.IXACTY1
CREATOR.TBNAME: TSOUB01.ACTIVITY
PART CARDF
FAROFFPOSF
NEAROFFPOSF
STATSTIME
0 -1.0E+00
-1.0E+00
-1.0E+00
0001-01-01-00.00.00
DSNU287I -DSNB 241 12:32:40.41 DSNURLIM - REORG TABLESPACE WWV8301D.TSPROJ INDREFLIMIT SYSTABLEPART ROWS
DBNAME .TSNAME
PART
CARD FARINDREF NEARINDREF
STATSTIME
WWV8301D.TSPROJ
0
403
48
0 2011-08-29-07.35.16
DSNU289I -DSNB 241 12:32:40.41 DSNURLIM - NO REORG LIMITS HAVE BEEN MET
DSNU010I
241 12:32:40.41 DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST RETURN CODE=1
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-107
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
1DSNU000I
241 12:37:38.06 DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = TSOUB01
DSNU1044I
241 12:37:38.09 DSNUGTIS - PROCESSING SYSIN AS EBCDIC
0DSNU050I
241 12:37:38.09 DSNUGUTC - REORG TABLESPACE WWV8301D.TSPROJ REPORTONLY OFFPOSLIMIT 10 INDREFLIMIT 10
DSNU286I -DSNB 241 12:37:38.09 DSNURLIM - REORG TABLESPACE WWV8301D.TSPROJ OFFPOSLIMIT SYSINDEXPART ROWS
CREATOR.IXNAME: TSOUB01.IXPROJ3
CREATOR.TBNAME: TSOUB01.PROJECT
PART CARDF
FAROFFPOSF
NEAROFFPOSF
STATSTIME
0
2.9E+02
1.0E+00
0.0E+00
2011-08-29-07.35.16
CREATOR.IXNAME: TSOUB01.IXONPR2
CREATOR.TBNAME: TSOUB01.ON_PROJECT
PART CARDF
FAROFFPOSF
NEAROFFPOSF
STATSTIME
0
3.9E+01
0.0E+00
0.0E+00
2011-08-29-07.35.16
CREATOR.IXNAME: TSOUB01.IXACTY1
CREATOR.TBNAME: TSOUB01.ACTIVITY
PART CARDF
FAROFFPOSF
NEAROFFPOSF
STATSTIME
0 -1.0E+00
-1.0E+00
-1.0E+00
0001-01-01-00.00.00
DSNU287I -DSNB 241 12:37:38.09 DSNURLIM - REORG TABLESPACE WWV8301D.TSPROJ INDREFLIMIT SYSTABLEPART ROWS
DBNAME .TSNAME
PART
CARD FARINDREF NEARINDREF
STATSTIME
* WWV8301D.TSPROJ
0
403
48
0 2011-08-29-07.35.16
DSNU289I -DSNB 241 12:37:38.09 DSNURLIM - REORG LIMITS HAVE BEEN MET
DSNU010I
241 12:37:38.10 DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST RETURN CODE=2
pr
cl
Ex
Student Exercises
V5.4.0.3
Student Exercises
EXempty
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
A-109
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
1DSNU000I
241 12:44:07.43 DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = TSOUB01
DSNU1044I
241 12:44:07.46 DSNUGTIS - PROCESSING SYSIN AS EBCDIC
0DSNU050I
241 12:44:07.46 DSNUGUTC - REORG TABLESPACE WWV8301D.TSPROJ OFFPOSLIMIT 10 INDREFLIMIT 10 STATISTICS
INDEX(ALL) REPORT(YES)
DSNU286I -DSNB 241 12:44:07.46 DSNURLIM - REORG TABLESPACE WWV8301D.TSPROJ OFFPOSLIMIT SYSINDEXPART ROWS
CREATOR.IXNAME: TSOUB01.IXPROJ3
CREATOR.TBNAME: TSOUB01.PROJECT
PART CARDF
FAROFFPOSF
NEAROFFPOSF
STATSTIME
0
2.9E+02
1.0E+00
0.0E+00
2011-08-29-07.35.16
CREATOR.IXNAME: TSOUB01.IXONPR2
CREATOR.TBNAME: TSOUB01.ON_PROJECT
PART CARDF
FAROFFPOSF
NEAROFFPOSF
STATSTIME
0
3.9E+01
0.0E+00
0.0E+00
2011-08-29-07.35.16
CREATOR.IXNAME: TSOUB01.IXACTY1
CREATOR.TBNAME: TSOUB01.ACTIVITY
PART CARDF
FAROFFPOSF
NEAROFFPOSF
STATSTIME
0
7.4E+01
0.0E+00
0.0E+00
2011-08-29-07.35.16
DSNU287I -DSNB 241 12:44:07.46 DSNURLIM - REORG TABLESPACE WWV8301D.TSPROJ INDREFLIMIT SYSTABLEPART ROWS
DBNAME .TSNAME
PART
CARD FARINDREF NEARINDREF
STATSTIME
* WWV8301D.TSPROJ
0
403
48
0 2011-08-29-07.35.16
DSNU289I -DSNB 241 12:44:07.46 DSNURLIM - REORG LIMITS HAVE BEEN MET
DSNU290I -DSNB 241 12:44:07.46 DSNURLIM - REORG WILL BE PERFORMED
DSNU252I
241 12:44:07.54 DSNURULD - UNLOAD PHASE STATISTICS - NUMBER OF RECORDS UNLOADED=403 FOR TABLESPACE
WWV8301D.TSPROJ
DSNU250I
241 12:44:07.54 DSNURULD - UNLOAD PHASE COMPLETE, ELAPSED TIME=00:00:00
DSNU304I -DSNB 241 12:44:08.48 DSNURWT - (RE)LOAD PHASE STATISTICS - NUMBER OF RECORDS=290 FOR TABLE TSOUB01.PROJECT
DSNU304I -DSNB 241 12:44:08.48 DSNURWT - (RE)LOAD PHASE STATISTICS - NUMBER OF RECORDS=39 FOR TABLE TSOUB01.ON_PROJECT
DSNU304I -DSNB 241 12:44:08.48 DSNURWT - (RE)LOAD PHASE STATISTICS - NUMBER OF RECORDS=74 FOR TABLE TSOUB01.ACTIVITY
DSNU302I
241 12:44:08.49 DSNURILD - (RE)LOAD PHASE STATISTICS - NUMBER OF INPUT RECORDS PROCESSED=403
DSNU300I
241 12:44:08.49 DSNURILD - (RE)LOAD PHASE COMPLETE, ELAPSED TIME=00:00:00
DSNU042I
241 12:44:08.49 DSNUGSOR - SORT PHASE STATISTICS NUMBER OF RECORDS=1096
ELAPSED TIME=00:00:00
DSNU349I -DSNB 241 12:44:08.53 DSNURBXA - BUILD PHASE STATISTICS - NUMBER OF KEYS=290 FOR INDEX TSOUB01.IXPROJ1
DSNU349I -DSNB 241 12:44:08.56 DSNURBXA - BUILD PHASE STATISTICS - NUMBER OF KEYS=290 FOR INDEX TSOUB01.IXPROJ2
DSNU349I -DSNB 241 12:44:08.58 DSNURBXA - BUILD PHASE STATISTICS - NUMBER OF KEYS=290 FOR INDEX TSOUB01.IXPROJ3
DSNU349I -DSNB 241 12:44:08.62 DSNURBXA - BUILD PHASE STATISTICS - NUMBER OF KEYS=39 FOR INDEX TSOUB01.IXONPR1
DSNU349I -DSNB 241 12:44:08.64 DSNURBXA - BUILD PHASE STATISTICS - NUMBER OF KEYS=39 FOR INDEX TSOUB01.IXONPR2
DSNU349I -DSNB 241 12:44:08.67 DSNURBXA - BUILD PHASE STATISTICS - NUMBER OF KEYS=74 FOR INDEX TSOUB01.IXACTY1
DSNU349I -DSNB 241 12:44:08.70 DSNURBXA - BUILD PHASE STATISTICS - NUMBER OF KEYS=74 FOR INDEX TSOUB01.IXACTY2
DSNU258I
241 12:44:08.73 DSNURBXD - BUILD PHASE STATISTICS - NUMBER OF INDEXES=7
DSNU259I
241 12:44:08.73 DSNURBXD - BUILD PHASE COMPLETE, ELAPSED TIME=00:00:00
DSNU613I -DSNB 241 12:44:08.74 DSNUSUTP - SYSTABLEPART CATALOG STATISTICS FOR WWV8301D.TSPROJ PARTITION 0
CARD
= 403
CARDF
= 4.03E+02
NEARINDREF
= 0
FARINDREF
= 0
PERCACTIVE
= 37
PERCDROP
= 0
PAGESAVE
= 0
SPACE
= 720
SPACEF
= 7.2E+02
PQTY
= -1
SQTY
= -1
DSNUM
= 1
EXTENTS
= 1
DSNU610I -DSNB 241 12:44:08.74 DSNUSUTP - SYSTABLEPART CATALOG UPDATE FOR WWV8301D.TSPROJ SUCCESSFUL
pr
cl
Ex
Student Exercises
DSNU610I
DSNU610I
DSNU618I
DSNU610I
DSNU612I
DSNU610I
DSNU614I
DSNU610I
DSNU614I
DSNU614I
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-111
DSNU610I
DSNU610I
DSNU618I
DSNU610I
DSNU618I
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
-DSNB 241 12:44:08.77 DSNUSUIP - SYSINDEXPART CATALOG STATISTICS FOR TSOUB01.IXPROJ1 PARTITION 0
CARD
= 290
CARDF
= 2.9E+02
NEAROFFPOS
= 74
NEAROFFPOSF
= 7.4E+01
FAROFFPOS
= 8
FAROFFPOSF
= 8.0E+00
LEAFDIST
= 50
LEAFNEAR
= 1
LEAFFAR
= 0
SPACE
= 720
SPACEF
= 7.2E+02
DSNUM
= 1
EXTENTS
= 1
P_DEL_ENT
= 0
PQTY
= -1
SQTY
= -1
-DSNB 241 12:44:08.77 DSNUSUIP - SYSINDEXPART CATALOG UPDATE FOR TSOUB01.IXPROJ1 SUCCESSFUL
-DSNB 241 12:44:08.77 DSNUSUIP - SYSINDEXPART CATALOG STATISTICS FOR TSOUB01.IXPROJ2 PARTITION 0
CARD
= 290
CARDF
= 2.9E+02
NEAROFFPOS
= 2
NEAROFFPOSF
= 2.0E+00
FAROFFPOS
= 5
FAROFFPOSF
= 5.0E+00
LEAFDIST
= 0
LEAFNEAR
= 0
LEAFFAR
= 0
SPACE
= 720
SPACEF
= 7.2E+02
DSNUM
= 1
EXTENTS
= 1
P_DEL_ENT
= 0
PQTY
= -1
SQTY
= -1
-DSNB 241 12:44:08.77 DSNUSUIP - SYSINDEXPART CATALOG UPDATE FOR TSOUB01.IXPROJ2 SUCCESSFUL
-DSNB 241 12:44:08.77 DSNUSUIP - SYSINDEXPART CATALOG STATISTICS FOR TSOUB01.IXONPR2 PARTITION 0
CARD
= 39
CARDF
= 3.9E+01
NEAROFFPOS
= 0
NEAROFFPOSF
= 0.0E0
FAROFFPOS
= 0
FAROFFPOSF
= 0.0E0
LEAFDIST
= 0
LEAFNEAR
= 0
LEAFFAR
= 0
SPACE
= 720
SPACEF
= 7.2E+02
DSNUM
= 1
EXTENTS
= 1
P_DEL_ENT
= 0
PQTY
= -1
SQTY
= -1
-DSNB 241 12:44:08.77 DSNUSUIP - SYSINDEXPART CATALOG UPDATE FOR TSOUB01.IXONPR2 SUCCESSFUL
pr
DSNU618I
cl
Ex
Student Exercises
DSNU610I
DSNU615I
DSNU610I
DSNU618I
DSNU610I
DSNU618I
DSNU618I
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
-DSNB 241 12:44:08.77 DSNUSUIP - SYSINDEXPART CATALOG STATISTICS FOR TSOUB01.IXONPR1 PARTITION 0
CARD
= 39
CARDF
= 3.9E+01
NEAROFFPOS
= 0
NEAROFFPOSF
= 0.0E0
FAROFFPOS
= 0
FAROFFPOSF
= 0.0E0
LEAFDIST
= 0
LEAFNEAR
= 0
LEAFFAR
= 0
SPACE
= 720
SPACEF
= 7.2E+02
DSNUM
= 1
EXTENTS
= 1
P_DEL_ENT
= 0
PQTY
= -1
SQTY
= -1
-DSNB 241 12:44:08.77 DSNUSUIP - SYSINDEXPART CATALOG UPDATE FOR TSOUB01.IXONPR1 SUCCESSFUL
-DSNB 241 12:44:08.78 DSNUSUIP - SYSINDEXPART CATALOG STATISTICS FOR TSOUB01.IXACTY1 PARTITION 0
CARD
= 74
CARDF
= 7.4E+01
NEAROFFPOS
= 0
NEAROFFPOSF
= 0.0E0
FAROFFPOS
= 0
FAROFFPOSF
= 0.0E0
LEAFDIST
= 0
LEAFNEAR
= 0
LEAFFAR
= 0
SPACE
= 720
SPACEF
= 7.2E+02
DSNUM
= 1
EXTENTS
= 1
P_DEL_ENT
= 0
PQTY
= -1
SQTY
= -1
-DSNB 241 12:44:08.79 DSNUSUIP - SYSINDEXPART CATALOG UPDATE FOR TSOUB01.IXACTY1 SUCCESSFUL
-DSNB 241 12:44:08.79 DSNUSUIP - SYSINDEXPART CATALOG STATISTICS FOR TSOUB01.IXACTY2 PARTITION 0
CARD
= 74
CARDF
= 7.4E+01
NEAROFFPOS
= 0
NEAROFFPOSF
= 0.0E0
FAROFFPOS
= 0
FAROFFPOSF
= 0.0E0
LEAFDIST
= 0
LEAFNEAR
= 0
LEAFFAR
= 0
SPACE
= 720
SPACEF
= 7.2E+02
DSNUM
= 1
EXTENTS
= 1
P_DEL_ENT
= 0
PQTY
= -1
SQTY
= -1
-DSNB 241 12:44:08.79 DSNUSUIP - SYSINDEXPART CATALOG UPDATE FOR TSOUB01.IXACTY2 SUCCESSFUL
-DSNB 241 12:44:08.79 DSNUSUCO - SYSCOLUMNS CATALOG STATISTICS FOR EMPNO
COLCARD
= 17
COLCARDF
= 1.7E+01
HIGH2KEY
= X'F0F0F0F3F3F0'
LOW2KEY
= X'F0F0F0F0F2F0'
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-113
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
DSNU610I -DSNB 241 12:44:08.79 DSNUSUCO - SYSCOLUMNS CATALOG UPDATE FOR TSOUB01.IXPROJ3 SUCCESSFUL
DSNU617I -DSNB 241 12:44:08.79 DSNUSUIX - SYSINDEXES CATALOG STATISTICS FOR TSOUB01.IXPROJ3
CLUSTERED
= Y
CLUSTERRATIO
= 100
CLUSTERRATIOF
= 1.0E+00
FIRSTKEYCARD
= 17
FIRSTKEYCARDF
= 1.7E+01
FULLKEYCARD
= 17
FULLKEYCARDF
= 1.7E+01
NLEAF
= 1
NLEVELS
= 2
SPACEF
= 7.2E+02
DATAREPEATFACTORF = 5.0E+00
DSNU610I -DSNB 241 12:44:08.79 DSNUSUIX - SYSINDEXES CATALOG UPDATE FOR TSOUB01.IXPROJ3 SUCCESSFUL
DSNU615I -DSNB 241 12:44:08.79 DSNUSUCO - SYSCOLUMNS CATALOG STATISTICS FOR PROJNO
COLCARD
= 290
COLCARDF
= 2.9E+02
HIGH2KEY
= X'D7D3F2F2F3F9'
LOW2KEY
= X'C1C4F3F1F1F0'
DSNU610I -DSNB 241 12:44:08.79 DSNUSUCO - SYSCOLUMNS CATALOG UPDATE FOR TSOUB01.IXPROJ1 SUCCESSFUL
DSNU617I -DSNB 241 12:44:08.79 DSNUSUIX - SYSINDEXES CATALOG STATISTICS FOR TSOUB01.IXPROJ1
CLUSTERED
= Y
CLUSTERRATIO
= 100
CLUSTERRATIOF
= 1.0E+00
FIRSTKEYCARD
= 290
FIRSTKEYCARDF
= 2.9E+02
FULLKEYCARD
= 290
FULLKEYCARDF
= 2.9E+02
NLEAF
= 2
NLEVELS
= 2
SPACEF
= 7.2E+02
DATAREPEATFACTORF = 3.0E+00
DSNU610I -DSNB 241 12:44:08.79 DSNUSUIX - SYSINDEXES CATALOG UPDATE FOR TSOUB01.IXPROJ1 SUCCESSFUL
DSNU615I -DSNB 241 12:44:08.79 DSNUSUCO - SYSCOLUMNS CATALOG STATISTICS FOR DEPTNO
COLCARD
= 8
COLCARDF
= 8.0E+00
HIGH2KEY
= X'C5F1F1'
LOW2KEY
= X'C3F0F1'
DSNU610I -DSNB 241 12:44:08.79 DSNUSUCO - SYSCOLUMNS CATALOG UPDATE FOR TSOUB01.IXPROJ2 SUCCESSFUL
DSNU617I -DSNB 241 12:44:08.80 DSNUSUIX - SYSINDEXES CATALOG STATISTICS FOR TSOUB01.IXPROJ2
CLUSTERED
= Y
CLUSTERRATIO
= 100
CLUSTERRATIOF
= 1.0E+00
FIRSTKEYCARD
= 8
FIRSTKEYCARDF
= 8.0E+00
FULLKEYCARD
= 8
FULLKEYCARDF
= 8.0E+00
NLEAF
= 1
NLEVELS
= 2
SPACEF
= 7.2E+02
DATAREPEATFACTORF = 5.0E+00
DSNU610I -DSNB 241 12:44:08.80 DSNUSUIX - SYSINDEXES CATALOG UPDATE FOR TSOUB01.IXPROJ2 SUCCESSFUL
DSNU615I -DSNB 241 12:44:08.80 DSNUSUCO - SYSCOLUMNS CATALOG STATISTICS FOR EMPNO
COLCARD
= 30
COLCARDF
= 3.0E+01
HIGH2KEY
= X'F0F0F0F3F3F0'
LOW2KEY
= X'F0F0F0F0F2F0'
pr
cl
Ex
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
DSNU610I -DSNB 241 12:44:08.80 DSNUSUCO - SYSCOLUMNS CATALOG UPDATE FOR TSOUB01.IXONPR2 SUCCESSFUL
DSNU617I -DSNB 241 12:44:08.80 DSNUSUIX - SYSINDEXES CATALOG STATISTICS FOR TSOUB01.IXONPR2
CLUSTERED
= Y
CLUSTERRATIO
= 100
CLUSTERRATIOF
= 1.0E+00
FIRSTKEYCARD
= 30
FIRSTKEYCARDF
= 3.0E+01
FULLKEYCARD
= 30
FULLKEYCARDF
= 3.0E+01
NLEAF
= 1
NLEVELS
= 2
SPACEF
= 7.2E+02
DATAREPEATFACTORF = 1.0E+00
DSNU610I -DSNB 241 12:44:08.80 DSNUSUIX - SYSINDEXES CATALOG UPDATE FOR TSOUB01.IXONPR2 SUCCESSFUL
DSNU615I -DSNB 241 12:44:08.80 DSNUSUCO - SYSCOLUMNS CATALOG STATISTICS FOR PROJNO
COLCARD
= 19
COLCARDF
= 1.9E+01
HIGH2KEY
= X'D6D7F2F0F1F3'
LOW2KEY
= X'C1C4F3F1F1F0'
DSNU610I -DSNB 241 12:44:08.80 DSNUSUCO - SYSCOLUMNS CATALOG UPDATE FOR TSOUB01.IXONPR1 SUCCESSFUL
DSNU617I -DSNB 241 12:44:08.80 DSNUSUIX - SYSINDEXES CATALOG STATISTICS FOR TSOUB01.IXONPR1
CLUSTERED
= Y
CLUSTERRATIO
= 100
CLUSTERRATIOF
= 1.0E+00
FIRSTKEYCARD
= 19
FIRSTKEYCARDF
= 1.9E+01
FULLKEYCARD
= 39
FULLKEYCARDF
= 3.9E+01
NLEAF
= 1
NLEVELS
= 2
SPACEF
= 7.2E+02
DATAREPEATFACTORF = 1.0E+00
DSNU610I -DSNB 241 12:44:08.80 DSNUSUIX - SYSINDEXES CATALOG UPDATE FOR TSOUB01.IXONPR1 SUCCESSFUL
DSNU615I -DSNB 241 12:44:08.80 DSNUSUCO - SYSCOLUMNS CATALOG STATISTICS FOR PROJNO
COLCARD
= 19
COLCARDF
= 1.9E+01
HIGH2KEY
= X'D6D7F2F0F1F3'
LOW2KEY
= X'C1C4F3F1F1F0'
DSNU610I -DSNB 241 12:44:08.80 DSNUSUCO - SYSCOLUMNS CATALOG UPDATE FOR TSOUB01.IXACTY1 SUCCESSFUL
DSNU617I -DSNB 241 12:44:08.80 DSNUSUIX - SYSINDEXES CATALOG STATISTICS FOR TSOUB01.IXACTY1
CLUSTERED
= Y
CLUSTERRATIO
= 100
CLUSTERRATIOF
= 1.0E+00
FIRSTKEYCARD
= 19
FIRSTKEYCARDF
= 1.9E+01
FULLKEYCARD
= 74
FULLKEYCARDF
= 7.4E+01
NLEAF
= 1
NLEVELS
= 2
SPACEF
= 7.2E+02
DATAREPEATFACTORF = 1.0E+00
DSNU610I -DSNB 241 12:44:08.80 DSNUSUIX - SYSINDEXES CATALOG UPDATE FOR TSOUB01.IXACTY1 SUCCESSFUL
DSNU615I -DSNB 241 12:44:08.80 DSNUSUCO - SYSCOLUMNS CATALOG STATISTICS FOR EMPNO
COLCARD
= 30
COLCARDF
= 3.0E+01
HIGH2KEY
= X'F0F0F0F3F3F0'
LOW2KEY
= X'F0F0F0F0F2F0'
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-115
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
DSNU610I -DSNB 241 12:44:08.80 DSNUSUCO - SYSCOLUMNS CATALOG UPDATE FOR TSOUB01.IXACTY2 SUCCESSFUL
DSNU617I -DSNB 241 12:44:08.80 DSNUSUIX - SYSINDEXES CATALOG STATISTICS FOR TSOUB01.IXACTY2
CLUSTERED
= Y
CLUSTERRATIO
= 100
CLUSTERRATIOF
= 1.0E+00
FIRSTKEYCARD
= 30
FIRSTKEYCARDF
= 3.0E+01
FULLKEYCARD
= 30
FULLKEYCARDF
= 3.0E+01
NLEAF
= 1
NLEVELS
= 2
SPACEF
= 7.2E+02
DATAREPEATFACTORF = 1.0E+00
DSNU610I -DSNB 241 12:44:08.80 DSNUSUIX - SYSINDEXES CATALOG UPDATE FOR TSOUB01.IXACTY2 SUCCESSFUL
DSNU616I -DSNB 241 12:44:08.80 DSNUSUCD - SYSCOLDIST CATALOG STATISTICS FOR
EMPNO
FREQUENCY
COLVALUE
---------------4.8620689655172E-01 X'F0F0F0F0F2F0'
1.7586206896551E-01 X'F0F0F0F0F6F0'
1.7586206896551E-01 X'F0F0F0F1F0F0'
1.0689655172413E-01 X'F0F0F0F2F7F0'
6.8965517241379E-03 X'F0F0F0F0F1F0'
6.8965517241379E-03 X'F0F0F0F0F3F0'
6.8965517241379E-03 X'F0F0F0F0F5F0'
3.4482758620689E-03 X'F0F0F0F0F7F0'
3.4482758620689E-03 X'F0F0F0F0F9F0'
3.4482758620689E-03 X'F0F0F0F1F5F0'
DSNU610I -DSNB 241 12:44:08.80 DSNUSUCD - SYSCOLDIST CATALOG UPDATE FOR TSOUB01.IXPROJ3 SUCCESSFUL
DSNU616I -DSNB 241 12:44:08.80 DSNUSUCD - SYSCOLDIST CATALOG STATISTICS FOR
DEPTNO
FREQUENCY
COLVALUE
---------------4.8620689655172E-01 X'C2F0F1'
1.8620689655172E-01 X'C4F1F1'
1.8620689655172E-01 X'C5F2F1'
1.1724137931034E-01 X'C4F2F1'
6.8965517241379E-03 X'C3F0F1'
6.8965517241379E-03 X'C4F0F1'
6.8965517241379E-03 X'C5F0F1'
3.4482758620689E-03 X'C5F1F1'
DSNU610I -DSNB 241 12:44:08.80 DSNUSUCD - SYSCOLDIST CATALOG UPDATE FOR TSOUB01.IXPROJ2 SUCCESSFUL
DSNU616I -DSNB 241 12:44:08.80 DSNUSUCD - SYSCOLDIST CATALOG STATISTICS FOR
EMPNO
FREQUENCY
COLVALUE
---------------7.6923076923076E-02 X'F0F0F0F0F1F0'
7.6923076923076E-02 X'F0F0F0F0F3F0'
5.1282051282051E-02 X'F0F0F0F0F5F0'
5.1282051282051E-02 X'F0F0F0F1F3F0'
5.1282051282051E-02 X'F0F0F0F1F4F0'
5.1282051282051E-02 X'F0F0F0F1F7F0'
5.1282051282051E-02 X'F0F0F0F3F0F0'
2.5641025641025E-02 X'F0F0F0F0F2F0'
2.5641025641025E-02 X'F0F0F0F0F7F0'
2.5641025641025E-02 X'F0F0F0F0F9F0'
DSNU610I -DSNB 241 12:44:08.80 DSNUSUCD - SYSCOLDIST CATALOG UPDATE FOR TSOUB01.IXONPR2 SUCCESSFUL
pr
cl
Ex
Student Exercises
DSNU610I
DSNU620I
DSNU010I
DSNU610I
DSNU616I
DSNU616I
DSNU616I
DSNU610I
DSNU616I
DSNU616I
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-117
Student Exercises
Steps 20 to 21: Some results of the REORG report (xxxINDREFs now 0):
Table 15: SYSIBM.SYSTABLEPART Catalog Statistics
NEARINDREF
FARINDREF
403
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
CARDF
NEAROFFPOSF
FAROFFPOSF
LEAFFAR
IXPROJ3
290
IXPROJ1
290
74
IXPROJ2
290
IXONPR2
39
IXONPR1
39
IXACTY1
74
IXACTY2
74
pr
Ex
cl
Index Name
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
TSPROJ
Table space Statistics
NACTIVE 15:
ACTIVITY
CARDF 74
NPAGES 1
PCTPAGES 25%
PERCACTIVE 37:
Percentage of space
occupied by rows
CARD 403
ON_PROJECT
CARDF 39
NPAGES 1
PCTPAGES 25%
PROJECT
CARDF 290
NPAGES 5
PCTPAGES 62%
Space
Map
Header
Segment 4
Segment 3
Segment 2
Segment 1
IDCAMS
15 tracks
1 extent
ALLOCATION
SPACE TYPE - CYLINDER
SPACE PRI - 1
SPACE SEC - 1
HI-A-RBA 737280
HI-U-RBA 61440
CISIZE 4096
AVGLRECL 0
MAXLRECL 0
cl
Ex
TSPROJ
------ page size: 4 KB
- SEGSIZE:
4 pages
- PCTFREE:
10 percent
pr
Tables
AVG_ROW_LENGTH AVG_RECORD_LENGTH COUNT(*)=CARD
----------------------- ----------------- ------------PROJECT
67
75
290
ON_PROJECT
18
26
39
ACTIVITY
36
44
74
where a) you must provide/estimate AVG_ROW_LENGTH and CARD, if data not yet stored in DB2;
b) AVG_RECORD_LENGTH includes 6 bytes for record header plus 2 bytes for id map entry.
A-119
Student Exercises
bytes
bytes
bytes
(max. 255 !)
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
PROJECT:
- page size:
- net:
about
- minus PCTFREE:
about
- rows per page:
3600 : 75
- number of pages needed:
290 : 48
ACTIVITY:
1
==
Sum
4 Segments
Remark: Precise record length for 4 K: 4096 - 20 header - 2 trailer = 4074.
But if only one record is stored, the max. length is 4056
16 pages
18 pages
12 pages
2 tracks
Allocation typically defaults to 1 cylinder depending on zparm TSQTY (amount of space in KB, 0 means default of 1 cyl.)
cl
Use the IDCAMS command LISTCAT to retrieve the actual space allocated:
pr
Ex
PAGE
PAGE
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
cl
Ex
2
V5.4.0.3
Student Exercises
EXempty
A-121
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
cl
Ex
Student Exercises
V5.4.0.3
Student Exercises
EXempty
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+
ALTER INDEX TSOUB01.IXLOCN1
PRIQTY 999999999 ;
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
A-123
Student Exercises
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
TSOUB01.DSNURGT.CNTL
Columns 00
===>
Scroll
***************************** Top of Data ********************
//TSOUB011 JOB 1CV83G26,'TSOUB01 JOB
',MSGLEVEL=(1,1),
//
CLASS=A,MSGCLASS=Q,NOTIFY=TSOUB01,REGION=0M
//*
//*
//UTIL EXEC DSNBUPRC,SYSTEM=DSNB,UID='TSOUB01',UTPROC=''
//*
//**********************************************
//*
//* GENERATING JCL FOR THE REORG TABLESPACE UTILITY
//* DATE: 08/29/11
TIME: 23:36:29
//*
//**********************************************
//*
//DSNUPROC.SORTWK01 DD DSN=TSOUB01.SORTWK01,
//
DISP=(MOD,DELETE,CATLG),
//
SPACE=(16384,(20,20),,,ROUND),
//
UNIT=SYSDA
//DSNUPROC.SORTWK02 DD DSN=TSOUB01.SORTWK02,
//
DISP=(MOD,DELETE,CATLG),
//
SPACE=(16384,(20,20),,,ROUND),
//
UNIT=SYSDA
//DSNUPROC.SORTWK03 DD DSN=TSOUB01.SORTWK03,
//
DISP=(MOD,DELETE,CATLG),
//
SPACE=(16384,(20,20),,,ROUND),
//
UNIT=SYSDA
//DSNUPROC.SORTWK04 DD DSN=TSOUB01.SORTWK04,
//
DISP=(MOD,DELETE,CATLG),
//
SPACE=(16384,(20,20),,,ROUND),
//
UNIT=SYSDA
//DSNUPROC.SYSREC DD DSN=TSOUB01.CV83.TSLOCN.REORG.SYSREC1,
//
DISP=(MOD,CATLG),
//
SPACE=(16384,(20,20),,,ROUND),
//
UNIT=SYSDA
//DSNUPROC.SYSUT1 DD DSN=TSOUB01.SYSUT1,
//
DISP=(MOD,DELETE,CATLG),
//
SPACE=(16384,(20,20),,,ROUND),
//
UNIT=SYSDA
//DSNUPROC.SORTOUT DD DSN=TSOUB01.SORTOUT,
//
DISP=(MOD,DELETE,CATLG),
//
SPACE=(16384,(20,20),,,ROUND),
//
UNIT=SYSDA
//DSNUPROC.SYSIN
DD *
REORG TABLESPACE WWV8301D.TSLOCN
//
**************************** Bottom of Data *******
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
1
J E S 2 J O B L O G -- S Y S T E M D I 1 1 -- N O D E M V S D I 1 1
0
23.36.45 JOB00492 ---- MONDAY,
29 AUG 2011 ---23.36.45 JOB00492 IRR010I USERID TSOUB01 IS ASSIGNED TO THIS JOB.
23.36.45 JOB00492 ICH70001I TSOUB01 LAST ACCESS AT 23:25:41 ON MONDAY, AUGUST 29, 2011
23.36.45 JOB00492 $HASP373 TSOUB011 STARTED - INIT 1
- CLASS A - SYS DI11
23.36.48 JOB00492 IEF450I TSOUB011 DSNUPROC UTIL - ABEND=S04E U0000 REASON=00E40305 066
066
TIME=23.36.48
23.36.48 JOB00492 -----TIMINGS (MINS.)----------PAGING COUNTS---23.36.48 JOB00492 -STEPNAME PROCSTEP
RC
EXCP
CONN
TCB
SRB CLOCK
SERV WORKLOAD PAGE SWAP
VIO
SWAPS
0
23.36.48 JOB00492 -UTIL
DSNUPROC *S04E
673
33
.00
.00
.0
147 BATCH
0
0
0
23.36.48 JOB00492 -TSOUB011 ENDED. NAME-TSOUB01 JOB
TOTAL TCB CPU TIME=
.00 TOTAL ELAPSED TIME=
.0
23.36.48 JOB00492 $HASP395 TSOUB011 ENDED
0------ JES2 JOB STATISTICS ------ 29 AUG 2011 JOB EXECUTION DATE
43 CARDS READ
245 SYSOUT PRINT RECORDS
0 SYSOUT PUNCH RECORDS
16 SYSOUT SPOOL KBYTES
0.04 MINUTES EXECUTION TIME
..........
etc
..........
..........
1DSNU000I
241 23:36:45.78 DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = TSOUB01
DSNU1044I
241 23:36:45.80 DSNUGTIS - PROCESSING SYSIN AS EBCDIC
0DSNU050I
241 23:36:45.81 DSNUGUTC - REORG TABLESPACE WWV8301D.TSLOCN
DSNU252I
241 23:36:45.86 DSNURULD - UNLOAD PHASE STATISTICS - NUMBER OF RECORDS UNLOADED=4 FOR TABLESPACE
WWV8301D.TSLOCN
DSNU250I
241 23:36:45.86 DSNURULD - UNLOAD PHASE COMPLETE, ELAPSED TIME=00:00:00
-DSNT500I
241 23:36:46.13 DSNUGBAC - RESOURCE UNAVAILABLE
REASON 00D70025
TYPE 00000220
NAME DBDSNB.DSNDBC.WWV8301D.IXLOCN1.I0001.A001
-DSNU017I
241 23:36:46.13 DSNUGBAC - UTILITY DATA BASE SERVICES MEMORY EXECUTION ABENDED, REASON=X'00E40305'
CAUSE=X'00D70025'
Step 23b: Partial job output of the unsuccessful REORG TABLESPACE utility
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-125
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
SELECT *
FROM LOCATION
---------+---------+---------+---------+---------+---------+---------+---------+
LOCID
ADDRESS
CITY
POSTAL_CODE
COUNTRY
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE610I NUMBER OF ROWS DISPLAYED IS 0
DSNT408I SQLCODE = -904, ERROR: UNSUCCESSFUL EXECUTION CAUSED BY AN
UNAVAILABLE RESOURCE. REASON 00C90082, TYPE OF RESOURCE 00000200, AND
RESOURCE NAME WWV8301D.TSLOCN
DSNT418I SQLSTATE
= 57011 SQLSTATE RETURN CODE
DSNT415I SQLERRP
= DSNXRRC SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD
= 102 13172746 0 13223106 -974970878 12714050 SQL
DIAGNOSTIC INFORMATION
DSNT416I SQLERRD
= X'00000066' X'00C9000A' X'00000000' X'00C9C4C2'
X'C5E32002' X'00C20042' SQL DIAGNOSTIC INFORMATION
---------+---------+---------+---------+---------+---------+---------+---------+
-DIS DB(WWV8301D) SPACE(*)
pr
Ex
cl
V5.4.0.3
Student Exercises
IXLOCN1 IX
RW,RBDP,UTUT
IXONPR1 IX
RW
IXONPR2 IX
RW
IXPROJ1 IX
RW
IXPROJ2 IX
RW
IXPROJ3 IX
RW
******* DISPLAY OF DATABASE WWV8301D ENDED
**********************
DSN9022I -DSNB DSNTDDIS 'DISPLAY DATABASE' NORMAL COMPLETION
***
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
EXempty
Display utility:
pr
Ex
cl
TSOUB01.CV83.TSLOCN.REORG.SYSREC1
Columns 0
===>
Scroll
***************************** Top of Data *******************
`
DE71083-01AM FICHTENBERG 1
HERRENBERG ...
`
US95141-B4555 BAILEY AVENUE
SAN JOSE
...
`
US95141-C2555 BAILEY AVENUE
SAN JOSE
...
`
US95193-505600 COTTLE ROAD
SAN JOSE
...
**************************** Bottom of Data *****************
A-127
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+
ALTER INDEX TSOUB01.IXLOCN1
PRIQTY 10 ;
---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
SSID: DSNB
7 LIB ==>
pr
Ex
cl
* The data set names panel will be displayed when required by a utility.
V5.4.0.3
Student Exercises
EXempty
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
TSOUB01.DSNURGT.CNTL
===>
***************************** Top of Data ******************
//TSOUB011 JOB 1CV83G26,'TSOUB01 JOB
',MSGLEVEL=(1,1),
//
CLASS=A,MSGCLASS=Q,NOTIFY=TSOUB01,REGION=0M
//*
//*
//UTIL EXEC DSNBUPRC,SYSTEM=DSNB,UID='TSOUB01',UTPROC=''
//*
//**********************************************
//*
//* GENERATING JCL FOR THE REORG TABLESPACE UTILITY
//* DATE: 08/29/11
TIME: 23:57:31
//*
//**********************************************
//*
//DSNUPROC.SORTWK01 DD DSN=TSOUB01.SORTWK01,
//
DISP=(MOD,DELETE,CATLG)
//DSNUPROC.SORTWK02 DD DSN=TSOUB01.SORTWK02,
//
DISP=(MOD,DELETE,CATLG)
//DSNUPROC.SORTWK03 DD DSN=TSOUB01.SORTWK03,
//
DISP=(MOD,DELETE,CATLG)
//DSNUPROC.SORTWK04 DD DSN=TSOUB01.SORTWK04,
//
DISP=(MOD,DELETE,CATLG)
//DSNUPROC.SYSREC DD DSN=TSOUB01.CV83.TSLOCN.REORG.SYSREC1,
//
DISP=(MOD,CATLG)
//DSNUPROC.SYSUT1 DD DSN=TSOUB01.SYSUT1,
//
DISP=(MOD,DELETE,CATLG)
//DSNUPROC.SORTOUT DD DSN=TSOUB01.SORTOUT,
//
DISP=(MOD,DELETE,CATLG)
//DSNUPROC.SYSIN
DD *
REORG TABLESPACE WWV8301D.TSLOCN
//
**************************** Bottom of Data ****************
A-129
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
..............
etc
..............
..............
1DSNU000I
241 23:57:36.92 DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = TSOUB01
DSNU1044I
241 23:57:36.95 DSNUGTIS - PROCESSING SYSIN AS EBCDIC
DSNU021I -DSNB 241 23:57:36.95 DSNUGASU - REORG UTILITY WITH UTILID = TSOUB01 ENDED IN PHASE = RELOAD, WILL ATTEMPT TO
RESTART(CURRENT)
0DSNU050I
241 23:57:36.95 DSNUGUTC - REORG TABLESPACE WWV8301D.TSLOCN
DSNU021I -DSNB 241 23:57:36.95 DSNURFIT - REORG UTILITY WITH UTILID = TSOUB01 ENDED IN PHASE = RELOAD, WILL ATTEMPT TO
RESTART(PHASE)
DSNU304I -DSNB 241 23:57:37.21 DSNURWT - (RE)LOAD PHASE STATISTICS - NUMBER OF RECORDS=4 FOR TABLE TSOUB01.LOCATION
DSNU302I
241 23:57:37.22 DSNURILD - (RE)LOAD PHASE STATISTICS - NUMBER OF INPUT RECORDS PROCESSED=4
DSNU300I
241 23:57:37.22 DSNURILD - (RE)LOAD PHASE COMPLETE, ELAPSED TIME=00:00:00
DSNU042I
241 23:57:37.22 DSNUGSOR - SORT PHASE STATISTICS NUMBER OF RECORDS=4
ELAPSED TIME=00:00:00
DSNU349I -DSNB 241 23:57:37.36 DSNURBXA - BUILD PHASE STATISTICS - NUMBER OF KEYS=4 FOR INDEX TSOUB01.IXLOCN1
DSNU258I
241 23:57:37.36 DSNURBXD - BUILD PHASE STATISTICS - NUMBER OF INDEXES=1
DSNU259I
241 23:57:37.36 DSNURBXD - BUILD PHASE COMPLETE, ELAPSED TIME=00:00:00
DSNU010I
241 23:57:37.38 DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST RETURN CODE=0
1
J E S 2 J O B L O G -- S Y S T E M D I 1 1 -- N O D E M V S D I 1 1
0
23.57.36 JOB00493 ---- MONDAY,
29 AUG 2011 ---23.57.36 JOB00493 IRR010I USERID TSOUB01 IS ASSIGNED TO THIS JOB.
23.57.36 JOB00493 ICH70001I TSOUB01 LAST ACCESS AT 23:36:45 ON MONDAY, AUGUST 29, 2011
23.57.36 JOB00493 $HASP373 TSOUB011 STARTED - INIT 1
- CLASS A - SYS DI11
23.57.37 JOB00493 -----TIMINGS (MINS.)----------PAGING COUNTS---23.57.37 JOB00493 -STEPNAME PROCSTEP
RC
EXCP
CONN
TCB
SRB CLOCK
SERV WORKLOAD PAGE SWAP
VIO
SWAPS
0
23.57.37 JOB00493 -UTIL
DSNUPROC
00
694
39
.00
.00
.0
116 BATCH
0
0
0
23.57.37 JOB00493 -TSOUB011 ENDED. NAME-TSOUB01 JOB
TOTAL TCB CPU TIME=
.00 TOTAL ELAPSED TIME=
.0
23.57.37 JOB00493 $HASP395 TSOUB011 ENDED
0------ JES2 JOB STATISTICS ------ 29 AUG 2011 JOB EXECUTION DATE
29 CARDS READ
212 SYSOUT PRINT RECORDS
0 SYSOUT PUNCH RECORDS
14 SYSOUT SPOOL KBYTES
0.00 MINUTES EXECUTION TIME
pr
Step 23c: Partial job output of the successful REORG TABLESPACE utility
cl
Ex
Student Exercises
V5.4.0.3
Student Exercises
EXempty
The second job has performed the RELOAD, SORT, and BUILD phases.
The data in the table space is available again:
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
Ex
cl
---------+---------+---------+---------+---------+---------+---------...
SELECT * FROM LOCATION
...
---------+---------+---------+---------+---------+---------+---------...
LOCID
ADDRESS
CITY
POSTAL_CODE ...
---------+---------+---------+---------+---------+---------+---------...
DE71083-01 AM FICHTENBERG 1
HERRENBERG
D-71083
...
US95141-B4 555 BAILEY AVENUE
SAN JOSE
CA 95141
...
US95141-C2 555 BAILEY AVENUE
SAN JOSE
CA 95141
...
US95193-50 5600 COTTLE ROAD
SAN JOSE
CA 95193
...
DSNE610I NUMBER OF ROWS DISPLAYED IS 4
A-131
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Student Exercises
V5.4.0.3
Student Exercises
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
EXempty
A-133
//DSNUPROC.SYSCOPY DD DSN=TSOUB01.CV83.TSEMPL.FIC1A,
//
DISP=(MOD,CATLG),
//
SPACE=(16384,(20,20),,,ROUND),
//
UNIT=SYSDA
//DSNUPROC.SYSCOPY2 DD DSN=TSOUB01.CV83.TSEMPL.FIC1B,
//
DISP=(MOD,CATLG),
//
SPACE=(16384,(20,20),,,ROUND),
//
UNIT=SYSDA
//DSNUPROC.SYSIN
DD *
COPY TABLESPACE WWV8301D.TSEMPL FULL YES
COPYDDN(,SYSCOPY2)
//
Enter output data sets for recovery site for COPY, LOAD, or REORG
TABLESPACE:
5 RCPYDSN1 ===>
6 RCPYDSN2 ===>
Enter output data sets for local/current site for COPY, MERGECOPY,
LOAD, or REORG TABLESPACE:
3 COPYDSN ===> CV83.TSEMPL.FIC1A
4 COPYDSN2 ===> CV83.TSEMPL.FIC1B
===>
SSID:
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
cl
Ex
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
242
242
242
242
242
242
242
242
Step 8: Execute same UPDATE statement as in step 4 above (output not depicted)
DSNU428I
DSNU010I
1DSNU000I
DSNU1044I
0DSNU050I
DSNU400I
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE615I NUMBER OF ROWS AFFECTED IS 2
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
UPDATE EMPLOYEE
SET SALARY = SALARY+10000
WHERE EMPNO IN ('000030','000280')
DSNU428I
DSNU010I
1DSNU000I
DSNU1044I
0DSNU050I
DSNU400I
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-135
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
1DSNU000I
242 03:07:49.03 DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = TSOUB01
DSNU1044I
242 03:07:49.06 DSNUGTIS - PROCESSING SYSIN AS EBCDIC
0DSNU050I
242 03:07:49.06 DSNUGUTC - RECOVER TABLESPACE WWV8301D.TSEMPL
DSNU515I
242 03:07:49.07 DSNUCBAL - THE IMAGE COPY DATA SET TSOUB01.CV83.TSEMPL.FIC1A WITH DATE=20110830 AND
TIME=023437
IS PARTICIPATING IN RECOVERY OF TABLESPACE WWV8301D.TSEMPL
DSNU515I
242 03:07:49.08 DSNUCBAL - THE IMAGE COPY DATA SET TSOUB01.CV83.TSEMPL.IIC1A WITH DATE=20110830 AND
TIME=024322
IS PARTICIPATING IN RECOVERY OF TABLESPACE WWV8301D.TSEMPL
DSNU504I
242 03:07:49.47 DSNUCBMD - MERGE STATISTICS FOR TABLESPACE WWV8301D.TSEMPL
NUMBER OF COPIES=2
NUMBER OF PAGES MERGED=9
ELAPSED TIME=00:00:00
DSNU513I -DSNB 242 03:07:49.48 DSNUCALA - RECOVER UTILITY LOG APPLY RANGE IS RBA 0000066E21DA LRSN 0000066E21DA TO
RBA 0000066E2AA5 LRSN 0000066E2AA5
DSNU1510I
242 03:07:49.49 DSNUCBLA - LOG APPLY PHASE COMPLETE, ELAPSED TIME = 00:00:00
DSNU500I
242 03:07:49.52 DSNUCBDR - RECOVERY COMPLETE, ELAPSED TIME=00:00:00
DSNU010I
242 03:07:49.52 DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST RETURN CODE=0
---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+----DBNAME
TSNAME
DSNUM ICTYPE SHRLEVEL ICBACKUP HEX_START_RBA TIMESTAMP
DATA_SET_NAME
---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+----WWV8301D TSEMPL
0 C
000005424454
2011-08-26-02.18.40.986776 WWV8301D.TSEMPL
WWV8301D TSEMPL
1 Z
0000059E01B6
2011-08-27-13.01.37.927432 WWV8301D.TSEMPL
WWV8301D TSEMPL
2 Z
0000059E01B6
2011-08-27-13.01.37.927432 WWV8301D.TSEMPL
WWV8301D TSEMPL
3 Z
0000059E01B6
2011-08-27-13.01.37.927432 WWV8301D.TSEMPL
WWV8301D TSEMPL
0 F
R
00000667AD5A
2011-08-30-02.34.37.449155 TSOUB01.CV83.TSEMPL.FIC1A
WWV8301D TSEMPL
0 F
R
LB
00000667AD5A
2011-08-30-02.34.37.449448 TSOUB01.CV83.TSEMPL.FIC1B
WWV8301D TSEMPL
0 I
R
0000066D6F47
2011-08-30-02.43.22.027921 TSOUB01.CV83.TSEMPL.IIC1A
WWV8301D TSEMPL
0 I
R
LB
0000066D6F47
2011-08-30-02.43.22.028189 TSOUB01.CV83.TSEMPL.IIC1B
DSNE610I NUMBER OF ROWS DISPLAYED IS 8
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+----SELECT DBNAME,TSNAME,DSNUM,ICTYPE,SHRLEVEL,ICBACKUP,
HEX(START_RBA) AS HEX_START_RBA,TIMESTAMP,
SUBSTR(DSNAME,1,25) AS DATA_SET_NAME
FROM SYSIBM.SYSCOPY
WHERE DBNAME = 'WWV8301D'
AND TSNAME = 'TSEMPL'
ORDER BY TIMESTAMP,ICBACKUP,DSNUM
WITH UR ;
pr
cl
Ex
Student Exercises
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
TSOUB01.CV83.TSEMPL.FIC1A
TSOUB01.CV83.TSEMPL.IIC1A
Step 15: Why must the RECOVER utility apply log records after restoring
the image copies?
The RECOVER utility must apply the log records which represent the update
performed after the incremental image copies were taken.
TSOUB01.CV83.TSEMPL.FIC1A
TSOUB01.CV83.TSEMPL.FIC1B
TSOUB01.CV83.TSEMPL.IIC1A
TSOUB01.CV83.TSEMPL.IIC1B
TSOUB01.CV83.TSLOCN.DATA
Result:
Deleted
pr
Ex
cl
TSOUB01.CV83.TSEMPL.FIC1A
TSOUB01.CV83.TSEMPL.FIC1B
TSOUB01.CV83.TSEMPL.IIC1A
TSOUB01.CV83.TSEMPL.IIC1B
TSOUB01.CV83.TSLOCN.DATA
TSOUB01.CV83.TSLOCN.DISCARD
A-137
DSNUGUTC
DSNUGTIS
DSNUGUTC
DSNUCBAL
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
03:12:24.20
03:12:24.22
03:12:24.23
03:12:24.24
242
242
242
242
pr
1DSNU000I
DSNU1044I
0DSNU050I
DSNU515I
TIME=023437
Step 17: Execute the same RECOVER job as in step 11-13; output
cl
Ex
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
242
242
242
242
03:16:24.34
03:16:24.36
03:16:24.37
03:16:24.38
DSNUGUTC
DSNUGTIS
DSNUGUTC
DSNUCBAL
1DSNU000I
DSNU1044I
0DSNU050I
DSNU515I
TIME=023437
Step 20: Execute the same RECOVER job as in step 11-13; output
Similar to step 16
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-139
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Step 22: Why must the RECOVER utility apply an additional range of log
records?
The additional range of log records represent the update performed before the
incremental image copies were taken.
Optional lab:
Step 23a: Copy the first partition only of table space TSEMPL
pr
Ex
cl
V5.4.0.3
Student Exercises
EXempty
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
TSOUB01.CV83.CNTL(L8LISTC) - 01.00
===>
***************************** Top of Data **********************
//TSOUB01L JOB 1CV83G26,'TSOUB01 JOB
',MSGLEVEL=(1,1),
//
CLASS=A,MSGCLASS=Q,NOTIFY=&SYSUID,REGION=0M
//*******************************************************************
//*
*
//*******************************************************************
//*
//* LISTCAT
//*
//IDCAMS
EXEC PGM=IDCAMS,REGION=2500K
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
LISTCAT LEVEL (DBDSNB.*.WWV8301D.TSEMPL) ALL
//
**************************** Bottom of Data ********************
A-141
PAGE
PAGE
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
cl
Ex
2
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-143
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
TSOUB01.CV83.CNTL(L8DELC) - 01.00
Columns 0000
===>
Scroll ==
***************************** Top of Data **********************
//TSOUB01D JOB 1CV83G26,'TSOUB01 JOB
',MSGLEVEL=(1,1),
//
CLASS=A,MSGCLASS=Q,NOTIFY=&SYSUID,REGION=0M
//*******************************************************************
//*
*
//*******************************************************************
//*
//* DELETE VSAM CLUSTER
//*
//IDCAMS
EXEC PGM=IDCAMS,REGION=2500K
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
DEL DBDSNB.DSNDBC.WWV8301D.TSEMPL.I0001.A001 CL
//
**************************** Bottom of Data ********************
Result:
08/30/11
cl
pr
Ex
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
TSOUB01.CV83.CNTL(L8DB2CMD) - 01.01
Col
===>
***************************** Top of Data *************
//TSOUB011 JOB 1CV83G26,'TSOUB01 JOB
',MSGLEVEL=(1,1),
//
CLASS=A,MSGCLASS=Q,NOTIFY=&SYSUID,REGION=0M
//*******************************************************************
//*
*
//*******************************************************************
//DB2CMD
EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(4,LT)
//STEPLIB DD DSN=DBDSNB.DB2A10.SDSNEXIT,DISP=SHR
//
DD DSN=DBDSNB.DB2A10.SDSNLOAD,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT
DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DSNB)
-STOP
DATABASE(WWV8301D) SPACENAM(TSEMPL) PART(1)
//
**************************** Bottom of Data ***********
Result:
pr
Ex
cl
A-145
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
DEL DBDSNB.DSNDBC.WWV8301D.TSEMPL.I0001.A001 CL
IDC0550I ENTRY (D) DBDSNB.DSNDBD.WWV8301D.TSEMPL.I0001.A001 DELETED
IDC0550I ENTRY (C) DBDSNB.DSNDBC.WWV8301D.TSEMPL.I0001.A001 DELETED
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
pr
Ex
cl
V5.4.0.3
Student Exercises
Step 23e: We pretend that the defective volume has been replaced.
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
EXempty
A-147
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
1READY
DSN SYSTEM(DSNB)
DSN
-START
DATABASE(WWV8301D) SPACENAM(TSEMPL) PART(1)
DSN9022I -DSNB DSNTDDIS 'START DATABASE' NORMAL COMPLETION
DSN
-DISPLAY DATABASE(WWV8301D) SPACENAM(TSEMPL)
DSNT360I -DSNB ***********************************
DSNT361I -DSNB * DISPLAY DATABASE SUMMARY
*
GLOBAL
DSNT360I -DSNB ***********************************
DSNT362I -DSNB
DATABASE = WWV8301D STATUS = RW
DBD LENGTH = 20180
DSNT397I -DSNB
NAME
TYPE PART STATUS
PHYERRLO PHYERRHI CATALOG PIECE
-------- ---- ----- ----------------- -------- -------- -------- ----TSEMPL
TS
0001 RW
-THRU
0003
TSEMPL
TS
RW
******* DISPLAY OF DATABASE WWV8301D ENDED
**********************
DSN9022I -DSNB DSNTDDIS 'DISPLAY DATABASE' NORMAL COMPLETION
DSN
END
READY
END
pr
cl
Ex
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
242
242
242
242
05:54:56.54
05:54:56.57
05:54:56.58
05:54:56.59
DSNUGUTC
DSNUGTIS
DSNUGUTC
DSNUCBAL
Note: The copy data set for the single partition was used.
DSNU504I
1DSNU000I
DSNU1044I
0DSNU050I
DSNU515I
TIME=042251
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-149
Student Exercises
Step 24: Why stop and restart TSDEPT before second DSN1PRNT?
The data is externalized from buffer pool to disk asynchronously, even if an update is
committed. When the table space is stopped, the table space is brought back to currency.
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
When performing a DSN1PRNT, an INSERT, and a second DSN1PRNT right away, you
may observe that the INSERT is not reflected in the output of the second DSN1PRNT job.
Depending on the option and parameter you use, it deletes the requested records from
SYSCOPY and some records from SYSLGRNX. If you specified, for example, AGE(*),
the tablespace is set in COPY PENDING.
3. Execute the REPORT RECOVERY utility again.
You see fewer SYSCOPY, SYSLGRNX entries and less information about archive logs.
It is possible that DB2 has no data at all to report.
pr
Ex
cl
See below for sample utility output for the three items in Step 25.
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
DSNU586I
DSNU588I
DSNU583I
UCDATE
082611
082611
082611
082911
082911
082911
DSNU580I
DSNU010I
DSNU598I
DSNU588I
DSNU589I
DSNU586I
DSNU584I -DSNB 242 06:00:41.42 DSNUPPBS - REPORT RECOVERY TABLESPACE WWV8301D.TSLOCN ARCHLOG1 BSDS VOLUMES
START TIME
END TIME
START RBA
END RBA
UNIT VOLSER
DATA SET NAME
20112341848179 20112412111264 000004380000 00000653FFFF SYSDA SMS013 DBDSNB.ARCHLOG1.A0000003
=
=
=
=
=
=
TIMESTAMP
DEV TYPE
LOW DSNUM
JOBNAME
NPAGESF
DSNAME
=
=
=
=
=
=
TIMESTAMP
DEV TYPE
LOW DSNUM
JOBNAME
NPAGESF
DSNAME
1DSNU000I
242 06:00:41.38 DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = TSOUB01
DSNU1044I
242 06:00:41.41 DSNUGTIS - PROCESSING SYSIN AS EBCDIC
0DSNU050I
242 06:00:41.41 DSNUGUTC - REPORT RECOVERY TABLESPACE WWV8301D.TSLOCN
DSNU581I -DSNB 242 06:00:41.42 DSNUPREC - REPORT RECOVERY TABLESPACE WWV8301D.TSLOCN
DSNU593I -DSNB 242 06:00:41.42 DSNUPREC - REPORT RECOVERY ENVIRONMENT RECORD:
MINIMUM
RBA: 000000000000
MAXIMUM
RBA: FFFFFFFFFFFF
MIGRATING RBA: 000000000000
DSNU582I -DSNB 242 06:00:41.42 DSNUPPCP - REPORT RECOVERY TABLESPACE WWV8301D.TSLOCN SYSCOPY ROWS
AND SYSTEM LEVEL BACKUPS
TIMESTAMP = 2011-08-26-02.18.40.182634, IC TYPE = *C*, SHR LVL = , DSNUM
= 0000, START LRSN =00000541C7BC
DEV TYPE =
,
IC BACK =
,
STYPE
= L, FILE SEQ = 0000, PIT LRSN = 000000000000
LOW DSNUM = 0000,
HIGH DSNUM = 0000,
OLDEST VERSION = 0000,
LOGICAL PART = 0000,
LOGGED = Y,
TTYPE =
JOBNAME
=
,
AUTHID =
,
COPYPAGESF = -1.0E+00
NPAGESF
= -1.0E+00
,
CPAGESF = -1.0E+00
DSNAME
= WWV8301D.TSLOCN
, MEMBER NAME =
, INSTANCE = 01, RELCREATED = O
pr
cl
Ex
V5.4.0.3
Student Exercises
EXempty
A-151
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
-DSNB 242 13:29:58.60 DSNUPPBS - REPORT RECOVERY TABLESPACE WWV8301D.TSLOCN ARCHLOG1 BSDS VOLUMES
-DSNB 242 13:29:58.60 DSNUPPBS - NO DATA TO BE REPORTED
DSNU584I
DSNU588I
DSNU586I
DSNU588I
DSNU589I
DSNU598I
DSNU588I
-DSNB 242 13:29:58.60 DSNUPPLR - SYSLGRNX ROWS FROM REPORT RECOVERY FOR TABLESPACE WWV8301D.TSLOCN
-DSNB 242 13:29:58.60 DSNUPPLR - NO DATA TO BE REPORTED
DSNU583I
DSNU588I
DSNU580I
DSNU010I
DSNU586I
DSNU588I
1DSNU000I
242 13:29:58.56 DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = TSOUB01
DSNU1044I
242 13:29:58.59 DSNUGTIS - PROCESSING SYSIN AS EBCDIC
0DSNU050I
242 13:29:58.59 DSNUGUTC - REPORT RECOVERY TABLESPACE WWV8301D.TSLOCN
DSNU581I -DSNB 242 13:29:58.59 DSNUPREC - REPORT RECOVERY TABLESPACE WWV8301D.TSLOCN
DSNU593I -DSNB 242 13:29:58.60 DSNUPREC - REPORT RECOVERY ENVIRONMENT RECORD:
MINIMUM
RBA: 000000000000
MAXIMUM
RBA: FFFFFFFFFFFF
MIGRATING RBA: 000000000000
DSNU582I -DSNB 242 13:29:58.60 DSNUPPCP - REPORT RECOVERY TABLESPACE WWV8301D.TSLOCN SYSCOPY ROWS
AND SYSTEM LEVEL BACKUPS
TIMESTAMP = 2011-08-30-13.25.36.400287, IC TYPE = *M*, SHR LVL = , DSNUM
= 0000, START LRSN =0000065E5522
DEV TYPE =
,
IC BACK =
,
STYPE
= R, FILE SEQ = 0000, PIT LRSN = 0000068D9A7F
LOW DSNUM = 0000,
HIGH DSNUM = 0000,
OLDEST VERSION = 0001,
LOGICAL PART = 0000,
LOGGED = Y,
TTYPE =
JOBNAME
= TSOUB011,
AUTHID =
TSOUB01 ,
COPYPAGESF = -1.0E+00
NPAGESF
= -1.0E+00
,
CPAGESF = -1.0E+00
DSNAME
= WWV8301D.TSLOCN
, MEMBER NAME =
, INSTANCE = 01, RELCREATED = O
DSNU381I
DSNU575I
DSNU010I
1DSNU000I
242
DSNU1044I
242
0DSNU050I
242
DSNU572I -DSNB
pr
cl
Ex
Student Exercises
V5.4.0.3
Student Exercises
EXempty
Exercise 9: Security
Steps 1 to 4: Privileges on tables you do not own
SELECT * FROM TSOUB02.EMPLOYEE
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
DSNT408I SQLCODE = -551, ERROR: TSOUB01 DOES NOT HAVE THE PRIVILEGE TO PERFORM
OPERATION SELECT ON OBJECT TSOUB02.EMPLOYEE
DSNT418I SQLSTATE
= 42501 SQLSTATE RETURN CODE
DSNT415I SQLERRP
= DSNXOSC SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD
= -100 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD
= X'FFFFFF9C' X'00000000' X'00000000' X'FFFFFFFF'
X'00000000' X'00000000' SQL DIAGNOSTIC INFORMATION
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE618I ROLLBACK PERFORMED, SQLCODE IS 0
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
Initially, you do not have SELECT privilege on your neighbors EMPLOYEE table. After
your neighbor grants you SELECT privilege via: GRANT SELECT ON EMPLOYEE TO TSOUB01,
you are able to select data from their table. However, you cannot delete data because you
do not have DELETE privilege.
Ex
cl
pr
A-153
Student Exercises
Step 6: Sample result of: ===> TSO LISTUSER (or TSO LU)
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
cl
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
pr
Ex
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
The Secondary Authid WWCV83ST has the privileges to create table spaces, tables and
display the status of the database WWV83XXD. SYSPROG who has SYSADM authority
granted the Secondary Authorization id WWV83ST these privileges.
pr
Ex
cl
---------+---------+---------+---------+---------+---------+---------+---------+
SELECT SUBSTR(GRANTOR,1,8) AS GRANTOR,
SUBSTR(GRANTEE,1,8) AS GRANTEE,
SUBSTR(NAME,1,8) AS NAME,
AUTHHOWGOT,CREATETABAUTH,CREATETSAUTH,DBADMAUTH
FROM SYSIBM.SYSDBAUTH
WHERE NAME
= 'WWV83XXD'
AND GRANTEE = 'SYSPROG'
WITH UR ;
---------+---------+---------+---------+---------+---------+---------+---------+
GRANTOR
GRANTEE
NAME
AUTHHOWGOT CREATETABAUTH CREATETSAUTH DBADMAUTH
---------+---------+---------+---------+---------+---------+---------+---------+
SYSPROG
SYSPROG
WWV83XXD S
G
G
G
A-155
Student Exercises
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
The database owner SYSPROG has all these privileges with GRANT option.
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
SET CURRENT SQLID = USER;
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
CREATE TABLE T1
(COL1 CHAR(1))
IN DATABASE WWV83XXD
---------+---------+---------+---------+---------+---------+---------+---------+
DSNT408I SQLCODE = -551, ERROR: TSOUB01 DOES NOT HAVE THE PRIVILEGE TO PERFORM
OPERATION CREATE TABLE ON OBJECT WWV83XXD
DSNT418I SQLSTATE
= 42501 SQLSTATE RETURN CODE
DSNT415I SQLERRP
= DSNXODD2 SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD
= 50 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD
= X'00000032' X'00000000' X'00000000' X'FFFFFFFF'
X'00000000' X'00000000' SQL DIAGNOSTIC INFORMATION
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE618I ROLLBACK PERFORMED, SQLCODE IS 0
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
This is because the privileges on database WWCV83XXD have been granted to your
Secondary Authorization id and not to your Primary Authid.
cl
---------+---------+---------+---------+---------+---------+---------+---------+
SET CURRENT SQLID = 'WWCV83ST';
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
Ex
pr
The CREATE is successful because WWCV83ST has the authority to create the table
(CREATETAB, and for the implicit tablespace creation: USE OF STOGROUP and
USE OF BUFFERPOOL).
A-157
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
The CREATE is successful because WWCV83ST has the authority to create the table
(CREATETAB, and for the implicit tablespace creation: USE OF STOGROUP and
USE OF BUFFERPOOL).
Ex
cl
pr
This is because the privileges on database WWCV83XXD have been granted to your
Secondary Authorization id and not to your Primary Authid. In this case although
WWCV83ST has the privilege to create a table in database WWV83XXD, the table owner
has to be your Primary Authid and this is not possible.
V5.4.0.3
Student Exercises
EXempty
Step 18: Current SQLID = USER, selecting from one groups table
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
SET CURRENT SQLID = USER;
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
SELECT *
FROM WWCV83ST.T01A
---------+---------+---------+---------+---------+---------+---------+---------+
COL1
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE610I NUMBER OF ROWS DISPLAYED IS 0
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+---------+---------+
Step 19: Why is the SELECT successful, even though your Primary
Authid does not have SELECT privilege on table sauthid.T??A?
The SELECT is successful because the privilege set is the set of privileges held by all
authorization ids associated with the process.
pr
Ex
cl
---------+---------+---------+---------+---------+---------+
SELECT SUBSTR(NAME,1,8) AS NAME,
SUBSTR(CREATOR,1,8) AS CREATOR,
SUBSTR(DBNAME,1,8) AS DBNAME,
SUBSTR(TSNAME,1,8) AS TSNAME,
SUBSTR(CREATEDBY,1,8) AS CREATEDBY,
SUBSTR(OWNER,1,8) AS OWNER
FROM SYSIBM.SYSTABLES
WHERE NAME IN ('T01A', 'T01B')
AND DBNAME = 'WWV83XXD'
WITH UR ;
---------+---------+---------+---------+---------+---------+-NAME
CREATOR
DBNAME
TSNAME
CREATEDBY
OWNER
---------+---------+---------+---------+---------+---------+-T01A
WWCV83ST WWV83XXD T01A
TSOUB01
WWCV83ST
T01B
WWCV83ST WWV83XXD T01B
TSOUB01
WWCV83ST
DSNE610I NUMBER OF ROWS DISPLAYED IS 2
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+--
Note: CREATOR shows schema name and OWNER shows the owner of the table.
Copyright IBM Corp. 1993, 2011
A-159
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+
SELECT SUBSTR(GRANTOR,1,8) AS GRANTOR,
SUBSTR(GRANTEE,1,8) AS GRANTEE,
SUBSTR(TCREATOR,1,8) AS TCREATOR,
SUBSTR(TTNAME,1,10) AS TTNAME,
AUTHHOWGOT,SELECTAUTH
FROM SYSIBM.SYSTABAUTH
WHERE GRANTEE IN ('TSOUB01', 'WWCV83ST')
AND TTNAME = 'SYSTABLES'
WITH UR ;
---------+---------+---------+---------+---------+---------+---------+
GRANTOR
GRANTEE
TCREATOR TTNAME
AUTHHOWGOT SELECTAUTH
---------+---------+---------+---------+---------+---------+---------+
INSCV83
TSOUB01
SYSIBM
SYSTABLES
S
Y
INSCV83
WWCV83ST SYSIBM
SYSTABLES
S
Y
pr
Ex
cl
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
DBNAME
NAME
CREATOR
TYPE LOCKRULE
---------+---------+---------+---------+-------WWV8301D TSLOCN
TSOUB01
A
A
WWV8301D TSDEPT
TSOUB01
G
A
WWV8301D TSEMPL
TSOUB01
R
WWV8301D TSPROJ
TSOUB01
A
WWV8301D TSEXCEPT TSOUB01
A
DSNE610I NUMBER OF ROWS DISPLAYED IS 5
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+---------+---------+
pr
Ex
cl
---------+---------+---------+---------+---------+---------+---------+---------+
SELECT SUBSTR(NAME,1,8)
AS NAME
, SUBSTR(CREATOR,1,8) AS CREATOR
, SUBSTR(OWNER,1,8) AS OWNER
, RELEASE
FROM SYSIBM.SYSPACKAGE
WHERE RELEASE
= 'D'
WITH UR ;
---------+---------+---------+---------+---------+---------+
NAME
CREATOR
OWNER
RELEASE
---------+---------+---------+---------+---------+---------+
DSNE610I NUMBER OF ROWS DISPLAYED IS 0
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+---------+---------+
A-161
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
SELECT SUBSTR(NAME,1,8) AS NAME,
SUBSTR(CREATOR,1,8) AS CREATOR,
SUBSTR(OWNER,1,8) AS OWNER
FROM SYSIBM.SYSPACKAGE
WHERE ISOLATION = 'R'
WITH UR ;
---------+---------+---------+---------+---------+---------+
NAME
CREATOR
OWNER
---------+---------+---------+---------+---------+---------+
DSNREXX
SYSPROG
SYSPROG
DSNESM68 SYSPROG
SYSPROG
DSNA6DB2 SYSPROG
SYSPROG
DSNA6THP SYSPROG
SYSPROG
DSNAEXPL SYSPROG
SYSPROG
DSNAHVPM SYSPROG
SYSPROG
DSNE610I NUMBER OF ROWS DISPLAYED IS 6
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+---------+---------+
Ex
cl
pr
Reason code 00C9008E means that a lock request for the resource identified by NAME
could not be granted, and the request waited for a period longer than the maximum
specified by the installation.
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+
SELECT SUBSTR(CREATOR,1,8) AS CREATOR, SUBSTR(NAME,1,10) AS NAME,
SUBSTR(DBNAME,1,8) AS DBNAME, SUBSTR(TSNAME,1,8) AS TSNAME,
DBID, OBID
FROM SYSIBM.SYSTABLES
WHERE CREATOR = 'WWCV831'
AND NAME = 'DEPARTMENT'
WITH UR ;
---------+---------+---------+---------+---------+---------+---------+
CREATOR
NAME
DBNAME
TSNAME
DBID
OBID
---------+---------+---------+---------+---------+---------+---------+
WWCV831
DEPARTMENT WWV83YYD TSDEPT
280
3
DSNE610I NUMBER OF ROWS DISPLAYED IS 1
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100
---------+---------+---------+---------+---------+---------+---------+
Background information for the following DISPLAY outputs: Userid INSCV83 has
previously issued (without commit):
pr
Ex
cl
---------+---------+---------+---------+---------+---------+
UPDATE WWCV831.DEPARTMENT
SET NAME = '*** THIS UPDATE IS UNCOMMITTED ***'
WHERE DEPTNO = 'E01';
---------+---------+---------+---------+---------+---------+
DSNE615I NUMBER OF ROWS AFFECTED IS 1
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+
DSNE614I AUTOCOMMIT IS NO; NO CHANGES COMMITTED
---------+---------+---------+---------+---------+---------+
A-163
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Step 4a to b
cl
In the example output, TSO userid INSCV83 is holding a lock in IX mode on table space
TSDEPT and a lock in X mode on a table with an object ID of 3 (table DEPARTMENT).
Ex
Step 4c
pr
Step 4d
TSO userids TSOUB01, TSOUB02 and TSOUB03 are holding lock in IS mode on the
table space WWV83YYD.TSDEPT. TSOUB01 is holding a lock in IX mode on the
DEPARTMENT table (OBID 3). TSOUB02 and TSOUB03 are holding lock in IS mode on
the DEPARTMENT table.
V5.4.0.3
Student Exercises
EXempty
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
UPDATE EMPLOYEE
SET SALARY = SALARY * 1.1
WHERE EMPNO = '000200'
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE615I NUMBER OF ROWS AFFECTED IS 1
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---------+---------+
DSNE614I AUTOCOMMIT IS NO; NO CHANGES COMMITTED
---------+---------+---------+---------+---------+---------+---------+---------+
pr
Ex
cl
Note: The current update changes one page in one partition - and only this partition gets
an IX lock.
A-165
Student Exercises
A00
B01
C01
D01
E01
D11
D21
E11
E21
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
---------+---------+---------+---------+---------+---------+---------+---------+
DEPTNO SUPERIOR_DEPTNO MGRNO
NAME
---------+---------+---------+---------+---------+---------+---------+---------+
--------------A00
A00
A00
A00
D01
D01
E01
E01
000010
000020
000030
-----000050
000060
000070
000090
000100
A SELECT statement that specifies UR ignores any locks and does not acquire any locks
on the data being accessed, and therefore the SELECT is successful.
Remark: When you remove the UR option, you find that the SELECT times out again
because the table is still locked in X mode by another user.
pr
Ex
cl
V5.4.0.3
Student Exercises
EXempty
SKIP LOCKED DATA skips the row for DEPTNO E01 as this row is locked. UR retrieves
the row for DEPTNO E01 although this row is not committed. You see only committed
rows with SKIP LOCKED DATA.
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
End of exercise
A-167
pr
Ex
cl
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
Student Exercises
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
backpg
pr
cl
Ex
V5.4.0.3
Back page
pr
u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.
cl
Ex
CONTACTO
Telfono
91 761 21 78
Pngase en contacto con nuestro equipo y le
informaremos de cualquier duda o cuestin
que pueda surgirle.
Email
formacion@arrowecs.es
Mndenos un email y le atenderemos
enseguida.
Online
@Arrow_Edu_ES
O bien puede contactarnos a travs de
nuestro perfil en Twitter.
Vistenos
Arrow ECS Education Services
Avenida de Europa 21,
Parque Empresarial La Moraleja
28108 Alcobendas, Madrid
EDUCATION
S