DB2 Utility Guide and Reference PDF
DB2 Utility Guide and Reference PDF
DB2 Utility Guide and Reference PDF
1 for z/OS
SC18-9855-05
SC18-9855-05
Note
Before using this information and the product it supports, be sure to read the general information under Notices at the
end of this information.
Contents
About this information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Who should read this information . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
DB2 Utilities Suite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Terminology and citations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Accessibility features for DB2 Version 9.1 for z/OS . . . . . . . . . . . . . . . . . . . . . . xvi
How to send your comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Naming conventions used in this information . . . . . . . . . . . . . . . . . . . . . . . xvii
How to read syntax diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3
3
4
4
5
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 7
. 8
.
.
.
.
. 13
. 15
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
18
18
18
21
22
28
30
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
33
34
35
36
36
39
40
40
40
40
41
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 44
. 46
. 47
iii
SYSTEM
. . .
. . .
. . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
47
47
48
48
Chapter 6. CATENFM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Syntax and options of the control statement . .
Before converting the catalog . . . . . . .
Data sets that CATENFM uses when converting
Concurrency and compatibility for CATENFM.
Converting to new-function mode . . . . . .
Termination or halt of CATENFM . . . . . .
. . . .
. . . .
the catalog
. . . .
. . . .
. . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
51
52
52
53
53
53
Chapter 7. CATMAINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
|
|
|
|
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
55
56
56
57
57
57
57
58
58
58
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
62
69
70
74
76
77
77
77
78
78
79
80
80
81
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
86
89
90
90
92
94
95
98
99
99
99
iv
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
104
107
107
109
110
table
. .
. .
. .
space
. .
. .
. .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
110
111
111
111
|
|
|
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
114
124
124
126
129
130
131
133
134
135
135
135
135
136
136
138
139
140
141
141
141
141
142
142
143
. . . . . . . . . . . . . . . . . . . . . . . . . . 155
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
156
161
162
163
163
164
164
164
164
164
165
165
165
166
166
166
167
167
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
173
177
177
177
178
178
Contents
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
181
183
183
183
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
185
193
193
194
197
197
198
199
200
200
200
|
|
|
|
vi
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
columns
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
207
248
249
253
256
256
256
257
259
260
260
260
262
262
263
265
267
267
269
270
271
272
273
273
274
275
276
277
277
278
280
281
281
282
282
283
283
284
284
285
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
285
285
286
288
288
288
288
289
291
291
292
292
293
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
308
310
311
312
313
313
313
313
313
314
314
314
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
318
321
321
321
322
323
323
324
324
324
325
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
328
330
330
331
331
331
332
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
335
338
339
339
339
339
339
vii
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
344
345
346
346
348
348
348
349
349
350
350
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
353
361
362
364
366
366
367
367
368
372
373
373
373
373
374
|
|
|
|
|
viii
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
379
387
387
388
390
390
391
391
391
392
393
393
394
394
395
395
396
401
401
402
403
408
409
409
411
411
412
412
413
413
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 413
. 414
. 414
. . . . . . . . . . . . . . . . . . . . . . . . . . 419
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
420
432
433
437
439
439
440
441
442
442
443
444
445
445
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
452
481
486
493
498
499
501
502
502
502
504
504
505
505
505
507
507
508
509
512
513
513
513
514
514
514
515
517
519
519
520
521
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Contents
.
.
.
.
.
536
550
551
551
554
ix
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
555
555
555
556
557
557
557
558
558
559
559
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
564
568
568
568
570
570
571
577
. . . . . . . . . . . . . . . . . . . . . . . . 585
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
586
587
588
589
589
589
589
590
590
590
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
594
608
608
610
612
612
613
613
613
613
614
615
615
615
615
615
620
623
629
629
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 636
. 636
. 637
requires
. . .
. . .
. . .
. . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
637
637
638
638
639
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
641
654
654
654
655
656
656
657
657
657
658
658
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
664
699
699
700
702
702
703
703
703
705
705
707
708
710
713
713
714
714
714
715
.
.
.
.
.
.
. 723
. 723
. 724
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Contents
.
.
.
.
.
730
743
745
745
746
xi
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
747
747
748
748
748
748
. . . . . . . . . . . . . . . . . . . . . 751
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 752
. 753
. 753
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 764
. 766
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
772
775
776
776
777
777
779
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
783
788
789
794
794
794
795
795
795
796
796
797
797
798
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
805
811
812
813
813
816
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
824
830
830
831
xii
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 834
. 839
. 840
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 840
. 841
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
860
871
874
895
. . .
. . .
. . .
. . .
. . .
status .
. . .
. . .
. . .
. . .
. . .
. . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
925
926
927
927
928
928
929
929
930
931
931
932
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 934
. 940
. 941
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. . . .
database .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 949
. 949
. 949
. 949
. 949
. 950
. 978
. 999
. 999
. 1007
. 1007
. 1007
. 1007
. 1007
. 1007
. 1009
. 1009
. 1010
. 1010
. 1010
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Contents
. 1012
. 1013
xiii
Information resources for DB2 for z/OS and related products . . . . . . . . . . . 1015
How to obtain DB2 information . . . . . . . . . . . . . . . . . . . . . . . . 1021
How to use the DB2 library . . . . . . . . . . . . . . . . . . . . . . . . . . 1025
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1029
Programming Interface Information . . . . . . . . . . . . . . . .
General-use Programming Interface and Associated Guidance Information . .
Product-sensitive Programming Interface and Associated Guidance Information .
Trademarks . . . . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1030
1031
1031
1031
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1033
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1077
xiv
xv
When referring to a DB2 product other than DB2 for z/OS, this information uses
the products full name to avoid ambiguity.
The following terms are used as indicated:
DB2
OMEGAMON
Refers to any of the following products:
v IBM Tivoli OMEGAMON XE for DB2 Performance Expert on z/OS
v IBM Tivoli OMEGAMON XE for DB2 Performance Monitor on z/OS
v IBM DB2 Performance Expert for Multiplatforms and Workgroups
v IBM DB2 Buffer Pool Analyzer for z/OS
C, C++, and C language
Represent the C or C++ programming language.
CICS Represents CICS Transaction Server for z/OS.
RACF
Represents the functions that are provided by the RACF component of the
z/OS Security Server.
Accessibility features
The following list includes the major accessibility features in z/OS products,
including DB2 Version 9.1 for z/OS. These features support:
v Keyboard-only operation.
v Interfaces that are commonly used by screen readers and screen magnifiers.
v Customization of display attributes such as color, contrast, and font size
Tip: The Information Management Software for z/OS Solutions Information
Center (which includes information for DB2 Version 9.1 for z/OS) and its related
publications are accessibility-enabled for the IBM Home Page Reader. You can
operate all features using the keyboard instead of the mouse.
Keyboard navigation
You can access DB2 Version 9.1 for z/OS ISPF panel functions by using a keyboard
or keyboard shortcut keys.
For information about navigating the DB2 Version 9.1 for z/OS ISPF panels using
TSO/E or ISPF, refer to the z/OS TSO/E Primer, the z/OS TSO/E Users Guide, and
the z/OS ISPF Users Guide. These guides describe how to navigate each interface,
including the use of keyboard shortcuts or function keys (PF keys). Each guide
includes the default settings for the PF keys and explains how to modify their
functions.
xvi
xvii
connection-name
An identifier of one to eight characters that identifies an address space
connection to DB2. A connection identifier is one of the following values:
v
v
v
v
See DB2 Administration Guide for more information about managing DB2
connections.
correlation-id
An identifier of 1 to 12 characters that identifies a process within an address
space connection. A correlation ID must begin with a letter.
A correlation ID can be one of the following values:
v The TSO logon identifier (for DSN processes that run in TSO foreground
and for CAF processes).
v The job name (for DSN processes that run in TSO batch).
v The PST#.PSBNAME (for IMS processes).
v The entry identifier.thread_number.transaction_identifier (for CICS
processes).
See DB2 Administration Guide for more information about correlation IDs.
cursor-name
An identifier that designates a result set. Cursor names that are specified with
the EXEC SQL and LOAD utilities cannot be longer than eight characters.
database-name
A short identifier that identifies a database. The identifier must start with a
letter and must not include special characters.
data-set-name
An identifier of 1 to 44 characters that identifies a data set.
dbrm-member-name
An identifier of one to eight letters or digits that identifies a member of a
partitioned data set.
A DBRM member name should not begin with DSN because of a potential
conflict with DB2-provided DBRM member names. If you specify a DBRM
member name that begins with DSN, DB2 issues a warning message.
dbrm-pds-name
An identifier of 1 to 44 characters that identifies a partitioned data set.
ddname
An identifier of one to eight characters that identifies the name of a DD
statement.
hexadecimal-constant
A sequence of digits or any of the letters from A to F (uppercase or lowercase).
hexadecimal-string
An X followed by a sequence of characters that begins and ends with the
string delimiter, an apostrophe. The characters between the string delimiters
must be a hexadecimal number.
index-name
A qualified or unqualified name that identifies an index.
xviii
|
|
|
|
|
|
If the index name contains a blank character, the name must be enclosed in
quotation marks when specified in a utility control statement.
location-name
A location identifier of 1 to 16 letters (but excluding the alphabetic extenders),
digits, or the underscore that identifies an instance of a database management
system. A location name must begin with a letter.
luname
An SQL short identifier of one to eight characters that identifies a logical unit
name. A LU name must begin with a letter.
member-name
An identifier of one to eight letters (including the three alphabetic extenders)
or digits that identifies a member of a partitioned data set.
A member name should not begin with DSN because of a potential conflict
with DB2-provided member names. If you specify a member name that begins
with DSN, DB2 issues a warning message.
qualifier-name
An SQL short identifier of one to eight letters, digits, or the underscore that
identifies the implicit qualifier for unqualified table names, views, indexes, and
aliases.
string
A sequence of characters that begins and ends with an apostrophe.
subsystem-name
An identifier that specifies the DB2 subsystem as it is known to the operating
system.
table-name
A qualified or unqualified name that designates a table.
|
|
|
|
A fully qualified table name is a three-part name. The first part is a location
name that designates the DBMS at which the table is stored. The second part is
a schema name. The third part is an SQL identifier. A period must separate
each of the parts.
|
|
|
|
|
|
|
|
|
If the table name contains a blank, the name must be enclosed in quotation
marks when specified in a utility control statement.
table-space-name
A short identifier that identifies a table space of an identified database. The
identifier must start with a letter and must not include special characters. If a
database is not identified, a table space name specifies a table space of
database DSNDB04.
About this information
xix
utility-id
An identifier of 1 to 16 characters that uniquely identifies a utility process
within DB2. A utility ID must begin with a letter. The remaining characters can
be uppercase and lowercase letters, numbers 0 through 9, and the following
characters: #, $, ., , !, , and @.
optional_item
If an optional item appears above the main path, that item has no effect on the
execution of the statement and is used only for readability.
optional_item
required_item
v If you can choose from two or more items, they appear vertically, in a stack.
If you must choose one of the items, one item of the stack appears on the main
path.
required_item
required_choice1
required_choice2
If choosing one of the items is optional, the entire stack appears below the main
path.
required_item
optional_choice1
optional_choice2
If one of the items is the default, it appears above the main path and the
remaining choices are shown below.
xx
default_choice
required_item
optional_choice
optional_choice
v An arrow returning to the left, above the main line, indicates an item that can be
repeated.
required_item repeatable_item
If the repeat arrow contains a comma, you must separate repeated items with a
comma.
,
required_item repeatable_item
A repeat arrow above a stack indicates that you can repeat the items in the
stack.
|
|
|
|
|
required_item
fragment-name:
fragment-name
required_item
optional_name
|
|
|
|
xxi
xxii
The following online utilities issue informational message DSNU185I when a table
space or index space with the DEFINE NO attribute is encountered. The object is
not processed.
v CHECK DATA
v CHECK INDEX
v COPY
v MERGECOPY
v MODIFY RECOVERY
v QUIESCE
v REBUILD INDEX
v RECOVER
v REORG INDEX
v REORG TABLESPACE
v REPAIR, but not REPAIR DBD
v RUNSTATS TABLESPACE INDEX(ALL) 1
v RUNSTATS INDEX 1
v UNLOAD
Note:
1. RUNSTATS recognizes DEFINE NO objects and updates the catalogs access
path statistics to reflect the empty objects.
You cannot use stand-alone utilities on objects whose data sets have not been
defined.
REBUILD INDEX
REORG TABLESPACE
REPAIR
RUNSTATS
UNLOAD
v DSN1PRNT
The following utilities are core utilities, which are included (at no extra charge)
with Version 9.1 of DB2 for z/OS:
v CATENFM
v CATMAINT
v DIAGNOSE
v LISTDEF
v OPTIONS
v QUIESCE
v REPAIR
v REPORT
v TEMPLATE
v All DSN stand-alone utilities
|
|
All other utilities are available as a separate product called the DB2 Utilities Suite
(5655-N97, FMIDs JDB991K), which includes the following utilities:
v BACKUP SYSTEM
v CHECK DATA
v CHECK INDEX
v CHECK LOB
v COPY
v COPYTOCOPY
v EXEC SQL
v LOAD
v MERGECOPY
v MODIFY RECOVERY
v MODIFY STATISTICS
v REBUILD INDEX
v RECOVER
v REORG INDEX
v REORG TABLESPACE
v RESTORE SYSTEM
v RUNSTATS
v STOSPACE
v UNLOAD
All DB2 utilities operate on catalog, directory, and sample objects, without
requiring any additional products.
|
|
|
The SMP/E RECEIVE job, DSNRECVK, loads the DB2 Utilities Suite Version 9
program modules, macros, and procedures into temporary data sets (SMPTLIBs). If
these jobs fail or abnormally terminate, correct the problem and rerun the jobs.
|
|
|
The SMP/E APPLY job, DSNAPPLK, copies and link-edits the program modules,
macros, and procedures for the DB2 Utilities Suite Version 9 into the DB2 target
libraries.
|
|
The SMP/E ACCEPT job, DSNACCPK, copies the program modules, macros, and
procedures for the DB2 Utilities Suite Version 9 into the DB2 distributed libraries.
Related information
SMP/E step 4: Run the receive jobs: DSNRECV1, DSNRECV2, DSNRECV3,
DSNRECV4 (DB2 Installation Guide)
SMP/E step 6: Run the apply job: DSNAPPL1 (DB2 Installation Guide)
SMP/E step 7: Run the accept job: DSNACEP1 (DB2 Installation Guide)
Utility name
DSNU91LV
DSNU91LA
CHECK
DSNU91LB
COPY
DSNU91LC
COPYTOCOPY
DSNU91LT
DIAGNOSE
DSNU91LD
EXEC SQL
DSNU91LU
LISTDEF
DSNU91LE
LOAD
DSNU91LF
MERGECOPY
DSNU91LG
|
|
DSNU91LH
OPTIONS
DSNU91LI
QUIESCE
DSNU91LJ
REBUILD INDEX
DSNU91LK
Utility name
RECOVER
DSNU91LL
DSNU91LM
REPAIR
DSNU91LN
REPORT
DSNU91LO
RUNSTATS
DSNU91LP
STOSPACE
DSNU91LQ
TEMPLATE
DSNU91LR
|
|
UNLOAD
DSNU91LS
10
11
12
13
|
|
|
|
14
Because you might need to restart a utility, take the following precautions when
defining the disposition of data sets:
v Use DISP=(NEW,CATLG,CATLG) or DISP=(MOD,CATLG) for data sets that you
want to retain.
v Use DISP=(MOD,DELETE,CATLG) for data sets that you want to discard after
utility execution.
v Use DISP=(NEW,DELETE) for DFSORT SORTWKnn data sets, or refer to
DFSORT Application Programming: Guide for alternatives.
v Do not use temporary data set names.
In all other cases, the control statement data set is processed as EBCDIC. An
informational message is issued to identify the character set that is being
processed.
v The utility statement must start with the syntax for a utility.
v Other syntactical constructs in the utility control statement describe options; you
can separate these constructs with an arbitrary number of blanks.
v The SYSIN stream can contain multiple utility control statements.
Chapter 3. Invoking DB2 online utilities
15
The options that you can specify after the online utility name depend on which
online utility you use. To specify a utility option, specify the option keyword,
followed by its associated parameter or parameters, if any. The parameter value
can be a keyword. You need to enclose the values of some parameters in
parentheses. The syntax diagrams for utility control statements that are included in
this information show parentheses where they are required.
You can specify more than one utility control statement in the SYSIN stream.
However, if any of the control statements returns a return code of 8 or greater, the
subsequent statements in the job step are not executed.
When specifying in a utility control statement multiple numeric values that are
meant to be delimited, you must delimit these values with a comma (,),
regardless of the definition of DECIMAL in DSNHDECP. Likewise, when
specifying a decimal number in a utility control statement, you must use a period
(.), regardless of the definition of DECIMAL in DSNHDECP.
You can enter comments within the SYSIN stream. Comments must begin with two
hyphens (--) and are subject to the following rules:
v You must use two hyphens on the same line with no space between them.
v You can start comments wherever a space is valid, except within a delimiter
token.
v The end of a line terminates a comment.
Two comments are shown in the following statement:
// SYSIN DD *
RUNSTATS TABLESPACE DSNDB06.SYSDBASE
-- COMMENT HERE
/*
-- COMMENT HERE
|
|
Multi-byte character sets can be difficult to work with in fixed 80-byte SYSIN data
sets. Long object names and long character literals might not fit on a single line.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
v Separate qualified object names into two parts following the dot . which
separates the qualifiers. Separating long names into multiple parts makes it
easier to follow the continuation rules This technique can not be used in the
EXEC SQL utility, which must follow both utility and SQL syntax rules.
|
|
|
|
v Use the || concatenation operator to divide long identifiers into two or more
parts that fit properly into each SYSIN record. Place the || concatenation
operator between two delimited character strings or between two non-delimited
character strings. Delimited character strings are enclosed in double quotation
16
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
In this example, the strings CREA and TOR are non-delimited, and the strings
TABL and ENAME are delimited by double quotation marks. The processed
output of this example is equivalent to the following statement:
LOAD INTO TABLE CREATOR."TABLENAME"
|
|
|
|
|
|
|
|
|
|
Both string1 and string2 must be syntactically correct within each SYSIN input
record. Quotes must be balanced within each string. If DBCS characters are used,
shift-out and shift-in characters must be balanced within each string. Any one
multi-byte character must be contained entirely within a single SYSIN record.
|
|
|
|
|
|
|
|
|
|
|
The || operator must be entered as a stand-alone token, with one or more blanks
preceding and following it. It may be entered on the same input record as
string1, alone or on an input record, or on the same input record with string2.
This operator functions at the token level before any context is detected or
semantic meaning is applied. An example utility statement is shown in the
following statement:
|
|
|
string1
||
string2
COPY
INDEX
"A" ||
"B"
results in:
COPY INDEX
"AB"
17
|
|
|
|
|
|
For the rest of this example, suppose that you save the statement in the
default data set, UTIL.
2. From the ISPF Primary Option menu, select the DB2I menu.
18
3. On the DB2I Utilities panel, select the UTILITIES option. Items that you must
specify are highlighted on the DB2 Utilities panel, as shown in the following
figure.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
DSNEUP01
===>
DB2 UTILITIES
===>
UTIL
===> NO
The data set names panel will be displayed when required by a utility.
PRESS:
ENTER to process
END to exit
4. Fill in field 1 with the function that you want to execute. In this example, you
want to submit the utility job, but you want to edit the JCL first, so specify
EDITJCL. After you edit the JCL, you do not need to return to this panel to
submit the job. Instead, type SUBMIT on the editor command line.
5. Ensure that Field 2 is a unique identifier for your utility job. The default value
is TEMP. In this example, that value is satisfactory; leave it as is.
6. Fill in field 3 with the utility that you want to run. In this example, specify
COPY.
7. Fill in field 4 if you want to use an input data set other than the default data
set. Unless you enclose the data set name between apostrophes, TSO adds
your user identifier as a prefix. In this example, specify UTIL, which is the
default data set.
8. Change field 5 if this job restarts a stopped utility or if you want to execute a
utility in PREVIEW mode. In this example, leave the default value, NO.
9. Specify in field 6 whether you are using LISTDEF statements or TEMPLATE
statements in this utility. If you specify YES for LISTDEF or TEMPLATE, DB2
displays the Control Statement Data Set Names panel, but the field entries are
optional.
10. Fill in field 7 with the data set name of the DB2 subsystem library when you
want the generated JCL to use the default DB2 subsystem library.
11. Press Enter.
v If you specified COPY, LOAD, MERGECOPY, REORG TABLESPACE, or
UNLOAD as the utility in field 3, you must complete the fields on the Data
Set Names panel, as shown in the following figure.
19
DSNEUP02
===>
20
SSID:
Enter the data set name for the LISTDEF data set (SYSLISTD DD):
1 LISTDEF DSN ===>
OPTIONAL or IGNORED
Enter the data set name for the TEMPLATE data set (SYSTEMPL DD):
2 TEMPLATE DSN ===>
OPTIONAL or IGNORED
PRESS:
ENTER to process
END to exit
a. Fill in field 1 to specify the data set that contains a LISTDEF control
statement. The default is the SYSIN data set. This field is ignored if you
specified NO in the LISTDEF? field in the DB2 Utilities panel.
b. Fill in field 2 to specify the data set that contains a TEMPLATE. The
default is the SYSIN data set. This field is ignored if you specified NO in
the TEMPLATE? field in the DB2 Utilities panel.
Related reference
Chapter 15, LISTDEF, on page 185
Chapter 31, TEMPLATE, on page 641
21
4. Optional: Edit the generated JCL data set to alter or add DD statements as
needed.
Syntax
(member-name)
CONTROL (
NONE
DB2I
NO
DB2I
YES
)
:
control-option
CONTROL (
DISCDSN(data-set-name)
)
COPYDSN(data-set-name)
COPYDSN2(data-set-name)
RCPYDSN1(data-set-name)
RECDSN(data-set-name)
RCPYDSN2(data-set-name)
EDIT (
NO
RESTART (
NO
)
PUNCHDSN (
SUBMIT (
data-set-name )
NO
EDIT
SYSTEM (
SPF
TSO
DSN
RESTART (
CURRENT
PHASE
PREVIEW
SUBMIT (
YES
PROMPT
UNIT
SYSDA )
UNIT
unit-name )
SYSTEM (
subsystem-name
group-attach
UID(utility-id)
VOLUME(vol-ser)
LIB(data-set-name)
22
|
|
|
|
|
|
DB2 places the JCL in a data set that is named DSNUxxx.CNTL, where
DSNUxxx is a control file name. The control file contains the statements that
are necessary to invoke the DSNUPROC procedure which, in turn, executes the
utility. If you execute another job with the same utility name, the first job is
deleted. See the table below for a list of the online utilities and the control file
name that is associated with each utility.
INDSN(data-set-name(member-name))
Specifies the data set that contains the utility statements and control
statements. Do not specify a data set that contains double-byte character set
data.
(data-set-name)
Specifies the name of the data set. If you do not specify a data set name,
the default command procedure prompts you for the data set name.
(member-name)
Specifies the member name. You must specify the member name if the data
set is partitioned.
CONTROL(control-option: ...)
Specifies whether to trace the CLIST command execution.
NONE
Omits tracing.
control-option
Lists one or more of the following options. Separate items in the list by
colons (:). To abbreviate, specify only the first letter of the option.
LIST
CONLIST
Displays CLIST commands after symbolic substitution and before
command execution.
SYMLIST
Displays all executable statements (TSO commands and CLIST
statements) before the scan for symbolic substitution.
NONE
Generates a CONTROL statement with the options NOLIST,
NOCONLIST, and NOSYMLIST.
DB2I
Indicates the environment from which the DSNU CLIST command is called.
(NO)
Indicates that DSNU CLIST command is not being called from the DB2I
environment.
(YES)
Indicates that DSNU CLIST command is called from the DB2I
environment. Only the utility panels should execute the CLIST command
with DB2I(YES).
DISCDSN (data-set-name)
The name of the cataloged data set that LOAD and REORG use for a discard
data set. For LOAD, this data set holds records that are not loaded; for
REORG, it holds records that are not reloaded.
23
COPYDSN(data-set-name)
The name of the cataloged data set that DB2 utilities use as a target (output)
data set. If you do not supply this information, the CLIST command prompts
you for it. This keyword is optional for LOAD and for REORG with
SHRLEVEL NONE; it is required for COPY, for MERGECOPY, and for REORG
with SHRLEVEL REFERENCE or CHANGE.
COPYDSN2 (data-set-name)
The name of the cataloged data set that DB2 utilities use as a target (output)
data set for the backup copy. This keyword is optional for COPY,
MERGECOPY, LOAD, and REORG.
RCPYDSN1 (data-set-name)
The name of the cataloged data set that DB2 utilities use as a target (output)
data set for the remote-site primary copy. This keyword is optional for COPY,
LOAD, and REORG.
RCPYDSN2 (data-set-name)
The name of the cataloged data set that DB2 utilities use as a target (output)
data set for the remote-site backup copy. This keyword is optional for COPY,
LOAD, and REORG.
RECDSN (data-set-name)
The name of the cataloged data set that LOAD uses for input or that REORG
TABLESPACE or UNLOAD use as the unload data set. If you do not supply
this information, the CLIST command prompts you for it. This keyword is
required for LOAD and REORG TABLESPACE only.
PUNCHDSN (data-set-name)
The name of the cataloged data set that REORG or UNLOAD use to hold the
generated LOAD utility control statements for UNLOAD EXTERNAL or
DISCARD.
EDIT
Specifies whether to invoke an editor to edit the temporary file that the CLIST
command generates.
(NO)
Does not invoke an editor.
(SPF)
Invokes the ISPF editor.
(TSO)
Invokes the TSO editor.
RESTART
Specifies whether this job restarts a current utility job, and, if so, at what point
it is to be restarted.
(NO)
Indicates that the utility is a new job, not a restarted job. The utility
identifier (UID) must be unique for each utility job step.
(CURRENT)
Restarts the utility at the most recent commit point.
(PHASE)
Restarts the utility at the beginning of the current stopped phase. You can
determine the current stopped phase by issuing the DISPLAY UTILITY
command.
24
(PREVIEW)
Restarts the utility in PREVIEW mode. While in PREVIEW mode, the
utility checks for syntax errors in all utility control statements, but normal
utility execution does not take place.
SUBMIT
Specifies whether to submit the generated JCL for processing.
(NO)
Does not submit the JCL data set for processing.
(YES)
Submits the JCL data set for background processing, using the TSO
SUBMIT command.
(PROMPT)
Prompts you, after the data set is processed, to specify whether to submit
the JCL data set for batch processing. You cannot use PROMPT when the
CLIST command is executed in the TSO batch environment.
SYSTEM (subsystem-name)
Specifies the DB2 subsystem or group attach name. The default value is DSN.
UID (utility-id)
Provides a unique identifier for this utility job within DB2. Do not reuse the
utility ID of a stopped utility that has not yet been terminated, unless you
want to restart that utility. If you do use the same utility ID to invoke a
different utility, DB2 tries to restart the original stopped utility with the
information that is stored in the SYSUTIL directory table.
The default value is tso-userid.control-file-name, where control-file-name for each
of the utilities is listed in the following table.
Table 2. Control-file name for each utility
Utility
control-file-name
CHECK INDEX
DSNUCHI
CHECK DATA
DSNUCHD
CHECK LOB
DSNUCHL
COPY
DSNUCOP
DIAGNOSE
DSNUDIA
LOAD
DSNULOA
MERGECOPY
DSNUMER
MODIFY
DSNUMOD
QUIESCE
DSNUQUI
REBUILD INDEX
DSNUREB
RECOVER
DSNUREC
REORG INDEX
DSNURGI
REORG LOB
DSNURGL
REORG TABLESPACE
DSNURGT
REPAIR
DSNUREP
REPORT
DSNURPT
RUNSTATS
DSNURUN
STOSPACE
DSNUSTO
25
control-file-name
UNLOAD
DSNUUNL
UNIT (unit-name)
Assigns a unit address, a generic device type, or a user-assigned group name
for a device on which a new temporary or permanent data set resides. When
the CLIST command generates the JCL, it places unit-name after the UNIT
clause of the generated DD statement.
The default value is SYSDA.
VOLUME (vol-ser)
Assigns the serial number of the volume on which a new temporary or
permanent data set resides. When the CLIST command generates the JCL, it
places vol-ser after the VOL=SER clause of the generated DD statement. If you
omit VOLUME, the VOL=SER clause is omitted from the generated DD
statement.
LIB (data-set-name)
Specifies the data set name of the DB2 subsystem library. The value that you
specify is used as the LIB parameter value when the DSNUPROC JCL
procedure is invoked.
|
|
|
|
The following list describes the required JCL data set statements:
Statement
Description
JOB
The CLIST command uses any JOB statements that you saved when using
DB2I. If no JOB statements exist, DB2 produces a skeleton JOB statement
that you can modify. The job name is DSNU, followed by the first three
letters of the name of the utility that you are using.
EXEC The CLIST command builds the EXEC statement. The values that you
specified for SYSTEM (DSN, by default), UID(TEMP), and RESTART (none)
become the values of SYSTEM, UID, and UTPROC for the DSNUPROC.
26
The CLIST command builds the necessary JCL DD statements. Those statements
vary depending on the utility that you execute. The following DD statements are
generated by the CLIST command:
SYSPRINT DD SYSOUT=A
Defines OUTPUT, SYSPRINT as SYSOUT=A. Utility messages are sent to the
SYSPRINT data set. You can use the TSO command to control the disposition
of the SYSPRINT data set. For example, you can send the data set to your
terminal. For more information, see z/OS TSO/E Command Reference.
UTPRINT DD SYSOUT=A
Defines UTPRINT as SYSOUT=A. If any utility requires a sort, it executes
DFSORT. Messages from that program are sent to UTPRINT.
SYSIN DD *
Defines SYSIN. To build the SYSIN DD * job stream, DSNU copies the data set
that is named by the INDSN parameter. The INDSN data set does not change,
and you can reuse it when the DSNU procedure has finished running.
27
DSNUPROC syntax
LIB=prefix.SSPGM
,SIZE=OM
,SYSTEM=DSN
LIB=DB2library-name
,SIZE=region-size
,SYSTEM=subsytem-name
DSNUPROC
,UID=
,UTPROC=
,UID=utility-qualifier
,UTPROC=
RESTART
RESTART(CURRENT)
RESTART(PHASE)
PREVIEW
28
SYSTEM=
Specifies the DB2 subsystem or group attach name.
The default value is DSN.
UID=
Specifies the unique identifier for your utility job. The maximum name length
is 16 characters. If the name contains special characters, enclose the entire
name between apostrophes (for example, PETERS.JOB). Do not reuse the
utility ID of a stopped utility that has not yet been terminated. If you do use
the same utility ID to invoke a different utility, DB2 tries to restart the original
stopped utility with the information that is stored in the SYSUTIL directory
table.
The default is an empty string.
|
|
|
|
UTPROC=
Controls restart processing. The default is an empty string. Use the default if
you want to allow DB2 to perform default restart processing as documented in
Restart of an online utility on page 36.
To override the default restart behavior, specify:
RESTART
To restart at the most recent commit point. This option has the same
meaning as RESTART(CURRENT).
RESTART(CURRENT)
To restart at the most recent commit point. This option has the same
meaning as RESTART.
RESTART(PHASE)
To restart at the beginning of the phase that executed most recently.
PREVIEW
To restart in preview mode. While in PREVIEW mode, the utility
checks for syntax errors in all utility control statements, but normal
utility execution does not take place.
The DSNUPROC procedure provides the SYSPRINT and UTPRINT DD statements
for printed output. You must provide DD statements for SYSIN and other data sets
that your job needs. See Data sets that online utilities use on page 13 for a
description of data sets that you might need.
*
*
*
*
*
*
*
*
*
*
*
29
//* ENVIRONMENT:
BATCH
*
//*
*
//* INPUT:
*
//*
PARAMETERS:
*
//*
LIB
= THE DATA SET NAME OF THE DB2 PROGRAM LIBRARY. *
//*
THE DEFAULT LIBRARY NAME IS PREFIX.SDSNLOAD,
*
//*
WITH PREFIX SET DURING INSTALLATION.
*
//*
SIZE
= THE REGION SIZE OF THE UTILITIES EXECUTION AREA.*
//*
THE DEFAULT REGION SIZE IS 2048K.
*
//*
SYSTEM = THE SUBSYSTEM NAME USED TO IDENTIFY THIS JOB
*
//*
TO DB2. THE DEFAULT IS "DSN".
*
//*
UID
= THE IDENTIFIER WHICH WILL DEFINE THIS UTILITY
*
//*
JOB TO DB2. IF THE PARAMETER IS DEFAULTED OR
*
//*
SET TO A NULL STRING, THE UTILITY FUNCTION WILL *
//*
USE ITS DEFAULT, USERID.JOBNAME. EACH UTILITY *
//*
WHICH HAS STARTED AND IS NOT YET TERMINATED
*
//*
(MAY NOT BE RUNNING) MUST HAVE A UNIQUE UID.
*
//*
UTPROC = AN OPTIONAL INDICATOR USED TO DETERMINE WHETHER *
//*
THE USER WISHES TO INITIALLY START THE REQUESTED*
//*
UTILITY OR TO RESTART A PREVIOUS EXECUTION OF
*
//*
THE UTILITY. IF OMITTED, THE UTILITY WILL
*
//*
BE INITIALLY STARTED. OTHERWISE, THE UTILITY
*
//*
WILL BE RESTARTED BY ENTERING THE FOLLOWING
*
//*
VALUES:
*
//*
RESTART(PHASE) = RESTART THE UTILITY AT THE *
//*
BEGINNING OF THE PHASE EXECUTED
*
//*
LAST.
*
//*
RESTART = RESTART THE UTILITY AT THE LAST
*
//*
OR CURRENT COMMIT POINT.
*
//*
*
//* OUTPUT: NONE.
*
//*
*
//* EXTERNAL-REFERENCES: NONE.
*
//*
*
//* CHANGE-ACTIVITY:
*
//*
*
//**********************************************************************
//DSNUPROC EXEC PGM=DSNUTILB,REGION=&SIZE,
//
PARM='&SYSTEM,&UID,&UTPROC'
//STEPLIB DD
DSN=&LIB,DISP=SHR
//**********************************************************************
//*
*
//* THE FOLLOWING DEFINE THE UTILITIES' PRINT DATA SETS
*
//*
*
//**********************************************************************
//*
//SYSPRINT DD
SYSOUT=*
//UTPRINT DD
SYSOUT=*
//SYSUDUMP DD
SYSOUT=*
//*DSNUPROC PEND
REMOVE * FOR USE AS INSTREAM PROCEDURE
30
EXEC PGM=DSNUTILB,PARM='system,[uid],[utproc]'
The brackets, [ ], indicate optional parameters. The parameters have the following
meanings:
DSNUTILB
Specifies the utility control program. The program must reside in an
APF-authorized library.
system
Specifies the DB2 subsystem.
uid
The unique identifier for your utility job. Do not reuse the utility ID of a
stopped utility that has not yet been terminated. If you do use the same utility
ID to invoke a different utility, DB2 tries to restart the original stopped utility
with the information that is stored in the SYSUTIL directory table.
utproc
The value of the UTPROC parameter in the DSNUPROC procedure. Specify
this option only when you want to restart the utility job. Specify:
RESTART
To restart at the most recent commit point. This option has the same
meaning as RESTART(CURRENT).
RESTART(CURRENT)
To restart the utility at the most recent commit point. This option has
the same meaning as RESTART.
RESTART(PHASE)
To restart at the beginning of the phase that executed most recently.
RESTART(PREVIEW)
To restart the utility in preview mode. While in PREVIEW mode, the
utility checks for syntax errors in all utility control statements, but
normal utility execution does not take place.
For the example in Figure 5 on page 30 you can use the following EXEC statement:
//stepname
EXEC PGM=DSNUTILB,PARM='DSN,TEMP'
31
32
33
Terminated
The utility has been requested to terminate by the DB2 TERM UTILITY
command. If the utility has terminated, no message is issued.
Related concepts
Termination of an online utility with the TERM UTILITY command on page 36
Related tasks
Using the DBD statement on page 555
Related reference
Chapter 24, REORG INDEX, on page 419
34
v For JES3 systems, insert the following statement into the utility JCL:
//*MAIN SYSTEM=(main-name)
The preceding JCL statements are described in z/OS MVS JCL Reference. Your
installation might have other mechanisms for controlling where batch jobs run,
such as by using job classes.
35
Alternatively, consider specifying the TIMEOUT TERM parameter for some online
REORG situations.
36
With the autonomic restart procedure, you avoid repeating much of the work that
the utility has already done.
Before you restart a job, correct the problem that caused the utility job to stop.
Then resubmit the job. DB2 recognizes the utility ID and restarts the utility job if
possible. DB2 retrieves information about the stopped utility from the SYSUTIL
directory table.
Do not reuse the utility ID of a stopped utility that has not yet been terminated,
unless you want to restart that utility. If you do use the same utility ID to invoke a
different utility, DB2 tries to restart the original stopped utility with the
information that is stored in the SYSUTIL directory table.
Two different methods of restart are available:
v You can do a phase restart from the beginning of the phase that was being
processed. This method is indicated by the value RESTART(PHASE).
v You can do a current restart from the last checkpoint that was taken during the
execution of the utility phase. If the utility phase does not take any checkpoints
or has not reached the first checkpoint, current restart is equivalent to phase
restart. This method is indicated by the value RESTART or
RESTART(CURRENT).
For each utility, DB2 uses the default RESTART value that is specified in the
following table. For a complete description of the restart behavior for an individual
utility, including any phase restrictions, refer to the restart topic for that utility.
You can override the default RESTART value by specifying the RESTART
parameter in the original JCL data set. DB2 ignores the RESTART parameter if you
are submitting the utility job for the first time. For instructions on how to specify
this parameter, see the following table.
Table 3. Default RESTART values for each utility
Utility
BACKUP SYSTEM
RESTART(CURRENT)
CATMAINT
No restart
CHECK DATA
RESTART(CURRENT)
CHECK INDEX
RESTART(CURRENT)
CHECK LOB
RESTART(CURRENT)
COPY
RESTART(CURRENT)
COPYTOCOPY
RESTART(CURRENT)
DIAGNOSE
EXEC SQL
LISTDEF
LOAD
RESTART(CURRENT) or RESTART(PHASE)1
MERGECOPY
RESTART(PHASE)
MODIFY RECOVERY
RESTART(CURRENT)
MODIFY STATISTICS
RESTART(CURRENT)
OPTIONS
QUIESCE
RESTART(CURRENT)
37
REBUILD INDEX
RESTART(PHASE)
RECOVER
RESTART(CURRENT)
REORG INDEX
RESTART(CURRENT) or RESTART(PHASE)1
REORG TABLESPACE
RESTART(CURRENT) or RESTART(PHASE)1
REPAIR
No restart
REPORT
RESTART(CURRENT)
RESTORE SYSTEM
RESTART(CURRENT)
RUNSTATS
RESTART(CURRENT)
STOSPACE
RESTART(CURRENT)
TEMPLATE
UNLOAD
RESTART(CURRENT)
Note:
1. The RESTART value that DB2 uses for these utilities depends on the situation.
Refer to the restart topic for each utility for a complete explanation.
If you cannot restart a utility job, you might have to terminate it to make the data
available to other applications. To terminate a utility job, issue the DB2 TERM
UTILITY command. Use the command only if you must start the utility from the
beginning.
Restarting hints
The following guidelines provide additional information about restarting utilities:
v If the data set is not dynamically allocated, ensure that the DD name that is
specified in the restart JCL matches the DD name for the original job; dont
change DD names on a restart job. If the data set is dynamically allocated, the
file sequence numbers must match for the restart and the original run. In either
case, if the data set is not cataloged, any explicit specification of VOLSERs must
match for the restart and the original job. If you copy a work data set, such as
SYSUT1, after an ABENDB37, and the number of volumes changes, do not
specify RESTART CURRENT. If you do, ABEND 413-1C occurs. To prevent this
abend, start the utility in RESTART(PHASE).
v When restarting a utility with cataloged data sets, do not specify VOLSER. Let
DB2 determine the VOLSER of the data sets from the system catalog.
v Do not change the utility function that is currently stopped and the DB2 objects
on which it is operating. However, you can change other parameters that are
related to the stopped step and to subsequent utility steps.
v Do not specify z/OS automatic step restart.
v If a utility is restarted in the UTILINIT phase, it is re-executed from the
beginning of the phase.
v Run the RUNSTATS utility after the completion of a restarted LOAD, REBUILD
INDEX, or REORG job with the STATISTICS option. When you restart these jobs,
DB2 does not collect inline statistics. The exception is REORG UNLOAD PAUSE;
when restarted after the pause, REORG UNLOAD PAUSE collects statistics.
v Ensure that the required data sets are properly defined.
38
39
40
41
42
You can use BACKUP SYSTEM to copy all data for a single application (for
example, when DB2 is the database server for a resource planning solution). All
data sets that you want to copy must be SMS-managed data sets. You can
subsequently run the RESTORE SYSTEM utility to recover the entire system.
In a data sharing environment, if any failed or abnormally quiesced members exist,
the BACKUP SYSTEM request fails.
The BACKUP SYSTEM utility uses copy pools. A copy pool is a defined set of
storage groups that contain data that DFSMShsm can backup and recover
collectively. For more information about copy pools, see z/OS DFSMSdfp Storage
Administration Reference.
Each DB2 subsystem can have up to two copy pools, one for databases and one for
logs. BACKUP SYSTEM copies the volumes that are associated with these copy
pools at the time of the copy.
|
|
|
With the BACKUP SYSTEM utility you can manage the dumping of system-level
backups (copy of the database, the log copy pools, or both) to tape. To use this
functionality, you need to have z/OS DFSMShsm V1R8 or above.
To use the DISPLAY UTILITY command for BACKUP SYSTEM on a data sharing
group, you must issue the command from the member on which the BACKUP
SYSTEM utility is invoked. Otherwise, the current utility information is not
displayed.
Output
The output for BACKUP SYSTEM is the copy of the volumes on which the DB2
data and log information resides. The BACKUP SYSTEM history is recorded in the
bootstrap data sets (BSDSs).
Authorization required
To execute this utility, you must use a privilege set that includes SYSCTRL or
SYSADM authority.
43
UTILTERM
Performs cleanup
Related information
System-level point-in-time recovery using the BACKUP SYSTEM utility (DB2
Administration Guide)
Syntax diagram
FULL
BACKUP SYSTEM
DATA ONLY
ESTABLISH FCINCREMENTAL
END FCINCREMENTAL
FORCE
DUMP
dumpclass-spec
FORCE
DUMPONLY
TOKEN (Xbyte-string)
dumpclass-spec:
44
dumpclass-spec
,
DUMPCLASS
dc1
dc2
dc3
dc4
dc5
Option descriptions
FULL
Indicates that you want to copy both the database copy pool and the log copy
pool.
You must ensure that the database copy pool is set up to contain the volumes
for the databases and the associated integrated catalog facility (ICF) catalogs.
You must also ensure that the log copy pool is set up to contain the volumes
for the BSDSs, the active logs, and the associated catalogs.
Use BACKUP SYSTEM FULL to allow for recovery of both data and logs. You
can use the RESTORE SYSTEM utility to recover the data. However, RESTORE
SYSTEM does not restore the logs; the utility only applies the logs. If you want
to restore the logs, you must use another method to restore them.
DATA ONLY
Indicates that you want to copy only the database copy pool. You must ensure
that the database copy pool is set up to contain the volumes for the databases
and the associated ICF catalogs.
|
|
|
|
|
|
|
ESTABLISH FCINCREMENTAL
Specifies that a persistent incremental FlashCopy relationship is to be
established, if none exists, for source copy volumes in the database copy pool.
Use this keyword once to establish the persistent incremental FlashCopy
relationships. Subsequent invocations of BACKUP SYSTEM (without this
keyword) will automatically process the persistent incremental FlashCopy
relationship.
|
|
|
|
|
END FCINCREMENTAL
Specifies that a last incremental FlashCopy be taken and for the persistent
incremental FlashCopy relationship to be withdrawn for all of the volumes in
the database copy pool. Use this keyword only if no further incremental
FlashCopy backups of the database copy pool are desired.
|
|
|
|
|
FORCE
Indicates that you want to overwrite the oldest DFSMShsm version of the fast
replication copy of the database copy pool. You can overwrite these copy pools
even if the dump to tape or the copy pools DFSMShsm dump classes have
been initiated, but are only partially completed.
|
|
|
|
|
|
|
You should only use the FORCE option if it is more important to take a new
system-level backup than to save a previous system-level backup to tape.
DUMP
Indicates that you want to create a fast replication copy of the database copy
pool and the log copy pool on disk and then initiate a dump to tape of the fast
replication copy. The dump to tape begins after DB2 successfully establishes
relationships for the fast replication copy.
45
|
|
The BACKUP SYSTEM utility does not wait for the dump processing to
complete.
|
|
|
|
|
DUMPCLASS
Indicates the DFSMShsm dump class that you want to use for the dump
processing. You can specify up to five dump classes. If you do not specify a
dump class, DB2 uses the default dump classes that are defined for the copy
pools.
|
|
|
|
|
DUMPONLY
Indicates that you want to create a dump on tape of an existing fast replication
copy (that is currently residing on the disk) of the database copy pool and the
log copy pool. You can also use this option to resume a dump process that has
failed.
|
|
The BACKUP SYSTEM utility does not wait for the dump processing to
complete.
|
|
|
|
|
|
|
TOKEN (Xbyte-string)
Specifies which fast replication copy of the database copy pool and the log
copy pool to dump to tape. The token is a 36-digit hexadecimal byte string that
uniquely identifies each system-level backup and is reported in the DSNJU0004
job output. For a data sharing system, you should run DSNJU0004 with the
MEMBER option so that the system-level backup information is displayed for
all members.
|
|
If you do not specify TOKEN, the most recent fast replication copy of the copy
pools is dumped to tape.
|
|
|
v You have defined an SMS backup storage group for each storage group in the
copy pools.
For information about defining copy pools and associated backup storage groups,
see z/OS DFSMSdfp Storage Administration Reference. Use the following DB2
naming convention when you define these copy pools:
DSN$locn-name$cp-type
46
The variables that are used in this naming convention have the following
meanings:
DSN
locn-name
The DB2 location name.
cp-type The copy pool type. Use DB for database and LG for log.
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
47
2. Create and run your utility control statement with the DUMPONLY option.
Specify the token if the system-level backup is not the most recent system-level
backup taken.
Restriction: Do not dump system-backups to the same tape that contains
image copies or concurrent copies because the RECOVER utility requires access
to both
3. Run the DFSMShsm command LIST COPYPOOL with the ALLVOLS option to
verify that the dump to tape was successful. The BACKUP SYSTEM utility
issues the DFSMShsm command to initiate a dump, but it does not wait for the
dump to be completed.
EXEC DSNUPROC,TIME=1440,
UTPROC='',
SYSTEM='DSN'
DD *
SYSTEM
48
//STEP1
//
//
//SYSIN
BACKUP
/*
EXEC DSNUPROC,TIME=1440,
UTPROC='',
SYSTEM='DSN'
DD *
SYSTEM DATA ONLY
The following control statement specifies that BACKUP SYSTEM is to create a fast
replication copy of the database copy pool and initiate a dump to tape of the fast
replication copy.
//SYSOPRB JOB (ACCOUNT),'NAME',CLASS=K
//UTIL EXEC DSNUPROC,SYSTEM=V91A,UID='TEMB',UTPROC=''
//*
//*
//DSNUPROC.SYSUT1 DD DSN=SYSOPR.SYSUT1,
//
DISP=(MOD,DELETE,CATLG),
//
SPACE=(16384,(20,20),,,ROUND),
//
UNIT=SYSDA
//DSNUPROC.SYSIN
DD *
BACKUP SYSTEM DATA ONLY DUMP
/*
The following control statement specifies that BACKUP SYSTEM is to create a fast
replication copy of the database copy pool, initiate a dump to tape of the fast
replication copy, and allow the oldest fast replication copy to be overwritten.
//SYSOPRB JOB (ACCOUNT),'NAME',CLASS=K
//UTIL EXEC DSNUPROC,SYSTEM=V91A,UID='TEMB',UTPROC=''
//*
//*
//DSNUPROC.SYSUT1 DD DSN=SYSOPR.SYSUT1,
//
DISP=(MOD,DELETE,CATLG),
//
SPACE=(16384,(20,20),,,ROUND),
//
UNIT=SYSDA
//DSNUPROC.SYSIN
DD *
BACKUP SYSTEM DATA ONLY DUMP FORCE
/*
The following control statement specifies that BACKUP SYSTEM is to dump the
existing fast replication copy XE5F9F1C1BD1909683AA8A1A600000E6962DE to
tape, using the DB2STGD2 dump class.
//SYSOPRB JOB (ACCOUNT),'NAME',CLASS=K
//UTIL EXEC DSNUPROC,SYSTEM=V91A,UID='TEMB',UTPROC=''
//*
//*
//DSNUPROC.SYSUT1 DD DSN=SYSOPR.SYSUT1,
//
DISP=(MOD,DELETE,CATLG),
//
SPACE=(16384,(20,20),,,ROUND),
//
UNIT=SYSDA
//DSNUPROC.SYSIN
DD *
BACKUP SYSTEM DATA ONLY DUMPONLY
TOKEN (X'E5F9F1C1BD1909683AA8A1A600000E6962DE')
DUMPCLASS(DB2STGD2)
/*
Chapter 5. BACKUP SYSTEM
49
50
Chapter 6. CATENFM
The CATENFM utility enables a DB2 subsystem to enter DB2 Version 9.1
enabling-new-function mode and Version 9.1 new-function mode. It also enables a
DB2 subsystem to return to enabling-new-function mode from new-function mode.
All new Version 9.1 functions are unavailable when the subsystem is in conversion
mode or enabling-new-function mode.
Output
Output from the CATENFM utility consists of:
v If you specify the CONVERT option, the CATENFM utility converts table spaces
during the enabling-new-function mode process.
v If you specify the ALTER option, some objects in the DB2 catalog are altered or
created.
v For other options, there is no output.
Authorization required
The required authorization for CATENFM is installation SYSADM.
|
|
Syntax diagram
CATENFM
START
COMPLETE
ENFMON
CMON
CONVERT INPUT
table-space-name
51
Option descriptions
START
Invokes the CATENFM utility and indicates the start of enabling-new-function
mode processing. Drops and recreates the DSNKSX01 index with new key
columns. Adds BIGINT columns to the SYSTABLESPACESTATS and
SYSINDEXSPACESTATS tables. No start processing is done if CATENFM
START was run previously; however, you can run the CATENFM utility as
many times as needed.
|
|
|
|
|
|
COMPLETE
Checks if the DB2 subsystem has completed enabling-new-function mode
processing. If the subsystem has completed this processing, the CATENFM
utility returns 0, and the subsystem enters new-function mode.
|
|
|
|
|
|
ENFMON
Returns DB2 to enabling-new-function mode. If the subsystem is currently in
enabling-new-function mode, no change occurs. If the subsystem has been to
new-function mode, ENFMON returns it to enabling-new-function* mode.
New Version 9.1 functions are not available in Version 9.1
enabling-new-function mode.
|
|
|
|
|
|
|
|
|
|
CMON
Returns DB2 to conversion mode. If the system is currently in conversion
mode, no change occurs. If the system has been to enabling-new-function
mode or new-function mode, CMON returns it to conversion* mode.
Conversion* mode is similar to conversion mode, but the * indicates that at
one time the system was in enabling-new-function mode or new-function
mode. You can still access objects that were created in enabling-new-function
mode or new-function mode. Data sharing groups cannot have any Version 8
members. You cannot fall back to Version 8 from conversion* mode or coexist
with a Version 8 system.
CONVERT
Starts enabling-new-function mode processing for the table space that is listed
after the INPUT keyword.
INPUT table-space-name
Specifies the table space for which enabling-new-function mode processing
should begin.
table-space-name
The name of the table space for which enabling-new-function mode
processing should begin.
52
A CATENFM job allocates all of the data sets that it needs. CATENFM uses data
sets only when the CONVERT option is specified.
The following table lists the data sets that CATENFM uses during conversion. The
table lists the DD name that is used to identify the data set, a description of the
data set, and an indication of whether it is required.
Table 5. Data sets that CATENFM uses during conversion
Data set
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
Chapter 6. CATENFM
53
54
Chapter 7. CATMAINT
The CATMAINT utility updates the catalog; run this utility during migration to a
new release of DB2 or when IBM Software Support instructs you to do so.
Output
Output for CATMAINT UPDATE is the updated catalog.
Authorization required
The required authorization for CATMAINT is installation SYSADM.
Syntax diagram
|
|
|
|
CATMAINT UPDATE
SCHEMA SWITCH(schema_name,new_schema_name)
,
OWNER FROM
|
|
owner_name
TO ROLE
VCAT SWITCH(vcat_name,new_vcat_name)
55
Option descriptions
UPDATE
Indicates that you want to update the catalog. Run this option only when you
migrate to a new release of DB2 or when IBM Software Support instructs you
to do so.
|
|
|
|
|
SCHEMA SWITCH(schema_name,new_schema_name)
Changes the owner, creator, and schema of database objects, plans, and
packages. The schema is not changed for views, materialized query tables, SQL
scalar function, and triggers. The authorization IDs of the creator or owner for
plans and packages that use the objects are not changed.
|
|
|
|
|
|
|
|
new_schema_name specifies the new name for the owner, creator, or schema. The
name cannot be a schema that qualifies existing objects.
OWNER FROM(owner_name) TO ROLE
Changes the ownership of objects from a user to a role. A trusted context must
have been created for INSTALL SYSADM before CATMAINT UPDATE
OWNER can run. The authorization IDs of the creator or owner for plans and
packages that use the objects are not changed.
|
|
|
|
|
owner_name specifies the current owner of the object. You can specify multiple
owners.
|
|
VCAT SWITCH(vcat_name,new_vcat_name)
Changes the catalog name that is used by storage groups, user indexes, and
table spaces.
|
|
|
|
|
vcat_name identifies the integrated catalog facility catalog that is currently used
by user-managed data sets for indexes, table spaces, and storage groups.
|
|
|
|
56
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
You can rename the owner, creator, and schema of database objects.
To rename the owner, creator, and schema of database objects, plan, and packages:
|
|
|
|
|
|
|
|
|
Run the CATMAINT utility with the SCHEMA SWITCH options. This process
updates every owner, creator or schema name in the catalog and directory that
matches the schema_name value. All grants that were made by or received by the
original owner are changed to the new owner. You can change multiple names by
repeating the SWITCH keyword, but you can not specify the same name more
than once. The names cannot be longer than 8 bytes in EBCDIC representation.
SYSIBM is not allowed as a schema_name or new_schema_name. OWNER FROM
and SCHEMA SWITCH are mutually exclusive. You cannot specify both clauses in
the same CATMAINT UPDATE statement.
|
|
|
|
|
57
|
|
|
|
|
|
|
|
|
|
|
|
|
|
You can change the catalog name used by storage groups or index spaces and table
spaces.
|
|
To change the catalog name that is used by storage groups or index spaces and
table spaces:
|
|
|
|
|
|
|
|
Run the CATMAINT VCAT SWITCH utility. The VCAT SWITCH option is similar
to the ALTER TABLESPACE USING VCAT statement for changing the catalog
name. You need to move the data for the affected indexes or table spaces to the
data set on the new catalog in a separate step. You can change multiple names by
repeating the SWITCH keyword, but you cannot specify the same name more than
once. The names cannot be longer than 8 bytes in EBCDIC representation. The
VCAT SWITCH option has no effect on the system indexes and table spaces in
DSNDB06/DSNDB01 because the catalog name is maintained in the parameter.
|
|
|
|
|
When the schema name of an object is changed, any plans or packages that are
dependent on the object are invalidated. Automatic rebind occurs when the
invalidated plan or package is executed.
|
|
|
|
|
|
|
|
|
|
|
|
|
DISTINCT DNAME
SYSIBM.SYSPLANDEP
BCREATOR IN (schema_name1, schema_name2...)
BY DNAME;
SELECT
FROM
WHERE
ORDER
58
Chapter 7. CATMAINT
59
60
CHECK DATA does not check LOB table spaces. The utility does not check
informational referential constraints.
|
|
|
Output
|
|
|
|
|
|
|
|
|
|
|
|
|
CHECK DATA SHRLEVEL CHANGE operates on shadow copies of the table space
and generates the corresponding REPAIR statements.
Authorization required
To execute this utility, you must use
following authorities:
v STATS privilege for the database
v DBADM, DBCTRL, or DBMAINT
which the utility operates is in an
on the implicitly created database
v SYSCTRL or SYSADM authority
If you are using SHRLEVEL CHANGE, the batch user ID that invokes COPY with
the CONCURRENT option must provide the necessary authority to execute the
Copyright IBM Corp. 1983, 2009
61
DFDSS COPY command. DFDSS will create a shadow data set with the authority
of the utility batch address space. The submitter should have an RACF ALTER
authority, or its equivalent, for the shadow data set.
|
|
|
If you specify the DELETE option, the privilege set must include the DELETE
privilege on the tables that are being checked. If you specify the FOR EXCEPTION
option, the privilege set must include the INSERT privilege on any exception table
that is used.If you specify the AUXERROR INVALIDATE option, the privilege set
must include the UPDATE privilege on the base tables that contain LOB columns.
|
|
SORT Sorts foreign keys if they are not extracted from the foreign key index
CHECKDAT
Looks in primary indexes for foreign key parents, and issues messages to
report detected errors
REPORTCK
Copies error rows into exception tables, and delete them from source table
if DELETE YES is specified
UTILTERM
Performs cleanup
62
Syntax diagram
|
SHRLEVEL REFERENCE
table-space-spec
CHECK DATA
PART
integer
SHRLEVEL CHANGE
CLONE
(1)
SCOPE PENDING
AUXERROR REPORT
SCOPE
AUXERROR INVALIDATE
drain-spec
AUXONLY
ALL
REFONLY
LOBERROR REPORT
XMLERROR REPORT
LOBERROR INVALIDATE
XMLERROR INVALIDATE
DELETE NO
LOG
YES
LOG
NO
DELETE YES
FOR
EXCEPTION IN
table-name1 USE
table-name2
EXCEPTIONS 0
ERRDDN SYSERR
WORKDDN SYSUT1 ,
SYSUT2
EXCEPTIONS integer
ERRDDN ddname
WORKDDN
, ddname2
, SYSUT2
ddname1
ddname1
SYSUT1
,
ddname2
PUNCHDDN
SYSPUNCH
ddname
SORTDEVT device-type
SORTNUM
integer
Notes:
|
|
If you specify AUXERROR and LOBERROR or XMLERROR, the options for the keywords
(REPORT and INVALIDATE) must match.
table-space-spec:
TABLESPACE
table-space-name
database-name.
63
drain-spec:
DRAIN_WAIT
integer
RETRY integer
RETRY_DELAY
integer
Option descriptions
DATA
Indicates that you want the utility to check referential and table check
constraints. CHECK DATA does not check informational referential constraints.
TABLESPACE database-name.table-space-name
Specifies the table space to which the data belongs. You can specify only base
table spaces, not LOB table spaces or XML table spaces.
|
|
database-name is the name of the database and is optional. The default value is
DSNDB04.
table-space-name is the name of the table space.
PART integer
Identifies which partition to check for constraint violations.
integer is the number of the partition and must be in the range from 1 to the
number of partitions that are defined for the table space. The maximum is
4096.
|
|
|
|
|
|
CLONE
Indicates that CHECK DATA is to check the clone table in the specified table
space. Because clone tables cannot have referential constraints, the utility
checks only constraints for inconsistencies between the clone table data and the
corresponding LOB data. If you do not specify CLONE, CHECK DATA
operates against only the base table.
|
|
|
SHRLEVEL
Indicates the type of access that is to be allowed for the index, table space, or
partition that is to be checked during CHECK DATA processing.
|
|
|
REFERENCE
Specifies that applications can read from but cannot write to the index,
table space, or partition that is to be checked.
|
|
|
CHANGE
Specifies that applications can read from and write to the index, table
space, or partition that is to be checked.
|
|
|
|
|
|
|
|
|
|
v Invokes DFSMSdss to copy the specified object and all of its indexes to
shadow data sets
v Enables read-write access for the specified object and all of its indexes
v Runs CHECK INDEX on the shadow data sets
64
|
|
|
|
|
|
|
|
|
|
DRAIN_WAIT
Specifies the number of seconds that CHECK DATA is to wait when draining
the table space or index. The specified time is the aggregate time for objects
that are to be checked. This value overrides the values that are specified by the
IRLMRWT and UTIMOUT subsystem parameters.
integer can be any integer from 0 to 1800. If you do not specify DRAIN_WAIT
or specify a value of 0, CHECK DATA uses the value of the lock timeout
subsystem parameter IRLMRWT.
RETRY integer
Specifies the maximum number of retries that CHECK DATA is to attempt.
|
|
integer can be any integer from 0 to 255. If you do not specify RETRY, CHECK
DATA uses the value of the utility multiplier system parameter UTIMOUT.
|
|
|
|
|
|
RETRY_DELAY integer
Specifies the minimum duration, in seconds, between retries. integer can be any
integer from 1 to 1800.
|
|
|
|
If you do not specify RETRY_DELAY, CHECK DATA uses the smaller of the
following two values:
v DRAIN_WAIT value RETRY value
v DRAIN_WAIT value 10
SCOPE
Limits the scope of the rows in the table space that are to be checked.
PENDING
Indicates that the only rows that are to be checked are those that are in
table spaces, partitions, or tables that are in CHECK-pending status.
If you specify this option for a table space that is not in CHECK-pending
status, the CHECK DATA utility does not check the table space and does
not issue an error message.
|
|
|
|
AUXONLY
Indicates that only the LOB column and the XML column check are to be
performed for table spaces that have tables with LOB columns or XML
columns. The referential integrity and constraint checks are not performed.
|
|
|
|
ALL
Indicates that all dependent tables in the specified table spaces are to be
checked. The referential integrity check, constraint check, and LOB check
are performed.
|
|
|
REFONLY
Same as the ALL option, except that the LOB column check and the XML
column check are not performed.
|
|
|
AUXERROR
Specifies the action that CHECK DATA is to perform when it finds a LOB or
XML column check error.
|
|
|
|
REPORT
A LOB or XML column check error is reported with a warning message.
The base table space is set to the auxiliary CHECK-pending (ACHKP)
status. .
Chapter 8. CHECK DATA
65
|
|
|
|
|
|
INVALIDATE
A LOB or XML column check error is reported with a warning message.
The base table LOB or XML column is set to an invalid status. A LOB or
XML column with invalid status that is now correct is set valid. This action
is also reported with a message. The base table space is set to the auxiliary
warning (AUXW) status if any LOB column remains in invalid status.
|
|
|
|
|
|
|
|
|
|
|
REPORT
A LOB column check error is reported with a warning message. The base
table space is set to the auxiliary CHECK-pending (ACHKP) status.
|
|
|
INVALIDATE
A LOB column check error is reported with a warning message. The base
table LOB column is set to an invalid status. A LOB column with invalid
status that is now correct is set valid. The base table space is set to the
auxiliary warning (AUXW) status if any LOB column remains in invalid
status.
|
|
|
|
|
|
XMLERROR
Specifies the action that CHECK DATA is to perform when it finds an XML
column check error. XMLERROR should not be specified if AUXERROR is
specified. If both are specified, the keywords must match. XMLERROR is
ignored for SCOPE XMLONLY since LOB checking is not being performed.
|
|
|
|
|
REPORT
An XML column check error is reported with a warning message. The base
table space is set to the auxiliary CHECK-pending (ACHKP) status.
|
|
|
INVALIDATE
An XML column check error is reported with a warning message. The base
table XML column is set to an invalid status. An XML column with invalid
status that is now correct is set valid. The base table space is set to the
auxiliary warning (AUXW) status if any LOB column remains in invalid
status.
|
|
|
|
|
|
FOR EXCEPTION
Indicates that any row that is in violation of referential or table check
constraints is to be copied to an exception table. Although this keyword does
not apply to the checking of LOB or XML columns, rows with LOB or XML
columns are moved to the exception tables. If you specify AUXONLY for LOB
and XML checking only, the FOR EXCEPTION option is ignored.
|
|
|
|
|
66
If any row violates more than one constraint, that row appears no more than
once in the exception table.
|
|
|
|
NO
Indicates that error rows are to remain in the table space. Primary errors in
dependent tables are copied to exception tables.
If DELETE NO and SHRLEVEL REFERENCE are specified, and constraint
violations are detected, CHECK DATA places the table space in the
CHECK-pending status.
|
|
|
|
|
|
|
|
YES
If you specify SHRLEVEL REFERENCE, error rows are to be deleted from
the table space. If you specify the FOR EXCEPTION keyword, deleted
rows from both dependent and descendent tables are placed into exception
tables.
|
|
|
|
|
NO
|
|
|
|
|
|
Does not log any records that are deleted during the REPORTCK phase. If
any rows are deleted, CHECK DATA places the table space in the
COPY-pending status, and it places any indexes that were defined with the
COPY YES attribute in the informational COPY-pending status. If rows are
deleted from a table space that is not logged, the table space is marked
informational COPY-pending.
67
Attention: Use the LOG NO option with caution because its use limits
your ability to recover data by using the log. For example, if you issue the
CHECK DATA DELETE YES LOG NO utility control statement at
particular log RBA, you can recover data that exists on the log before that
point in time or after the point on the log at which the utility execution
completes.
EXCEPTIONS integer
Specifies the maximum number of exceptions, which are reported by messages
only. CHECK DATA terminates in the CHECKDATA phase when it reaches the
specified number of exceptions; if termination occurs, the error rows are not
written to the EXCEPTION table.
Only records that contain primary referential integrity errors or table check
constraint violations are applied toward the exception limit. The number of
records that contain secondary errors is not limited.
integer is the maximum number of exceptions. The default value is 0, which
indicates no limit on the number of exceptions.
This keyword does not apply to LOB table spaces or base table spaces that
contain XML columns.
|
|
ERRDDN ddname
Specifies a DD statement for an error processing data set.
ddname is either a DD name or a TEMPLATE name specification from a
previous TEMPLATE control statement. If utility processing detects that the
specified name is both a DD name in the current job step and a TEMPLATE
name, the utility uses the DD name. The default value is SYSERR.
WORKDDN (ddname1,ddname2)
Specifies the DD statements for the temporary work file for sort input and the
temporary work file for sort output. A temporary work file for sort input and
output is required.
You can use the WORKDDN keyword to specify either a DD name or a
TEMPLATE name specification from a previous TEMPLATE control statement.
If utility processing detects that the specified name is both a DD name in the
current job step and a TEMPLATE name, WORKDDN uses the DD name.
ddname1 is the DD name of the temporary work file for sort input. The default
is SYSUT1.
ddname2 is the DD name of the temporary work file for sort output. The
default is SORTOUT.
PUNCHDDN ddname
Specifies the DD statement for a data set that is to receive the REPAIR utility
control statements that CHECK DATA SHRLEVEL CHANGE generates.
|
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
device-type is the device type. If you omit SORTDEVT and a sort is required,
you must provide the DD statements that the sort program requires for the
temporary data sets.
SORTNUM integer
Specifies the number of temporary data sets that are to be dynamically
allocated by the sort program.
integer is the number of temporary data sets that can range from 2 to 255.
If you omit SORTDEVT, SORTNUM is ignored. If you use SORTDEVT and
omit SORTNUM, no value is passed to DFSORT; DFSORT uses its own default.
|
|
|
|
You need at least two sort work data sets for each sort. The SORTNUM value
applies to each sort invocation in the utility.
Important: The SORTNUM keyword will not be considered if ZPARM
UTSORTAL is set to YES and IGNSORTN is set to YES.
Related reference
Chapter 31, TEMPLATE, on page 641
69
Figure 8. Relationship between a base table with a LOB column and the LOB table space
|
|
|
70
Data set
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
Yes
|
|
Data set
Description
Required?
UTPRINT
Yes
The following objects are named in the utility control statement and do not require
DD statements in the JCL:
Table space
Object that is to be checked. (If you want to check only one partition of a
table space, use the PART option in the control statement.)
Exception table
Table that stores rows that violate any referential constraints. For each table
in a table space that is checked, specify the name of an exception table in
the utility control statement. Any row that violates a referential constraint
is copied to the exception table.
|
|
|
|
|
|
DB2 utilities uses DFSORT to perform sorts. Sort work data sets cannot span
volumes. Smaller volumes require more sort work data sets to sort the same
amount of data; therefore, large volume sizes can reduce the number of needed
sort work data sets. It is recommended that at least 1.2 times the amount of data to
be sorted be provided in sort work data sets on disk. For more information about
DFSORT, see DFSORT Application Programming: Guide.
Description
71
2. Create the ERRDDN data set so that it is large enough to accommodate one
error entry (length=60 bytes) per violation that CHECK DATA detects.
|
|
|
|
|
|
|
|
|
If a table space, partition, or index resides in DB2-managed data sets and shadow
data sets do not already exist when you execute CHECK DATA, DB2 creates the
shadow data sets. At the end of CHECK DATA processing, the DB2-managed
shadow data sets are deleted.
|
|
|
If you do not want the shadow data sets to be allocated in the same storage class
as the production data sets, set the UTIL_TEMP_STORCLAS system parameter to
specify the storage class for the shadow data sets.
catname.DSNDBx.dbname.psname.y000z.Lnnn
|
|
variable
meaning
|
|
catname
|
|
dbname
|
|
psname
I or J
1 or 2
|
|
|
|
|
|
Lnnn
|
|
|
|
|
|
To determine the names of existing data sets, execute one of the following
queries against the SYSTABLEPART or SYSINDEXPART catalog tables:
When you execute the CHECK DATA utility with the SHRLEVEL CHANGE
option, the utility uses shadow data sets. For user-managed data sets, you must
preallocate the shadow data sets before you execute CHECK DATA SHRLEVEL
CHANGE.
72
|
|
|
|
|
|
|
|
|
For a partitioned table space, DB2 returns rows from which you select the row for
the partitions that you want to check.
|
|
For a partitioned table space, DB2 returns rows from which you select the row for
the partitions that you want to check.
|
|
Consider the following actions when you preallocate the data sets:
v Allocate the shadow data sets according to the rules for user-managed data sets.
|
|
|
|
|
|
v Allocate the shadow data sets on the volumes that are defined in the storage
group for the original table space or index space.
|
|
If you specify a secondary space quantity, DB2 does not use it. Instead, DB2 uses
the SECQTY value for the table space or index space.
|
|
|
|
|
|
|
|
|
Recommendation: Use the MODEL option, which causes the new shadow data set
to be created like the original data set. This method is shown in the following
example:
|
|
|
|
|
|
When you preallocate shadow data sets for indexes, create the data sets as follows:
v Create shadow data sets for the partition of the table space and the
corresponding partition in each partitioning index and data-partitioned
secondary index.
v Create a shadow data set for logical partitions of nonpartitioned secondary
indexes.
|
|
Use the same naming scheme for these index data sets as you use for other data
sets that are associated with the base index, except use J0001 instead of I0001.
DEFINE CLUSTER +
(NAME('catname.DSNDBC.dbname.psname.x0001.L001') +
MODEL('catname.DSNDBC.dbname.psname.y0001.L001')) +
DATA +
(NAME('catname.DSNDBD.dbname.psname.x0001.L001') +
MODEL('catname.DSNDBD.dbname.psname.y0001.L001'))
73
|
|
|
If you have not changed the value of FREEPAGE or PCTFREE, the amount of
required space for a shadow data set is comparable to the amount of required
space for the original data set.
Target objects
DA/UTUT
DW/UTRO
DA/UTUT
Partitioning index or
index partition
DW/UTRO
DA/UTUT
DW/UTRO
DA/UTUT
Secondary index
DW/UTRO
DA/UTUT
none
DR
Logical partition of
index
none
none
DW/UTRO
DA/UTUT
Primary index
DW/UTRO
DW/UTRO
DW/UTRO
DW/UTRO
none
RI dependent and
descendent table spaces
and indexes
DA/UTUT
none
DA/UTUT
RI exception table
spaces and indexes
(FOR EXCEPTION
only)
DA/UTUT
DA/UTUT
DA/UTUT
DA/UTUT
Legend:
v DA: Drain all claim classes, no concurrent SQL access
v DR: Drain the repeatable read class, no concurrent access for SQL repeatable readers
v DW: Drain the write claim class, concurrent access for SQL readers
v UTUT: Utility restrictive state, exclusive control
v UTRO: Utility restrictive state, read-only access allowed
v none: Object not affected by this utility
v RI: Referential Integrity
The following table shows claim classes on a LOB table space and an index on the
auxiliary table.
74
Table 9. Claim classes of CHECK DATA operations on a LOB table space and index on the
auxiliary table
Target objects
DW/UTRO
DA/UTUT
DW/UTRO
DA/UTUT
Legend:
v DW: Drain the write claim class, concurrent access for SQL readers
v DA: Drain all claim classes, no concurrent SQL access
v UTRO: Utility restrictive state, read-only access allowed
v UTUT: Utility restrictive state, exclusive control
|
|
Target objects
DW/UTRO
DA/UTUT
DW/UTRO
DA/UTUT
XML index
DW/UTRO
DA/UTUT
|
|
|
|
|
|
Legend:
v DW: Drain the write claim class, concurrent access for SQL readers
v DA: Drain all claim classes, no concurrent SQL access
v UTRO: Utility restrictive state, read-only access allowed
v UTUT: Utility restrictive state, exclusive control
Compatibility
The following utilities are compatible with CHECK DATA and can run
concurrently on the same target object:
v DIAGNOSE
v MERGECOPY
v MODIFY
v REPORT
v STOSPACE
v UNLOAD (when CHECK DATA DELETE NO)
SQL operations and other online utilities are incompatible.
To run on DSNDB01.SYSUTILX, CHECK DATA must be the only utility in the job
step and the only utility that is running in the DB2 subsystem.
The index on the auxiliary table for each LOB column inherits the same
compatibility and concurrency attributes of a primary index.
75
|
|
|
|
|
|
|
|
|
The following table describes the contents of an exception table. This table lists the
columns, a description of the column content, whether or not the column is
required, the data type and length of the column value, and whether or not the
column has the NULL attribute.
Description
| 1 to n
|
|
|
|
NULL attribute
| n+1
|
|
|
|
|
No
Anything
CHAR(4);
CHAR(5)1 for
table spaces that
are defined with
LARGE or DSSIZE
options
| n+2
|
No
TIMESTAMP
Anything
| n+2
|
No
Anything
Anything
Required?
| Note:
| 1. You can use CHAR(5) for any type of table space, but you must use it for table spaces that are defined with the
|
LARGE or DSSIZE options.
|
|
|
|
If you delete rows by using the CHECK DATA utility with SCOPE ALL, you must
create exception tables for all tables that are named in the table spaces and for all
their descendents. All descendents of any row are deleted.
|
|
|
|
|
|
|
|
|
|
|
|
|
76
|
|
|
v Any change to the structure of the dependent table (such as a dropped column)
is not automatically recorded in the exception table. You must make that change
in the exception table.
|
|
Related information
CREATE TABLE (DB2 for z/OS SQL Reference)
If an exception is found, DB2 moves the base table row with its auxiliary column
to the exception table. If you specify DELETE YES, DB2 deletes the base table row
and the auxiliary column.
An auxiliary table cannot be an exception table. A LOB column check error is not
included in the exception count. A row with only a LOB column check error does
not participate in exception processing.
77
DSNU0501
78
v Use the DELETE YES option to remove all rows that violate referential or table
check constraints.
If you run CHECK DATA with the DELETE NO option and referential or table
check constraint violations are found, the table space or partition is placed in
CHECK-pending status.
Orphan LOBs
An orphan LOB column is a LOB that is found in the LOB table space but that is
not referenced by the base table space. If an orphan error is the only type of error
reported by CHECK DATA, the base table is considered correct.
An orphan can result from the following situations:
v You recover the base table space to a point in time prior to the insertion of the
base table row.
v You recover the base table space to a point in time prior to the definition of the
LOB column.
v You recover the LOB table space to a point in time prior to the deletion of a base
table row.
v A base record ROWID is incorrect, which results in an orphan LOB column error
message and a missing LOB column error message. The missing LOB column
error message identifies the ROWID, VERSION and row in error. The missing
LOB column is handled depending on the value that you specify for the
AUXERROR or LOBERROR parameter.
79
Missing LOBs
A missing LOB column is a LOB that is referenced by the base table space but that
is not in the LOB table space. A missing LOB can result from the following
situations:
v You recover the LOB table space to a point in time prior to the first insertion of
the LOB into the base table.
v You recover the LOB table space to a point in time when the LOB column is null
or has a zero length
Out-of-synch LOBs
An out-of-synch LOB error is a LOB that is found in both the base table and the
LOB table space, but the LOB in the LOB table space is at a different level. A LOB
column is also out-of-synch if the base table is null or has a zero length, but the
LOB is found in the LOB table space. An out-of-synch LOB can occur anytime you
recover the LOB table space or the base table space to a prior point in time.
Invalid LOBs
An invalid LOB is an uncorrected LOB column error that is found by a previous
execution of CHECK DATA AUXERROR INVALIDATE.
Related reference
Appendix C, Advisory or restrictive states, on page 925
|
|
|
|
|
|
|
v Use the SCOPE(AUXONLY) option to check for LOB and XML columns.
If you specified the AUXERROR(INVALIDATE), LOBERROR(INVALIDATE) or
XMLERROR(INVALIDATE) option and DB2 finds inconsistencies, it places the
table space in AUXW status.
Related reference
Appendix C, Advisory or restrictive states, on page 925
80
CHECK DATA detects an error; at the end of the phase, CHECK DATA resets the
CHECK-pending status if it detects no errors. The REPORTCK phase resets the
CHECK-pending status if you specify the DELETE YES option.
You can restart a CHECK DATA utility job, but it starts from the beginning again.
Related concepts
Termination of an online utility with the TERM UTILITY command on page 36
Restart of an online utility on page 36
EXEC DSNUPROC,UID='IUIQU1UQ.CHK1',
UTPROC='',
SYSTEM='DSN'
DD DSN=IUIQU1UQ.CHK3.STEP1.SYSUT1,DISP=(MOD,DELETE,CATLG),
UNIT=SYSDA,SPACE=(8000,(200,20),,,ROUND)
DD DSN=IUIQU1UQ.CHK3.SYSERR,DISP=(MOD,DELETE,CATLG),
UNIT=SYSDA,SPACE=(6000,(20,20),,,ROUND)
DD DSN=IUIQU1UQ.CHK3.STEP1.SORTOUT,DISP=(MOD,DELETE,CATLG),
UNIT=SYSDA,SPACE=(6000,(20,20),,,ROUND)
DD *
TABLESPACE DSN8D91A.DSN8S91D
TABLESPACE DSN8D91A.DSN8S91E
FOR EXCEPTION IN DSN8910.DEPT
USE DSN8910.EDEPT
IN DSN8910.EMP
USE DSN8910.EEMP
IN DSN8910.PROJ
USE DSN8910.EPROJ
IN DSN8910.PROJACT
USE DSN8910.EPROJACT
IN DSN8910.EMPPROJACT USE DSN8910.EEPA
DELETE YES
//*
You can create an exception table for the project activity table by using the
following SQL statements:
EXEC SQL
CREATE TABLE EPROJACT
LIKE DSN8910.PROJACT
IN DATABASE DSN8D91A
ENDEXEC
EXEC SQL
ALTER TABLE EPROJACT
ADD RID CHAR(4)
ENDEXEC
81
EXEC SQL
ALTER TABLE EPROJACT
ADD TIME TIMESTAMP NOT NULL WITH DEFAULT
ENDEXEC
The first statement requires the SELECT privilege on table DSN8910.PROJACT and
the privileges that are usually required to create a table.
Table EPROJACT has the same structure as table DSN8910.PROJACT, but it can
have two extra columns. The columns in EPROJACT are:
v Its first five columns mimic the columns of the project activity table; they have
exactly the same names and descriptions. Although the column names are the
same, they do not need to be. However, the rest of the column attributes for the
initial columns must be same as those of the table that is being checked.
v The next column, which is added by ALTER TABLE, is optional; CHECK DATA
uses it as an identifier. The name RID is an arbitrary choice; if the table
already has a column with that name, use a different name. The column
description, CHAR(4), is required.
v The final timestamp column is also optional. If you define the timestamp
column, a row identifier (RID) column must precede this column. You might
define a permanent exception table for each table that is subject to referential or
table check constraints. You can define it once and use it to hold invalid rows
that CHECK DATA detects. The TIME column allows you to identify rows that
were added by the most recent run of the utility.
Eventually, you correct the data in the exception tables, perhaps with an SQL
UPDATE statement, and transfer the corrections to the original tables by using
statements that are similar to those in the following example:
INSERT INTO DSN8910.PROJACT
SELECT PROJNO, ACTNO, ACSTAFF, ACSTDATE, ACENDATE
FROM EPROJACT
WHERE TIME > CURRENT TIMESTAMP - 1 DAY;
PSPI
82
EXEC DSNUPROC,UID='IUIQU1UQ.CHK2',
UTPROC='',
SYSTEM='SSTR'
DD DSN=IUIQU1UQ.CHK2.STEP5.SYSUT1,DISP=(MOD,DELETE,CATLG),
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//SORTOUT DD DSN=IUIQU1UQ.CHK2.STEP5.SORTOUT,DISP=(MOD,DELETE,CATLG),
//
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//SYSERR
DD DSN=IUIQU1UQ.CHK2.SYSERR,DISP=(MOD,DELETE,CATLG),
//
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//SYSIN
DD *
CHECK DATA TABLESPACE DBIQUQ01.TPIQUQ01 SCOPE ALL
AUXERROR INVALIDATE
/*
EXEC DSNUPROC,UID='L450TST3.CHECK',
UTPROC='',
SYSTEM='SSTR'
DD DSN=L450TST3.CHECK.STEP1.SYSREC,DISP=(MOD,DELETE,CATLG),
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
DD DSN=L450TST3.CHECK.STEP1.SYSERR,DISP=(MOD,DELETE,CATLG),
UNIT=SYSDA,SPACE=(2000,(20,20),,,ROUND)
DD DSN=L450TST3.CHECK.STEP1.SYSUT1,DISP=(MOD,DELETE,CATLG),
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
DD DSN=L450TST3.CHECK.STEP1.SORTOUT,
DISP=(MOD,DELETE,CATLG),UNIT=SYSDA,
SPACE=(4000,(20,20),,,ROUND)
DD *
DATA TABLESPACE DBNC0216.TPNC0216 PART 254
SCOPE ALL EXCEPTIONS 1
/*
The control statement specifies that the CHECK DATA utility is to check the clone
table in the specified table space.
CHECK DATA TABLESPACE DBNI0101.TSNI010P CLONE SCOPE ALL
ERRDDN SYSERR
The control statement specifies that the CHECK DATA utility is to specifies that
applications can read from and write to the table space that is to be checked.
CHECK DATA TABLESPACE DBNI0101.TSNI010P SHRLEVEL CHANGE
83
84
|
|
|
|
If you run CHECK INDEX against the index with the following characteristics,
CHECK INDEX fails:
|
|
To fix the problem, alter the column data type to BINARY, and then rebuild the
index.
Output
CHECK INDEX generates several messages that show whether the indexes are
consistent with the data.
For unique indexes, any two null values are treated as equal values, unless the
index was created with the UNIQUE WHERE NOT NULL clause. In that case, if
the key is a single column, it can contain any number of null values, and CHECK
INDEX does not issue an error message.
CHECK INDEX issues an error message if it finds two or more null values and the
unique index was not created with the UNIQUE WHERE NOT NULL clause.
Authorization required
To execute this utility, you must use
following authorities:
v STATS privilege for the database
v DBADM, DBCTRL, or DBMAINT
which the utility operates is in an
on the implicitly created database
v SYSCTRL or SYSADM authority
85
An ID with installation SYSOPR authority can also execute CHECK INDEX, but
only on a table space in the DSNDB01 or DSNDB06 databases.
If you are using SHRLEVEL CHANGE, the batch user ID that invokes COPY with
the CONCURRENT option must provide the necessary authority to execute the
DFDSS ADRSSU command. DFDSS will create a shadow data set with the
authority of the utility batch address space. The submitter should have an RACF
ALTER authority, or its equivalent, for the shadow data set.
|
|
|
|
|
Syntax diagram
CHECK INDEX
LIST listdef-name
( index-name
)
PART integer
( ALL ) TABLESPACE
database-name.
CLONE
table-space-name
PART
integer
SHRLEVEL REFERENCE
RETRY
UTIMOUT value
SHRLEVEL CHANGE
DRAIN_WAIT integer
RETRY
integer
WORKDDN SYSUT1
RETRY_DELAY
86
integer
WORKDDN ddname
SORTDEVT
device-type
SORTNUM
integer
Option descriptions
INDEX
Indicates that you are checking for index consistency.
LIST listdef-name
Specifies the name of a previously defined LISTDEF list name. The list should
contain only index spaces. Do not specify the name of an index or of a table
space. DB2 groups indexes by their related table space and executes CHECK
INDEX once per table space. CHECK INDEX allows one LIST keyword for
each control statement in CHECK INDEX. This utility will only process clone
data if the CLONE keyword is specified. The use of CLONED YES on the
LISTDEF statement is not sufficient.
(index-name, ...)
Specifies the indexes that are to be checked. All indexes must belong to tables
in the same table space. If you omit this option, you must use the (ALL)
TABLESPACE option. Then CHECK INDEX checks all indexes on all tables in
the table space that you specify.
index-name is the name of an index, in the form creator-id.name. If you omit the
qualifier creator-id., the user identifier for the utility job is used. If you use a list
of names, separate items in the list by commas. Parentheses are required
around a name or list of names. Enclose the index name in quotation marks if
the name contains a blank.
PART integer
Identifies a physical partition of a partitioned index or a logical partition of a
nonpartitioned index that is to be checked for consistency. If you specify an
index on a nonpartitioned table space, an error occurs.
integer is the number of the partition and must be in the range from 1 to the
number of partitions that are defined for the table space. The maximum is
4096.
If the PART keyword is not specified, CHECK INDEX tests the entire target
index for consistency.
(ALL)
Specifies that all indexes in the specified table space that are referenced by the
table space are to be checked.
TABLESPACE database-name.table-space-name
Specifies the table space from which all indexes are to be checked. If an explicit
list of index names is not specified, all indexes on all tables in the specified
table space are checked.
Do not specify TABLESPACE with an explicit list of index names.
database-name is the name of the database that the table space belongs to. The
default value is DSNDB04.
table-space-name is the name of the table space from which all indexes are
checked.
|
|
|
|
CLONE
Indicates that CHECK INDEX is to check only the specified indexes that are on
clone tables. This utility will only process clone data if the CLONE keyword is
specified. The use of CLONED YES on the LISTDEF statement is not sufficient.
SHRLEVEL
Indicates the type of access that is to be allowed for the index, table space, or
partition that is to be checked during CHECK INDEX processing.
Chapter 9. CHECK INDEX
87
REFERENCE
Specifies that applications can read from but cannot write to the index,
table space, or partition that is to be checked.
If you specify SHRLEVEL REFERENCE or use this value as the default,
DB2 unloads the index entries, sorts the index entries, and scans the data
to validate the index entries.
CHANGE
Specifies that applications can read from and write to the index, table
space, or partition that is to be checked.
If you specify SHRLEVEL CHANGE, DB2 performs the following actions:
v Drains all writers and forces the buffers to disk for the specified object
and all of its indexes
v Invokes DFSMSdss to copy the specified object and all of its indexes to
shadow data sets
v Enables read-write access for the specified object and all of its indexes
v Runs CHECK INDEX on the shadow data sets
DFSMSdss uses FlashCopy Version 2 if available. Otherwise, DFSMSdss
might take a long time to copy the object, and the time during which the
data and indexes have read-only access might increase.
DRAIN_WAIT integer
Specifies the number of seconds that CHECK INDEX is to wait when draining
the table space or index. The specified time is the aggregate time for objects
that are to be checked. This value overrides the values that are specified by the
IRLMRWT and UTIMOUT subsystem parameters.
integer can be any integer from 0 to 1800. If you do not specify DRAIN_WAIT
or specify a value of 0, CHECK INDEX uses the value of the lock timeout
subsystem parameter IRLMRWT.
RETRY integer
Specifies the maximum number of retries that CHECK INDEX is to attempt.
integer can be any integer from 0 to 255. Specifying a value other than 0 can
increase processing costs and result in multiple or extended periods during
which the specified index, table space, or partition is in read-only access.
If you do not specify RETRY, CHECK INDEX uses the value of the utility
multiplier subsystem parameter UTIMOUT.
RETRY_DELAY integer
Specifies the minimum duration, in seconds, between retries. integer can be any
integer from 1 to 1800.
If you do not specify RETRY_DELAY, CHECK INDEX uses the smaller of the
following two values:
v DRAIN_WAIT value RETRY value
v DRAIN_WAIT value 10
WORKDDN ddname
Specifies a DD statement for a temporary work file.
You can use the WORKDDN keyword to specify either a DD name or a
TEMPLATE name specification from a previous TEMPLATE control statement.
If utility processing detects that the specified name is both a DD name in the
current job step and a TEMPLATE name, the utility uses the DD name.
88
SORTDEVT device-type
Specifies the device type for temporary data sets that are to be dynamically
allocated by DFSORT. You can specify any disk device type that is acceptable
to the DYNALLOC parameter of the SORT or OPTION control statement for
DFSORT.
|
|
A TEMPLATE specification does not dynamically allocate sort work data sets.
The SORTDEVT keyword controls dynamic allocation of these data sets.
|
|
|
device-type is the device type. If you omit SORTDEVT and a sort is required,
you must provide the DD statements that the sort program requires for the
temporary data sets.
SORTNUM integer
Specifies the number of temporary data sets that are to be dynamically
allocated by the sort program.
integer is the number of temporary data sets that can range from 2 to 255.
If you omit SORTDEVT, SORTNUM is ignored. If you use SORTDEVT and
omit SORTNUM, no value is passed to DFSORT; DFSORT uses its own default.
|
|
|
|
|
You need at least two sort work data sets for each sort. The SORTNUM value
applies to each sort invocation in the utility. For example, if three indexes,
SORTKEYS is specified, there are no constraints that limit parallelism, and
SORTNUM is specified as 8, a total of 24 sort work data sets are allocated for a
job.
|
|
|
|
|
Each sort work data set consumes both above-the-line and below-the-line
virtual storage, so if you specify a value for SORTNUM that is too high, the
utility might decrease the degree of parallelism due to virtual storage
constraints, and possibly decreasing the degree down to one, meaning no
parallelism.
|
|
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
89
|
|
Data set
Description
Required?
UTPRINT
Yes
The following object is named in the utility control statement and does not require
a DD statement in the JCL:
Index space
Object that is to be checked. (If you want to check only one partition of an
index, use the PART option in the control statement.)
|
|
|
90
catname.DSNDBx.dbname.psname.y000z.Lnnn
In the preceding name, the variables have the following meanings:
variable
meaning
catname
The VSAM catalog name or alias
x
C or D
dbname
Database name
psname
Table space name or index name
I or J
1 or 2
Lnnn
|
|
|
|
|
|
|
|
|
|
|
|
To determine the names of existing data sets, execute one of the following
queries against the SYSTABLEPART or SYSINDEXPART catalog tables:
SELECT DBNAME, TSNAME, IPREFIX
FROM SYSIBM.SYSTABLEPART
WHERE DBNAME = 'dbname'
AND TSNAME = 'psname';
SELECT DBNAME, IXNAME, IPREFIX
FROM SYSIBM.SYSINDEXES X, SYSIBM.SYSINDEXPART Y
WHERE X.NAME = Y.IXNAME
AND X.CREATOR = Y.IXCREATOR
AND X.DBNAME = 'dbname'
AND X.INDEXSPACE = 'psname';
Consider the following actions when you preallocate the data sets:
v Allocate the shadow data sets according to the rules for user-managed data sets.
v Define the shadow data sets as LINEAR.
v Use SHAREOPTIONS(3,3).
v Allocate base or clone objects
Chapter 9. CHECK INDEX
91
v Define the shadow data sets as EA-enabled if the original table space or index
space is EA-enabled.
v Allocate the shadow data sets on the volumes that are defined in the storage
group for the original table space or index space.
If you specify a secondary space quantity, DB2 does not use it. Instead, DB2 uses
the SECQTY value for the table space or index space.
Recommendation: Use the MODEL option, which causes the new shadow data set
to be created like the original data set. This method is shown in the following
example:
|
|
|
|
|
|
DEFINE CLUSTER +
(NAME('catname.DSNDBC.dbname.psname.x000z.L001') +
MODEL('catname.DSNDBC.dbname.psname.y000z.L001')) +
DATA
+
(NAME('catname.DSNDBD.dbname.psname.x000z.L001') +
MODEL('catname.DSNDBD.dbname.psname.y000z.L001') )
92
|
|
|
|
|
Target
CHECK
INDEX
SHRLEVEL
REFERENCE
CHECK
INDEX PART
SHRLEVEL
REFERENCE
CHECK
INDEX
SHRLEVEL
CHANGE
CHECK
INDEX PART
SHRLEVEL
CHANGE
DW/UTRO
DW/UTRO
DW/UTRW
DW/UTRW
|
|
DW/UTRO
DW/UTRO
DW/UTRW
DW/UTRW
Secondary index1
DW/UTRO
none
DW/UTRW
DW/UTRW
|
|
Data-partitioned secondary
index or index partition2
DW/UTRO
DW/UTRO
DW/UTRW
DW/UTRW
DW/UTRO
DW/UTRW
DW/UTRW
|
|
|
|
|
Legend:
v DW: Drain the write claim class, concurrent access for SQL readers
v UTRO: Utility restrictive state, read only-access allowed
v UTRW: Utility restrictive state, read and write access allowed
v none: Object not affected by this utility
|
|
|
|
|
Note:
1. Includes document ID indexes and node ID indexes over non-partitioned XML table
spaces and XML indexes.
2. Includes document ID indexes and node ID indexes over partitioned XML table spaces.
CHECK INDEX does not set a utility restrictive state if the target object is
DSNDB01.SYSUTILX.
|
|
|
|
|
CHECK INDEX of an XML index cannot run if REBUILD INDEX, REORG INDEX,
or RECOVER is being run on that index because CHECK INDEX needs access to
the node ID index. CHECK INDEX SHRLEVEL CHANGE cannot run two jobs
concurrently for two different indexes that are in the same table space or partition
because the snapshot shadow will have a conflicting name for the table space.
Compatibility
The following table shows which utilities can run concurrently with CHECK
INDEX on the same target object. The first column lists the other utility and the
second column lists whether or not that utility is compatible with CHECK INDEX.
The target object can be a table space, an index space, or an index partition. If
compatibility depends on particular options of a utility, that information is also
documented in the table.
Table 14. Compatibility of CHECK INDEX SHRLEVEL REFERENCE with other utilities
Action
Compatible with
CHECK INDEX?
CHECK DATA
No
CHECK INDEX.
Yes
CHECK LOB
Yes
COPY INDEXSPACE
Yes
COPY TABLESPACE
Yes
DIAGNOSE
Yes
LOAD
No
93
Compatible with
CHECK INDEX?
MERGECOPY
Yes
MODIFY
Yes
QUIESCE
Yes
REBUILD INDEX
No
RECOVER INDEX
No
RECOVER TABLESPACE
No
REORG INDEX
No
No
Yes
No
Yes
REPORT
Yes
RUNSTATS
Yes
STOSPACE
Yes
UNLOAD
Yes
In this example, the keys are unique within each logical partition, but both
logical partitions contain the key, T; so for the index as a whole, the keys are not
unique. CHECK INDEX does not detect the duplicates.
v CHECK INDEX does not detect keys that are out of sequence between different
logical partitions. For example, the following keys are out of sequence:
1
10
12
12 LP 2
10
When checking a single logical partition, CHECK INDEX does not detect this
out-of-sequence condition.
94
Indexes in parallel
If you specify more than one index to check, CHECK INDEX checks the indexes in
parallel unless constrained by available memory or sort work files. Checking
indexes in parallel reduces the elapsed time for a CHECK INDEX job by sorting
the index keys and checking multiple indexes in parallel, rather than sequentially.
The following figure shows the flow of a CHECK INDEX job with a parallel index
check for a nonpartitioned table space or a single partition of a partitioned table
space.
Table
space
Indexes
Snapshot copy
Table
space
Unload
SW01WKnn
Sort
Sort
Sort
SW02WKnn
Check
Check
Check
Indexes
SW03WKnn
Figure 10. Parallel index check for a nonpartitioned table space or a single partition of a
partitioned table space
The following figure shows the flow of a CHECK INDEX job with a parallel index
check for all partitioning indexes on a partitioned table space.
95
Table
space
parts
Index
parts
Snapshot copy
Table
space
parts
Unload
Unload
Unload
SW01WKnn
Sort
Sort
Sort
SW02WKnn
Check
Check
Check
Index
parts
SW03WKnn
Figure 11. Parallel index check for all partitioning indexes on a partitioned table space
The following figure shows the flow of a CHECK INDEX job with a parallel index
check for a partitioned table space with a single nonpartitioned secondary index.
96
Table
space
parts
Index
Snapshot copy
Table
space
parts
Unload
Unload
Unload
Sort
Sort
Sort
SW01WKnn
SW02WKnn
Merge
Check
Index
SW03WKnn
Figure 12. Parallel index check for a partitioned table space with a single nonpartitioned
secondary index
The following figure shows the flow of a CHECK INDEX job with a parallel index
check for all indexes on a partitioned table space. Each unload task pipes keys to
each sort task, sorting the keys and piping them back to the check tasks.
97
Table
space
parts
Indexes
Snapshot copy
Table
space
parts
Unload
Unload
Unload
Sort
Sort
Sort
SW01WKnn
SW02WKnn
Check
Check
Check
Indexes
SW03WKnn
Figure 13. Parallel index check for all indexes on a partitioned table space
98
Action
EXEC DSNUPROC,UID='IUIQU1UQ.CHK1',
UTPROC='',
SYSTEM='DSN'
DD DSN=IUIQU1UQ.CHK3.STEP1.SYSUT1,DISP=(MOD,DELETE,CATLG),
UNIT=SYSDA,SPACE=(8000,(200,20),,,ROUND)
DD DSN=IUIQU1UQ.CHK3.SYSERR,DISP=(MOD,DELETE,CATLG),
UNIT=SYSDA,SPACE=(6000,(20,20),,,ROUND)
DD DSN=IUIQU1UQ.CHK3.STEP1.SORTOUT,DISP=(MOD,DELETE,CATLG),
99
//
UNIT=SYSDA,SPACE=(6000,(20,20),,,ROUND)
//SYSIN
DD *
CHECK INDEX (ALL) TABLESPACE DSN8D91A.DSN8S91E
//*
DSNUGUTCDSNUKGETDSNUKGETDSNUKGETDSNUK001DSNUKTERDSNUKTERDSNUKTERDSNUK001DSNUGBAC-
Figure 14. CHECK INDEX output from a job that checks the third partition of all indexes.
100
The following control statement specifies that the CHECK INDEX utility is to
check all specified indexes that are on clone tables.
CHECK INDEX (ALL) TABLESPACE DBLOB01.TSLOBC4 CLONE
101
102
Output
|
|
|
|
After successful execution, CHECK LOB SHRLEVEL CHANGE does not set or
reset the CHECK-pending (CHKP) and auxiliary-warning (AUXW) statuses.
CHECK LOB SHRLEVEL CHANGE does not reset the CHECK-pending (CHKP)
and auxiliary-warning (AUXW) statuses.
Authorization required
To execute this utility, you must use a privilege set that includes one of the
following authorities:
v STATS privilege for the database
v DBADM, DBCTRL, or DBMAINT authority for the database. If the object on
which the utility operates is in an implicitly created database, DBADM authority
on the implicitly created database or DSNDB04 is required.
An ID with installation SYSOPR authority can also execute CHECK LOB.
|
|
|
|
|
If you are using SHRLEVEL CHANGE, the batch user ID that invokes COPY with
the CONCURRENT option must provide the necessary authority to execute the
DFDSS ADRSSU command. DFDSS will create a shadow data set with the
authority of the utility batch address space. The submitter should have a RACF
ALTER authority, or its equivalent, for the shadow data set.
103
SORTIN
Passes CHECKLOB phase records to SORT
SORT Sorts the records from the CHECKLOB phase
SORTOUT
Passes sorted records to the REPRTLOB phase
REPRTLOB
Examines records that are produced by the CHECKLOB phase; issues error
messages
UTILTERM
Performs cleanup
Syntax diagram
SHRLEVEL REFERENCE
CHECK LOB
lob-table-space-spec
drain-spec
SHRLEVEL CHANGE
EXCEPTIONS 0
EXCEPTIONS
integer
PUNCHDDN
SYSPUNCH
ddname
SORTDEVT
device-type
SORTNUM
integer
lob-table-space-spec:
TABLESPACE
lob-table-space-name
database-name.
drain-spec:
104
CLONE
RETRY
UTIMOUT value
DRAIN_WAIT integer
RETRY
integer
RETRY_DELAY
integer
Option descriptions
LOB
Indicates that you are checking a LOB table space for defects.
TABLESPACE database-name.lob-table-space-name
Specifies the table space to which the data belongs.
database-name is the name of the database and is optional.
The default value is DSNDB04.
lob-table-space-name is the name of the LOB table space.
|
|
|
SHRLEVEL
Indicates the type of access that is to be allowed for the index, table space, or
partition that is to be checked during CHECK LOB processing.
|
|
|
REFERENCE
Specifies that applications can read from but cannot write to the index,
table space, or partition that is to be checked.
|
|
|
CHANGE
Specifies that applications can read from and write to the index, table
space, or partition that is to be checked.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DRAIN_WAIT
Specifies the number of seconds that CHECK LOB is to wait when draining the
table space or index. The specified time is the aggregate time for objects that
are to be checked. This value overrides the values that are specified by the
IRLMRWT and UTIMOUT subsystem parameters.
integer can be any integer from 0 to 1800. If you do not specify DRAIN_WAIT
or specify a value of 0, CHECK LOB uses the value of the lock timeout
subsystem parameter IRLMRWT.
RETRY integer
Specifies the maximum number of retries that CHECK LOB is to attempt.
integer can be any integer from 0 to 255. If you do not specify RETRY, CHECK
LOB uses the value of the utility multiplier system parameter UTIMOUT.
105
|
|
|
|
|
|
RETRY_DELAY integer
Specifies the minimum duration, in seconds, between retries. integer can be any
integer from 1 to 1800.
|
|
|
|
If you do not specify RETRY_DELAY, CHECK LOB uses the smaller of the
following two values:
v DRAIN_WAIT value RETRY value
v DRAIN_WAIT value 10
EXCEPTIONS integer
Specifies the maximum number of exceptions, which are reported by messages
only. CHECK LOB terminates in the CHECKLOB phase when it reaches the
specified number of exceptions.
All defects that are reported by messages are applied to the exception count.
integer is the maximum number of exceptions.
The default value is 0, which indicates no limit on the number of exceptions.
PUNCHDDN ddname
Specifies the DD statement for a data set that is to receive the REPAIR utility
control statements that CHECK LOB SHRLEVEL REFERENCE generates. The
REPAIR statements generated deletes the LOBs reported in error messages
from the LOB table space. CHECK DATA should then be run against the base
table space to set the deleted LOB columns in the base records to invalid.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If you omit SORTDEVT and a sort is required, you must provide the DD
statements that the sort program requires for the temporary data sets.
SORTNUM integer
Indicates the number of temporary data sets that are to be dynamically
allocated by the sort program.
integer is the number of temporary data sets that can range from 2 to 255.
If you omit SORTDEVT, SORTNUM is ignored. If you use SORTDEVT and
omit SORTNUM, no value is passed to DFSORT, which then uses its own
default. You need at least two sort work data sets for each sort.
106
|
|
|
|
|
|
|
Data set
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
UTPRINT
Yes
The following object is named in the utility control statement and does not require
DD statements in the JCL:
Table space
Object that is to be checked.
|
|
|
|
|
|
|
DB2 utilities use DFSORT to perform sorts. Sort work data sets cannot span
volumes. Smaller volumes require more sort work data sets to sort the same
amount of data; therefore, large volume sizes can reduce the number of needed
sort work data sets. When you allocate sort work data sets on disk, the
recommended amount of space to allow provides at least 1.2 times the amount of
data that is to be sorted. For |more information about DFSORT, see DFSORT
Application Programming: Guide.
107
|
|
|
|
|
|
|
|
If a table space, partition, or index resides in DB2-managed data sets and shadow
data sets do not already exist when you execute CHECK LOB, DB2 creates the
shadow data sets. At the end of CHECK LOB processing, the DB2-managed
shadow data sets are deleted.
|
|
|
If you have not changed the value of FREEPAGE or PCTFREE on the CREATE
TABLESPACE statement, the amount of required space for a shadow data set is
comparable to the amount of required space for the original data set.
|
|
|
If you do not want the shadow data sets to be allocated in the same storage class
as the production data sets, set the UTIL_TEMP_STORCLAS system parameter to
specify the storage class for the shadow data sets.
catname.DSNDBx.dbname.psname.y000z.Lnnn
|
|
variable
meaning
|
|
catname
|
|
dbname
|
|
psname
I or J
1 or 2
|
|
|
|
Lnnn
When you execute the CHECK LOB utility with the SHRLEVEL CHANGE option,
the utility uses shadow data sets. For user-managed data sets, you must preallocate
the shadow data sets before you execute CHECK LOB SHRLEVEL CHANGE.
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
|
|
For a partitioned table space, DB2 returns rows from which you select the row for
the partitions that you want to check.
Consider the following actions when you preallocate the data sets:
v Allocate the shadow data sets according to the rules for user-managed data sets.
v Define the shadow data sets as LINEAR.
|
|
|
|
|
|
|
v Use SHAREOPTIONS(3,3).
v Define the shadow data sets as EA-enabled if the original table space or index
space is EA-enabled.
v Allocate the shadow data sets on the volumes that are defined in the storage
group for the original table space or index space.
|
|
If you specify a secondary space quantity, DB2 does not use it. Instead, DB2 uses
the SECQTY value for the table space or index space.
|
|
|
|
|
|
|
|
|
Recommendation: Use the MODEL option, which causes the new shadow data set
to be created like the original data set. This method is shown in the following
example:
|
|
|
|
|
|
When you preallocate shadow data sets for indexes, create the data sets as follows:
v Create shadow data sets for the partition of the table space and the
corresponding partition in each partitioning index and data-partitioned
secondary index.
|
|
Use the same naming scheme for these index data sets as you use for other data
sets that are associated with the base index, except use J0001 instead of I0001.
DEFINE CLUSTER +
(NAME('catname.DSNDBC.dbname.psname.x000z.L001') +
MODEL('catname.DSNDBC.dbname.psname.y000z.L001')) +
DATA +
(NAME('catname.DSNDBD.dbname.psname.x000z.L001') +
MODEL('catname.DSNDBD.dbname.psname.y000z.L001') )
109
DB2 treats individual data and index partitions as distinct target objects. Utilities
that operate on different partitions of the same table space or index space are
compatible.
Target objects
CHECK LOB
SHRLEVEL
REFERENCE
CHECK LOB
SHRLEVEL CHANGE
DW/UTRO
CR/UTRW
DW/UTRO
CR/UTRW
Legend:
v CR: Claim the read claim class
v DW: Drain the write claim class, concurrent access for SQL readers
v UTRO: Utility restrictive state, read-only access allowed
v UTRW: Utility restrictive state, read and write access allowed
|
|
Compatibility
Any SQL operation or other online utility that attempts to update the same LOB
table space is incompatible.
110
Attention: Use the REPAIR utility with care because improper use can further
damage the data. If necessary, contact IBM Software Support for guidance on
using the REPAIR utility.
2. Run CHECK LOB again, or run the REPAIR utility to reset CHECK-pending or
auxiliary-warning status.
111
|
|
|
|
|
|
|
|
|
|
|
The following control statement specifies that the CHECK LOB utility is to check
the LOB space data for only the clone table, not the LOB data for the base table.
The EXCEPTIONS 0 option indicates that there is no limit on the number of
exceptions. The SORTDEVT and SORTNUM options provide information about
temporary data sets that are to be dynamically allocated by DFSORT. SORTDEVT
SYSDA specifies that the device type is SYSDA, and SORTNUM 10 indicates that
ten temporary data sets are to be dynamically allocated by the sort program.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The following control statement specifies that the CHECK LOB utility is to check
the LOB table space data with the SHRLEVEL CHANGE option, which specifies
that the application can read from and write to the table space that is to be
checked.
CLONE
112
Output
Output from the COPY utility consists of:
v Up to four sequential data sets containing the image copy.
v Rows in the SYSIBM.SYSCOPY catalog table that describe the image copy data
sets that are available to the RECOVER utility. Your installation is responsible for
ensuring that these data sets are available if the RECOVER utility requests them.
v If you specify the CHANGELIMIT option, a report on the change status of the
table space.
|
|
|
|
|
|
|
The COPY-pending status is set off for table spaces if the copy was a full image
copy. However, DB2 does not reset the COPY-pending status if you copy a single
piece of a multi-piece linear data set. If you copy a single table space partition,
DB2 resets the COPY-pending status only for the copied partition and not for the
whole table space. DB2 resets the informational COPY-pending (ICOPY) status
after you copy an index space or index. The COPY utility will reset
ICOPY-pending status for not logged table spaces.
Authorization required
To execute this utility, you must use a privilege set that includes one of the
following authorities:
v IMAGCOPY privilege for the database
113
114
Syntax diagram
(1)
SHRLEVEL REFERENCE
SCOPE ALL
SHRLEVEL CHANGE
SCOPE PENDING
copy-spec
COPY
(2)
CLONE
concurrent-spec
(3)
filterddn-spec
Notes:
1
Use the copy-spec if you do not want to use the CONCURRENT option.
Use the concurrent-spec if you want to use the CONCURRENT option, but not the FILTERDDN
option.
Use the filterddn spec if you want to use the CONCURRENT and FILTERDDN options.
copy-spec:
FULL
LIST
listdef-name
YES
data-set-spec
FULL NO
changelimit-spec
FULL
table-space-spec
index-name-spec
YES
DSNUM
ALL
data-set-spec
FULL NO
changelimit-spec
(1)
DSNUM
integer
(2)
SYSTEMPAGES
YES
SYSTEMPAGES
NO
CHECKPAGE
PARALLEL
(num-objects)
TAPEUNITS
num-tape-units
Notes:
concurrent-spec:
LIST listdef-name
data-set-spec
DSNUM
CONCURRENT
ALL
table-space-spec
index-name-spec
data-set-spec
(1)
DSNUM
integer
Notes:
1
115
filterddn-spec:
LIST listdef-name
ALL
DSNUM
integer
table-space-spec
index-name-spec
(1)
Notes:
1
data-set-spec:
(1)
COPYDDN(
ddname1
)
,ddname2
RECOVERYDDN(
ddname3
,ddname2
)
,ddname4
,ddname4
RECOVERYDDN(
ddname3
)
,ddname4
,ddname4
Notes:
1
COPYDDN SYSCOPY is the default for the primary copy, but this default can only be used for
one object in the list.
changelimit-spec:
CHANGELIMIT
(ANY)
(percent_value1
REPORTONLY
)
,percent_value2
table-space-spec:
TABLESPACE
table-space-name
database-name.
index-name-spec:
116
(1)
INDEXSPACE
INDEX
index-space-name
database-name.
index-name
creator-id.
Notes:
1
Option descriptions
LIST listdef-name
Specifies the name of a previously defined LISTDEF list name. LIST specifies
one LIST keyword for each COPY control statement. Do not specify LIST with
either the INDEX or the TABLESPACE keyword. DB2 invokes COPY once for
the entire list. This utility will only process clone data if the CLONE keyword
is specified. The use of CLONED YES on the LISTDEF statement is not
sufficient.
TABLESPACE database-name.table-space-name
Specifies the table space (and, optionally, the database it belongs to) that is to
be copied.
database-name is the name of the database that the table space belongs to. The
default value is DSNDB04.
table-space-name is the name of the table space to be copied.
Specify the DSNDB01.SYSUTILX, DSNDB06.SYSCOPY, or
DSNDB01.SYSLGRNX table space by itself in a single COPY statement.
Alternatively, specify the DSNDB01.SYSUTILX, DSNDB06.SYSCOPY, or
DSNDB01.SYSLGRNX table space with indexes over the table space that were
defined with the COPY YES attribute.
|
|
|
|
|
|
|
|
|
|
CLONE
Indicates that COPY is to copy only clone table or index data. This utility will
only process clone data if the CLONE keyword is specified. The use of
CLONED YES on the LISTDEF statement is not sufficient.
If the utility is processing a table space and CLONE is specified, the utility will
only process clone table data. If the utility is processing an index and CLONE
is specified, the utility will only process indexes over clone tables. If you use
the LIST keyword to specify a list of objects, COPY processes only those
objects in the list that contain clone tables or indexes on clone tables. COPY
ignores other objects in the list.
INDEXSPACE database-name.index-space-name
Specifies the qualified name of the index space that is to be copied; the name is
obtained from the SYSIBM.SYSINDEXES table. The specified index space must
be defined with the COPY YES attribute.
database-name Optionally specifies the name of the database that the index
space belongs to. The default value is DSNDB04.
index-space-name specifies the name of the index space that is to be copied.
INDEX creator-id.index-name
Specifies the index that is to be copied. Enclose the index name in quotation
marks if the name contains a blank.
Chapter 11. COPY
117
creator-id optionally specifies the creator of the index. The default value is the
user identifier for the utility.
index-name specifies the name of the index that is to be copied.
COPYDDN (ddname1,ddname2)
Specifies a DD name or a TEMPLATE name for the primary (ddname1) and
backup (ddname2) copy data sets for the image copy at the local site.
You can use the COPYDDN keyword to specify either a DD name or a
TEMPLATE name specification from a previous TEMPLATE control statement.
If utility processing detects that the specified name is both a DD name in the
current job step and a TEMPLATE name, the utility uses the DD name. For
more information about TEMPLATE specifications, see Chapter 31,
TEMPLATE, on page 641.
ddname is the DD name. The default value is SYSCOPY for the primary copy.
You can use the default for only one object in the list. The first object in the list
that does not have COPYDDN specified uses the default. Any other objects in
the list that do not have COPYDDN specified cause an error.
If you use the CHANGELIMIT REPORTONLY option, you can use a DD
DUMMY statement when you specify the SYSCOPY output data set. This card
prevents a data set from being allocated and opened.
Recommendation: Catalog all of your image copy data sets.
You cannot have duplicate image copy data sets. If the DD statement identifies
a noncataloged data set with the same name, volume serial, and file sequence
number as one that is already recorded in the SYSIBM.SYSCOPY catalog table,
the COPY utility issues a message and does not make an image copy. If COPY
identifies a cataloged data set with only the same name, it does not make an
image copy. For cataloged image copy data sets, CATLG must be specified for
the normal termination disposition in the DD statement, as shown in the
following example:
DISP=(MOD,CATLG,CATLG)
118
YES
Specifies a full image copy. Making a full image copy resets the
COPY-pending status for the table space or index, or for the partition if
you specify DSNUM.
NO
Specifies only an incremental image copy. Only changes since the last
image copy are to be copied. NO is not valid for indexes.
Incremental image copies are not allowed in the following situations:
v The last full image copy of the table space was taken with the
CONCURRENT option.
v No full image copies exist for the table space or data set that is being
copied.
v After a successful LOAD or REORG operation, unless an inline copy
was made during the LOAD or REORG job.
v You specify one of the following table spaces: DSNDB01.DBD01,
DSNDB01.SYSUTILX, or DSNDB06.SYSCOPY.
v A previous COPY was terminated with the -TERM UTIL command, so
the most recent SYSIBM.SYSCOPY record for the object contains ICTYPE
= T.
For incremental image copies of partitioned table spaces, COPY includes
the header page for each partition that has changed pages.
COPY automatically takes a full image copy of a table space if you specify
FULL NO when an incremental image copy is not allowed.
CHANGELIMIT
Specifies the limit of changed pages in the table space, partition, or data set at
which an incremental or full image copy is to be taken.
|
|
|
ANY
Specifies that COPY is to take a full image copy if any pages have changed
since the last image copy.
percent_value1
Specifies the first value in the CHANGELIMIT range. percent_value1 must
be an integer or decimal value from 0.0 to 100.0. You do not need to
specify leading zeroes, and the decimal point is not required when
specifying a whole integer. Specify a maximum of one decimal place for a
decimal value. For example, you can specify .5. If you specify this value,
COPY takes an incremental image copy if more than one half of one
percent of the pages have changed.
percent_value2
Specifies the second value in the CHANGELIMIT range. percent_value2
must be an integer or decimal value from 0.0 to 100.0. You do not need to
specify leading zeroes, and the decimal point is not required when
specifying a whole integer. Specify a maximum of one decimal place for a
decimal value (for example, .5).
COPY CHANGELIMIT accepts percentage values in any order. For example,
you can specify (10,1) or (1,10).
If only one percentage value is specified, COPY CHANGELIMIT:
v Creates an incremental image copy if the percentage of changed pages is
greater than 0 and less than percent_value1.
119
v Creates a full image copy if the percentage of changed pages is greater than
or equal to percent_value1, or if CHANGELIMIT(0) is specified.
v Does not create an image copy if no pages have changed, unless
CHANGELIMIT(0) is specified.
v Always creates a full image copy, even when no pages have been updated
since the last image copy, if CHANGELIMIT(0) is specified.
|
|
|
|
|
|
120
For a nonpartitioned table space, find the integer at the end of the data
set name as it is cataloged in the ICF catalog. The data set name has the
following format:
|
catname.DSNDBx.dbname.spacename.y000Z.Annn
In this format:
catname
Is the ICF catalog name or alias.
x
dbname
Is the database name.
spacename
Is the table space or index space name.
Is 1 or 2.
nnn
If COPY takes an image copy of data sets (rather than on table spaces),
RECOVER, MERGECOPY, or COPYTOCOPY must use the copies on a data set
level. For a nonpartitioned table space, if COPY takes image copies on data
sets and you run MODIFY RECOVERY with DSNUM ALL, the table space is
placed in COPY-pending status if a full image copy of the entire table space
does not exist.
PARALLEL
Specifies the maximum number of objects in the list that are to be processed in
parallel. The utility processes the list of objects in parallel for image copies
being written to or from different disk or tape devices. If you specify
TAPEUNITS with PARALLEL, you control the number of tape drives that are
dynamically allocated for the copy. If you omit PARALLEL, the list is not
processed in parallel.
Restriction: Do not specify the PARALLEL keyword if one or more of the
output data sets are defined with DD statements that specify UNIT=AFF to
refer to the same device as a previous DD statement. This usage is not
supported with the PARALLEL keyword and could result in an abend. Instead,
consider using templates to define your data sets.
(num-objects)
Specifies the number of objects in the list that are to be processed in
parallel. You can adjust this value to a smaller value if COPY encounters
storage constraints.
If you specify 0 or do not specify a value for num-objects, COPY determines
the optimal number of objects to process in parallel.
TAPEUNITS
Specifies the maximum number of tape drives that the utility dynamically
allocates for the list of objects to be processed in parallel. TAPEUNITS applies
only to tape drives that are dynamically allocated through the TEMPLATE
keyword. It does not apply to JCL allocated tape drives. The total number of
tape drives allocated for the COPY request is the sum of the JCL allocated tape
drives plus the number of tape drives determined as follows:
Chapter 11. COPY
121
|
|
|
|
|
|
|
Note: Use of the CHECKPAGE option for indexes can result in greatly
increased processor usage.
|
|
SYSTEMPAGES
Specifies whether the COPY utility puts system pages at the beginning of the
image copy data set.
Although the system pages are located at the beginning of many image copies,
this placement is not guaranteed. In many cases, the system pages are not
included. For example, incremental copies do not include system pages.
YES
Ensures that any header, dictionary, and version system pages are copied
at the beginning of the image copy data set. The version system pages can
be copied twice.
Selecting YES ensures that the image copy contains the necessary system
pages for subsequent UNLOAD utility jobs to correctly format and unload
all data rows.
NO
Does not ensure that the dictionary and version system pages are copied at
the beginning of the image copy data set. The COPY utility copies the
pages in the current order, including the header pages.
CONCURRENT
Specifies that DFSMSdss concurrent copy is to make the full image copy. The
image copy is recorded in the SYSIBM.SYSCOPY catalog table with ICTYPE=F
and STYPE=C or STYPE=J.
If the SYSPRINT DD statement points to a data set, you must use a DSSPRINT
DD statement.
When you specify SHRLEVEL(REFERENCE), an ICTYPE=Q record is placed
into the SYSIBM.SYSCOPY catalog table after the object has been quiesced. If
COPY fails, this record remains in SYSIBM.SYSCOPY. When COPY is
successful, this ICTYPE=Q record is replaced with the ICTYPE=F record.
If the page size in the table space matches the control interval for the
associated data set, you can use either the SHRLEVEL CHANGE option or the
122
|
|
|
|
The read claim class is briefly obtained for each object during the
UTILINIT phase to determine the object size if LIMIT is specified on the
COPYDDN or RECOVERYDDN template. This applies only if OPTIONS
EVENT(ITEMERROR,SKIP) is specified.
123
|
|
|
|
ALL
Indicates that you want to copy all of the specified objects.
PENDING
Indicates that you want to copy only those objects in COPY-pending or
informational COPY-pending status. When the DSNUM ALL option is
specified for partitioned objects, and one or more of the partitions are in
COPY-pending or informational COPY-pending status, a copy will be taken
of the entire table space or index space.
|
|
|
|
|
|
|
|
|
|
|
124
Data set
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
DSSPRINT
No1
Description
Required?
Filter
No2
A single data set that DB2 uses when you
specify the FILTERDDN option in the utility
control statement. This data set contains a
list of VSAM data set names that DB2
builds, and is used during COPY when you
specify the CONCURRENT and
FILTERDDN options.
Copies
Note:
1. Required if you specify CONCURRENT and the SYSPRINT DD statement points to a
data set.
2. Required if you specify the FILTERDDN option.
The following objects are named in the utility control statement and do not require
DD statements in the JCL:
Table space or index space
Object that is to be copied. (If you want to copy only certain data sets in a
table space, you must use the DSNUM option in the control statement.)
DB2 catalog objects
Objects in the catalog that COPY accesses. The utility records each copy in
the DB2 catalog table SYSIBM.SYSCOPY.
125
Alternatively, you can determine the approximate size of the filter data set size that
is required, in bytes, by using the following formula, where n = the number of
specified objects in the COPY control statement:
(240 + (80 * n))
JCL parameters
You can specify a block size for the output by using the BLKSIZE parameter on the
DD statement for the output data set. Valid block sizes are multiples of 4096 bytes.
You can increase the buffer using the BUFNO parameter; for example, you might
specify BUFNO=30, which creates 30 buffers.
Restricted states
Do not copy a table space that is in any of the following states:
v CHECK-pending
v RECOVER-pending
v REFRESH-pending
v Logical error range
v Group buffer pool RECOVER-pending
v Stopped
v STOP-pending
Do not copy an index space that is in any of the following states:
v CHECK-pending
126
v
v
v
v
v
v
v
REBUILD-pending
RECOVER-pending
REFRESH pending
Logical error range
Group buffer pool RECOVER-pending
Stopped
STOP-pending
SHRLEVEL
REFERENCE
SHRLEVEL
CHANGE
DW UTRO
CR UTRW1
Legend:
v DW - Drain the write claim class - concurrent access for SQL readers
v CR - Claim the read claim class
v UTRO - Utility restrictive state, read-only access allowed
v UTRW - Utility restrictive state, read-write access allowed
Note:
1. If the target object is a segmented table space, SHRLEVEL CHANGE does not allow you
to concurrently execute an SQL DELETE without the WHERE clause.
COPY does not set a utility restrictive state if the target object is
DSNDB01.SYSUTILX.
Compatibility
The following table documents which utilities can run concurrently with COPY on
the same target object. The target object can be a table space, an index space, or a
partition of a table space or index space. If compatibility depends on particular
options of a utility, that information is also documented in the table.
Table 19. Compatibility of COPY with other utilities
Action
COPY
INDEXSPACE
SHRLEVEL
REFERENCE
COPY
INDEXSPACE
SHRLEVEL
CHANGE
COPY
TABLESPACE
SHRLEVEL
REFERENCE1
COPY
TABLESPACE
SHRLEVEL
CHANGE
BACKUP SYSTEM
Yes
Yes
Yes
Yes
CHECK DATA
Yes
Yes
No
No
CHECK INDEX
Yes
Yes
Yes
Yes
CHECK LOB
Yes
Yes
Yes
Yes
127
Action
COPY
INDEXSPACE
SHRLEVEL
REFERENCE
COPY
INDEXSPACE
SHRLEVEL
CHANGE
COPY
TABLESPACE
SHRLEVEL
REFERENCE1
COPY
TABLESPACE
SHRLEVEL
CHANGE
COPY INDEXSPACE
No
No
Yes
Yes
COPY TABLESPACE
Yes
Yes
No
No
COPYTOCOPY
No
No
No
No
DIAGNOSE
Yes
Yes
Yes
Yes
LOAD
No
No
No
No
MERGECOPY
No
No
No
No
MODIFY
No
No
No
No
QUIESCE
Yes
No
Yes
No
REBUILD INDEX
No
No
Yes
Yes
RECOVER INDEX
No
No
Yes
Yes
RECOVER TABLESPACE
Yes
Yes
No
No
REORG INDEX
No
No
Yes
Yes
REORG TABLESPACE
UNLOAD CONTINUE or
PAUSE
No
No
No
No
REORG TABLESPACE
UNLOAD ONLY or
EXTERNAL
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
No
No
Yes
No
REPAIR LOCATE
TABLESPACE PAGE
REPLACE
Yes
Yes
No
No
REPORT
Yes
Yes
Yes
Yes
RESTORE SYSTEM
No
No
No
No
RUNSTATS INDEX
Yes
Yes
Yes
Yes
RUNSTATS TABLESPACE
Yes
Yes
Yes
Yes
STOSPACE
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
UNLOAD
Note:
To run on DSNDB01.SYSUTILX, COPY must be the only utility in the job step.
Also, if SHRLEVEL REFERENCE is specified, the COPY job of
DSNDB01.SYSUTILX must be the only utility running in the Sysplex.
128
COPY on SYSUTILX is an exclusive job; such a job can interrupt another job
between job steps, possibly causing the interrupted job to time out.
Related concepts
Monitoring utilities with the DISPLAY UTILITY command on page 33
Related reference
Appendix C, Advisory or restrictive states, on page 925
The COPY utility writes pages from the table space or index space to the output
data sets. The JCL for the utility job must include DD statements or have a
template specification for the data sets. If the object consists of multiple data sets
and all are copied in one run, the copies reside in one physical sequential output
data set.
Image copies should be made either by entire page set or by partition, but not by
both.
Recommendations:
v Take a full image copy after any of the following operations:
CREATE or LOAD operations for a new object that is populated.
|
|
|
If a table space changes after an image copy is taken and before the table space is
altered from NOT LOGGED to LOGGED, the table space is marked
COPY-pending, and a full image copy must be taken.
The catalog table SYSIBM.SYSCOPY and the directory tables SYSIBM.SYSUTILX
and SYSIBM.SYSLGRNX record information from the COPY utility. Copying the
Chapter 11. COPY
129
catalog table or the directories can lock out separate COPY jobs that are running
simultaneously; therefore, defer copying the catalog table or directories until the
other copy jobs have completed if possible. However, if you must copy other
objects while another COPY job processes catalog tables or directories, specify
SHRLEVEL (CHANGE) for the copies of the catalog and directory tables.
Related reference
Appendix C, Advisory or restrictive states, on page 925
FULL NO
SHRLEVEL CHANGE
Performance advantage
An incremental image copy generally does not require a complete scan of the table
space, with two exceptions:
v The table space is defined with the TRACKMOD NO option.
v You are taking the first copy after you altered a table space to TRACKMOD YES.
Space maps in each table space indicate, for each page, regardless of whether it has
changed since the last image copy. Therefore, making an incremental copy can be
significantly faster than making a full copy if the table space is defined with the
TRACKMOD YES option. Incremental image copies of a table space that is defined
with TRACKMOD NO still saves space, although the performance advantage is
smaller.
Restriction: You cannot make incremental copies of DSNDB01.DBD01,
DSNDB01.SYSUTILX, or DSNDB06.SYSCOPY in the catalog. For those objects,
COPY always makes a full image copy and places the SYSCOPY record in the log.
130
Remote-site recovery
For remote site recovery, DB2 assumes that the system and application libraries
and the DB2 catalog and directory are identical at the local site and recovery site.
You can regularly transport copies of archive logs and database data sets to a safe
location to keep current data for remote-site recovery current. This information can
be kept on tape until needed.
RECOVERYDDN (ddname3,ddname4)
The DD names for the primary output data sets are ddname1 and ddname3. The
ddnames for the backup output data sets are ddname2 and ddname4.
You do not need to make copies for local use and for remote-site recovery at the
same time. COPY allows you to use either the COPYDDN or the RECOVERYDDN
option without the other. If you make copies for local use more often than copies
for remote-site recovery, a remote-site recovery could be performed with an older
copy, and more of the log, than a local recovery; hence, the recovery would take
longer. However, in your plans for remote-site recovery, that difference might be
acceptable. You can also use MERGECOPY RECOVERYDDN to create recovery-site
131
full image copies, and merge local incremental copies into new recovery-site full
copies.
To proceed, and still keep the two sets of data synchronized, take another full
image copy of the table space for both sites, or change your request to make an
incremental image copy only for the site at which you are working.
DB2 cannot make an incremental image copy if the object that is being copied is an
index or index space.
This action helps to ensure correct recovery for both local and recovery sites. If the
requested full image copy is for one site only, but the history shows that copies
were made previously for both sites, COPY continues to process the image copy
and issues the following warning message:
DSNU406I
FULL IMAGE COPY SHOULD BE TAKEN FOR BOTH LOCAL SITE AND
RECOVERY SITE.
The COPY-pending status of a table space is not changed for the other site when
you make multiple image copies at the current site for that other site. For example,
if a table space is in COPY-pending status at the current site, and you make copies
from there for the other site only, the COPY-pending status is still on when you
bring up the system at that other site.
132
Related reference
Chapter 12, COPYTOCOPY, on page 155
|
|
|
133
the placement and, thus, the order of processing for such objects. When only
templates are used, objects are processed according to their size, with the largest
objects processed first.
Both the PARALLEL and TAPEUNITS keywords act as constraints on the
processing of the COPY utility. The PARALLEL keyword constrains the amount of
parallelism by restricting the maximum number of objects that can be processed
simultaneously. The TAPEUNITS keyword constrains the number of tape drives
that can be dynamically allocated for the COPY command. The TAPEUNITS
keyword can constrain the amount of parallelism if an object requires a number of
tapes such that the number of remaining tapes is insufficient to service another
object.
To calculate the number of threads that you need when you specify the PARALLEL
keyword, use the formula (n * 2 + 1), where n is the number of objects that are to
be processed in parallel, regardless of the total number of objects in the list. If you
do not use the PARALLEL keyword, n is 1 and COPY uses three threads for a
single-object COPY job.
|
|
|
|
|
COPY SCOPE PENDING indicates that you want to copy only those objects in
COPY-pending or informational COPY-pending status. When the DSNUM ALL
option is specified for partitioned objects, and one or more of the partitions are in
COPY-pending or informational COPY-pending status, a copy will be taken of the
entire table space or index space.
|
|
|
|
|
For partitioned objects, if you only want the partitions in COPY-pending status or
informational COPY-pending status to be copied, then a list of partitions should be
specified. It is recommended that you do this by invoking COPY on a LISTDEF list
built with the PARTLEVEL option. An output image copy data set will be created
for each partition that is in COPY-pending or informational COPY-pending status.
|
|
|
|
The LIMIT option on the TEMPLATE statement allows you to switch templates for
output copy data sets. Template switching is most commonly needed to direct
small data sets to DASD and large data sets to TAPE. This allows you to switch to
templates that differ in the UNIT, DSNs, or HSM classes.
The following table spaces cannot be included in a list of table spaces. You must
specify each one as a single object:
v DSNDB01.SYSUTILX
v DSNDB06.SYSCOPY
v DSNDB01.SYSLGRNX
The only exceptions to this restriction are the indexes over these table spaces that
were defined with the COPY YES attribute. You can specify such indexes along
with the appropriate table space.
Related reference
Chapter 31, TEMPLATE, on page 641
134
v The image copy data sets are valid and available for RECOVER, MERGECOPY,
COPYTOCOPY, and UNLOAD.
If a job step that contains more than one COPY statement abends, do not use
TERM UTILITY. Restart the job from the last commit point by using RESTART
instead. Terminating COPY by using TERM UTILITY in this case creates
inconsistencies between the ICF catalog and DB2 catalogs.
|
|
|
An image copy at the table space level with SHRLEVEL(CHANGE) contains new
partitions added by SQL INSERTS after the image copy began. The newly added
partitions are recoverable via the DB2 logs.
|
|
|
|
When you make an image copy of a partition-by-growth table space, the partition
is empty as a result of REORG, SQL delete operations, or recovery to a prior point
in time. The empty partition has a header page and space map pages or system
pages. The COPY utility still copies the empty partition.
|
|
|
Both full and incremental image copies are supported for an XML table space, as
well as SHRLEVEL REFERENCE, SHRLEVEL CHANGE, and the CONCURRENT
options.
|
|
COPY without the CONCURRENT option does not copy empty or unformatted
data pages of an XML table space.
|
|
|
|
If you copy a LOB table space that has a base table space with the NOT LOGGED
attribute, copy the base table space and the LOB table space together so that a
RECOVER TOLASTCOPY of the entire set results in consistent data across the base
table space and all of the associated LOB table spaces.
Chapter 11. COPY
135
|
|
|
|
|
To copy an XML table space with a base table space that has the NOT LOGGED
attribute, all associated XML table spaces must also have the NOT LOGGED
attribute. The XML table space acquires this NOT LOGGED attribute by being
linked to the logging attribute of its associated base table space. You cannot
independently alter the logging attribute of an XML table space.
|
|
|
|
|
|
If the LOG column of the SYSIBM.SYSTABLESPACE record for an XML table space
has the value of X, the logging attributes of the XML table space and its base
table space are linked, and that the logging attribute of both table spaces is NOT
LOGGED. To break the link, alter the logging attribute of the base table space back
to LOGGED, and the logging attribute of both table spaces are changed back to
LOGGED.
Copying indexes
|
|
|
If you copy a COPY YES index of a table space that has the NOT LOGGED
attribute, copy the indexes and table spaces together to ensure that the indexes and
the table space have the same recoverable point.
|
|
|
|
|
|
|
|
|
Any new partitions added by SQL INSERT are not contained in the image copy,
but the newly added partitions are recoverable by the DB2 logs.
|
|
|
|
|
|
|
When the index has the COMPRESS YES attribute, concurrent copies of indexes are
compressed because DFSMSdss is invoked to copy the VSAM linear data sets
(LDS) for the index. Image copies of indexes are not compressed because the index
pages are copied from the DB2 buffer pool. When image copies are taken without
the concurrent option, you can choose to compress the image copies by using
access method compression via DFSMS or by using IDRC if the image copies
reside on tape.
136
137
138
2 (informational)
If the percentage of changed pages is greater than the low CHANGELIMIT
and less than the high CHANGELIMIT value.
3 (informational)
If the percentage of changed pages is greater than or equal to the high
CHANGELIMIT value.
If you specify multiple COPY control statements in one job step, that job step
reports the highest return code from all of the imbedded statements. Basically, the
statement with the highest percentage of changed pages determines the return
code and the recommended action for the entire list of COPY control statements
that are contained in the subsequent job step.
139
Create these copies, so that if the primary image copy is not available, fallback
recovery using the secondary image copy is possible.
|
|
|
|
Improving performance
Certain activities can improve COPY performance.
You can merge a full image copy and subsequent incremental image copies into a
new full copy by running the MERGECOPY utility. After reorganizing a table
space, the first image copy must be a full image copy.
Do not base the decision of whether to run a full image copy or an incremental
image copy on the number of rows that are updated since the last image copy was
taken. Instead, base your decision on the percentage of pages that contain at least
one updated record (not the number of updated records). Regardless of the size of
the table, if more than 50% of the pages contain updated records, use full image
copy (this saves the cost of a subsequent MERGECOPY). To find the percentage of
changed pages, you can execute COPY with the CHANGELIMIT REPORTONLY
option. Alternatively, you can execute COPY CHANGELIMIT to allow COPY to
determine whether a full image copy or incremental copy is required.
140
Using DB2 data compression for table spaces can improve COPY performance
because COPY does not decompress data. The performance improvement is
proportional to the amount of compression.
141
Termination of COPY
You can terminate the COPY utility.
An active or stopped COPY job may be terminated with the TERM UTILITY
command. However, if you issue TERM UTILITY while COPY is in the active or
stopped state, DB2 inserts an ICTYPE=T record in the SYSIBM.SYSCOPY catalog
table for each object that COPY had started processing, but not yet completed.
(Exception: If the COPY utility is already in the UTILTERM phase, the image copy
is considered completed.) For copies that are made with SHRLEVEL REFERENCE,
some objects in the list might not have an ICTYPE=T record. For SHRLEVEL
CHANGE, some objects might have a valid ICTYPE=F, I, or T record, or no record
at all. The COPY utility does not allow you to take an incremental image copy if
an ICTYPE=T record exists. You must make a full image copy.
|
|
|
|
|
|
|
|
|
|
Restart of COPY
You can restart the COPY utility.
Recommendation: Use restart current when possible, because it:
v Is valid for full image copies and incremental copies
v Is valid for a single job step with several COPY control statements
v Is valid for a list of objects
v Requires a minimum of re-processing
v Keeps the DB2 catalog and the integrated catalog facility catalog synchronized
If you do not use the TERM UTILITY command, you can restart a COPY job.
COPY jobs with the CONCURRENT option restart from the beginning, and other
COPY jobs restart from the last commit point. You cannot use RESTART(PHASE)
for any COPY job. If you are restarting a COPY job with uncataloged output data
sets, you must specify the appropriate volumes for the job in the JCL or on the
TEMPLATE utility statement. Doing so could impact your ability to use implicit
restart.
If the recommended procedure is not followed an ABEND 413-1C may occur
during restart of the COPY.
|
|
142
Instead of defining the data sets in the JCL, you can use templates. In the
following example, the preceding job is modified to use a template. In this
example, the name of the template is LOCALDDN. The LOCALDDN template is
identified in the COPY statement by the COPYDDN option.
//STEP1
EXEC DSNUPROC,UID='IUJMU111.COPYTS',
//
UTPROC='',
//
SYSTEM='DSN'
//SYSIN DD *
TEMPLATE LOCALDDN UNIT SYSDA DSN(COPY001F.IFDY01)
SPACE(15,1) CYL DISP(NEW,CATLG,CATLG)
COPY TABLESPACE DSN8D81A.DSN8S81E COPYDDN(LOCALDDN)
/*
Example 2: Making full image copies for local site and recovery
site
The following COPY control statement specifies that COPY is to make primary and
backup full image copies of table space DSN8D91P.DSN8S91C at both the local site
and the recovery site. The COPYDDN option specifies the output data sets for the
Chapter 11. COPY
143
local site, and the RECOVERYDDN option specifies the output data sets for the
recovery site. The PARALLEL option indicates that up to 2 objects are to be
processed in parallel.
The OPTIONS statement at the beginning indicates that if COPY encounters any
errors (return code 8) while making the requested copies, DB2 ignores that
particular item. COPY skips that item and moves on to the next item. For example,
if DB2 encounters an error copying the specified data set to the COPY1 data set,
DB2 ignores the error and tries to copy the table space to the COPY2 data set.
OPTIONS EVENT(ITEMERROR,SKIP)
COPY TABLESPACE DSN8D81P.DSN8S81C
COPYDDN(COPY1,COPY2)
RECOVERYDDN(COPY3,COPY4)
PARALLEL(2)
144
DD
DD
DD
DD
DD
DD
EXEC DSNUPROC,UID='IUJMU111.COPYTS',
UTPROC='',
SYSTEM='DSN'
DSN=C81A.S20001.D2003142.T155241.LP,
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
DSN=C81A.S20001.D2003142.T155241.LB,
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
DSN=C81A.S20001.D2003142.T155241.RP,
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
DSN=C81A.S20001.D2003142.T155241.RB,
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
DSN=C81A.S20002.D2003142.T155241.LP,
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
DSN=C81A.S20002.D2003142.T155241.LB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY7 DD DSN=C81A.S20002.D2003142.T155241.RP,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY8 DD DSN=C81A.S20002.D2003142.T155241.RB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY1 DD DSN=C81A.S20001.D2003142.T155241.LP,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY2 DD DSN=C81A.S20001.D2003142.T155241.LB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY3 DD DSN=C81A.S20001.D2003142.T155241.RP,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY4 DD DSN=C81A.S20001.D2003142.T155241.RB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY5 DD DSN=C81A.S20002.D2003142.T155241.LP,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY6 DD DSN=C81A.S20002.D2003142.T155241.LB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY7 DD DSN=C81A.S20002.D2003142.T155241.RP,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY8 DD DSN=C81A.S20002.D2003142.T155241.RB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY9 DD DSN=C81A.S20003.D2003142.T155241.LP,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY10 DD DSN=C81A.S20003.D2003142.T155241.LB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY11 DD DSN=C81A.S20003.D2003142.T155241.RP,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY12 DD DSN=C81A.S00003.D2003142.T155241.RB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY13 DD DSN=C81A.S00004.D2003142.T155241.LP,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY14 DD DSN=C81A.S00004.D2003142.T155241.LB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY15 DD DSN=C81A.S00004.D2003142.T155241.RP,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY16 DD DSN=C81A.S00004.D2003142.T155241.RB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY17 DD DSN=C81A.S00005.D2003142.T155241.LP,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY18 DD DSN=C81A.S00005.D2003142.T155241.LB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY19 DD DSN=C81A.S00005.D2003142.T155241.RP,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY20 DD DSN=C81A.S00005.D2003142.T155241.RB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY21 DD DSN=C81A.S00006.D2003142.T155241.LP,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY22 DD DSN=C81A.S00006.D2003142.T155241.LB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY23 DD DSN=C81A.S00006.D2003142.T155241.RP,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY24 DD DSN=C81A.S00006.D2003142.T155241.RB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY25 DD DSN=C81A.S00007.D2003142.T155241.LP,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY26 DD DSN=C81A.S00007.D2003142.T155241.LB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY27 DD DSN=C81A.S00007.D2003142.T155241.RP,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//COPY28 DD DSN=C81A.S00007.D2003142.T155241.RB,
//
SPACE=(CYL,(15,1)),DISP=(NEW,CATLG,CATLG)
//SYSIN DD *
COPY
TABLESPACE DSN8D91A.DSN8S91D
COPYDDN (COPY1,COPY2)
RECOVERYDDN (COPY3,COPY4)
INDEX DSN8910.XDEPT1
Chapter 11. COPY
145
COPYDDN (COPY5,COPY6)
RECOVERYDDN (COPY7,COPY8)
INDEX DSN8910.XDEPT2
COPYDDN (COPY9,COPY10)
RECOVERYDDN (COPY11,COPY12)
INDEX DSN8910.XDEPT3
COPYDDN (COPY13,COPY14)
RECOVERYDDN (COPY15,COPY16)
TABLESPACE DSN8D91A.DSN8S91E
COPYDDN (COPY17,COPY18)
RECOVERYDDN (COPY19,COPY20)
INDEX DSN8910.XEMP1
COPYDDN (COPY21,COPY22)
RECOVERYDDN (COPY23,COPY24)
INDEX DSN8910.XEMP2
COPYDDN (COPY25,COPY26)
RECOVERYDDN (COPY27,COPY28)
PARALLEL(4)
SHRLEVEL REFERENCE
/*
|
|
|
|
|
|
|
You can also write this COPY job so that it uses lists and templates, as shown
below. In this example, the name of the template is T1. Note that this TEMPLATE
statement does not contain any space specifications for the dynamically allocated
data sets. Instead, DB2 determines the space requirements. The T1 template is
identified in the COPY statement by the COPYDDN and RECOVERYDDN options.
The name of the list is COPYLIST. This list is identified in the COPY control
statement by the LIST option.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//STEP1
EXEC DSNUPROC,UID='IUJMU111.COPYTS',
//
UTPROC='',
//
SYSTEM='DSN'
//SYSIN DD *
TEMPLATE T2 UNIT(SYSDA) SPACE CYL
DSN(T2.&SN..T&TI..COPY&IC.&LOCREM.)
TEMPLATE T1 UNIT(SYSDA) SPACE CYL
DSN(T1.&SN..T&TI..COPY&IC.&LOCREM.)
LIMIT(5 MB,T2)
LISTDEF COPYLIST
INCLUDE TABLESPACE DSN8D81A.DSN8S81D
INCLUDE INDEX DSN8810.XDEPT1
INCLUDE INDEX DSN8810.XDEPT2
INCLUDE INDEX DSN8810.XDEPT3
INCLUDE TABLESPACE DSN8D81A.DSN8S81E
INCLUDE INDEX DSN8810.XEMP1
INCLUDE INDEX DSN8810.XEMP2
COPY LIST COPYLIST COPYDDN(T1,T1)
RECOVERYDDN(T1,T1)
PARALLEL(4) SHRLEVEL REFERENCE
/*
Figure 17. Example of using a list and template to make full image copies of multiple objects
|
|
|
|
146
|
|
|
|
performed. The output data set for table space SMALL.TS will be allocated on
UNIT=SYSALLDA. Table space LARGE.TS is larger than this limit so the template
is switched to the LARGETP template. The output data set for table space
LARGE.TS will be allocated on UNIT=TAPE.
TEMPLATE LARGETP DSN &DB..&TS..D&DA..T&TI. UNIT=TAPE
TEMPLATE SMALLTP DSN &DB..&TS..D&DA..T&TI. UNIT=SYSALLDA LIMIT( 20 CYL, LARGETP )
COPY TABLESPACE SMALL.TS COPYDDN( SMALLTP )
COPY TABLESPACE LARGE.TS COPYDDN( SMALLTP )
Note that the DSN option of the TEMPLATE statement identifies the names of the
data sets to which the copies are to be written.
Each of the preceding COPY jobs create a point of consistency for the table spaces
and their indexes. You can subsequently use the RECOVER utility with the
TOLOGPOINT option to recover all of these objects.
EXEC DSNUPROC,SYSTEM=DSN
DD *
TEMPLATE A1 DSN(&DB..&SP..COPY1) UNIT CART STACK YES
TEMPLATE A2 DSN(&DB..&SP..COPY2) UNIT CART STACK YES
COPY PARALLEL 2 TAPEUNITS 2
TABLESPACE DSN8D81A.DSN8S81D COPYDDN(A1)
INDEXSPACE DSN8810.XDEPT COPYDDN(A1)
TABLESPACE DSN8D81A.DSN8S81E COPYDDN(A2)
INDEXSPACE DSN8810.YDEPT COPYDDN(A2)
Although use of templates is recommended, you can also define the output data
sets by coding JCL DD statements, as in the following example. This COPY control
statement also specifies a list of objects to be processed in parallel, but in this case,
the data sets are defined by DD statements. In each DD statement, notice the
parameters for the VOLUME option. These values show that the data sets are
defined on three different tape devices as follows:
v The first tape device contains data sets that are defined by DD statements DD1
and DD4. (For DD4, the VOLUME option has a value of *.DD1 for the REF
parameter.)
v A second tape device contains data sets that are defined by DD statements DD2
and DD3. (For DD3, the VOLUME option has a value of *.DD3 for the REF
parameter.)
v A third tape device contains the data set that is defined by DD statement DD5.
147
The following table spaces are to be processed in parallel on two different tape
devices:
v DSN8D81A.DSN8S81D on the device that is defined by the DD1 DD statement
and the device that is defined by the DD5 DD statement
v DSN8D81A.DSN8S81E on the device that is defined by the DD2 DD statement
Copying of the following tables spaces must wait until processing has completed
for DSN8D81A.DSN8S81D and DSN8D81A.DSN8S81E:
v DSN8D81A.DSN8S81F on the device that is defined by the DD2 DD statement
after DSN8D81A.DSN8S81E completes processing
v DSN8D81A.DSN8S81G on the device that is defined by the DD1 DD statement
after DSN8D81A.DSN8S81D completes processing
//COPY1A
EXEC DSNUPROC,SYSTEM=DSN
//DD1 DD DSN=DB1.TS1.CLP,
//
DISP=(NEW,CATLG,CATLG),
//
UNIT=TAPE,LABEL=(1,SL),
//
VOLUME=(,RETAIN)
//DD2 DD DSN=DB2.TS2.CLP,
//
DISP=(NEW,CATLG,CATLG),
//
UNIT=TAPE,LABEL=(1,SL),
//
VOLUME=(,RETAIN)
//DD3 DD DSN=DB3.TS3.CLB.BACKUP,
//
DISP=(NEW,CATLG,CATLG),
//
UNIT=TAPE,LABEL=(2,SL),
//
VOLUME=(,RETAIN,REF=*.DD2)
//DD4 DD DSN=DB4.TS4.CLB.BACKUP,
//
DISP=(NEW,CATLG,CATLG),
//
UNIT=TAPE,LABEL=(2,SL),
//
VOLUME=(,RETAIN,REF=*.DD1)
//DD5 DD DSN=DB1.TS1.CLB.BACKUP,
//
DISP=(NEW,CATLG,CATLG),
//
UNIT=TAPE,LABEL=(1,SL),
//
VOLUME=(,RETAIN)
COPY PARALLEL 2 TAPEUNITS 3
TABLESPACE DSN8D81A.DSN8S81D COPYDDN(DD1,DD5)
TABLESPACE DSN8D81A.DSN8S81E COPYDDN(DD2)
TABLESPACE DSN8D81A.DSN8S81F COPYDDN(DD3)
TABLESPACE DSN8D81A.DSN8S81G COPYDDN(DD4)
Figure 18. Example of making full image copies of a list of objects in parallel on tape
148
Four tape devices are allocated for this COPY job: the JCL allocates two tape
drives, and the TAPEUNITS 2 option in the COPY statement indicates that two
tape devices are to be dynamically allocated. Note that the TAPEUNITS option
applies only to those tape devices that are dynamically allocated by the
TEMPLATE statement.
Recommendation: Although this example shows how to use both templates and
DD statements, use only templates, if possible.
//COPY1D
EXEC DSNUPROC,SYSTEM=DSN
//DD1 DD DSN=DB1.TS1.CLP,
//
DISP=(,CATLG),
//
UNIT=3490,LABEL=(1,SL)
//
VOLUME=(,RETAIN)
//DD2 DD DSN=DB2.TS2.CLB.BACKUP,
//
DISP=(,CATLG),
//
UNIT=3490,LABEL=(2,SL)
//
VOLUME=(,RETAIN)
//SYSIN
DD *
TEMPLATE A1 DSN(&DB..&SN..COPY1) UNIT CART STACK YES
TEMPLATE A2 DSN(&DB..&SN..COPY2) UNIT CART STACK YES
COPY PARALLEL 2 TAPEUNITS 2
TABLESPACE DSN8D81A.DSN8S81D COPYDDN(DD1,DD2)
TABLESPACE DSN8D81A.DSN8S81E COPYDDN(A1,A2)
Figure 19. Example of using both JCL-defined and template-defined data sets to copy a list
of objects on a tape
EXEC DSNUPROC,SYSTEM=DSN
DD *
LISTDEF PAYROLL INCLUDE TABLESPACES TABLESPACE DBPAYROLL.*
INCLUDE BOTH
TEMPLATE LOCAL DSN(&DB..©..LOCAL) (+1) UNIT CART STACK YES
TEMPLATE REMOTE DSN(&DB..©..REMOTE) (+1) UNIT CART STACK YES
COPY LIST PAYROLL PARALLEL(10) TAPEUNITS(8)
COPYDDN(LOCAL) RECOVERYDDN(REMOTE)
In the preceding example, the utility determines the number of tape streams to use
by dividing the value for TAPEUNITS (8) by the number of output data sets (2) for
a total of 4 in this example. For each tape stream, the utility attaches one subtask.
The list of objects is sorted by size and processed in descending order. The first
subtask to finish processes the next object in the list. In this example, the
PARALLEL(10) option limits the number of objects to be processed in parallel to 10
and attaches four subtasks. Each subtask copies the objects in the list in parallel to
two tape drives, one for the primary and one for the recovery output data sets.
149
150
EXEC DSNUPROC,SYSTEM=DSN
DD DSN=COPY1.PRINT1,DISP=(NEW,CATLG,CATLG),
SPACE=(4000,(20,20),,,ROUND),UNIT=SYSDA,VOL=SER=DB2CC5
DD DSN=COPY1.PRINT2,DISP=(NEW,CATLG,CATLG),
SPACE=(4000,(20,20),,,ROUND),UNIT=SYSDA,VOL=SER=DB2CC5
DD *
SYSCOPY1 DSN &DB..&TS..COPY&IC.&LR.&PB..D&DATE..T&TIME.
UNIT(SYSDA) DISP (MOD,CATLG,CATLG)
LISTDEF COPYLIST INCLUDE TABLESPACE DSN8D81A.DSN8S81D
INCLUDE TABLESPACE DSN8D81A.DSN8S81P
COPY LIST COPYLIST
COPYDDN (SYSCOPY1)
CONCURRENT
Figure 20. Example of invoking DFSMSdss concurrent copy with the COPY utility
151
CHANGELIMIT option for that table space. For example, if the percentage of
changed pages for table space TPIQUD01 is equal to or greater than 6.7%, COPY
is to take a full image copy.
v Take an incremental image copy of each specified table space if the percentage of
changed pages falls in the range between the specified decimal percentage
values for the CHANGELIMIT option for that table space. For example, if the
percentage of changed pages for table space TLIQUDA1 is greater than 7.9% and
less than 25.3%, COPY is to take an incremental image copy.
v Do not take an image copy of each specified table space if the percentage of
changed pages is equal to or less than the lowest decimal percentage value for
the CHANGELIMIT option for that table space. For example, if the percentage of
changed pages for table space TLIQUDA2 is equal to or less than 2.2%, COPY is
not to take an incremental image copy.
v Take full image copies of index spaces IPIQUD01, IXIQUD02, IUIQUD03,
IXIQUDA1, IXIQUDA2, IXIQUDA3, and IXIQUDA4.
COPY
TABLESPACE DBIQUD01.TPIQUD01
COPYDDN(COPYTB1)
TABLESPACE DBIQUD01.TLIQUDA1
COPYDDN(COPYTA1)
TABLESPACE DBIQUD01.TLIQUDA2
COPYDDN(COPYTA2)
TABLESPACE DBIQUD01.TLIQUDA3
COPYDDN(COPYTA3)
TABLESPACE DBIQUD01.TLIQUDA4
COPYDDN(COPYTA4)
INDEXSPACE DBIQUD01.IPIQUD01
COPYDDN(COPYIX1)
INDEXSPACE DBIQUD01.IXIQUD02
COPYDDN(COPYIX2)
INDEXSPACE DBIQUD01.IUIQUD03
COPYDDN(COPYIX3)
INDEXSPACE DBIQUD01.IXIQUDA1
COPYDDN(COPYIXA1)
INDEXSPACE DBIQUD01.IXIQUDA2
COPYDDN(COPYIXA2)
INDEXSPACE DBIQUD01.IXIQUDA3
COPYDDN(COPYIXA3)
INDEXSPACE DBIQUD01.IXIQUDA4
COPYDDN(COPYIXA4)
SHRLEVEL REFERENCE
Figure 22. Example of copying LOB table spaces together with related objects
152
//STEP2
EXEC DSNUPROC,UID='JULTU225.COPY',
//
UTPROC='',
//
SYSTEM='SSTR'
//SYSIN
DD *
TEMPLATE COPYTEM1
UNIT SYSDA
DSN 'JULTU225.GDG.LOCAL.&PB.(+1)'
MODELDCB JULTU225.MODEL
TEMPLATE COPYTEM2
UNIT SYSDA
DSN 'JULTU225.GDG.REMOTE.&PB.(+1)'
MODELDCB JULTU225.MODEL
COPY TABLESPACE DBLT2501.TPLT2501
FULL YES
COPYDDN (COPYTEM1,COPYTEM1)
RECOVERYDDN (COPYTEM2,COPYTEM2)
SHRLEVEL REFERENCE
The following control statement indicates that COPY is to copy only clone table
data in the specified table spaces or indexes.
COPY SHRLEVEL REFERENCE CLONE
TABLESPACE DBIQUD01.TPIQUD01
COPYDDN(COPYTB1)
TABLESPACE DBIQUD01.TLIQUDA1
COPYDDN(COPYTA1)
TABLESPACE DBIQUD01.TLIQUDA2
COPYDDN(COPYTA2)
TABLESPACE DBIQUD01.TLIQUDA3
COPYDDN(COPYTA3)
TABLESPACE DBIQUD01.TLIQUDA4
COPYDDN(COPYTA4)
INDEXSPACE DBIQUD01.IPIQUD01
COPYDDN(COPYIX1)
The following control statement indicates that COPY is to copy only the objects
that have been updated. SCOPE PENDING indicates that you want to copy only
those objects in COPY-pending or informational COPY-pending status.
COPY SHRLEVEL REFERENCE
TABLESPACE DBIQUD01.TPIQUD01 DSNUM
COPYDDN(COPYTB1)
TABLESPACE DBIQUD01.TLIQUDA1 DSNUM
COPYDDN(COPYTA1)
TABLESPACE DBIQUD01.TLIQUDA2 DSNUM
COPYDDN(COPYTA2)
TABLESPACE DBIQUD01.TLIQUDA3 DSNUM
COPYDDN(COPYTA3)
TABLESPACE DBIQUD01.TLIQUDA4 DSNUM
COPYDDN(COPYTA4)
INDEXSPACE DBIQUD01.IPIQUD01 DSNUM
COPYDDN(COPYIX1)PARALLEL(4)
SCOPE PENDING
/*
ALL CHANGELIMIT(3.3,6.7)
ALL CHANGELIMIT(7.9,25.3)
ALL CHANGELIMIT(2.2,4.3)
ALL CHANGELIMIT(1.2,9.3)
ALL CHANGELIMIT(2.2,4.0)
ALL
153
154
Output
Output from the COPYTOCOPY utility consists of:
v Up to three sequential data sets that contain the image copy. If the copy base is a
FlashCopy, four sequential copies can be made.
v Rows in the SYSIBM.SYSCOPY catalog table that describe the image copy data
sets that are available to the RECOVER utility. Your installations responsible for
ensuring that these data sets are available if the RECOVER utility requests them.
The entries for SYSCOPY columns remain the same as the original entries in the
SYSCOPY row when the COPY utility recorded them. The COPYTOCOPY job
inserts values in the columns DSNAME, GROUP_MEMBER, JOBNAME, AUTHID,
DSVOLSER, and DEVTYPE.
Restriction: COPYTOCOPY does not support the following catalog and directory
objects:
v DSNDB01.SYSUTILX, and its indexes
v DSNDB01.DBD01, and its indexes
v DSNDB06.SYSCOPY, and its indexes
An image copy from a COPY job with the CONCURRENT option cannot be
processed by COPYTOCOPY.
COPYTOCOPY does not check the recoverability of an object.
Authorization required
To execute this utility, you must use a privilege set that includes one of the
following authorities:
v IMAGCOPY privilege for the database
155
Syntax diagram
COPYTOCOPY
LIST listdef-name
from-copy-spec
data-set-spec
CLONE
ts-num-spec
index-name-spec
from-copy-spec
data-set-spec
ts-num-spec:
DSNUM ALL
TABLESPACE
table-space-name
database-name.
index-name-spec:
156
DSNUM
integer
(1)
DSNUM ALL
INDEXSPACE
INDEX
index-space-name
database-name.
index-name
creator-id.
(2)
DSNUM
integer
Notes:
1
from-copy-spec:
FROMLASTCOPY
FROMLASTFULLCOPY
(1)
FROMLASTINCRCOPY
(2)
FROMCOPY
dsn
FROMVOLUME
CATALOG
volser
FROMSEQNO
Notes:
1
data-set-spec:
(1)
COPYDDN(
(2)
ddname1
)
,ddname2
RECOVERYDDN(
ddname3
,ddname2
)
,ddname4
,ddname4
RECOVERYDDN(
ddname3
)
,ddname4
,ddname4
Notes:
1
Use this option if you want to make a local site primary copy from one of the recovery site
copies.
You can specify up to three DD names for both the COPYDDN and RECOVERYDDN options
combined.
157
Option descriptions
LIST listdef-name
Specifies the name of a previously defined LISTDEF list name. The utility
allows one LIST keyword for each COPYTOCOPY control statement. Do not
specify LIST with either the INDEX or TABLESPACE keywords. DB2 invokes
COPYTOCOPY once for the entire list. This utility will only process clone data
if the CLONE keyword is specified. The use of CLONED YES on the LISTDEF
statement is not sufficient.
TABLESPACE
Specifies the table space (and, optionally, the database it belongs to) that is to
be copied. database-name is the name of the database that the table space
belongs to. The default value is DSNDB04.
table-space-name is the name of the table space to be copied.
INDEXSPACE database-name.index-space-name
Specifies the qualified name of the index space that is to be copied; the name is
obtained from the SYSIBM.SYSINDEXES table. Define the index space with the
COPY YES attribute.
database-name optionally specifies the name of the database that the index space
belongs to. The default value is DSNDB04.
index-space-name specifies the name of the index space that is to be copied.
INDEX creator-id.index-name
Specifies the index that is to be copied. Enclose the index name in quotation
marks if the name contains a blank.
creator-id optionally specifies the creator of the index. The default value is the
user identifier for the utility.
index-name specifies the name of the index that is to be copied.
DSNUM
Identifies a partition or data set, within the table space or the index space, that
is to be copied. The keyword ALL specifies that the entire table space or index
space is to be copied.
You cannot specify DSNUM for nonpartitioned indexes.
ALL
Specifies that the entire table space or index space is to be copied. You
must use ALL for a nonpartitioned secondary index.
integer
Is the number of a partition or data set that is to be copied.
An integer value is not valid for nonpartitioned secondary indexes.
For a partitioned table space or index space, the integer is its partition
number. The maximum is 4096.
For a nonpartitioned table space, find the integer at the end of the data
set name as cataloged in the VSAM catalog. The data set name has the
following format:
|
catname.DSNDBx.dbname.spacename.y000Z.Annn
In this format:
catname
Is the VSAM catalog name or alias.
158
Is C or D.
dbname
Is the database name.
spacename
Is the table space or index space name.
Is I or J.
Is 1 or 2.
nnn
159
noncataloged data set. Specify the first vol-ser in the SYSCOPY record to
locate a data set that is stored on multiple tape volumes.If an individual
volume serial number contains leading zeros, it must be enclosed in single
quotation marks.
FROMSEQNO n
Identifies the image copy data set by its file sequence number. n is the file
sequence number.
COPYDDN (ddname1,ddname2)
Specifies a DD name (ddname) or a TEMPLATE name for the primary (ddname1)
and backup (ddname2) copied data sets for the image copy at the local site. If
ddname2 is specified by itself, COPYTOCOPY expects the local site primary
image copy to exist. If it does not exist, error message DSNU1401 is issued and
the process for the object is terminated.
Recommendation: Catalog all of your image copy data sets.
You cannot have duplicate image copy data sets. If the DD statement identifies
a noncataloged data set with the same name, volume serial, and file sequence
number as one that is already recorded in SYSIBM.SYSCOPY, COPYTOCOPY
issues a message and no copy is made. If the DD statement identifies a
cataloged data set with only the same name, no copy is made. For cataloged
image copy data sets, you must specify CATLG for the normal termination
disposition in the DD statement; for example, DISP=(MOD,CATLG,CATLG).
The DSVOLSER field of the SYSCOPY entry is blank.
When the image copy data set is going to a tape volume, specify VOL=SER
parameter in the DD statement.
The COPYDDN keyword specifies either a DD name or a TEMPLATE name
specification from a previous TEMPLATE control statement. If utility
processing detects that the specified name is both a DD name in the current job
step and a TEMPLATE name, the utility uses the DD name.
RECOVERYDDN (ddname3,ddname4)
Specifies a DD name (ddname) or a TEMPLATE name for the primary (ddname3)
and backup (ddname4) copied data sets for the image copy at the recovery site.
If ddname4 is specified by itself, COPYTOCOPY expects the recovery site
primary image copy to exist. If this image copy does not exist, error message
DSNU1401 is issued and the process for the object is terminated.
You cannot have duplicate image copy data sets. The same rules apply for
RECOVERYDDN as for COPYDDN.
The RECOVERYDDN keyword specifies either a DD name or a TEMPLATE
name specification from a previous TEMPLATE control statement. If utility
processing detects that the specified name is both a DD name in the current job
step and a TEMPLATE name, the utility uses the DD name.
CLONE
Indicates that COPYTOCOPY is to process only image copy data sets that were
taken against clone tables or indexes on clone tables. This utility will only
process clone data if the CLONE keyword is specified. The use of CLONED
YES on the LISTDEF statement is not sufficient.
|
|
|
|
|
160
Related reference
Chapter 15, LISTDEF, on page 185
Chapter 31, TEMPLATE, on page 641
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
Output copies
Yes
From one to three output data sets that
contain the resulting image copy data sets.
Specify their DD names with the COPYDDN
and RECOVERYDDN options of the utility
control statement.
The following objects are named in the utility control statement and do not require
DD statements in the JCL:
Table space or Index space
Object that is to be copied. (If you want to copy only certain partitions in a
partitioned table space, use the DSNUM option in the control statement.)
DB2 catalog objects
Objects in the catalog that COPYTOCOPY accesses. The utility records each
copy in the DB2 catalog table SYSIBM.SYSCOPY.
Input image copy data set
This information is accessed through the DB2 catalog. COPYTOCOPY
retains all tape mounts for you. You do not need to code JCL statements to
retain tape mounts. If the image copy data sets that are used by
COPYTOCOPY reside on the same tape, you do not need to remove the
tape.
161
Claims
The following table shows which claim classes COPYTOCOPY claims on the target
object.
Table 21. Claim classes of COPYTOCOPY operations.
Target
COPYTOCOPY
UTRW
Legend:
v UTRW - Utility restrictive state - read-write access allowed
Compatibility
The following table documents which utilities can run concurrently with
COPYTOCOPY on the same target object. The target object can be a table space, an
index space, or a partition of a table space or index space. If compatibility depends
on particular options of a utility, that information is also documented in the table.
162
Compatible with
COPYTOCOPY?
CHECK DATA
Yes
CHECK INDEX
Yes
CHECK LOB
Yes
COPY
No
DIAGNOSE
Yes
LOAD
No
MERGECOPY
No
MODIFY
No
QUIESCE
Yes
REBUILD INDEX
Yes
RECOVER
No
REORG INDEX
No
REORG TABLESPACE
No
REPAIR
Yes
REPORT
Yes
RUNSTATS INDEX
Yes
RUNSTATS TABLESPACE
Yes
STOSPACE
Yes
UNLOAD
Yes
The COPYTOCOPY utility makes a copy from an existing image copy and writes
pages from the image copy to the output data sets. The JCL for the utility job must
include DD statements or a template for the output data sets. If the object consists
of multiple data sets and all are copied in one job, the copies reside in one physical
sequential output data set.
163
If you specify the FROMCOPY keyword and the specified data set is not found in
SYSIBM.SYSCOPY, COPYTOCOPY issues message DSNU1401I. Processing for the
object then terminates.
164
Columns that are inserted by COPYTOCOPY are the same as those of the original
entries in SYSCOPY row when the COPY utility recorded them. Except for
columns GROUP_MEMBER, JOBNAME, AUTHID, DSNAME, DEVTYPE, and
DSVOLSER, the columns are those of the COPYTOCOPY job. When
COPYTOCOPY is invoked at the partition level (DSNUM n) and the input data set
is an inline copy that was created by the REORG of a range of partitions,
COPYTOCOPY inserts zeros in the HIGHDSNUM and LOWDSNUM columns of
the SYSCOPY record.
165
If you plan to use SMS, catalog all image copies. Never maintain cataloged and
uncataloged image copies that have the same name.
|
|
|
For example, image copies of the following table spaces with their FSNs are
stacked on TAPE1:
v DB2.TS1 FSN=1
v DB2.TS2 FSN=2
v DB2.TS3 FSN=3
v DB2.TS4 FSN=4
In the following statements, COPYTOCOPY uses a template for the output data
set:
//COPYTOCOPY EXEC DSNUPROC,SYSTEM=V71A
//SYSIN
DD *
TEMPLATE A1 &DB..&SP..COPY1 TAPE UNIT CART STACK YES
COPYTOCOPY
TABLESPACE DB1.TS4
LASTFULL
RECOVERYDDN(A1)
TABLESPACE DB1.TS1
LASTFULL
166
RECOVERYDDN(A1)
TABLESPACE DB1.TS2
LASTFULL
RECOVERYDDN(A1)
TABLESPACE DB1.TS3
LASTFULL
RECOVERYDDN(A1)
As a result, the utility sorts the objects by FSN and processes them in the following
order:
v DB1.TS1
v DB1.TS2
v DB1.TS3
v DB1.TS4
If the output data sets are defined by JCL, the utility gives stacking preference to
the output data sets over input data sets. If the input data sets are not stacked, the
utility sorts the objects by size in descending order.
Termination of COPYTOCOPY
You can use the TERM UTILITY command to terminate a COPYTOCOPY job
167
168
EXEC DSNUPROC,UID='JUKQU2BP.C2C1',
UTPROC='',
SYSTEM='SSTR'
DD *
TEMPLATE C2C1_T1
DSN(JUKQU2BP.C2C1.LB.&SN.)
DISP(NEW,CATLG,CATLG)
UNIT(SYSDA)
TEMPLATE C2C1_T2
DSN(JUKQU2BP.C2C1.RP.&SN.)
DISP(NEW,CATLG,CATLG)
UNIT(SYSDA)
TEMPLATE C2C1_T3
DSN(JUKQU2BP.C2C1.RB.&SN.)
DISP(NEW,CATLG,CATLG)
UNIT(SYSDA)
COPYTOCOPY TABLESPACE DBKQBP01.TPKQBP01
FROMCOPY JUKQU2BP.COPY1.STEP1.TP01
FROMVOLUME SCR03
COPYDDN(,C2C1_T1)
RECOVERYDDN(C2C1_T2,C2C1_T3)
/*
Figure 23. Example of identifying an uncataloged image copy data set
169
|
|
|
|
|
|
|
|
The OPTIONS PREVIEW statement before the LISTDEF statement is used to force
the CPY1 list contents to be included in the output. For long lists, using this
statement is not recommended, because it might cause the output to be too long.
The OPTIONS OFF statement ends the PREVIEW mode processing, so that the
following TEMPLATE and COPYTOCOPY jobs run normally.
|
|
|
|
|
|
|
|
|
|
OPTIONS PREVIEW
LISTDEF CPY1 INCLUDE TABLESPACES TABLESPACE DBA906*.T*A906*
INCLUDE INDEXSPACES COPY YES INDEXSPACE ADMF001.I?A906*
OPTIONS OFF
TEMPLATE T4 UNIT(3B0)
DSN(T4.&SN..T&TI..COPY&IC.&LOCREM.)
TEMPLATE T3 UNIT(SYSDA) SPACE CYL
DSN(T3.&SN..T&TI..COPY&IC.&LOCREM.)
LIMIT(5 MB,T4)
COPYTOCOPY LIST CPY1 COPYDDN(T3,T3)
|
|
|
|
|
|
|
|
|
|
|
LISTDEF C2C1_LIST
INCLUDE
INCLUDE
INCLUDE
INCLUDE
INCLUDE
INCLUDE
170
TABLESPACES
INDEXSPACES
INDEXSPACES
TABLESPACES
INDEXSPACES
INDEXSPACES
TABLESPACE
INDEXSPACE
INDEXSPACE
TABLESPACE
INDEXSPACE
INDEXSPACE
DBKQBS01.TPKQBS01
DBKQBS01.IPKQBS11
DBKQBS01.IXKQBS12
DBKQBS02.TSKQBS02
DBKQBS02.IXKQBS21
DBKQBS02.IXKQBS22
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEMPLATE C2C1_T1
DSN(JUKQU2BS.C2C1.LB.&SN.)
DISP(NEW,CATLG,CATLG)
UNIT(SYSDA)
TEMPLATE C2C1_T2
DSN(JUKQU2BS.C2C1.RP.&SN.)
DISP(NEW,CATLG,CATLG)
UNIT(SYSDA)
TEMPLATE C2C1_T3
DSN(JUKQU2BS.C2C1.RB.&SN.)
DISP(NEW,CATLG,CATLG)
UNIT(SYSDA)
COPYTOCOPY LIST C2C1_LIST
FROMLASTFULLCOPY
COPYDDN(,C2C1_T1)
RECOVERYDDN(C2C1_T2,C2C1_T3)
CLONE
171
172
Interpreting output
One intended use of this utility is to aid in determining and correcting system
problems. When diagnosing DB2 problems, you might need to refer to licensed
documentation to interpret output from this utility.
Authorization required
To execute this utility for options which access relational data, you must use a
privilege set that includes one of the following authorizations:
v REPAIR privilege for the database
v DBADM or DBCTRL authority for the database. If the object on which the utility
operates is in an implicitly created database, DBADM authority on the implicitly
created database or DSNDB04 is required.
v SYSCTRL or SYSADM authority
An ID with installation SYSOPR authority can execute the DIAGNOSE utility on a
table space in the DSNDB01 or DSNDB06 database.
An ID with installation SYSADM authority can execute the DIAGNOSE utility
with the WAIT statement option on any table space.
Syntax diagram
DIAGNOSE
diagnose statement
END
diagnose statement:
173
,
ALLDUMPS
,
TYPE( integer
)
( Xabend-code
)
NODUMPS
,
( Xabend-code
)
display statement
wait statement
abend statement
display statement:
DISPLAY
OBD
table-space-name
database-name .
ALL
TABLES
INDEXES
SYSUTIL
MEPL
AVAILABLE
DBET
DATABASE database-name
TABLESPACE
database-name.
INDEX index-name
CLONE
table-space-name
CLONE
wait statement:
WAIT
MESSAGE message-id
INSTANCE integer
TRACEID
Xtrace-id
integer
INSTANCE
integer
abend statement:
ABEND
MESSAGE
message-id
INSTANCE integer
TRACEID
174
Xtrace-id
integer
INSTANCE
integer
NODUMP
Option descriptions
TYPE(integer, ...)
Specifies one or more types of diagnose that you want to perform.
integer is the number of types of diagnoses. The maximum number of types is
32. IBM Software Support defines the types as needed to diagnose problems
with IBM utilities.
ALLDUMPS(Xabend-code, ...)
Forces a dump to be taken in response to any utility abend code.
Xabend-code is a member of a list of abend codes to which the scope of
ALLDUMPS is limited.
abend-code is a hexadecimal value.
NODUMPS(Xabend-code, ...)
Suppresses the dump for any utility abend code.
Xabend-code is a member of a list of abend codes to which the scope of
NODUMPS is limited.
abend-code is a hexadecimal value.
DISPLAY
Formats the specified database items using SYSPRINT.
OBD database-name.table-space-name
Formats the object descriptor (OBD) of the table space.
database-name is the name of the database in which the table space belongs.
table-space-name is the name of the table space whose OBD is to be
formatted.
ALL
Formats all OBDs of the table space. The OBD of any object that is
associated with the table space is also formatted.
TABLES
Formats the OBDs of all tables in the specified table spaces.
INDEXES
Formats the OBDs of all indexes in the specified table spaces.
SYSUTIL
Formats every record from SYSIBM.SYSUTIL. This directory table stores
information about all utility jobs.
MEPL
Dumps the module entry point lists (MEPLs) to SYSPRINT.
|
|
|
|
AVAILABLE
Displays the utilities that are installed on this subsystem in both bitmap
and readable format. The presence or absence of the utility products
5655-N97 (IBM DB2 Utilities Suite for z/OS) affects the results of this
display. See message DSNU862I for the output of this display.
DBET
Dumps the contents of a database exception table (DBET) to SYSPRINT.
DATABASE database-name
Dumps the DBET entry that is associated with the specified database.
database-name is the name of the database.
Chapter 13. DIAGNOSE
175
TABLESPACE database-name.table-space-name
Dumps the DBET entry that is associated with the specified table
space.
database-name is the name of the database.
table-space-name is the name of the table space.
INDEX creator-name.index-name
Dumps the DBET entry that is associated with the specified index.
creator-name is the ID of the creator of the index.
index-name is the name of the index.
Enclose the index name in quotation marks if the name contains a
blank.
CLONE
Indicates that DIAGNOSE is to display information for only the specified
objects that are clone tables, table spaces that contain clone tables, indexes
on clone tables, or index spaces that contain indexes on clone tables.
|
|
|
|
WAIT
Suspends utility execution when it encounters the specified utility message or
utility trace ID. DIAGNOSE issues a message to the console and utility
execution does not resume until the operator replies to that message, the utility
job times out, or the utility job is canceled. This waiting period allows events
to be synchronized while you are diagnosing concurrency problems. The utility
waits for the operator to reply to the message, allowing the opportunity to
time or synchronize events.
If neither the utility message nor the trace ID are encountered, processing
continues.
ABEND
Forces an abend during utility execution if the specified utility message or
utility trace ID is issued.
If neither the utility message nor the trace ID are encountered, processing
continues.
NODUMP
Suppresses the dump that is generated by an abend of DIAGNOSE.
MESSAGE message-id
Specifies a DSNUxxx or DSNUxxxx message that causes a wait or an abend to
occur when that message is issued.
message-id is the message, in the form of Uxxx or Uxxxx.
INSTANCE integer
Specifies that a wait or an abend is to occur when the MESSAGE option
message has been encountered a specified number of times. If INSTANCE
is not specified, a wait or abend occurs each time that the message is
encountered.
integer is the number of times that a message is to be encountered before a
wait or an abend occurs.
TRACEID trace-id
Specifies a trace ID that causes a wait or an abend to occur when the ID is
encountered. You can find valid trace IDs can be found in data set
prefix.SDSNSAMP(DSNWEIDS).
176
trace-id is a trace ID that is associated with the utility trace (RMID21). You can
specify trace-id in either decimal (integer) or hexadecimal (Xtrace-id) format.
INSTANCE integer
Specifies that a wait or an abend is to occur when the TRACEID option
has been encountered a specified number of times. If INSTANCE is not
specified, a wait or abend occurs each time that the trace ID is
encountered.
integer is the number of times that a trace ID is to be encountered before a
wait or an abend occurs.
END
Ends DIAGNOSE processing.
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
The following objects are named in the utility control statement and do not require
DD statements in the JCL:
Database
Database about which DIAGNOSE is to gather diagnosis information.
Table space
Table space about which DIAGNOSE is to gather diagnosis information.
Index space
Index about which DIAGNOSE is to gather diagnosis information.
177
DIAGNOSE can force a utility to abend when a specific message is issued. To force
an abend when unique-index or referential-constraint violations are detected, you
must specify the message that is issued when the error is encountered. Specify this
message by using the MESSAGE option of the ABEND statement.
Instead of using a message, you can force an abend by using the TRACEID option
of the ABEND statement to specify a trace IFCID that is associated with the utility
to force an abend.
Use the INSTANCE keyword to specify the number of times that the specified
message or trace record is to be generated before the utility abends.
The following control statement forces a dump for any utility abend that occurs
during the execution of the specified COPY job. The DIAGNOSE END option ends
DIAGNOSE processing.
DIAGNOSE
ALLDUMPS
COPY TABLESPACE DSNDB06.SYSDBASE
DIAGNOSE END
178
179
//STEP2
EXEC DSNUPROC,UID='DH109012.C2C01',
//
UTPROC='',
//
SYSTEM='SSTR'
//COPY2
DD DSN=DH109012.C2C01.STEP2.COPY2,DISP=(MOD,CATLG,CATLG),
//
UNIT=SYSDA,SPACE=(1000,(20,20),,,ROUND)
//COPY3
DD DSN=DH109012.C2C01.STEP2.COPY3,DISP=(MOD,CATLG,CATLG),
//
UNIT=SYSDA,SPACE=(1000,(20,20),,,ROUND)
//COPY4
DD DSN=DH109012.C2C01.STEP2.COPY4,DISP=(MOD,CATLG,CATLG),
//
UNIT=SYSDA,SPACE=(1000,(20,20),,,ROUND)
//SYSIN
DD *
DIAGNOSE WAIT TRACEID X'2E6F' INSTANCE 51
COPYTOCOPY TABLESPACE DBA91201.TPA91201 DSNUM 1
FROMLASTFULLCOPY COPYDDN(,COPY2)
RECOVERYDDN(COPY3,COPY4)
DIAGNOSE END
/*
Figure 26. Example of suspending utility execution
|
|
|
|
180
Output
The EXEC SQL control statement produces a result table when you specify a
cursor.
Authorization required
The EXEC SQL statement itself requires no privileges to execute. The authorization
rules that are defined for the dynamic preparation of the SQL statement specified
by EXECUTE IMMEDIATE apply.
181
Syntax diagram
EXEC
SQL
declare-cursor-spec
non-select dynamic SQL statement
ENDEXEC
declare-cursor-spec:
DECLARE
select-statement
Option descriptions
cursor-name
Specifies the cursor name. The name must not identify a cursor that is already
declared within the same input stream. When using the DB2 cross-loader
function to load data from a remote server, you must identify the cursor with a
three-part name. Cursor names that are specified with the EXEC SQL utility
cannot be longer than eight characters.
select-statement
Specifies the result table for the cursor. This statement can be any valid SQL
SELECT statement, including joins, unions, conversions, aggregations, special
registers, and user-defined functions. The result table cannot include XML
columns.
|
|
|
|
182
UPDATE
Each SQL statement runs as a separate thread. When the utility executes the
SQL statement, the specified statement string is parsed and checked for errors.
If the SQL statement is invalid, EXEC SQL does not execute the statement and
reports the error condition. If the SQL statement is valid, but an error occurs
during execution, EXEC SQL reports that error condition. When an error
occurs, the utility terminates.
Related reference
select-statement (DB2 SQL Reference)
183
EXEC SQL
INSERT INTO MYEMP SELECT * FROM DSN8810.EMP
ENDEXEC
You can use a declared cursor with the DB2 cross-loader function to load data from
a local server or from any DRDA-compliant remote server as part of the DB2
cross-loader function.
PSPI
Related reference
Sample REORG TABLESPACE control statements on page 521
184
Output
Output from the LISTDEF control statement consists of a list with a name.
Authorization required
To execute the LISTDEF utility, you must have SELECT authority on
SYSIBM.SYSINDEXES, SYSIBM.SYSTABLES, and SYSIBM.SYSTABLESPACE.
Additionally, you must have the authority to execute the utility that is used to
process the list, as currently documented in the Authorization required topic for
each utility.
|
|
|
If you do not have authorization to execute the utility on one or more of the items
in the list, the utility will stop on the first authorization error. To skip items in the
list that return an error, use the OPTIONS (ITEMERROR, SKIP) control statement.
185
Syntax diagram
LISTDEF
list-name
|
INCLUDE
EXCLUDE
LIST referenced-list
initial-object-spec
(1)
CLONED
type-spec
YES
NO
RI
ALL
BASE
LOB
XML
Notes:
1
type-spec:
TABLESPACES
INDEXSPACES
COPY
NO
YES
initial-object-spec:
DATABASE database-name
table-space-spec
index-space-spec
table-spec
index-spec
PARTLEVEL
(n)
table-space-spec:
TABLESPACE
table-space-name
database-name.
index-space-spec:
186
INDEXSPACE
index-space-name
database-name.
table-spec:
TABLE
table-name
creator-id.
index-spec:
INDEX
index-name
creator-id.
Option descriptions
LISTDEF list-name
Defines a list of DB2 objects and assigns a name to the list. The list name
makes the list available for subsequent execution as the object of a utility
control statement or as an element of another LISTDEF statement.
list-name is the name (up to 18 alphanumeric characters in length) of the
defined list.
You can put LISTDEF statements either in a separate LISTDEF library data set
or before a DB2 utility control statement that refers to the list-name.
INCLUDE
Specifies that the list of objects that results from the expression that follows is
to be added to the list. You must first specify an INCLUDE clause. You can
then specify subsequent INCLUDE or EXCLUDE clauses in any order to add
to or delete clauses from the existing list.
EXCLUDE
Specifies, after the initial INCLUDE clause, that the list of objects that results
from the expression that follows is to be excluded from the list if the objects
are in the list. If the objects are not in the list, they are ignored, and DB2
proceeds to the next INCLUDE or EXCLUDE clause.
TABLESPACES
Specifies that the INCLUDE or EXCLUDE object expression is to create a list of
related table spaces.
TABLESPACES is the default type for lists that use a table space or a table for
the initial search. For more information about specifying these objects, see the
descriptions of the TABLESPACE and TABLE options.
No default type value exists for lists that use other lists for the initial search.
The list that is referred to by the LIST option is used unless you specify
TABLESPACES or INDEXSPACES. Likewise, no type default value exists for
lists that use databases for the initial search. If you specify the DATABASE
Chapter 15. LISTDEF
187
DATABASE
Returns all table spaces that are contained within the database
TABLESPACE
TABLE
INDEXSPACE
INDEX
Returns the related table spaces for the index spaces in the
expanded referenced list
Returns the table spaces from the expanded referenced list and
the related table spaces for the index spaces in the same list
INDEXSPACES
Specifies that the INCLUDE or EXCLUDE object expression is to create a list of
related index spaces.
INDEXSPACES is the default type for lists that use an index space or an index
for the initial search. For more information about specifying these objects, see
the descriptions of the INDEXSPACE and INDEX options.
No default type value exists for lists that use other lists for the initial search.
The list that is referred to by the LIST option is used unless you specify
TABLESPACES or INDEXSPACES. Likewise, no type default value exists for
lists that use databases for the initial search. If you specify the DATABASE
option, you must specify INDEXSPACES or TABLESPACES. For more
information about specifying lists and databases, see the descriptions of the
LIST and DATABASE options.
The result of the INDEXSPACES keyword varies depending on the type of
object that you specify in the INCLUDE or EXCLUDE clause. These results are
shown in The following table.
Table 25. Result of the INDEXSPACES keyword based on the object type that is specified in
the INCLUDE or EXCLUDE clause.
188
DATABASE
Returns all index spaces that are contained within the database
TABLESPACE
Returns all index spaces for indexes over all tables in the table
space
TABLE
INDEXSPACE
Table 25. Result of the INDEXSPACES keyword based on the object type that is specified in
the INCLUDE or EXCLUDE clause. (continued)
Object type specified in
INCLUDE or EXCLUDE
clause
INDEX
Returns the related index spaces for the table spaces in the
expanded referenced list
Returns the index spaces from the expanded referenced list and
the related index spaces for the table spaces in the same list
COPY
Specifies whether indexes that were defined with or altered to COPY YES or
COPY NO attributes are to be included or excluded in this portion of the list.
If you omit COPY, all index spaces that satisfy the INCLUDE or EXCLUDE
expression, regardless of their COPY attribute, are included or excluded in this
portion of the list. If specified, this keyword must immediately follow the
INDEXSPACES keyword. If you specify this keyword elsewhere, it is
interpreted as the start of the COPY utility control statement.
YES
Specifies that only index spaces that were defined with or altered to COPY
YES are to be included in this portion of the list. Use INCLUDE with
COPY YES to develop a list of index spaces that the COPY utility can
process.
NO
Specifies that only index spaces that were defined with or altered to COPY
NO are to be included in this portion of the list. Use EXCLUDE with
COPY NO to remove indexes that the COPY utility cannot process from a
larger list.
LIST referenced-list
Specifies the name of a previously defined object list that is to be expanded
and used for the initial search for the object.
referenced-list is the name of the list. You must explicitly specify this name. You
cannot specify pattern-matching characters (%,*, ?, and _) for lists.
No default type value exists for lists that are developed from the LIST option.
The list is expanded as defined, and it is then modified by subsequent
keywords, if any.
You can specify a type-spec of TABLESPACES to create a list of only table
spaces. If the list to be processed contains index spaces, the TABLESPACES
keyword creates a list that includes related table spaces.
You can specify a type-spec of INDEXSPACES to create a list of only index
spaces. If the list to be processed contains table spaces, the INDEXSPACES
keyword creates a list that includes related index spaces.
You can use the LIST keyword to make aggregate lists of lists, to exclude entire
lists from other lists, and to develop lists of objects that are related to other
lists.
DATABASE database-name
Specifies the database that is to be used for the initial search for the object.
Chapter 15. LISTDEF
189
|
|
|
|
TABLESPACE database-name.table-space-name
Specifies the table space that is to be used for the initial search for the object.
If you specify TABLESPACE, the default list type is TABLESPACES. All table
spaces that satisfy the pattern-matching expression are included in the list
unless the list is modified by other keywords. TABLESPACE *.* and TABLESPACE
%.% are not supported.
database-name specifies the name of the database to which the table space
belongs. The default value is DSNDB04.
table-space-name specifies the name of the table space.
You can explicitly specify or use pattern-matching characters to specify
database-name, table-space-name, or both.
You cannot include any objects in DSNDB07 or any user-defined work file
databases in a LISTDEF. Pattern matching is not supported for DSNDB01 and
DSNDB06 objects.
INDEXSPACE database-name.index-space-name
Specifies the index space that is to be used for the initial search for the object.
If you specify INDEXSPACE, the default list type is INDEXSPACES. All index
spaces that satisfy the pattern-matching expression are included in the list
unless the index spaces are excluded by other LISTDEF options. INDEXSPACE
*.* and INDEXSPACE %.% are not supported.
database-name specifies the name of the database to which the index space
belongs. The default value is DSNDB04.
index-space-name specifies the name of the index space.
You can explicitly specify or use pattern-matching characters to specify
database-name, index-space-name, or both.
You cannot include any objects in DSNDB07 or any user-defined work file
databases in a LISTDEF. Pattern-matching is not supported for DSNDB01 and
DSNDB06 objects.
TABLE creator-id.table-name
Specifies the table that is to be used for the initial search for the object.
If you specify TABLE, the default list type is TABLESPACES. All table spaces
that contain tables that satisfy the pattern-matching expression are included in
the list unless the list is modified by other keywords. TABLE *.* and TABLE %.%
are not supported.
190
|
|
creator-id specifies the qualifier creator ID for the table. The default value is the
user identifier for the utility. table-name specifies the name of the table. If you
specify a table name with CLONED, the CLONED keyword is ignored.
You can explicitly specify or use pattern-matching characters to specify
creator-id,table-name, or both. However, the underscore pattern-matching
character is ignored in a table name.
Pattern-matching is not supported for catalog and directory objects. In a
LISTDEF statement, you must include catalog and directory objects by their
fully qualified names.
Enclose the table name in quotation marks if the name contains a blank.
INDEX creator-id.index-name
Specifies the index that is to be used for the initial search for the object.
If you specify INDEX, the default list type is INDEXSPACES. All index spaces
that contain indexes that satisfy the pattern-matching expression are included
in the list unless the list is modified by other keywords. INDEX *.* and INDEX
%.% are not supported.
creator-id specifies the qualifier creator ID for the index. The default value is
the user identifier for the utility.
index-name specifies the name of the index.
Enclose the index name in quotation marks if the name contains a blank.
You can explicitly specify or use pattern-matching characters to specify
creator-id, index-name, or both. However, the underscore pattern-matching
character is ignored in an index name.
Pattern-matching is not supported for catalog and directory objects. In a
LISTDEF statement, you must include catalog and directory objects by their
fully qualified names.
PARTLEVEL
Specifies the partition granularity for partitioned table spaces, partitioning
indexes, and data-partitioned secondary indexes that are to be contained in the
list. You cannot specify the PARTLEVEL keyword with the RI keyword.
(n) n is the integer partition number where n >= 0.
If you specify PARTLEVEL 0, the resulting list contains one entry for each
nonpartitioned object.
If you specify PARTLEVEL with a nonzero operand, the resulting list
contains one entry for the specified partition for partitioned objects and
one entry for each nonpartitioned object.
If you specify PARTLEVEL without (n), the resulting list contains one entry
for each partition in the partitioned object and one entry for each
nonpartitioned object.
An INCLUDE with the PARTLEVEL keyword can be removed from the list
only by an EXCLUDE with PARTLEVEL.
|
|
|
|
|
|
191
original list is saved during the original execution for a later restart, and the
list will not include the added partitions.
|
|
CLONED
Use the CLONED keyword to have LISTDEF perform a final filtering of the
INCLUDE or EXCLUDE clause contents based on the existence or absence of
clone data. This operation is performed last, after processing all other
keywords on the INCLUDE or EXCLUDE clause.
|
|
|
|
|
|
|
|
|
|
CLONED YES specifies that only tablespaces and indexspaces that contain
cloned objects are to be returned in the INCLUDE or EXCLUDE clause.
CLONED NO specifies that only tablespaces and indexspaces that do not
contain cloned objects are to be returned in the INCLUDE or EXCLUDE clause.
Omit the CLONED keyword if the existence of clone data is not a factor.
|
|
|
|
|
The use of CLONED YES or CLONED NO only impacts the contents of the
list. It does not determine if clone or base data is later processed by the utility
using the list. Only the presence or absence of the CLONE keyword on
individual utility control statements determines if clone or base data is
processed.
RI Specifies that all objects that are referentially related to the object expression
(PRIMARY KEY <--> FOREIGN KEY) are to be included in the list. DB2
processes all referential relationships repeatedly until the entire referential set
is developed. You cannot specify RI with PARTLEVEL(n).
LOB indicator keywords: Use one of three LOB indicator keywords to direct
LISTDEF processing to follow auxiliary relationships to include related LOB objects
in the list. The auxiliary relationship can be followed in either direction. LOB
objects include the LOB table spaces, auxiliary tables, indexes on auxiliary tables,
and their containing index spaces.
Incomplete LOB definitions cause seemingly related LOB objects to not be found.
The auxiliary relationship does not exist until you create the AUX TABLE with the
STORES keyword.
No default LOB indicator keyword exists. If you do not specify BASE, LOB, or
ALL, DB2 does not follow the auxiliary relationships and does not filter LOB from
base objects in the enumerated list.
ALL
Specifies that BASE, LOB, and XML objects are to be included in the list.
Auxiliary relationships are to be followed from all objects that result from the
initial object lookup, and BASE, LOB, and XML objects are to remain in the
final enumerated list. CLONED objects are not included.
|
|
|
|
BASE
Specifies that only base table spaces (non-LOB) and index spaces are to be
included in this element of the list.
If the result of the initial search for the object is a base object, auxiliary
relationships are not followed. If the result of the initial search for the object is
a LOB object, the auxiliary relationship is applied to the base table space or
index space, and only those objects become part of the resulting list.
LOB
Specifies that only LOB table spaces and related index spaces that contain
indexes on auxiliary tables are to be included in this element of the list.
192
If the result of the initial search for the object is a LOB object, auxiliary
relationships are not followed. If the result of the initial search for the object is
a base object, the auxiliary relationship is applied to the LOB table space or
index space, and only those objects become part of the resulting list.
|
|
XML
Specifies that only XML objects are to be included in this element of the list.
193
Related concepts
Including objects in a list
TABLESPACE
TABLESPACES
TABLE
TABLESPACES
INDEXSPACE
INDEXSPACES
INDEX
INDEXSPACES
LIST
For example, the following INCLUDE clause specifies that table space
DBLT0301.TLLT031A is to be added to the LIST:
INCLUDE TABLESPACE DBLT0301.TLLT031A
194
In this example, the clause specifies that all index spaces over all tables in table
space DBLT0301.TLLT031A are to be added to the list.
|
|
Optionally, you can add related objects to the list by specifying keywords that
indicate a relationship, such as referentially related objects or auxiliary related
objects. Valid specifications include the following keywords:
v BASE (non-LOB and non-XML objects)
v LOB (LOB objects)
v XML (XML objects)
v ALL (BASE, LOB, and XML objects)
v TABLESPACES (related table spaces)
v INDEXSPACES (related index spaces)
v RI (related by referential constraints, including informational referential
constraints)
The preceding keywords perform two functions: they determine which objects are
related, and they then filter the contents of the list. The behavior of these keywords
varies depending on the type of object that you specify. For example, if your initial
object is a LOB object, the LOB keyword is ignored. If, however, the initial object is
not a LOB object, the LOB keyword determines which LOB objects are related, and
DB2 excludes non-LOB objects from the list.
DB2 processes each INCLUDE and EXCLUDE clause in the following order:
1. Perform the initial search for the object that is based on the specified
pattern-matching expression, including PARTLEVEL specification, if specified.
|
|
2. Add or remove related objects and filter the list elements based on the specified
list type, either TABLESPACES or INDEXSPACES (COPY YES or COPY NO).
3. Add or remove related objects depending on the presence or absence of the RI,
BASE, LOB, XML, and ALL keywords.
For example, to generate a list of all table spaces in the ACCOUNT database but
exclude all LOB table spaces, you can specify the following LISTDEF statement:
LISTDEF ACCNT INCLUDE TABLESPACES DATABASE ACCOUNT BASE
In the preceding example, the name of the list is ACCNT. The TABLESPACES
keyword indicates that the list is to include table spaces that are associated with
the specified object. In this case, the table spaces to be included are those table
spaces in database ACCOUNT. Finally, the BASE keyword limits the objects to only
base table spaces.
If you want a list of only LOB index spaces in the ACCOUNT database, you can
specify the following LISTDEF statement:
LISTDEF ACLOBIX INCLUDE INDEXSPACES DATABASE ACCOUNT LOB
In the preceding example, the INDEXSPACES and LOB keywords indicate that the
INCLUDE clause is to add only LOB index spaces to the ACLOBIX list.
Chapter 15. LISTDEF
195
Equivalent
symbol used in
SQL LIKE
predicates
Usage notes
Question mark
(?)
Underscore (_)
Asterisk (*)
Underscore (_)
Underscore (_)
196
space names for those objects. Pattern-matching is not supported for catalog or
directory objects. DB2 issues error messages for any catalog or directory objects
that are invalid for a utility.
Although DB2 catalog and directory objects can appear in LISTDEF lists, these
objects might be invalid for a utility and result in an error message.
The following valid INCLUDE clauses contain catalog and directory objects:
v
INCLUDE TABLESPACE DSNDB06.SYSDBASE
v
INCLUDE TABLESPACES TABLESPACE DSNDB06.SYSDBASE
v
INCLUDE INDEXSPACE DSNDB06.DSNDXX01
v
INCLUDE INDEXSPACES INDEXSPACE DSNDB06.DSNDXX01
197
//LISTDSN DD DSN=ADMF001.DB.LIST1,DISP=SHR
//
DD DSN=ADMF001.DB.LIST2,DISP=SHR
In general, utilities processes the objects in the list in the order in which they are
specified. However, some utilities alter the list order for optimal processing as
follows:
v CHECK INDEX, REBUILD INDEX, and RUNSTATS INDEX process all index
spaces that are related to a given table space at one time, regardless of list order.
v UNLOAD processes all specified partitions of a given table space at one time
regardless of list order.
The LIST keyword is supported by the utilities that are listed in the following
table. When possible, utility processing optimizes the order of list processing as
indicated in the table.
198
CHECK INDEX
COPY
COPYTOCOPY
MERGECOPY
MODIFY
RECOVERY
MODIFY
STATISTICS
QUIESCE
REBUILD
RECOVER
REORG
REPORT
RUNSTATS INDEX
RUNSTATS
TABLESPACE
UNLOAD
Some utilities such as COPY and RECOVER, can process a LIST without a
specified object type. Object types are determined from the list contents. Other
utilities, such as REPORT, RUNSTATS, and REORG INDEX, must know the object
type that is to be processed before processing can begin. These utilities require that
you specify an object type in addition to the LIST keyword (for example: REPORT
RECOVERY TABLESPACE LIST, RUNSTATS INDEX LIST, and REORG INDEX
LIST). See the syntax diagrams for an individual utility for details.
Related tasks
Creating LISTDEF libraries on page 197
199
Related reference
Chapter 31, TEMPLATE, on page 641
200
TABLESPACE DBLT0301.TLLT031A
INDEXSPACE DBLT0301.IXLT031A
TABLESPACE DBLT0301.TPLT031C
TABLE ADMF001.TBLT032A_1
TABLESPACE
TABLESPACE
INDEXSPACE
INDEXSPACE
PAYROLL.*
PAYROLL.TEMP*
PAYROLL.*IX
PAYROLL.TMPIX*
Assume that three table spaces qualify. Of these table spaces, two are partitioned
table spaces (PAY2.DEPTA and PAY2.DEPTF) that each have three partitions and
one is a nonpartitioned table space (PAY1.COMP). In this case, the EXAMPLE4 list
includes the following items:
v PAY2.DEPTA partition 1
v PAY2.DEPTA partition 2
v PAY2.DEPTA partition 3
v PAY2.DEPTF partition 1
v PAY2.DEPTF partition 2
v PAY2.DEPTF partition 3
v PAY1.COMP
If you specified PARTLEVEL(2) instead of PARTLEVEL, the EXAMPLE4 list
includes the following items:
v PAY2.DEPTA partition 2
v PAY2.DEPTF partition 2
v PAY1.COMP
If you specified PARTLEVEL(0) instead of PARTLEVEL, the EXAMPLE4 list
includes only PAY1.COMP.
201
Note that if the PARTLEVEL keyword is not specified in both clauses, as in the
following two sample statements, the INCLUDE and EXCLUDE items do not
intersect. For example, in the following statement, table space X is included is
included in the list in its entirety, not at the partition level. Therefore, partition 12
cannot be excluded.
LISTDEF EXAMPLE6 INCLUDE TABLESPACE X
EXCLUDE TABLESPACE X PARTLEVEL(12)
In the following sample statement, the list includes only partition 12 of table space
X, so table space X in its entirety can not be excluded.
LISTDEF EXAMPLE6 INCLUDE TABLESPACE X PARTLEVEL(12)
EXCLUDE TABLESPACE X
202
DB2 is to first search SYSIN for the list definition. If DB2 does not find the list
definition in SYSIN, it is to search any data sets that are included in the LISTLIB
LISTDEF library.
The last LISTDEF statement defines the NAME3 list. This list includes all objects in
the NAME1 and NAME2 lists, except for three table spaces (TSLT032B, TSLT031B,
TSLT032C). Because the NAME1 and NAME2 lists are not included in SYSIN, DB2
searches the default LISTDEF library (LISTLIB) to find them.
Finally, the QUIESCE utility control statement specifies this list of objects (NAME3)
for which DB2 is to establish a quiesce point.
//CREATE1 JOB 'USER=NAME',CLASS=A,...
//*-----------------------------------------------------//* Create an input data set.
//*-----------------------------------------------------//LOAD1
EXEC PGM=IEBGENER
//SYSPRINT DD DUMMY
//SYSIN
DD DUMMY
//SYSUT2
DD DSN=JULTU103.TCASE.DATA2,
//
DISP=(NEW,CATLG,CATLG),
//
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND),
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=2400)
//SYSUT1
DD *
LISTDEF NAME1 INCLUDE TABLESPACE DBLT0301.TLLT031A
INCLUDE TABLESPACE DBLT0301.TSLT031B
/*
//CREATE2 JOB 'USER=NAME',CLASS=A,...
//*-----------------------------------------------------//* Create an input data set.
//*-----------------------------------------------------//CRECNTL EXEC PGM=IEFBR14
//CNTL
DD DSN=JULTU103.TCASE.DATA3,UNIT=SYSDA,
//
VOL=SER=SCR03,
//
SPACE=(TRK,(2,2,2)),DCB=(DSORG=PO,
//
LRECL=80,RECFM=FB,BLKSIZE=4560),
//
DISP=(NEW,CATLG,CATLG)
/*
//*-----------------------------------------------------//* Create member of input data set.
//*-----------------------------------------------------//FILLCNTL EXEC PGM=IEBUPDTE
//SYSPRINT DD SYSOUT=*
//SYSUT1
DD DSN=JULTU103.TCASE.DATA3,DISP=OLD
//SYSUT2
DD DSN=JULTU103.TCASE.DATA3,DISP=OLD
//SYSIN DD DATA
./ ADD NAME=MEM1
LISTDEF NAME2 INCLUDE TABLESPACE DBLT0302.TLLT032A
INCLUDE TABLESPACE DBLT0302.TSLT032B
INCLUDE TABLESPACE DBLT0302.TPLT032C
./ ENDUP
/*
//QUIESCE JOB 'USER=NAME',CLASS=A,...
//*******************************************************
//* QUIESCE LISTDEF DD LILSTDEF data sets
//*******************************************************
//STEP1
EXEC DSNUPROC,UID='JULTU103.QUIESC2',
//
UTPROC='',SYSTEM='SSTR'
//LISTLIB DD DSN=JULTU103.TCASE.DATA2,DISP=SHR
//
DD DSN=JULTU103.TCASE.DATA3(MEM1),DISP=SHR
//SYSIN
DD *
OPTIONS LISTDEFDD LISTLIB
LISTDEF NAME3 INCLUDE LIST NAME1
INCLUDE LIST NAME2
Chapter 15. LISTDEF
203
Figure 27. Example of building a LISTDEF library and then running the QUIESCE utility
|
|
|
204
Output
LOAD DATA generates one or more of the following forms of output:
v A loaded table space or partition.
v A discard file of rejected records.
v A summary report of errors that were encountered during processing; this report
is generated only if you specify ENFORCE CONSTRAINTS or if the LOAD
involves unique indexes.
Authorization required
To execute this utility, you must use a privilege set that includes one of the
following authorizations:
v Ownership of the table
v LOAD privilege for the database
v STATS privilege for the database is required if STATISTICS keyword is specified
v SYSCTRL or SYSADM authority
LOAD operates on a table space level, so you must have authority for all tables in
the table space when you perform LOAD.
To run LOAD STATISTICS, the privilege set must include STATS authority on the
database. To run LOAD STATISTICS REPORT YES, the privilege set must also
include the SELECT privilege on the tables required.
If you use RACF access control with multilevel security and LOAD is to process a
table space that contains a table that has multilevel security with row-level
granularity, you must be identified to RACF and have an accessible valid security
label. You must also meet the following authorization requirements:
v To replace an entire table space with LOAD REPLACE, you must have the
write-down privilege unless write-down rules are not in effect.
v You must have the write-down privilege to specify values for the security label
columns, unless write-down rules are not in effect. If these rules are in effect and
you do not have write-down privilege, DB2 assigns your security label as the
value for the security label column for the rows that you are loading.
205
Description
UTILINIT
Performs initialization.
RELOAD
Loads record types and writes temporary file records for indexes and foreign
keys. RELOAD makes one pass through the sequential input data set. Check
constraints are checked for each row. Internal commits provide commit points
at which to restart in case operation should halt in this phase.
RELOAD creates inline copies if you specified the COPYDDN or
RECOVERYDDN keywords.
A subtask is started at the beginning of the RELOAD phase to sort the keys.
The sort subtask initializes and waits for the main RELOAD phase to pass its
keys to SORT. RELOAD loads the data, extracts the keys, and passes them in
memory for sorting. At the end of the RELOAD phase, the last key is passed
to SORT, and record sorting completes.
Note that load partition parallelism starts subtasks. PREFORMAT for table
spaces occurs at the end of the RELOAD phase.
SORT
206
BUILD
Creates indexes from temporary file records for all indexes that are defined on
the loaded tables. Build also detects duplicate keys. PREFORMAT for indexes
occurs at the end of the BUILD phase.
SORTBLD
Performs all activities that normally occur in both the SORT and BUILD
phases, if you specify a parallel index build.
INDEXVAL
ENFORCE
DISCARD
Copies records that cause errors from the input data set to the discard data
set.
REPORT
UTILTERM
Performs cleanup.
Related information
Multilevel security (DB2 Administration Guide)
207
Syntax diagram
DATA
INDDN
SYSREC
LOAD
PREFORMAT
INDDN ddname
INCURSOR cursor-name
COPYDICTIONARY
1
integer
(1)
RESUME
NO
SHRLEVEL NONE
REPLACE
copy-spec
statistics-spec
SHRLEVEL NONE
RESUME
YES
SHRLEVEL CHANGE
(2)
LOG
YES
LOG
NO
SORTKEYS 0
workddn-spec
KEEPDICTIONARY
REUSE
SORTKEYS NO
SORTKEYS integer
NOCOPYPEND
FLOAT(S390)
EBCDIC
FLOAT(IEEE)
ASCII
UNICODE
format-spec
,
NOSUBS
CCSID( integer
ENFORCE
CONSTRAINTS
ERRDDN
SYSERR
MAPDDN
SYSMAP
DISCARDDN SYSDISC
ENFORCE
NO
ERRDDN
ddname
MAPDDN
ddname
DISCARDDN
ddname
DISCARDS 0
DISCARDS integer
SORTDEVT
CONTINUEIF(start
)=
device-type
SORTNUM
integer
:end
Xbyte-string
character-string
DECFLOAT_ROUNDMODE
ROUND_CEILING
ROUND_DOWN
ROUND_FLOOR
ROUND_HALF_DOWN
ROUND_HALF_EVEN
ROUND_HALF_UP
ROUND_UP
INTO-TABLE-spec
IDENTITYOVERRIDE
Notes:
|
|
The value specified in the INTO TABLE for RESUME or REPLACE overrides the default value
for LOAD RESUME.
The default is 0 if the input is on tape, a cursor, a PDS member or for SYSREC DD *. For
sequential data sets, LOAD computes the default based upon the input data set size.
208
workddn-spec:
WORKDDN(SYSUT1,SORTOUT)
WORKDDN
(ddname1,ddname2)
,SORTOUT
(ddname1
)
SYSUT1
(
,ddname2)
copy-spec:
(SYSCOPY)
RECOVERYDDN(ddname3
COPYDDN
)
,ddname4
(ddname1
)
,ddname2
(,ddname2)
statistics-spec:
TABLE
ALL
STATISTICS
SAMPLE
integer
COLUMN
TABLE
table-name
SAMPLE
integer
,
COLUMN
INDEX
ALL
ALL
( column-name
REPORT
NO
UPDATE
REPORT
YES
UPDATE
ALL
correlation-stats-spec
,
INDEX
( index-name
correlation-stats-spec
ACCESSPATH
SPACE
NONE
HISTORY
ALL
ACCESSPATH
SPACE
NONE
FORCEROLLUP
YES
NO
correlation-stats-spec:
209
FREQVAL
NUMCOLS
COUNT
10
KEYCARD
FREQVAL
NUMCOLS
integer
COUNT
integer
format-spec:
FORMAT
UNLOAD
SQL/DS
COLDEL
CHARDEL
DECPT
COLDEL
coldel
CHARDEL
chardel
DECPT
decpt
DELIMITED
INTO-TABLE-spec:
For the syntax diagram and the option descriptions of the into-table specification,
see INTO-TABLE-spec on page 226.
Option descriptions
DATA
Specifies that data is to be loaded. This keyword is optional and is used for
clarity only.
INDDN ddname
Specifies the data definition (DD) statement or template that identifies the
input data set for the partition. The record format for the input data set must
be fixed-length or variable-length. The data set must be readable by the basic
sequential access method (BSAM).
The ddname is the name of the input data set.
The default value is SYSREC.
INCURSOR cursor-name
Specifies the cursor for the input data set. You must declare the cursor before it
is used by the LOAD utility. Use the EXEC SQL utility control statement to
define the cursor. You cannot load data into the same table on which you
defined the cursor. You cannot load data into a table that is a parent in a RI
relationship with the dependent table on which the cursor is defined.
|
|
|
|
|
|
|
|
|
The specified cursor can be used with the DB2 family cross-loader function,
which enables you to load data from any DRDA-compliant remote server. For
more information about using the cross-loader function, see Loading data by
using the cross-loader function on page 270.
|
|
cursor-name is the cursor name. Cursor names that are specified with the
LOAD utility cannot be longer than eight characters.
|
|
|
|
You cannot use the INCURSOR option with the following options:
v SHRLEVEL CHANGE
v NOSUBS
v FORMAT UNLOAD
210
|
|
|
v FORMAT SQL/DS
v CONTINUEIF
v WHEN
|
|
211
and you have not used REPLACE, a message is issued and the utility job
step terminates with a job step condition code of 8.
For nonsegmented table spaces that contain deleted rows or rows of
dropped tables, using the REPLACE keyword provides increased efficiency.
The default value is NO, unless you override it with PART integer
RESUME YES.
YES
Loads records into a non-empty table space. If the table space is empty, a
warning message is issued, but the table space is loaded. Loading begins at
the current end of data in the table space. Space is not reused for rows that
are marked as deleted or for rows of dropped tables.
LOAD RESUME SHRLEVEL CHANGE activates the before triggers and after
triggers for each row that is loaded.
SHRLEVEL
Specifies the extent to which applications can concurrently access the table
space or partition during the LOAD utility job. The following parameter values
are listed in order of increasing extent of allowed concurrent access.
NONE
Specifies that applications have no concurrent access to the table space or
partition.
CHANGE
Specifies that applications can concurrently read from and write to the
table space or partition into which LOAD is loading data. If you specify
SHRLEVEL CHANGE, you cannot specify the following parameters:
INCURSOR, RESUME NO, REPLACE, KEEPDICTIONARY, LOG NO,
ENFORCE NO, STATISTICS, COPYDDN, RECOVERYDDN, MAPDDN,
PREFORMAT, REUSE, or PART integer REPLACE.
For a partition-directed LOAD, if you specify SHRLEVEL CHANGE, only
RESUME YES can be specified or inherited from the LOAD statement.
LOAD SHRLEVEL CHANGE does not perform the SORT, BUILD,
SORTBLD, INDEXVAL, ENFORCE, or REPORT phases, and the
compatibility and concurrency considerations differ.
A LOAD SHRLEVEL CHANGE job functions like a mass INSERT. Whereas
a regular LOAD job drains the entire table space, LOAD SHRLEVEL
CHANGE functions like an INSERT statement and uses claims when
accessing an object.
Normally, a LOAD RESUME YES job loads the records at the end of the
already existing records. However, for a LOAD RESUME YES job with the
SHRLEVEL CHANGE option, the utility tries to insert the new records in
available free space as close to the clustering order as possible. This LOAD
job does not create any additional free pages. If you insert a lot of records,
these records are likely to be stored out of clustering order. In this case,
you should run the REORG TABLESPACE utility after loading the records.
|
|
When an identity column exists in the table being loaded, performance can
be improved by specifying the CACHE attribute for the identity column.
|
|
212
When using COPYDDN for XML data, an inline copy is taken only of the base
table space, not the XML table space.
Using COPYDDN when loading a table with LOB columns does not create a
copy of any index, LOB table space, or XML table space. You must perform
these tasks separately.
The COPYDDN keyword specifies either a DD name or a TEMPLATE name
specification from a previous TEMPLATE control statement. If utility
processing detects that the specified name is both a DD name in the current job
step and a TEMPLATE name, the utility uses the DD name.
Chapter 16. LOAD
213
RECOVERYDDN ddname3,ddname4
Specifies the DD statements for the primary (ddname3) and backup (ddname4)
copy data sets for the image copy at the recovery site.
ddname is the DD name.
You cannot have duplicate image copy data sets. The same rules apply for
RECOVERYDDN and COPYDDN.
The RECOVERYDDN keyword specifies either a DD name or a TEMPLATE
name specification from a previous TEMPLATE control statement. If utility
processing detects that the specified name is both a DD name in the current job
step and a TEMPLATE name, the utility uses the DD name.
STATISTICS
Specifies the gathering of statistics for a table space, index, or both; the
statistics are stored in the DB2 catalog.
|
|
|
|
Restrictions:
v If you specify STATISTICS for encrypted data, DB2 might not provide useful
statistics on this data.
v You cannot specify STATISTICS if the named table is a table clone.
TABLE
Specifies the table for which column information is to be gathered. All tables
must belong to the table space that is specified in the TABLESPACE option.
(ALL)
Specifies that information is to be gathered for all columns of all tables in
the table space.
(table-name)
Specifies the tables for which column information is to be gathered. If you
omit the qualifier, the user identifier for the utility job is used. Enclose the
table name in quotation marks if the name contains a blank.
If you specify more than one table, you must repeat the TABLE option.
Multiple TABLE options must be specified entirely before or after any
INDEX keyword that may also be specified. For example, the INDEX
keyword may not be specified between any two TABLE keywords.
SAMPLE integer
Indicates the percentage of rows that LOAD is to sample when collecting
non-indexed column statistics. You can specify any value from 1 through 100.
The default value is 25.
COLUMN
Specifies the columns for which column information is to be gathered.
You can specify this option only if you specify the particular tables for which
statistics are to be gathered (TABLE (table-name)). If you specify particular
tables and do not specify the COLUMN option, the default, COLUMN(ALL), is
used. If you do not specify a particular table when using the TABLE option,
you cannot specify the COLUMN option; however, COLUMN(ALL) is
assumed.
214
(ALL)
Specifies that statistics are to be gathered for all columns in the table.
(column-name, ...)
Specifies the columns for which statistics are to be gathered.
You can specify a list of column names; the maximum is 10. If you specify
more than one column, separate each name with a comma.
INDEX
Specifies indexes for which information is to be gathered. Column information
is gathered for the first column of the index. All the indexes must be associated
with the same table space, which must be the table space that is specified in
the TABLESPACE option.
(ALL)
Specifies that the column information is to be gathered for all indexes that
are defined on tables in the table space.
(index-name)
Specifies the indexes for which information is to be gathered. Enclose the
index name in quotation marks if the name contains a blank.
KEYCARD
Requests the collection of all distinct values in all of the 1 to n key column
combinations for the specified indexes. n is the number of columns in the
index.
FREQVAL
Controls the collection of frequent-value statistics. If you specify FREQVAL, it
must be followed by two additional keywords:
NUMCOLS
Indicates the number of key columns that are to be concatenated together
when collecting frequent values from the specified index. Specifying 3
means that frequent values are to be collected on the concatenation of the
first three key columns. The default value is 1, which means that DB2
collects frequent values on the first key column of the index.
COUNT
Indicates the number of frequent values that are to be collected. Specifying
15 means that DB2 collects 15 frequent values from the specified key
columns. The default value is 10.
REPORT
Indicates whether a set of messages is to be generated to report the collected
statistics.
NO
Indicates that the set of messages is not sent to SYSPRINT as output.
YES
Indicates that the set of messages is sent to SYSPRINT as output. The
generated messages are dependent on the combination of keywords (such
as TABLESPACE, INDEX, TABLE, and COLUMN) that are specified with
the RUNSTATS utility. However, these messages are not dependent on the
specification of the UPDATE option. REPORT YES always generates a
report of SPACE and ACCESSPATH statistics.
UPDATE
Indicates whether the collected statistics are to be inserted into the catalog
215
tables. UPDATE also allows you to select statistics that are used for access path
selection or statistics that are used by database administrators.
ALL
Indicates that all collected statistics are to be updated in the catalog.
ACCESSPATH
Indicates that updates are to be made only to the catalog table columns
that provide statistics that are used for access path selection.
SPACE
Indicates that updates are to be made only to the catalog table columns
that provide statistics to help database administrators assess the status of a
particular table space or index.
NONE
Indicates that no catalog tables are to be updated with the collected
statistics. This option is valid only when REPORT YES is specified.
HISTORY
Records all catalog table inserts or updates to the catalog history tables.
The default is supplied by the value that is specified in STATISTICS HISTORY
on panel DSNTIPO.
ALL
Indicates that all collected statistics are to be updated in the catalog history
tables.
ACCESSPATH
Indicates that updates are to be made only to the catalog history table
columns that provide statistics that are used for access path selection.
SPACE
Indicates that only space-related catalog statistics are to be updated in
catalog history tables.
NONE
Indicates that no catalog history tables are to be updated with the collected
statistics.
FORCEROLLUP
Specifies whether aggregation or rollup of statistics is to take place when
RUNSTATS is executed even if some parts are empty. This keyword enables
the optimizer to select the best access path.
YES
Indicates that forced aggregation or rollup processing is to be done, even
though some parts might not contain data.
NO
Indicates that aggregation or rollup is to be done only if data is available
for all parts.
If data is not available for all parts, DSNU623I message is issued if the
installation value for STATISTICS ROLLUP on panel DSNTIPO is set to
NO.
KEEPDICTIONARY
Prevents the LOAD utility from building a new compression dictionary. LOAD
retains the current compression dictionary and uses it for compressing the
input data. This option eliminates the cost that is associated with building a
new dictionary.
216
|
|
|
|
|
|
DB2 ignores the KEEPDICTIONARY option if the REORG utility changes the
table space from basic row format to reordered row format.
This keyword is valid only if the table space that is being loaded has the
COMPRESS YES attribute.
If the table space or partition is empty, DB2 performs one of these actions:
v DB2 builds a dictionary if a compression dictionary does not exist.
v DB2 keeps the dictionary if a compression dictionary exists.
If RESUME NO and REPLACE are specified when the table space or partition
is not empty, DB2 performs the same actions as it does when the table space or
partition is empty.
If the table space or partition is not empty and RESUME YES is specified, DB2
performs one of these actions:
v DB2 does not build a dictionary if a compression dictionary does not exist.
v DB2 keeps the dictionary if a compression dictionary exists.
|
|
|
|
|
YES
Specifies normal logging during the load process. All records that are
loaded are logged. If the table space has the NOT LOGGED attribute, DB2
does the LOAD with no logging.
NO
|
|
|
|
|
|
Specifies no logging of data during the load process. If the table space has
the LOGGED attribute, the NO option sets the COPY-pending restriction
against the table space or partition that the loaded table resides in. No
table or partition in the table space can be updated by SQL until the
restriction is removed. For ways to remove the restriction, see Resetting
COPY-pending status on page 288.
|
|
If you load a single partition of a partitioned table space and the table
space has a secondary index, some logging might occur during the build
217
|
|
|
phase as DB2 logs any changes to the index structure. This logging allows
recoverability of the secondary index in case an abend occurs, and it also
allows concurrency.
|
|
|
|
|
DB2 treats table spaces that were created as NOT LOGGED as if you
specified LOG NO. If you specify LOG NO without specifying COPYDDN,
the base table space is placed in COPY-pending status. If XML columns are
nullable and not loaded, only the base table space is placed in
COPY-pending status.
|
|
|
A LOB table space affects logging while DB2 loads a LOB column
regardless of whether the LOB table space was defined with LOG YES or
LOG NO.
|
|
|
|
|
|
|
|
|
NOCOPYPEND
Specifies that LOAD is not to set the table space in the COPY-pending
status, even though LOG NO was specified. A NOCOPYPEND
specification does not turn on or change any informational
COPY-pending (ICOPY) status for indexes. A NOCOPYPEND
specification will not turn off any COPY-pending status that was set
prior to the LOAD. Normal completion of a LOAD LOG NO
NOCOPYPEND job returns a 0 code if no other errors or warnings
exist.
|
|
|
|
|
|
|
|
|
WORKDDN (ddname1,ddname2)
Specifies the DD statements for the temporary work file for sort input and sort
output. Temporary work files for sort input and output are required if the
LOAD involves tables with indexes.
ddname1 is the DD name for the temporary work file for sort input. The
default value is SYSUT1.
ddname2 is the DD name for the temporary work file for sort output. The
default value is SORTOUT.
The WORKDDN keyword specifies either a DD name or a TEMPLATE name
specification from a previous TEMPLATE control statement. If utility
processing detects that the specified name is both a DD name in the current job
step and a TEMPLATE name, the utility uses the DD name. For more
information about TEMPLATE specifications, see Chapter 31, TEMPLATE, on
page 641.
SORTKEYS
Specifies that index keys are to be sorted in parallel during the SORTBLD
phase to improve performance.
integer
Specifies an integer to provide an estimate of the number of index keys that
|
|
218
|
|
|
|
|
|
|
|
NO
Indicates that the SORTKEYS default is to be turned off.
For sequential data sets, LOAD computes an estimate based upon the input
data set size.
For more information about sorting keys, see Improved performance with
SORTKEYS on page 273 and Building indexes in parallel for LOAD on page
278.
FORMAT
Identifies the format of the input record. If you use FORMAT UNLOAD or
FORMAT SQL/DS, it uniquely determines the format of the input, and no field
specifications are allowed in an INTO TABLE option.
If you omit FORMAT, the format of the input data is determined by the rules
for field specifications.If you specify FORMAT DELIMITED, the format of the
input data is determined by the rules that are described in Appendix G,
Delimited file format, on page 1011.
UNLOAD
Specifies that the input record format is compatible with the DB2 unload
format. (The DB2 unload format is the result of REORG with the UNLOAD
ONLY option.)
Input records that were unloaded by the REORG utility are loaded into the
tables from which they were unloaded, if an INTO TABLE option specifies
each table. Do not add columns or change column definitions of tables
between the time you run REORG UNLOAD ONLY and LOAD FORMAT
UNLOAD.
Any WHEN clause on the LOAD FORMAT UNLOAD statement is
ignored; DB2 reloads the records into the same tables from which they
were unloaded. Not allowing a WHEN clause with the FORMAT
UNLOAD clause ensures that the input records are loaded into the proper
tables. Input records that cannot be loaded are discarded.
If the DCB RECFM parameter is specified on the DD statement for the
input data set, and the data set format has not been modified since the
REORG UNLOAD (ONLY) operation, the record format must be variable
(RECFM=V).
SQL/DS
Specifies that the input record format is compatible with the SQL/DS
unload format. The data type of a column in the table that is to be loaded
must be the same as the data type of the corresponding column in the
SQL/DS table.
If the SQL/DS input contains rows for more than one table, the WHEN
clause of the INTO TABLE option indicates which input records are to be
loaded into which DB2 table.
LOAD cannot load SQL/DS strings that are longer than the DB2 limit.
Chapter 16. LOAD
219
SQL/DS data that has been unloaded to disk under DB2 Server for VSE &
VM resides in a simulated z/OS-type data set with a record format of VBS.
Consider this format when transferring the data to another system that is
to be loaded into a DB2 table (for example, the DB2 Server for VSE & VM.
FILEDEF must define it as a z/OS-type data set). Processing the data set as
a standard CMS file puts the SQL/DS record type field at the wrong offset
within the records; LOAD is unable to recognize them as valid SQL/DS
input.
DELIMITED
Specifies that the input data file is in a delimited format. When data is in a
delimited format, all fields in the input data set are character strings or
external numeric values. In addition, each column in a delimited file is
separated from the next column by a column delimiter character.
For each of the delimiter types that you can specify, you must ensure that
the delimiter character is specified in the code page of the source data. The
delimiter character can be specified as either a character or hexadecimal
constant. For example, to specify # as the delimiter, you can specify either
COLDEL # or COLDEL X23. If the utility statement is coded in a
character type that is different from the input file, such as a utility
statement that is coded in EBCDIC and input data that is in Unicode, you
should specify the delimiter character in the utility statement as a
hexadecimal constant, or the result can be unpredictable.
You cannot specify the same character for more than one type of delimiter
(COLDEL, CHARDEL, and DECPT). For more information about delimiter
restrictions, see Loading delimited files on page 263.
Unicode input data for FORMAT DELIMITED must be UTF-8, CCSID 1208.
If you specify the FORMAT DELIMITED option, you cannot use any of the
following options:
v CONTINUEIF
v INCURSOR
v Multiple INTO TABLE statements
v WHEN
Also, LOAD ignores any specified POSITION statements within the LOAD
utility control statement.
For more information about using delimited output and delimiter
restrictions, see Loading delimited files on page 263. For more
information about delimited files see Appendix G, Delimited file format,
on page 1011.
COLDEL coldel
Specifies the column delimiter that is used in the input file. The
default value is a comma (,). For ASCII and UTF-8 data this is X2C,
and for EBCDIC data it is a X6B.
CHARDEL chardel
Specifies the character string delimiter that is used in the input file.
The default value is a double quotation mark (). For ASCII and UTF-8
data this is X22, and for EBCDIC data it is X3F.
To delimit character strings that contain the character string delimiter,
repeat the character string delimiter where it is used in the character
string. LOAD interprets any pair of character delimiters that are found
between the enclosing character delimiters as a single character. For
example, the phrase what a nice warm day is interpreted as what
220
Note: If you use DSNHDECP, ensure that the specified decimal value is
the same as the decimal value that is used in the input data. You must
specify the decimal value to match the decimal value that is used in the
input data.
FLOAT
Specifies that LOAD is to expect the designated format for floating point
numbers.
(S390)
Specifies that LOAD is to expect that floating point numbers are provided
in System/390 hexadecimal floating point (HFP) format. (S390) is the
format that DB2 stores floating point numbers in. It is also the default
value if you do not explicitly specify the FLOAT keyword.
(IEEE)
Specifies that LOAD is to expect that floating point numbers are provided
in IEEE binary floating point (BFP) format.
When you specify FLOAT(IEEE), DB2 converts the BFP data to HFP format
as the data is being loaded into the DB2 table. If a conversion error occurs
while DB2 is converting from BFP to HFP, DB2 places the record in the
discard file.
FLOAT(IEEE) is mutually exclusive with any specification of the FORMAT
keyword. If you specify both FLOAT(IEEE) and FORMAT, DB2 issues
message DSNU070I.
BFP format is sometimes called IEEE floating point.
EBCDIC
Specifies that the input data file is EBCDIC.
ASCII
Specifies that the input data file is ASCII. Numeric, date, time, and timestamp
internal formats are not affected by the ASCII option.
UNICODE
Specifies that the input data file is Unicode. The UNICODE option does not
affect the numeric internal formats.
CCSID
Specifies up to three coded character set identifiers (CCSIDs) for the input file.
The first value specifies the CCSID for SBCS data that is found in the input
file, the second value specifies the CCSID for mixed DBCS data, and the third
value specifies the CCSID for DBCS data. If any of these values is specified as
Chapter 16. LOAD
221
0 or omitted, the CCSID of the corresponding data type in the input file is
assumed to be the same as the installation default CCSID. If the input data is
EBCDIC, the omitted CCSIDs are assumed to be the EBCDIC CCSIDs that are
specified at installation, and if the input data is ASCII, the omitted CCSIDs are
assumed to be the ASCII CCSIDs that are specified at installation. If the
CCSIDs of the input data file do not match the CCSIDs of the table that is
being loaded, the input data is converted to the table CCSIDs before being
loaded.
integer is any valid CCSID specification.
If the input data is Unicode, the default CCSID values are the Unicode CCSIDs
that are specified at system installation.
NOSUBS
Specifies that LOAD is not to accept substitution characters in a string.
Place a substitution character in a string when that string is being converted
from ASCII to EBCDIC, or when the string is being converted from one CCSID
to another. For example, this substitution occurs when a character (sometimes
referred to as a code point) that exists in the source CCSID (code page) does
not exist in the target CCSID (code page).
When you specify the NOSUBS option and the LOAD utility determines that a
substitution character has been placed in a string as a result of a conversion, it
performs one of the following actions:
v If discard processing is active: DB2 issues message DSNU310I and places
the record in the discard file.
v If discard processing is not active: DB2 issues message DSNU334I, and the
utility abnormally terminates.
ENFORCE
Specifies whether LOAD is to enforce check constraints and referential
constraints, except informational referential constraints, which are not enforced.
CONSTRAINTS
Indicates that constraints are to be enforced. If LOAD detects a violation, it
deletes the errant row and issues a message to identify it. If you specify
this option and referential constraints exist, sort input and sort output data
sets must be defined.
NO
Indicates that constraints are not to be enforced. This option places the
target table space in the CHECK-pending status if at least one referential
constraint or check constraint is defined for the table.
ERRDDN ddname
Specifies the DD statement for a work data set that is being used during error
processing. Information about errors that are encountered during processing is
stored in this data set. A SYSERR data set is required if you request discard
processing.
ddname is the DD name.
The default value is SYSERR.
The ERRDDN keyword specifies either a DD name or a TEMPLATE name
specification from a previous TEMPLATE control statement. If utility
processing detects that the specified name is both a DD name in the current job
222
step and a TEMPLATE name, the utility uses the DD name. For more
information about TEMPLATE specifications, see Chapter 31, TEMPLATE, on
page 641.
MAPDDN ddname
Specifies the DD statement for a work data set that is to be used during error
processing. The work data set is used to correlate the identifier of a table row
with the input record that caused an error. A SYSMAP data set is required if
you specify ENFORCE CONSTRAINTS and the tables have a referential
relationship, or if you request discard processing when loading one or more
tables that contain unique indexes or extended indexes.
ddname is the DD name.
The default value is SYSMAP.
The MAPDDN keyword specifies either a DD name or a TEMPLATE name
specification from a previous TEMPLATE control statement. If utility
processing detects that the specified name is both a DD name in the current job
step and a TEMPLATE name, the utility uses the DD name. For more
information about TEMPLATE specifications, see Chapter 31, TEMPLATE, on
page 641.
DISCARDDN ddname
Specifies the DD statement for a discard data set that is to hold copies of
records that are not loaded (for example, if they contain conversion errors). The
discard data set also holds copies of records that are loaded and then removed
(because of unique index errors, referential or check constraint violations, or
index evaluation errors). Flag input records for discarding during RELOAD,
INDEXVAL, and ENFORCE phases. However, the discard data set is not
written until the DISCARD phase when the flagged records are copied from
the input data set to the discard data set. The discard data set must be a
sequential data set that can be written to by BSAM, with the same record
format, record length, and block size as the input data set.
ddname is the DD name.
The default value is SYSDISC.
If you omit the DISCARDDN option, the utility application program saves
discarded records only if a SYSDISC DD statement is in the JCL input.
|
|
|
|
|
|
223
SORTDEVT device-type
Specifies the device type for temporary data sets that are to be dynamically
allocated by DFSORT. You can specify any disk device type that is acceptable
to the DYNALLOC parameter of the SORT or OPTION options for DFSORT.
|
|
|
|
|
If you omit SORTDEVT and a sort is required, you must provide the DD
statements that the sort application program needs for the temporary data sets.
|
|
A TEMPLATE specification does not dynamically allocate sort work data sets.
The SORTDEVT keyword controls dynamic allocation of these data sets.
SORTNUM integer
Specifies the number of temporary data sets that are to be dynamically
allocated by the sort application program.
integer is the number of temporary data sets that can range from 2 to 255.
If you omit SORTDEVT, SORTNUM is ignored. If you use SORTDEVT and
omit SORTNUM, no value is passed to DFSORT. In this case, DFSORT uses its
own default.
If you omit SORTDEVT, SORTNUM is ignored. If you use SORTDEVT and
omit SORTNUM, no value is passed to DFSORT; DFSORT uses its own default.
|
|
|
|
|
You need at least two sort work data sets for each sort. The SORTNUM value
applies to each sort invocation in the utility. For example, if three indexes,
SORTKEYS is specified, there are no constraints that limit parallelism, and
SORTNUM is specified as 8, a total of 24 sort work data sets are allocated for a
job.
|
|
|
|
|
Each sort work data set consumes both above-the-line and below-the-line
virtual storage, so if you specify a value for SORTNUM that is too high, the
utility might decrease the degree of parallelism due to virtual storage
constraints, and possibly decreasing the degree down to one, meaning no
parallelism.
|
|
If the condition is true in any record, the next record is concatenated with it
before loading takes place. You can concatenate any number of records into a
larger record, up to a maximum size of 32767 bytes.
|
|
|
|
|
|
|
|
|
|
(start:end)
Specifies column numbers in the input record; the first column of the
record is column 1. The two numbers tell the starting and ending columns
of a continuation field in the input record.
224
|
|
|
|
|
The continuation field is removed from the input record and is not part of
the final load record.
|
|
|
|
|
|
If you omit :end, DB2 assumes that the length of the continuation field is
the length of the byte string or character string. If you use :end, and the
length of the resulting continuation field is not the same as the length of
the byte string or character string, the shorter string is padded. Character
strings are padded with blanks. Hexadecimal strings are padded with
zeros.
|
|
|
|
|
|
|
|
|
Xbyte-string
Specifies a string of hexadecimal characters. This byte-string value in the
continuation field indicates that the next input record is a continuation of
the current load record. Records with this byte-string value are
concatenated until the value in the continuation field changes. For
example, the following CONTINUEIF specification indicates that for any
input records that have a value of XFFin column 72, LOAD is to
concatenate that record with the next input record.
|
|
|
|
|
|
character-string
Specifies a string of characters that has the same effect as Xbyte-string. For
example, the following CONTINUEIF specification indicates that for any
input records that have the string CC in columns 99 and 100, LOAD is to
concatenate that record with the next input record.
|
|
|
DECFLOAT_ROUNDMODE
Specifies the rounding mode to use when DECFLOATs are manipulated. The
following rounding modes are supported:
|
|
|
|
ROUND_CEILING
Round toward +infinity. The discarded digits are removed if they are all
zero or if the sign is negative. Otherwise, the result coefficient should be
incremented by 1 (rounded up).
|
|
ROUND_DOWN
Round toward 0 (truncation). The discarded digits are ignored.
|
|
|
|
ROUND_FLOOR
Round toward -infinity. The discarded digits are removed if they are all
zero or positive. Otherwise, the sign is negative and the result coefficient
should be incremented by 1 (rounded up).
|
|
|
|
ROUND_HALF_DOWN
Round to the nearest number. If equidistant, round down. If the discarded
digits are greater than 0.5, the result coefficient should be incremented by 1
(rounded up). The discarded digits are ignored if they are 0.5 or less.
|
|
|
|
|
|
|
|
ROUND_HALF_EVEN
Round to the nearest number. If equidistant, round so that the final digit is
even. If the discarded digits are greater than .05, the result coefficient
should be incremented by 1 (rounded up). The discarded digits are ignored
if they are less than 0.5. If the result coefficient is .05 and the rightmost
digit is even, the result coefficient is not altered. If the result coefficient is
.05 and the rightmost digit is odd, the result coefficient should be
incremented by 1 (rounded up).
Chapter 16. LOAD
225
|
|
|
|
ROUND_HALF_UP
Round to nearest. If equidistant, round up. If the discarded digits are
greater than or equal to 0.5, the result coefficient should be incremented by
1 (rounded up). Otherwise the discarded digits are ignored.
|
|
|
|
ROUND_UP
Round away from 0. If all of the discarded digits are 0, the result is
unchanged. Otherwise, the result coefficient should be incremented by 1
(rounded up).
|
|
|
|
|
|
Specifying this option will allow LOAD INTO TABLE PART when the identity
column is part of the partitioning index.
|
|
INTO-TABLE-spec
The INTO-TABLE-spec control statement, with its multiple options, defines the
function that the utility job performs. More than one table or partition for each
table space can be loaded with a single invocation of the LOAD utility. At least one
INTO TABLE statement is required for each table that is to be loaded. Each INTO
TABLE statement:
v Identifies the table that is to be loaded
v Describes fields within the input record
v Defines the format of the input data set
All tables that are specified by INTO TABLE statements must belong to the same
table space.
If the data is already in UNLOAD or SQL/DS format, and FORMAT UNLOAD or
FORMAT SQL/DS is used on the LOAD statement, no field specifications are
allowed.
INTO-TABLE-spec:
226
IGNOREFIELDS NO
INTO
TABLE table-name
IGNOREFIELDS YES
PART integer
INDDN
SYSREC
INDDN
ddname
resume-spec
PREFORMAT
INCURSOR
DISCARDDN
cursor-name
ddname
WHEN
SQL/DS=table-name
field selection criterion
,
( field specification
resume-spec:
(1)
RESUME
NO
KEEPDICTIONARY
REPLACE
REUSE
RESUME
copy-spec
YES
Notes:
|
|
The value specified in the INTO TABLE for RESUME or REPLACE overrides the default value
for LOAD RESUME.
field-name
(start
:end
=
)
Xbyte-string
character-string
Ggraphic-string
Ngraphic-string
field specification:
227
field-name
POSITION(start
CHAR
:end
strip-spec
BIT
MIXED
BLOBF
PRESERVE WHITESPACE
CLOBF
MIXED
PRESERVE WHITESPACE
DBCLOBF
PRESERVE WHITESPACE
strip-spec
EXTERNAL
(length)
VARGRAPHIC strip-spec
SMALLINT
INTEGER
EXTERNAL
(length)
BIGINT
BINARY
strip-spec
(length)
VARBINARY
strip-spec
BINARY VARYING
decimal-spec
FLOAT
EXTERNAL
(length)
DATE EXTERNAL
(length)
TIME EXTERNAL
(length)
TIMESTAMP EXTERNAL
(length)
ROWID
BLOB
CLOB
MIXED
DBCLOB
(34)
DECFLOAT
(16)
EXTERNAL
(length)
XML
PRESERVE WHITESPACE
GRAPHIC
NULLIF field selection criterion
DEFAULTIF field selection criterion
strip spec:
BOTH
TRUNCATE
STRIP
TRAILING
LEADING
(1)
strip-char
Xstrip-char
Notes:
|
|
228
decimal spec:
PACKED
DECIMAL
ZONED
EXTERNAL
,0
(length
)
,scale
229
Use this option with care, because it also causes fields to be skipped if you
intend to load a column but have misspelled the name.
|
|
|
PART integer
Specifies that data is to be loaded into a partition of a partitioned table space.
This option is valid only for partitioned table spaces, not including
partition-by-growth table spaces.
|
|
|
|
integer is the number of the partition into which records are to be loaded. The
same partition number cannot be specified more than once if partition
parallelism has been requested. Any data that is outside the range of the
specified partition is not loaded. The maximum is 4096.
|
|
|
|
|
PREFORMAT
Specifies that the remaining pages are to be preformatted up to the
high-allocated RBA in the partition and its corresponding partitioning index
space. The preformatting occurs after the data is loaded and the indexes are
built.
RESUME
Specifies whether records are to be loaded into an empty or non-empty
partition. For nonsegmented table spaces, space is not reused for rows that
have been marked as deleted or by rows of dropped tables is not reused. If the
RESUME option is specified at the table space level, the RESUME option is not
allowed in the PART clause.
If you want the RESUME option to apply to the entire table space, use the
LOAD RESUME option. If you want the RESUME option to apply to a
particular partition, specify it by using PART integer RESUME.
NO
Loads records into an empty partition. If the partition is not empty, and
you have not used REPLACE, a message is issued, and the utility job step
terminates with a job step condition code of 8.
For nonsegmented table spaces that contains deleted rows or rows of
dropped tables, using the REPLACE keyword provides increased efficiency.
YES
Loads records into a non-empty partition. If the partition is empty, a
warning message is issued, but the partition is loaded.
REPLACE
Indicates that you want to replace only the contents of the partition that is
cited by the PART option, rather than the entire table space.
You cannot use LOAD REPLACE with the PART integer REPLACE option of
INTO TABLE. If you specify the REPLACE option, you must either replace an
entire table space, using LOAD REPLACE, or a single partition, using the
PART integer REPLACE option of INTO TABLE. You can, however, use PART
integer REPLACE with LOAD RESUME YES.
REUSE
Specifies, when used with the REPLACE option, that LOAD should logically
230
reset and reuse DB2-managed data sets without deleting and redefining them.
If you do not specify REUSE, DB2 deletes and redefines DB2-managed data
sets to reset them.
If you specify REUSE with REPLACE on the PART specification (and not for
LOAD at the table space level), only the specified partitions are logically reset.
If you specify REUSE for the table space and REPLACE for the partition, data
sets for the replaced parts are logically reset.
KEEPDICTIONARY
Specifies that the LOAD utility is not to build a new dictionary. LOAD retains
the current dictionary and uses it for compressing the input data. This option
eliminates the cost that is associated with building a new dictionary.
This keyword is valid only if a dictionary exists and the partition that is being
loaded has the COMPRESS YES attribute.
If the partition has the COMPRESS YES attribute, but no dictionary exists, one
is built and an error message is issued.
INDDN ddname
Specifies the data definition (DD) statement or template that identifies the
input data set for the partition. The record format for the input data set must
be fixed or variable. The data set must be readable by the basic sequential
access method (BSAM).
The ddname is the name of the input data set.
The default value is SYSREC. INDDN can be a template name.
When loading LOB data using file reference variables, this input data set
should include the names of the files that contain the LOB column values.
Each file can be either a sequential file, PDS member, PDSE member, or
separate HFS file.
If you specify INDDN, with or without DISCARDDN, in one INTO TABLE
PART specification and you supply more than one INTO TABLE PART clause,
you must specify INDDN in all INTO TABLE PART specifications.
Specifying INDDN at the partition level and supplying multiple PART clauses,
each with their own INDDN, enables load partition parallelism, which can
significantly improve performance. Loading all partitions in a single job with
load partition parallelism is recommended instead of concurrent separate jobs
whenever one or more nonpartitioned secondary indexes are on the table
space.
The field specifications apply separately to each input file. Therefore, if
multiple INTO TABLE PART INDDN clauses are used, field specifications are
required on each one.
DISCARDDN ddname
Specifies the DD statement for a discard data set for the partition. The discard
data set holds copies of records that are not loaded (for example, if they
contain conversion errors). The discard data set also holds copies of records
that were loaded and then removed (due to unique index errors, or referential
or check constraint violations).
Flag input records for discarding during the RELOAD, INDEXVAL, and
ENFORCE phases. However, the utility does not write the discard data set
until the DISCARD phase when the utility copies the flagged records from the
input data set to the discard data set.
231
The discard data set must be a sequential data set, and it must be
write-accessible by BSAM, with the same record format, record length, and
block size as the input data set.
The ddname is the name of the discard data set. DISCARDDN can be a
template name.
If you omit the DISCARDDN option, LOAD does not save discarded records.
INCURSOR cursor-name
Specifies the cursor for the input data set. You must declare the cursor before it
is used by the LOAD utility. Use the EXEC SQL utility control statement to
define the cursor. You cannot load data into the same table on which you
defined the cursor.
The specified cursor can be used as part of the DB2 family cross loader
function, which enables you to load data from any DRDA-compliant remote
server. For more information about using the cross loader function, see
Loading data by using the cross-loader function on page 270.
cursor-name is the cursor name. Cursor names that are specified with the
LOAD utility cannot be longer than eight characters.
You cannot use the INCURSOR option with the following options:
v SHRLEVEL CHANGE
v NOSUBS
v FORMAT UNLOAD
v FORMAT SQL/DS
v CONTINUEIF
v WHEN.
In addition, you cannot specify field specifications with the INCURSOR option.
WHEN
Indicates which records in the input data set are to be loaded. If no WHEN
clause is specified (and if FORMAT UNLOAD was not used in the LOAD
statement), all records in the input data set are loaded into the specified tables
or partitions. (Data that is beyond the range of the specified partition is not
loaded.)
The option following WHEN describes a condition; input records that satisfy
the condition are loaded. Input records that do not satisfy any WHEN clause
of any INTO TABLE statement are written to the discard data set, if one is
being used.
|
|
|
|
|
|
|
|
|
SQL/DS=table-name
Is valid only when the FORMAT SQL/DS option is used on the LOAD
statement.
table-name is the name of a table that has been unloaded into the unload
data set. The table name after INTO TABLE tells which DB2 table the
SQL/DS table is loaded into. Enclose the table name in quotation marks if
the name contains a blank.
|
|
|
|
232
|
|
|
|
|
|
field-selection-criterion
Describes a field and a character constant. Only those records in which the
field contains the specified constant are to be loaded into the table that is
specified after INTO TABLE.
|
|
|
|
|
|
|
|
v Start at the same byte offset in each assembled input record. If any
record contains varying-length strings, which are stored with length
fields, that precede the selection field, they must be padded so that the
start of the selection field is always at the same offset.
|
|
|
|
The field and the constant do not need to be the same length. If they are
not, the shorter of the two is padded before a comparison is made.
Character and graphic strings are padded with blanks. Hexadecimal strings
are padded with zeros.
|
|
|
|
field-name
Specifies the name of a field that is defined by a field-specification. If
field-name is used, the start and end positions of the field are given by
the POSITION option of the field specification.
|
|
|
|
(start:end)
Identifies column numbers in the assembled load record; the first
column of the record is column 1. The two numbers indicate the
starting and ending columns of a selection field in the load record.
|
|
If :end is not used, the field is assumed to have the same length as the
constant.
|
|
|
|
|
Xbyte-string
Identifies the constant as a string of hexadecimal characters. For
example, the following WHEN clause specifies that a record is to be
loaded if it has the value XFFFF in columns 33 through 34.
|
|
|
|
|
character-string
Identifies the constant as a string of characters. For example, the
following WHEN clause specifies that a record is to be loaded if the
field DEPTNO has the value D11.
|
|
|
|
|
Ggraphic-string
Identifies the constant as a string of double-byte characters. For
example, the following WHEN clause specifies that a record is to be
loaded if it has the specified value in columns 33 through 36.
|
|
|
|
233
Ngraphic-string
Identifies the constant as a string of double-byte characters. N and G
are synonymous for specifying graphic string constants. Specify N as
an uppercase character.
|
|
|
|
(field-specification, ...)
Describes the location, format, and null value identifier of the data that is to be
loaded.
If no field specifications are used:
v The fields in the input records are assumed to be in the same order as in the
DB2 table.
v The formats are set by the FORMAT option on the LOAD statement, if that
option is used.
v Fixed strings in the input are assumed to be of fixed maximum length.
VARCHAR and VARGRAPHIC fields must contain a valid 2-byte binary
length field preceding the data; no intervening gaps are allowed between the
VARCHAR or VARGRAPHIC fields and the field that follows.
v BINARY fields are assumed to be of fixed maximum length.
|
|
|
v VARBINARY fields must contain a valid 2-byte binary length field preceding
the data.
v ROWID fields are varying length, and must contain a valid 2-byte binary
length field preceding the data; no intervening gaps are allowed between
ROWID fields and the fields that follow.
v LOB fields are varying length, and require a valid 4-byte binary length field
preceding the data; no intervening gaps are allowed between them and the
LOB fields that follow.
v Numeric data is assumed to be in the appropriate internal DB2 number
representation.
v The NULLIF or DEFAULTIF options cannot be used.
If any field specification is used for an input table, a field specification must
exist for each field of the table that does not have a default value. Any field in
the table with no corresponding field specification is loaded with its default
value.
If any column in the output table does not have a field specification and is
defined as NOT NULL, with no default, the utility job step is terminated.
Identity columns or row change timestamp columns can appear in the field
specification only if you defined them with the GENERATED BY DEFAULT
attribute.
|
|
|
field-name
Specifies the name of a field, which can be a name of your choice. If the field
is to be loaded, the name must be the name of a column in the table that is
named after INTO TABLE unless IGNOREFIELDS is specified. You can use the
field name as a vehicle to specify the range of incoming data. See Example 4:
Loading data of different data types for an example of loading selected records
into an empty table space.
The starting location of the field is given by the POSITION option. If
POSITION is not used, the starting location is one column after the end of the
previous field.
LOAD determines the length of the field in one of the following ways, in the
order listed:
234
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Data type
BIGINT
BINARY
BLOB
Varying
CHARACTER
CLOB
Varying
DATE
DBCLOB
Varying
DECFLOAT(16)
DECFLOAT(34)
16
|
|
|
DECIMAL EXTERNAL
DECIMAL PACKED
|
|
|
DECIMAL ZONED
|
|
GRAPHIC
INTEGER
MIXED
ROWID
Varying
SMALLINT
TIME
235
Table 30. Default length of each data type (in bytes) (continued)
Data type
TIMESTAMP
26
VARBINARY
Varying
VARCHAR
Varying
VARGRAPHIC
Varying
|
|
XML
Varying
If a data type is not given for a field, its data type is assumed to be the same
as that of the column into which it is loaded, as given in the DB2 table
definition.
POSITION(start:end)
Indicates where a field is in the assembled load record.
start and end are the locations of the first and last columns of the field; the first
column of the record is column 1. The option can be omitted.
Column locations can be specified as:
v An integer n, meaning an actual column number
v *, meaning one column after the end of the previous field
v *+n, where n is an integer, meaning n columns after the location that is
specified by *
Do not enclose the entire POSITION option specification in parentheses;
enclose only the start:end description in parentheses. Valid and invalid
specifications are shown in the following table.
Table 31. Example of valid and invalid POSITION specifications
Valid
Invalid
POSITION (10:20)
(POSITION (10:20))
Data types in a field specification: The data type of the field can be specified by
any of the keywords that follow. Except for graphic fields, length is the length in
bytes of the input field.
All numbers that are designated EXTERNAL are in the same format in the input
records.
CHAR(length)
Specifies a fixed-length character string. If you do not specifylength, the length
of the string is determined from the POSITION specification. If you do not
specifylength or POSITION, LOAD uses the default length for CHAR, which is
determined from the length of the column in the table. You can also specify
CHARACTER and CHARACTER(length).
When you specify CHAR as the type for the file name for CLOBF, BLOBF, or
DBCLOBF, you must also provide the length so that the LOAD utility can
determine the correct file name. Otherwise message DSNU338I will be issued
for an invalid column specification.
|
|
|
|
BIT
Specifies that the input field contains BIT data. If BIT is specified, LOAD
bypasses any CCSID conversions for the input data. If the target column
has the BIT data type attribute, LOAD bypasses any code page translation
for the input data.
236
MIXED
Specifies that the input field contains mixed SBCS and DBCS data. If
MIXED is specified, any required CCSID conversions use the mixed CCSID
for the input data. If MIXED is not specified, any such conversions use the
SBCS CCSID for the input data.
|
|
|
BLOBF
Indicates that the input field contains the name of a BLOB file which is
going to be loaded to a specified BLOB/XML column.
|
|
|
CLOBF
Indicates that the input field contains the name of a CLOB file which is
going to be loaded to a specified CLOB/XML column.
|
|
|
DBCLOBF
Indicates that the input field contains the name of a DBCLOBF file which
is going to be loaded to a specified DBCLOB/XML column.
PRESERVE WHITESPACE
Specifies that the white space in the XML column is preserved. The default
is not to preserve the white space.
STRIP
Specifies that LOAD is to remove zeros (the default) or the specified
characters from the beginning, the end, or both ends of the data. LOAD
pads the CHAR field, so that it fills the rest of the column.
LOAD applies the strip operation before performing any character code
conversion or padding.
The effect of the STRIP option is the same as the SQL STRIP scalar
function.
BOTH
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the beginning and end of the data.
TRAILING
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the end of the data.
LEADING
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the beginning of the data.
strip-char
Specifies a single-byte or double-byte character that LOAD is to strip
from the data.
Specify this character value in EBCDIC. Depending on the input
encoding scheme, LOAD applies SBCS CCSID conversion to the
strip-char value before it is used in the strip operation.
If the subtype of the column to be loaded is BIT or you want to specify
a strip-char value in an encoding scheme other than EBCDIC, use the
hexadecimal form (Xstrip-char). LOAD does not perform any CCSID
conversion if the hexadecimal form is used.
Xstrip-char
Specifies in hexadecimal form a single-byte or double-byte character
that LOAD is to strip from the data. For single-byte characters, specify
this value in the form Xhh, where hh is two hexadecimal characters.
237
BLOBF
Indicates that the input field contains the name of a BLOB file which is
going to be loaded to a specified BLOB/XML column.
|
|
|
CLOBF
Indicates that the input field contains the name of a CLOB file which is
going to be loaded to a specified CLOB/XML column.
|
|
|
DBCLOBF
Indicates that the input field contains the name of a DBCLOBF file which
is going to be loaded to a specified DBCLOB/XML column.
PRESERVE WHITESPACE
Specifies that the white space in the XML column is preserved. The default
is not to preserve the white space.
STRIP
Specifies that LOAD is to remove zeros (the default) or the specified
characters from the beginning, the end, or both ends of the data. LOAD
adjusts the VARCHAR length field to the length of the stripped data.
238
LOAD applies the strip operation before performing any character code
conversion or padding.
The effect of the STRIP option is the same as the SQL STRIP scalar
function.
BOTH
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the beginning and end of the data.
TRAILING
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the end of the data.
LEADING
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the beginning of the data.
strip-char
Specifies a single-byte or double-byte character that LOAD is to strip
from the data.
Specify this character value in EBCDIC. Depending on the input
encoding scheme, LOAD applies SBCS CCSID conversion to the
strip-charvalue before it is used in the strip operation.
If the subtype of the column to be loaded is BIT or you want to specify
a strip-char value in an encoding scheme other than EBCDIC, use the
hexadecimal form (Xstrip-char). LOAD does not perform any CCSID
conversion if the hexadecimal form is used.
Xstrip-char
Specifies in hexadecimal form a single-byte or double-byte character
that LOAD is to strip from the data. For single-byte characters, specify
this value in the form Xhh, where hh is two hexadecimal characters.
For double-byte characters, specify this value in the form Xhhhh,
where hhhh is four hexadecimal characters.
Use the hexadecimal form to specify a character in an encoding scheme
other than EBCDIC. When you specify the character value in
hexadecimal form, LOAD does not perform any CCSID conversion.
If you specify a strip character in the hexadecimal format, you must
specify the character in the input encoding scheme.
TRUNCATE
Indicates that LOAD is to truncate the input character string from the right
if the string does not fit in the target column. LOAD performs the
truncation operation after any CCSID translation.
If the input data is BIT data, LOAD truncates the data at a byte boundary.
If the input data is character type data, LOAD truncates the data at a
character boundary. If a mixed-character type data is truncated to fit a
column of fixed size, the truncated string can be shorter than the specified
column size. In this case, blanks in the output CCSID are padded to the
right.
GRAPHIC(length)
Specifies a fixed-length graphic type. You can specify both start and end for the
field specification.
If you use GRAPHIC, the input data must not contain shift characters. start
and end must indicate the starting and ending positions of the data itself.
Chapter 16. LOAD
239
length is the number of double-byte characters. The length of the field in bytes
is twice the value of length. If you do not specify length, the number of
double-byte characters is determined from the POSITION specification. If you
do not specify length or POSITION, LOAD uses the default length for
GRAPHIC, which is determined from the length of the column in the table.
For example, let *** represent three double-byte characters. Then, to describe
***, specify either POS(1:6) GRAPHIC or POS(1) GRAPHIC(3). A GRAPHIC field
that is described in this way cannot be specified in a field selection criterion.
STRIP
Specifies that LOAD is to remove zeros (the default) or the specified
characters from the beginning, the end, or both ends of the data.
LOAD applies the strip operation before performing any character code
conversion or padding.
The effect of the STRIP option is the same as the SQL STRIP scalar
function.
BOTH
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the beginning and end of the data.
TRAILING
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the end of the data.
LEADING
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the beginning of the data.
Xstrip-char
Specifies the hexadecimal form of the double-byte character that LOAD
is to strip from the data. Specify this value in the form Xhhhh, where
hhhh is four hexadecimal characters.
You must specify the character in the input encoding scheme.
TRUNCATE
Indicates that LOAD is to truncate the input character string from the right
if the string does not fit in the target column. LOAD performs the
truncation operation after any CCSID translation.
LOAD truncates the data at a character boundary. Double-byte characters
are not split.
GRAPHIC EXTERNAL(length)
Specifies a fixed-length field of the graphic type with the external format. You
can specify both start and end for the field specification.
If you use GRAPHIC EXTERNAL, the input data must contain a shift-out
character in the starting position, and a shift-in character in the ending
position. Other than the shift characters, this field must have an even number
of bytes. The first byte of any pair must not be a shift character.
length is the number of double-byte characters. length for GRAPHIC
EXTERNAL does not include the number of bytes that are represented by shift
characters. The length of the field in bytes is twice the value of length. If you
do not specify length, the number of double-byte characters is determined from
the POSITION specification. If you do not specify length or POSITION, LOAD
uses the default length for GRAPHIC, which is determined from the length of
the column in the table.
240
For example, let *** represent three double-byte characters, and let < and >
represent shift-out and shift-in characters. Then, to describe <***>, specify
either POS(1:8) GRAPHIC EXTERNAL or POS(1) GRAPHIC EXTERNAL(3).
STRIP
Specifies that LOAD is to remove zeros (the default) or the specified
characters from the beginning, the end, or both ends of the data.
LOAD applies the strip operation before performing any character code
conversion or padding.
The effect of the STRIP option is the same as the SQL STRIP scalar
function.
BOTH
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the beginning and end of the data.
TRAILING
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the end of the data.
LEADING
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the beginning of the data.
Xstrip-char
Specifies the hexadecimal form of the double-byte character that LOAD
is to strip from the data. Specify this value in the form Xhhhh, where
hhhh is four hexadecimal characters.
You must specify the character in the input encoding scheme.
TRUNCATE
Indicates that LOAD is to truncate the input character string from the right
if the string does not fit in the target column. LOAD performs the
truncation operation after any CCSID translation.
LOAD truncates the data at a character boundary. Double-byte characters
are not split.
VARGRAPHIC
Identifies a graphic field of varying length. The length, in double-byte
characters, must be specified in a 2-byte binary field preceding the data. (The
length does not include the 2-byte field itself.) The length field must start in
the column that is specified as start in the POSITION option. :end, if used, is
ignored.
VARGRAPHIC input data must not contain shift characters.
STRIP
Specifies that LOAD is to remove zeros (the default) or the specified
characters from the beginning, the end, or both ends of the data. LOAD
adjusts the VARGRAPHIC length field to the length of the stripped data
(the number of DBCS characters).
LOAD applies the strip operation before performing any character code
conversion or padding.
The effect of the STRIP option is the same as the SQL STRIP scalar
function.
241
BOTH
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the beginning and end of the data.
TRAILING
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the end of the data.
LEADING
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the beginning of the data.
Xstrip-char
Specifies the hexadecimal form of the double-byte character that LOAD
is to strip from the data. Specify this value in the form Xhhhh, where
hhhh is four hexadecimal characters.
You must specify the character in the input encoding scheme.
TRUNCATE
Indicates that LOAD is to truncate the input character string from the right
if the string does not fit in the target column. LOAD performs the
truncation operation after any CCSID translation.
LOAD truncates the data at a character boundary. Double-byte characters
are not split.
SMALLINT
Specifies a 2-byte binary number. Negative numbers are in twos complement
notation.
INTEGER
Specifies a 4-byte binary number. Negative numbers are in twos complement
notation. You can also specify INT.
INTEGER EXTERNAL(length)
A string of characters that represent a number. The format is that of an SQL
numeric constant. If you do not specify length, the length of the string is
determined from the POSITION specification. If you do not specify length or
POSITION, LOAD uses the default length for INTEGER, which is 4 bytes. You
can also specify INT EXTERNAL.
|
|
|
BIGINT
Specifies an 8-byte binary number. Negative numbers are in twos complement
notation.
|
|
|
|
|
|
|
BINARY(length)
Specifies a fixed-length binary string. If you do not specify length, the length of
the string is determined from the POSITION specification. If you do not
specify length or POSITION, LOAD uses the default length for BINARY, which
is determined from the length of the column in the table. The default for
Xstrip-char is hexadecimal zero (X00). No data conversion is applied to the
field.
|
|
|
|
STRIP
Specifies that LOAD is to remove binary zeros (the default) or the specified
Xstrip-char from the beginning, the end, or both ends of the data. LOAD
pads the BINARY field, so that it fills the rest of the column.
The effect of the STRIP option is the same as the SQL STRIP scalar
function.
|
|
242
|
|
|
BOTH
Indicates that LOAD is to remove occurrences of binary zeros or the
specified strip character from the beginning and end of the data.
|
|
|
TRAILING
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the end of the data.
|
|
|
LEADING
Indicates that LOAD is to remove occurrences of blank or the specified
strip character from the beginning of the data.
|
|
|
|
Xstrip-char
Specifies, in hexadecimal form, a single-byte or double-byte character
that LOAD is to strip from the data. For single-byte characters, specify
this value in the form Xhh, where hh is two hexadecimal characters.
|
|
|
TRUNCATE
Indicates that LOAD is to truncate the input character string from the right
if the string does not fit in the target column.
|
|
|
|
|
|
|
VARBINARY
Specifies a varying length binary string. The length in bytes must be specified
in a 2-byte binary field preceding the data (the length does not include the
2-byte field itself). The length field must start in the column that is specified as
start in the POSITION option. If :end is used, it is ignored. The default for
Xstrip-char is hexadecimal zero (X00). No data conversion is applied to the
field.
|
|
|
|
STRIP
Specifies that LOAD is to remove binary zeros (the default) or the specified
characters from the beginning, the end, or both ends of the data. LOAD
pads the VARBINARY field, so that it fills the rest of the column.
|
|
The effect of the STRIP option is the same as the SQL STRIP scalar
function.
|
|
|
BOTH
Indicates that LOAD is to remove occurrences of binary zeros or the
specified strip character from the beginning and end of the data.
|
|
|
TRAILING
Indicates that LOAD is to remove occurrences of binary zeros or the
specified strip character from the end of the data.
|
|
|
LEADING
Indicates that LOAD is to remove occurrences of binary zeros or the
specified strip character from the beginning of the data.
|
|
|
|
Xstrip-char
Specifies, in hexadecimal form, a single-byte character that LOAD is to
strip from the data. For single-byte characters, specify this value in the
form Xhh, where hh is two hexadecimal characters.
|
|
|
TRUNCATE
Indicates that LOAD is to truncate the input character string from the right
if the string does not fit in the target column.
243
DECIMAL PACKED
Specifies a number of the form ddd...ds, where d is a decimal digit that is
represented by four bits, and s is a 4-bit sign value. The plus sign (+) is
represented by A, C, E, or F, and the minus sign (-) is represented by B or D.
The maximum number of ds is the same as the maximum number of digits
that are allowed in the SQL definition. You can also specify DECIMAL, DEC,
or DEC PACKED.
DECIMAL ZONED
Specifies a number in the form znznzn...z/sn, where z, n, and s have the
following values:
n
A decimal digit represented by the right 4 bits of a byte (called the
numeric bits)
z
That digits zone, represented by the left 4 bits
s
The right-most byte of the decimal operand; s can be treated as a zone
or as the sign value for that digit
The plus sign (+) is represented by A, C, E, or F, and the minus sign (-) is
represented by B or D. The maximum number of zns is the same as the
maximum number of digits that are allowed in the SQL definition. You can
also specify DEC ZONED.
DECIMAL EXTERNAL(length,scale)
Specifies a string of characters that represent a number. The format is that of
an SQL numeric constant.
length
Overall length of the input field, in bytes. If you do not specify length, the
length of the input field is determined from the POSITION specification. If
you do not specify length or POSITION, LOAD uses the default length for
DECIMAL EXTERNAL, which is determined by using decimal precision.
scale
Specifies the number of digits to the right of the decimal point. scale must
be an integer greater than or equal to 0, and it can be greater than length.
The default value is 0.
If scale is greater than length, or if the number of provided digits is less than
the specified scale, the input number is padded on the left with zeros until the
decimal point position is reached. If scale is greater than the target scale, the
source scale locates the implied decimal position. All fractional digits greater
than the target scale are truncated. If scale is specified and the target column
has a data type of small integer or integer, the decimal portion of the input
number is ignored. If a decimal point is present, its position overrides the field
specification of scale.
FLOAT(length)
Specifies either a 64-bit floating-point number or a 32-bit floating-point
number. If length is between 1 and 21 inclusive, the number is 32 bits in the
s390 (HFP) format:
Bit 0
Bits 1-7
Represent an exponent
Bits 8-31
Represent a mantissa
244
If length is between 1 and 24 inclusive, the number is 32 bits in the IEEE (BFP)
format:
Bit 0
Bits 1-8
Represent an exponent
Bits 9-31
Represent a mantissa
If length is not specified, or is between 22 and 53 inclusive, the number is 64
bits in the s390 (HFP) format:
Bit 0
Bits 1-7
Represent an exponent
Bits 8-63
Represent a mantissa.
If length is not specified, or is between 25 and 53 inclusive, the number is 64
bits in the IEEE (BFP) format:
Bit 0
Bits 1-11
Represent an exponent
Bits 12-63
Represent a mantissa.
You can also specify REAL for single-precision floating-point numbers and
DOUBLE PRECISION for double-precision floating-point numbers.
FLOAT EXTERNAL(length)
Specifies a string of characters that represent a number. The format is that of
an SQL floating-point constant.
A specification of FLOAT(IEEE) or FLOAT(S390) does not apply for this format
(string of characters) of floating-point numbers.
If you do not specify length, the length of the string is determined from the
POSITION specification. If you do not specify length or POSITION, LOAD uses
the default length for FLOAT, which is 4 bytes for single precision and 8 bytes
for double precision.
DATE EXTERNAL(length)
Specifies a character string representation of a date. The length, if unspecified,
is the specified length on the LOCAL DATA LENGTH install option, or, if none
was provided, the default is 10 bytes. If you specify a length, it must be within
the range of 8 to 254 bytes.
Dates can be in any of the following formats. You can omit leading zeros for
month and day. You can include trailing blanks, but no leading blanks are
allowed.
v dd.mm.yyyy
v mm/dd/yyyy
v yyyy-mm-dd
v Any local format that your site defined at the time DB2 was installed
TIME EXTERNAL(length)
Specifies a character string representation of a time. The length, if unspecified,
Chapter 16. LOAD
245
is the specified length on the LOCAL TIME LENGTH install option, or, if none
was provided, the default is 8 bytes. If you specify a length, it must be within
the range of 4 to 254 bytes.
Times can be in any of the following formats:
v hh.mm.ss
v hh:mm AM
v hh:mm PM
v hh:mm:ss
v Any local format that your site defined at the time DB2 was installed
You can omit the mm portion of the hh:mm AM and hh:mm PM formats if mm is
equal to 00. For example, 5 PM is a valid time, and can be used instead of 5:00
PM.
TIMESTAMP EXTERNAL(length)
Specifies a character string representation of a time. The default for length is 26
bytes. If you specify a length, it must be within the range of 19 to 26 bytes.
Timestamps can be in any of the following formats. Note that nnnnnn
represents the number of fractional seconds, and can be from 0 to 6 digits. You
can omit leading zeros from the month, day, or hour parts of the timestamp;
you can omit trailing zeros from the fractional seconds part of the timestamp.
v yyyy-mm-dd-hh.mm.ss
v yyyy-mm-dd-hh.mm.ss.nnnnnn
v yyyy-mm-dd hh:mm:ss.nnnnnn
ROWID
Specifies a row ID. The input data must be a valid value for a row ID; DB2
does not perform any conversions.
A field specification for a row ID column is not allowed if the row ID column
was created with the GENERATED ALWAYS option.
If the row ID column is part of the partitioning key, LOAD INTO TABLE PART
is not allowed; specify LOAD INTO TABLE instead.
BLOB
Specifies a BLOB field. You must specify the length in bytes in a 4-byte binary
field that precedes the data. (The length does not include the 4-byte field
itself.) The length field must start in the column that is specified as start in the
POSITION option. If :end is used, it is ignored.
CLOB
Specifies a CLOB field. You must specify the length in bytes in a 4-byte binary
field that precedes the data. (The length does not include the 4-byte field
itself.) The length field must start in the column that is specified as start in the
POSITION option. If :end is used, it is ignored.
MIXED
Specifies that the input field contains mixed SBCS and DBCS data. If
MIXED is specified, any required CCSID conversions use the mixed CCSID
for the input data; if MIXED is not specified, any such conversions use the
SBCS CCSID for the input data.
DBCLOB
Specifies a DBCLOB field. You must specify the length in double-byte
characters in a 4-byte binary field that precedes the data. (The length does not
include the 4-byte field itself.) The length field must start in the column that is
specified as start in the POSITION option. If :end is used, it is ignored.
246
|
|
|
|
|
|
DECFLOAT (length)
Specifies either a 128-bit decimal floating-point number or a 64-bit decimal
floating-point number. The value of the length must be either 16 or 34. If the
length is 16, the number is in 64 bit decimal floating-point number format. If
the length is 34, the number is in 128 bit decimal floating-point format. If the
length is not specified, the number is in 128 bit decimal floating-point format.
|
|
|
|
|
|
|
|
|
|
XML
Specifies the input field type is XML. Field type XML can only be loaded to a
XML column. Specify XML when loading the XML value directly from the
input record. If the format of the input record is in nondelimited, you must
specify a 2 byte length field precedes the actual data value.
|
|
|
PRESERVE WHITESPACE
Specifies that the white space in the XML column is preserved. The default is
not to preserve the white space.
DEFAULTIF field-selection-criterion
Describes a condition that causes the DB2 column to be loaded with its default
value. You can write the field-selection-criterion with the same options as
described under field-selection-criterion. If the contents of the DEFAULTIF field
match the provided character constant, the field that is specified in
field-specification is loaded with its default value.
If the DEFAULTIF field is defined by the name of a VARCHAR or
VARGRAPHIC field, DB2 takes the length of the field from the 2-byte binary
field that appears before the data portion of the VARCHAR or VARGRAPHIC
field.
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
The fact that a field in the output table is loaded with NULL does not change
the format or function of the corresponding field in the input record. The input
field can still be used in a field selection criterion. For example, assume that a
LOAD statement has the following field specification:
(FIELD1 POSITION(*) CHAR(4)
FIELD2 POSITION(*) CHAR(3) NULLIF(FIELD1='SKIP')
FIELD3 POSITION(*) CHAR(5))
FLD03
248
|
|
If you are using LOAD for a partition-by-growth table space, you can load data
only at the table space level, not at the partition level.
Related information
Multilevel security (DB2 Administration Guide)
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
249
|
|
250
Data set
Description
Required?
STPRIN01
No1
Yes2
Yes3, 5
UTPRINT
Yes
Yes
Yes
No8
Yes9, 11
No1, 10, 11
|
|
|
Description
Required?
Note:
1. Required when collecting inline statistics on at least one data-partitioned secondary
index.
2. As an alternative to specifying an input data set, you can specify a cursor with the
INCURSOR option.
3. Required if referential constraints exist and ENFORCE(CONSTRAINTS) is specified
(This option is the default).
4. Used for tables with indexes.
5. Required for discard processing when loading one or more tables that have unique
indexes.
6. Required if a sort is done.
7. If you omit the DD statement for this data set, LOAD creates the data set with the
same record format, record length, and block size as the input data set.
8. Required for inline copies.
9. Required if any indexes are to be built or if a sort is required for processing errors.
10. If the DYNALLOC parm of the SORT program is not turned on, you need to allocate
the data set. Otherwise, DFSORT dynamically allocates the temporary data set.
11. It is recommended that you use dynamic allocation by specifying SORTDEVT in the
utility statement because dynamic allocation reduces the maintenance required of the
utility job JCL.
The following object is named in the utility control statement and does not require
a DD statement in the JCL:
Table
Table that is to be loaded. (If you want to load only one partition of a
table, you must use the PART option in the control statement.)
Size
SORTOUT
max(f,e)
2 (maximum record length numcols (count + 2) number of
indexes)
ST01WKnn
SYSDISC
SYSERR
SYSMAP
251
Table 33. Size of work data sets for LOAD jobs (continued)
Work data set
Size
SYSUT1
Note:
variable
meaning
k
Key calculation
Map calculation
Error calculation
max()
numcols Number of key columns to concatenate when you collect frequent values from the
specified index
count
252
DB2 utilities uses DFSORT to perform sorts. Sort work data sets cannot span
volumes. Smaller volumes require more sort work data sets to sort the same
amount of data; therefore, large volume sizes can reduce the number of needed
sort work data sets. It is recommended that at least 1.2 times the amount of data to
be sorted be provided in sort work data sets on disk. For more information about
DFSORT, see DFSORT Application Programming: Guide.
253
LOAD PART
SHRLEVEL
NONE
LOAD
SHRLEVEL
CHANGE
LOAD PART
SHRLEVEL
CHANGE
DA/UTUT
DA/UTUT
CW/UTRW
CW/UTRW
Nonpartitioned secondary
index1
DA/UTUT
DR
CW/UTRW
CW/UTRW
Data-partitioned secondary
index2
DA/UTUT
DA/UTUT
CW/UTRW
CW/UTRW
None
DA/UTUT
None
CW/UTRW
DW/UTRO
DW/UTRO
CR/UTRW
CR/UTRW
RI dependents
CHKP (NO)
CHKP (NO)
CHKP (NO)
CHKP (NO)
Target
Legend:
v CHKP (NO): Concurrently running applications do not see CHECK-pending status after
commit.
v CR: Claim the read claim class.
v CW: Claim the write claim class.
v DA: Drain all claim classes, no concurrent SQL access.
v DR: Drain the repeatable read class, no concurrent access for SQL repeatable readers.
v DW: Drain the write claim class, concurrent access for SQL readers.
v UTUT: Utility restrictive state, exclusive control.
v UTRO: Utility restrictive state, read-only access allowed.
v UTRW: Utility restrictive state, read-write access allowed.
v None: Object is not affected by this utility.
v RI: Referential integrity
Note:
|
|
|
|
1. Includes the document ID indexes and node ID indexes over non-partitioned XML table
spaces and XML indexes.
2. Includes document ID indexes and node ID indexes over partitioned XML table spaces.
3. Includes logical partitions of an XML index over partitioned table spaces.
Compatibility
The following table shows whether or not utilities are compatible with LOAD and
can run concurrently on the same target object. The target object can be a table
space, an index space, or a partition of a table space or index space.
Table 35. Compatibility of LOAD with other utilities
254
Action
LOAD SHRLEVEL
NONE
LOAD SHRLEVEL
CHANGE
BACKUP SYSTEM
YES
YES
No
No
No
No
CHECK INDEX
No
No
CHECK LOB
No
No
No
Yes
LOAD SHRLEVEL
CHANGE
No
No
No
Yes
No
No
COPYTOCOPY
No
Yes
DIAGNOSE
Yes
Yes
No
Yes
No
No
MERGECOPY
No
Yes
MODIFY RECOVERY
No
Yes
MODIFY STATISTICS
No
Yes
QUIESCE
No
No
REBUILD INDEX
No
No
No
No
No
No
No
No
REORG INDEX
No
No
No
No
No
No
No
No
No
No
No
No
REPORT
Yes
No
RESTORE SYSTEM
No
No
No
Yes
No
No
RUNSTATS TABLESPACE
SHRLEVEL CHANGE
No
Yes
RUNSTATS TABLESPACE
SHRLEVEL REFERENCE
No
No
STOSPACE
Yes
Yes
UNLOAD
No
Yes
Action
SQL operations and other online utilities on the same target partition are
incompatible.
Chapter 16. LOAD
255
|
|
|
|
|
|
|
|
|
|
|
256
DSN8910.DEPT
POSITION (1)
POSITION (5)
POSITION (37)
POSITION (44)
POSITION (48)
CHAR(3),
VARCHAR,
CHAR(6),
CHAR(3),
CHAR(16) )
Figure 28. Example of using LOAD to replace one table in a single-table table space
257
2. Use LOAD with RESUME YES on the second table as shown in the control
statement in the following example. This option adds the records for the second
table without destroying the data in the first table.
LOAD DATA CONTINUEIF(72:72)='X'
RESUME YES
INTO DSN8910.TDSPTXT
( DSPINDEX POSITION (2)
CHAR(2),
LINENO
POSITION (6)
CHAR(2),
DSPLINE
POSITION (80)
CHAR(79) )
Figure 30. Example of using LOAD with RESUME YES on the second table in a
multiple-table table space
If you need to replace just one table in a multiple-table table space, you need to
delete all the rows in the table, and then use LOAD with RESUME YES. For
example, assume that you want to replace all the data in DSN8910.TDSPTXT
without changing any data in DSN8910.TOPTVAL. To do this, follow these steps:
1. Delete all the rows from DSN8910.TDSPTXT by using the following SQL
DELETE statement:
EXEC SQL
DELETE FROM DSN8910.TDSPTXT
ENDEXEC
Tip: The mass delete works most quickly on a segmented table space.
2. Use the LOAD job that is shown in the following figure to replace the rows in
that table.
258
Related reference
Appendix C, Advisory or restrictive states, on page 925
Using LOAD for tables with identity columns, ROWID columns, or row
change timestamp columns
When you run the UNLOAD utility or the REORG utility with the UNLOAD
EXTERNAL or DISCARD options, DB2 generates a LOAD statement that you can
use to load the unloaded data into any table that has a compatible format.
|
|
|
|
|
|
|
|
|
|
|
|
If the source table has a ROWID column that is defined with GENERATED
ALWAYS, the generated LOAD statement contains a dummy field named
DSN_ROWID for the ROWID column. If the source table has an identity column
that is defined with GENERATED ALWAYS, the generated LOAD statement
contains a dummy field named DSN_IDENTITY for the identity column. If the
source table has a row change timestamp column that is defined with
GENERATED ALWAYS, the generated LOAD statement contains a dummy field
named DSN_RCTIMESTAMP for the row change timestamp column. The keyword
IGNOREFIELDS in the LOAD statement causes DB2 to skip the DSN_ROWID,
DSN_IDENTITY, or DSN_RCTIMESTAMP field when it loads the data into a table.
Using the combination of IGNOREFIELDS and the dummy fields, you can load the
unloaded data into a compatible table that has GENERATED ALWAYS columns.
|
|
|
|
|
To include the data from the ROWID, identity, or row change timestamp column
when you load the unloaded data into a table, define the ROWID, identity, or row
change timestamp column with GENERATED BY DEFAULT. To use the generated
LOAD statement, remove the IGNOREFIELDS keyword and change the dummy
field names to the corresponding column names in the target table.
|
|
To load the unloaded data into a compatible table that has identity columns that
are defined as GENERATED ALWAYS, use one of the following techniques:
v Using the combination of IGNOREFIELDS and the dummy DSN_IDENTITY
field, load will generate the identity column data.
v To load the unloaded identity column data, add the IDENTITYOVERRIDE
keyword to the LOAD control statement. Change the dummy field name,
DSN_IDENTITY, to the corresponding identity column name in the target table.
v To load the unloaded data into a compatible table that has identity columns or
ROWID columns that are defined as GENERATED BY DEFAULT, remove the
IGNOREFIELDS keyword and change the dummy field names to the
corresponding column names in the target table.
v To load the unloaded data into a compatible table that has ROWID columns that
are defined as GENERATED ALWAYS, using the combination of
IGNOREFIELDS and the dummy DSN_ROWID field, load will generate the
ROWID column data.
259
Loading partitions
If you use the PART clause of the INTO TABLE option, only the specified
partitions of a partitioned table are loaded. If you omit PART, the entire table is
loaded.
You can specify the REPLACE and RESUME options separately by partition. The
control statement in the following example specifies that DB2 is to load data into
the first and second partitions of the employee table. Records with 0 in column 1
replace the contents of partition 1; records with 1 in column 1 are added to
partition 2; all other records are ignored. (The following example control statement,
which is simplified to illustrate the point, does not list field specifications for all
columns of the table.)
260
To load columns in an order that is different than the order of the columns in the
CREATE TABLE statement, you must code field specifications for each INTO
TABLE statement.
The following example assumes that your data is in separate input data sets. That
data is already sorted by partition, so you do not need to use the WHEN clause of
INTO TABLE. Placing the RESUME YES option before the PART option inhibits
concurrent partition processing while the utility is running.
LOAD DATA INDDN EMPLDS1 CONTINUEIF(72:72)='X'
RESUME YES
INTO TABLE DSN8910.EMP REPLACE PART 1
LOAD DATA INDDN EMPLDS2 CONTINUEIF(72:72)='X'
RESUME YES
INTO TABLE DSN8910.EMP REPLACE PART 2
The following example allows partitioning independence when more than one
partition is loaded concurrently.
LOAD DATA INDDN SYSREC LOG NO
INTO TABLE DSN8910.EMP PART 2 REPLACE
When index-based partitioning is used, LOAD INTO PART integer is not allowed if
an identity column is part of the partitioning index. When table-based partitioning
is used, LOAD INTO PART integer is not allowed if an identity column is used in a
partitioning clause of the CREATE TABLE or ALTER TABLE statement. If
IDENTITYOVERRIDE is used, these operations are allowed.
To invoke partition parallelism, specify a PART clause with INDDN or INCURSOR
and optionally DISCARDDN keywords for each partition in your utility control
statement. This partition parallelism reduces the elapsed time that is required for
loading large amounts of data into partitioned table spaces. Loading partition
parallelism requires a separate input data set for each partition.
Consequences of DEFINE NO
If a partitioned table space is created with DEFINE NO, all partitions are also
implicitly defined with DEFINE NO. The first data row that is inserted by the
LOAD utility defines all data sets in the partitioned table space. If this process
takes a long time, expect timeouts on the DBD.
Coding your LOAD job with SHRLEVEL CHANGE and using partition parallelism
is equivalent to concurrent, independent insert jobs. For example, in a large
partitioned table space that is created with DEFINE NO, the LOAD utility starts
Chapter 16. LOAD
261
three tasks. The first task tries to insert the first row, which causes an update to the
DBD. The other two tasks time out while they wait to access the DBD. The first
task holds the lock on the DBD while the data sets are defined for the table space.
Restriction: You cannot load data at the partition level of a partition-by-growth
table space.
|
|
|
|
|
|
|
When you load a partition-by-growth table space, you can load data only at the
table space level and not at the partition level. If you need additional partitions
during the LOAD process and the maximum number of partitions for the table
space is not yet reached, the LOAD utility will trigger the process to add
additional partitions. If the maximum number of partitions is reached, the LOAD
utility fails.
|
|
|
|
|
|
You can load data containing XML columns with one of two methods.
v The XML column can be loaded from the input record when the total input
record length is less than 32K. XML column value can be placed in the INPUT
record with or without any other any other loading column values. The input
record can be in delimited or non-delimited format. For a non-delimited format,
the XML column is treated like a variable character with a 2-byte length
preceding the XML value. For a delimited format there are no length bytes
present.
v The XML column can be loaded from a separate file whether the XML column
length is less than 32K or not.
|
|
|
|
|
|
|
|
|
|
|
v If you use delimited format, specify XML data in the input data set as
delimited character strings, separated by the column delimiter.
v If you do not use delimited format, specify the XML input field length in a
2-byte binary field preceding the data.
2. Create a LOAD utility control statement.
v To load XML directly from input record, specify XML as the input field type.
XML is the only acceptable field type and data type conversion is not
supported. Do not specify DEFAULTIF.
v To load XML from a file, specify CHAR or VARCHAR along with either
BLOBF, CLOBF or DBCLOBF to indicate that the input column contains a
filename from which a BLOBF, CLOBF or DBCLOBF is to be loaded to the
XML column.
3. Submit the utility control statement.
|
|
|
When you load XML documents into a table, and the XML value cannot be cast to
the type that you specified when you created the index, the value is ignored
without any warnings or errors, and the document is inserted into the table.
|
|
|
|
|
|
|
|
|
|
|
|
262
|
|
|
|
When you insert XML documents into a table with XML indexes that are of type
DECFLOAT, the values might be rounded when they are inserted. If the index is
unique, the rounding might cause duplicates even if the original values are not
exactly the same.
|
|
|
DB2 does not compress an XML table space during the LOAD process. If the XML
table space is defined with COMPRESS YES, the XML table space is compressed
during REORG.
263
The following table lists the default hexadecimal values for the delimiter characters
based on encoding scheme.
Table 36. Default delimiter values for different encoding schemes
Character
EBCDIC SBCS
EBCDIC
DBCS/MBCS
ASCII/Unicode
SBCS
ASCII/Unicode
MBCS
Character string
delimiter
X7F
X7F
X22
X22
Decimal point
character
X4B
X4B
X2E
X2E
Column
delimiter
X6B
X6B
X2C
X2C
In most EBCDIC code pages, the hexadecimal values that are specified in the
previous table are a double quotation mark() for the character string delimiter, a
period(.) for the decimal point character, and a comma(,) for the column delimiter.
The following table lists the maximum allowable hexadecimal values for any
delimiter character based on the encoding scheme.
Table 37. Maximum delimiter values for different encoding schemes
Encoding scheme
EBCDIC SBCS
None
EBCDIC DBCS/MBCS
X3F
ASCII/Unicode SBCS
None
ASCII/Unicode MBCS
X7F
The following table identifies the acceptable data type forms for the delimited file
format that the LOAD and UNLOAD utilities use.
Table 38. Acceptable data type forms for delimited files.
Acceptable form for loading
a delimited file
Data type
CHAR, VARCHAR
264
Table 38. Acceptable data type forms for delimited files. (continued)
Data type
FLOAT
BLOB, CLOB
DBCLOB
DATE
TIME
TIMESTAMP
Note:
1. Field specifications of INTEGER or SMALLINT are treated as INTEGER EXTERNAL.
2. Field specifications of DECIMAL, DECIMAL PACKED, or DECIMAL ZONED are treated
as DECIMAL EXTERNAL.
3. Field specifications of FLOAT, REAL, or DOUBLE are treated as FLOAT EXTERNAL.
Related concepts
Unloading delimited files on page 710
Related reference
Appendix G, Delimited file format, on page 1011
265
266
therefore, automatically places the table space that contains the project activity
table (and all table spaces that contain dependent tables of any table that is being
replaced) into CHECK-pending status.
The CHECK-pending status indicates that the referential integrity of the table
space is in doubt; it might contain rows that violate a referential constraint. DB2
places severe restrictions on the use of a table space in CHECK-pending status;
typically, you run the CHECK DATA utility to reset this status.
Consequences of ENFORCE NO
If you use the ENFORCE NO option, you tell LOAD not to enforce referential
constraints. Sometimes you have good reasons for doing that, but the result is that
the loaded table space might violate the constraints. Hence, LOAD places the
loaded table space in CHECK-pending status. If you use REPLACE, all table spaces
that contain any dependent tables of the tables that were loaded are also placed in
CHECK-pending status. You must reset the status of each table before you can use
any of the table spaces.
Related concepts
Resetting the CHECK-pending status on page 289
Compressing data
You can use LOAD with the REPLACE, RESUME NO, or RESUME YES options to
build a compression dictionary. The RESUME NO option requires the table space
to be empty and RESUME YES will only build a dictionary if the table space is
empty.
|
|
|
|
|
|
LOAD RESUME YES or NO will build compression dictionaries for empty table
spaces, except for linear/simple table spaces. LOAD REPLACE must be used on
linear/simple table spaces in order to build new compression dictionaries. If your
table space, or a partition in a partitioned table space, is defined with COMPRESS
YES, the dictionary is created while records are loaded. After the dictionary is
completely built, the rest of the data is compressed as it is loaded.
Chapter 16. LOAD
267
For Partition-by-growth table spaces, the utility only builds one dictionary and the
same dictionary page is populated through all partitions. For XML table spaces
that are defined with COMPRESS YES, compression does not occur until the first
REORG.
The data is not compressed until the dictionary is built. You must use LOAD
REPLACE or RESUME NO to build the dictionary, except for linear/simple table
spaces where LOAD REPLACE must be used to build new compression
dictionaries. To save processing costs, and initial LOAD doe not go back to
compress the records that were used to build the dictionary.
|
|
|
|
|
The number of records that are required to build a dictionary is dependent on the
frequency of patterns in the data. For large data sets, the number of rows that are
required to build the dictionary is a small percentage of the total number of rows
that are to be compressed. For the best compression results, build a new dictionary
whenever you load the data.
However, in some circumstances, you might want to compress data by using an
existing dictionary. If you are satisfied with the compression that you are getting
with an existing dictionary, you can keep that dictionary by using the
KEEPDICTIONARY option of LOAD or REORG. For both LOAD and REORG, this
method also saves you the processing overhead of building the dictionary. LOAD
RESUME on a linear/simple table space will always keep the existing dictionary if
one exists. In order to build new dictionaries for a linear/simple table space,
LOAD REPLACE or REORG is required.
|
|
|
|
|
|
|
|
Consider using KEEPDICTIONARY if the last dictionary was built by REORG; the
REORG utilitys sampling method can yield more representative dictionaries than
LOAD and can thus mean better compression. REORG with KEEPDICTIONARY is
efficient because the data is not decompressed in the process.
However, REORG with KEEPDICTIONARY does not generate a compression
report. You need to use RUNSTATS to update the catalog statistics and then query
the catalog columns yourself.
Use KEEPDICTIONARY if you want to try to compress all the records during
LOAD, and if you know that the data has not changed much in content since the
last dictionary was built. An example of LOAD with the KEEPDICTIONARY
option is shown in the following figure.
LOAD DATA
REPLACE KEEPDICTIONARY
INTO TABLE DSN8910.DEPT
( DEPTNO
POSITION (1)
DEPTNAME POSITION (5)
MGRNO
POSITION (37)
ADMRDEPT POSITION (44)
LOCATION POSITION (48)
ENFORCE NO
CHAR(3),
VARCHAR,
CHAR(6),
CHAR(3),
CHAR(16) )
268
dummy input data set, you can then use INSERT to insert data into partitions
other than the partition that is specified in COPYDICTIONARY. The data that is
inserted is compressed.
Related reference
Chapter 25, REORG TABLESPACE, on page 449
Chapter 29, RUNSTATS, on page 593
269
|
|
|
|
|
|
|
When you submit the LOAD job, DB2 parses the SELECT statement in the cursor
definition and checks for errors. If the statement is invalid, the LOAD utility issues
an error message and identifies the condition that prevented the execution. If the
statement syntax is valid but an error occurs during execution, the LOAD utility
also issues an error message. The utility terminates when it encounters an error. If
you specify a data-change-table-reference in the from-clause of the cursor, the
changes to the source might be committed even though the load fails.
If no errors occur, the utility loads the result table that is identified by the cursor
into the specified target table according to the following rules:
v LOAD matches the columns in the input data to columns in the target table by
name, not by sequence.
v If the number of columns in the cursor is less than the number of columns in the
table that is being loaded, DB2 loads the missing columns with their default
values. If the missing columns are defined as NOT NULL without defaults, the
LOAD job fails.
v If a source column is defined as NULLABLE and the corresponding target
column is defined as NOT NULL without defaults, the LOAD job fails.
|
|
v If you specify IGNOREFIELDS YES, LOAD skips any columns in the input data
that do not exist in the target table.
v If the data types in the target table do not match the data types in the cursor,
DB2 tries to convert the data as much as possible. If the conversion fails, the
LOAD job fails. You might be able to avoid these conversion errors by using
SQL conversion functions in the SELECT statement of the cursor declaration.
270
v If the encoding scheme of the input data is different than the encoding scheme
of the target table, DB2 converts the encoding schemes automatically.
v The sum of the lengths of all of the columns cannot exceed 1 GB.
v If the SELECT statement in the cursor definition specifies a table with at least
one LOB column and a ROWID that was created with the GENERATED
ALWAYS clause with a unique index on it, you cannot specify this ROWID
column in the SELECT list of the cursor.
v If the SELECT statement in the cursor definition specifies a table with a row
change timestamp column that was created with the GENERATED ALWAYS
clause, you cannot specify this row change timestamp column in the SELECT list
of the cursor.
Also, although you do not need to specify casting functions for any distinct types
in the input data or target table, you might need to add casting functions to any
additional WHERE clauses in the SQL.
Related concepts
Before running LOAD on page 248
Related reference
Sample LOAD control statements on page 293
271
272
Related concepts
Before running LOAD on page 248
273
Preformatting boundaries
You can manage your own data sets or have DB2 manage the data sets. For
user-managed data sets, DB2 does not delete and reallocate them during utility
processing. The size of the data set does not shrink back to the original data set
allocation size but either remains the same or increases in size if additional space
or data is added. This characteristic has implications when LOAD or REORG
PREFORMAT is used because of the preformatting that is done for all free pages
between the high-used RBA (or page) to the high-allocated RBA. This
preformatting includes secondary extents that have been allocated.
274
For DB2-managed data sets, DB2 deletes and reallocates them if you specify
REPLACE on the LOAD or REORG job. This results in the data sets being re-sized
to their original allocation size. They remain that size if the data that is being
reloaded does not fill the primary allocation and forces a secondary allocation. This
means the LOAD or REORG PREFORMAT option with DB2-managed data causes
at least the full primary allocation amount of a data set to be preformatted after
the reload of data into the table space.
For both user-managed and DB2-managed data sets, if the data set goes into
secondary extents during utility processing, the high-allocated RBA becomes the
end of the secondary extent, and that becomes the high value for preformatting.
SMALLINT
BIGINT
INTEGER
DECIMAL
FLOAT
DECFLOAT
BIGINT
INTEGER
DECIMAL
FLOAT
DECFLOAT
SMALLINT
275
|
|
|
|
CHAR
VARCHAR
CLOB
GRAPHIC
VARGRAPHIC
DBCLOB
ROWID
BINARY
VARBINARY
Y
CHAR
Y1
Y1
Y1
CHAR MIXED
Y1
Y1
Y1
VARCHAR
Y1
Y1
Y1
VARCHAR
MIXED
Y1
Y1
Y1
GRAPHIC
Y1
Y1
Y1
VAR-GRAPHIC
Y1
Y1
Y1
ROWID
BINARY
VAR-BINARY
Note:
1. Conversion applies when either the input data or the target table is Unicode.
TIME
TIMESTAMP
DATE EXTERNAL
TIME EXTERNAL
TIMESTAMP EXTERNAL
Input fields with data types CHAR, CHAR MIXED, CLOB, DBCLOB, VARCHAR,
VARCHAR MIXED, GRAPHIC, GRAPHIC EXTERNAL, and VARGRAPHIC are
converted from the CCSIDs of the input file to the CCSIDs of the table space when
they do not match. For example:
v You specify the ASCII or UNICODE option for the input data, and the table
space is EBCDIC.
v You specify the EBCDIC or UNICODE option, and the table space is ASCII.
v You specify the ASCII or EBCDIC option, and the table space is Unicode.
v The CCSID option is specified, and the CCSIDs of the input data are not the
same as the CCSIDs of the table space.
CLOB, BLOB, and DBCLOB input field types cannot be converted to any other
field type.
Conversion errors cause LOAD:
v To abend, if no discard data set is provided or if the discard limit is exceeded.
v To map the input record for subsequent discarding and continue (if a discard
data set is provided)
Truncation of the decimal part of numeric data is not considered a conversion
error.
276
|
|
|
|
|
|
|
|
|
|
You can also remove a specified character from the beginning, end, or both ends of
the data by specifying the STRIP option. This option is valid only with the CHAR,
VARCHAR, GRAPHIC, VARGRAPHIC, BINARY, and VARBINARY data type
options. If you specify both the TRUNCATE and STRIP options, LOAD performs
the strip operation first. For example, if you specify both TRUNCATE and STRIP
for a field that is to be loaded into a VARCHAR(5) column, LOAD alters the
character strings as shown in the following table. In this table, an underscore
represents a character that is to be stripped.
Table 42. Results of specifying both TRUNCATE and STRIP for data that is to be loaded into
a VARCHAR(5) column.
Specified STRIP
option
Input string
STRIP BOTH
'_ABCDEFG_'
'ABCDEFG'
'ABCDE'
STRIP LEADING
'_ABC_'
'ABC_'
'ABC_'
STRIP TRAILING
'_ABC_DEF_'
'_ABC_DEF'
'_ABC_'
277
correct them, and load them again. If you use a discard data set, you can correct
the records there and add them to the table with LOAD RESUME.
278
The DD names SWnnWKmm define the sort work data sets that are used during
utility processing. nn identifies the subtask pair, and mm identifies one or more
data sets that are to be used by that subtask pair. For example:
SW01WK01
The first sort work data set that is used by the subtask as it builds the first
index.
SW01WK02
The second sort work data set that is used by the subtask as it builds the
first index.
SW02WK01
The first sort work data set that is used by the subtask as it builds the
second index.
SW02WK02
The second sort work data set that is used by the subtask as it builds the
second index.
The DD names UTPRINnn define the sort work message data sets that are used by
the utility subtask pairs. nn identifies the subtask pair.
279
Assigned index
SW01WKmm
SW02WKmm
SW03WKmm
SW04WKmm
SW05WKmm
|
|
280
If you are replacing a partition, these preceding restrictions are relaxed; the
partition that is being replaced can be in the RECOVER-pending status, and its
corresponding index partition can be in the REBUILD-pending status. However, all
secondary indexes must not be in the page set REBUILD-pending status and
KEEPDICTIONARY must not have been specified on active compressed partitions.
The one RECOVER-pending restrictive status has the following description:
RECP RECOVER-pending status is set on a table space or partition. If a single
logical partition is in RECP status, the partition is treated as RECP status
for SQL access. A single logical partition in RECP status does not restrict
utility access to other logical partitions that are not in RECP status. RECP
status is reset by recovering only the single logical partition.
The four REBUILD-pending restrictive states have the following descriptions:
RBDP REBUILD-pending status is set on a physical or logical index partition. The
individual physical or logical partition is inaccessible and must be rebuilt
by using the REBUILD INDEX utility, or recovered by using the RECOVER
utility.
PSRBD
Page set REBUILD-pending is set on nonpartitioned secondary indexes.
Partitioned indexes, including data-partitioned secondary indexes, are
never placed in a page set REBUILD-pending status. The entire index
space is inaccessible until you rebuild it with the REBUILD utility, or
recover it with the RECOVER utility.
RBDP*
REBUILD-pending star status is set only on logical partitions of
nonpartitioning indexes. The entire index is inaccessible, but it is made
available again when the affected partitions are rebuilt by using the
REBUILD INDEX utility, or recovered by using the RECOVER utility.
The one REORG-pending restrictive status has the following description:
REORP
REORG-pending status indicates that a table space or partition needs to be
reorganized.
Related concepts
Resetting the REBUILD-pending status on page 372
Exit procedures
Any field procedure that is associated with a column of a table that is being loaded
is executed to encode the data before it is loaded. The field procedures for all
columns are executed before any edit or validation procedure for the row.
281
Any field specification that describes the data is checked before a field procedure is
executed. That is, the field specification must describe the data as it appears in the
input record.
|
|
|
282
v Load the LOB value from a file that is listed in the input data set: When you
load a LOB value from a file, the LOB value can be greater than 32 KB. To load
a LOB value from a file:
1. In the input data set, specify the names of the files that contain the LOB
values. Each file can be either a PDS, PDSE, or an HFS file.
2. Specify either BLOBF, CLOBF, or DBCLOBF in the field specification portion
of the LOAD statement. For example, to load a LOB into the RESUME
column of a table, specify something like RESUME POSITION(7) VARCHAR CLOBF.
This specification indicates that position 7 of the input data set contains the
name of a file from which a varying-length CLOB is to be loaded into the
RESUME column.
v Load data from another table: To transfer data from one location to another
location or from one table to another table at the same location, use a cursor.
This method of loading data is called the cross-loader function.
When you use the cross-loader function, the LOB value can be greater than 32
KB. For this method, DB2 uses a separate buffer for LOB data and therefore
stores only 8 bytes per LOB column. The sum of the lengths of the non-LOB
columns plus the sum of 8 bytes per LOB column cannot exceed 32 KB.
Related tasks
Loading data by using the cross-loader function on page 270
LOG YES
LOG YES
No pending status
LOG YES
LOG NO
Control information
No pending status
LOG NO
LOG YES
Nothing
COPY-Pending1
LOG NO
LOG NO
Nothing
COPY-Pending1
Note:
1. REORG LOG NO of a LOB table space requires SHRLEVEL REFERENCE, which requires that an inline copy be
taken during the REORG. This means that you never set COPY-pending for REORG of LOB table spaces under
any circumstances
|
|
XML columns are treated by the LOAD utility as varying-length data. The length
value for an XML column must be 2 bytes.
|
|
|
|
|
283
1. In the input data set, include the XML value preceded by a 2-byte binary
field that contains the length of the XML column.
2. When loading directly from an input record, you must specify XML as the
input field type. This is the only acceptable input field type for loading XML
column from input record. For example, to load a data into the RESUME
column which is XML, specify something like RESUME POSITION(7) XML. This
specification indicates that position 7 of the input data set contains the length
of the XML followed by the XML value that is to be loaded into the
RESUME column.
v Load the XML value from a file that is listed in the input data set: When you
load an XML value from a file, the XML value can be greater than 32 KB. To
load an XML value from a file:
1. In the input data set, specify the name of the file that contains the value to
be loaded to the XML column. The file name can be a PDS, PDSE or a HFS
file.
2. Specify either BLOBF, CLOBF, or DBCLOBF in the field specification portion
of the LOAD statement. For example, to load a CLOB file into an XML
column RESUME, specify something like RESUME POSITION(7) VARCHAR CLOBF.
This specification indicates that position 7 of the input data set contains the
name of a file from which a varying-length CLOB is to be loaded into the
RESUME column.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
What is logged
| LOG YES
LOG YES
Data
No pending status
| LOG YES
LOG NO
Nothing
No pending status
| LOG NO
LOG YES
Nothing
COPY-Pending
| LOG NO
|
LOG NO
Nothing
ICOPY-Pending
|
|
You can run LOAD RESUME YES SHRLEVEL CHANGE without logging.
|
|
|
|
|
To
1.
2.
3.
4.
|
|
|
You cannot restart LOAD against a NOT LOGGED table space. If the load fails,
terminate the load job, recover the data from a prior image copy, and rerun the
LOAD job.
284
If you perform a LOAD operation on a base table that contains an XML column,
DB2 does not collect inline statistics for the related XML table space or its indexes.
Collecting inline statistics for discarded rows: If you specify the DISCARDDN
and STATISTICS options and a row is found with check constraint errors or
conversion errors, the row is not loaded into the table and DB2 does not collect
inline statistics on it. However, the LOAD utility collects inline statistics prior to
discarding rows that have unique index violations or referential integrity
violations. In these cases, if the number of discarded rows is large enough to make
the statistics significantly inaccurate, run the RUNSTATS utility separately on the
table to gather the most accurate statistics.
Collecting inline statistics for data partitioned secondary indexes: To collect
inline statistics on data partitioned secondary indexes, you must allocate sort work
data sets.
Related reference
Data sets that LOAD uses on page 249
Termination of LOAD
You can terminate a LOAD utility job.
If you terminate LOAD by using the TERM UTILITY command during the reload
phase, the records are not erased. The table space remains in RECOVER-pending
status, and indexes remain in the REBUILD-pending status.
If you terminate LOAD by using the TERM UTILITY command during the sort or
build phases, the indexes that are not yet built remain in the REBUILD-pending
status.
If you terminate a LOAD SHRLEVEL CHANGE, uncommitted records are rolled
back, but committed records remain in the table. The table space is not in
RECOVER-pending status, and the indexes are not in REBUILD-pending status.
If the LOAD job terminates during the RELOAD, SORT, BUILD, or SORTBLD
phases, both RESTART and RESTART(PHASE) phases restart from the beginning of
Chapter 16. LOAD
285
the RELOAD phase. However, restart of LOAD RESUME YES or LOAD PART
RESUME YES in the BUILD or SORTBLD phase results in message DSNU257I.
The following table lists the LOAD phases and their effects on any pending states
when the utility is terminated in a particular phase.
Table 46. LOAD phases and their effects on pending states when terminated.
Phase
Reload
v
v
v
v
Build
Indexval
Enforce
Places
Places
Places
Places
Restart of LOAD
You can restart a LOAD utility job.
You can restart LOAD at its last commit point (RESTART(CURRENT)) or at the
beginning of the phase during which operation ceased (RESTART(PHASE)). LOAD
output messages identify the completed phases; use the DISPLAY command to
identify the specific phase during which operation stopped.
By default, DB2 uses RESTART(CURRENT), except if LOAD is restarting during
the UTILINIT phase or the UTILTERM phase. In both of these situations, DB2 uses
RESTART(PHASE) by default. You can override the default RESTART values by
using the RESTART parameter.
The following restrictions apply to restarting LOAD jobs:
v If LOAD abnormally terminates or a system failure occurs while LOAD is in the
UTILTERM phase, you must restart with RESTART(PHASE).
v If you restart a LOAD job for a table that has LOB columns that specified the
RESUME YES option and SORTKEYS NO specified on the stopped job, you
must use RESTART(CURRENT).
v If you use RESTART(PHASE) to restart a LOAD job that specified RESUME NO,
the LOB table spaces and indexes on auxiliary tables are reset.
v For a table that has LOB columns, you cannot restart a LOAD job that uses the
INCURSOR option.
v If you restart a LOAD job that uses the STATISTICS keyword, inline statistics
collection does not occur. To update catalog statistics, run the RUNSTATS utility
after the restarted LOAD job completes.
v If you are using a BatchPipes file, you cannot restart the LOAD utility. If the
application that populates the BatchPipes file terminates, you need to terminate
the job where LOAD is executing. If the LOAD utility was invoked from a
stored procedure, you also need to terminate the WLM application environment
of the LOAD utility that reads the BatchPipes file. After you terminate the job,
terminate the LOAD utility using the DB2 TERM UTILITY command, and then
you can resubmit the LOAD job.
|
|
|
|
|
|
|
|
|
|
286
Type of
RESTART
RELOAD
SORT
BUILD
SORTBLD
INDEXVAL
ENFORCE
DISCARD
REPORT
Notes
CURRENT
1, 2, 10
PHASE
SYSREC
3, 10
CURRENT
SYSUT1
4, 10
PHASE
SYSUT1
10
CURRENT
SORTOUT
4, 5, 10
PHASE
SORTOUT
5, 10
CURRENT
5, 6, 10
PHASE
5, 6, 10
CURRENT
SYSERR or SYSUT1
PHASE
SYSERR or SYSUT1
CURRENT
PHASE
CURRENT
7, 8
PHASE
7, 8
CURRENT
7, 9
PHASE
7, 9
Note:
1. SYSMAP and SYSERR data sets might not be required for all load jobs.
2. If the SYSERR data set is not required and has not been provided, LOAD uses SYSUT1
as a work data set to contain error information.
3. You must not restart during the RELOAD phase if you specified SYSREC DD *.This
statement prevents internal commits from being taken, and RESTART performs like
RESTART(PHASE), except with no data back out. Also, you must not restart if your
SYSREC input consists of multiple, concatenated data sets.
4. The utility can be restarted with either RESTART or RESTART(PHASE). However,
because this phase does not take checkpoints, RESTART is always re-executed from the
beginning of the phase.
5. A LOAD RESUME YES job cannot be restarted in the BUILD or SORTBLD phase.
6. Use RESTART or RESTART(PHASE) to restart at the beginning of the RELOAD phase.
7. This utility can be restarted with either RESTART or RESTART(PHASE).However, the
utility can be re-executed from the last internal checkpoint. This is dependent on the
data sets that are used and whether any input data sets have been rewritten.
8. The SYSUT1 data set is required if the target table space is segmented or partitioned.
9. If report is required and this is a load without discard processing, SYSMAP is required
to complete the report phase.
10. Any job that finished abnormally in the RELOAD, SORT, BUILD, or SORTBUILD phase
restarts from the beginning of the RELOAD phase.
287
You can restart LOAD at its last commit point or at the beginning of the phase
during which operation ceased. LOAD output messages identify the completed
phases; use the DISPLAY command to identify the specific phase during which
operation stopped.
Related concepts
Restart of an online utility on page 36
Related tasks
Restarting after the output data set is full on page 40
288
LOAD places all the index spaces for a table space in the REBUILD-pending status
if you end the job (by using the TERM UTILITY command) before it completes the
INDEXVAL phase. DB2 places the table space in RECOVER-pending status if you
end the job before the job completes the RELOAD phase.
Resetting the RECOVER-pending status depends on when the utility terminated:
v If the data is intact and you have a full image copy of the affected indexes, you
can recover the indexes using the RECOVER INDEX utility. Run the DISPLAY
DATABASE command and examine the output. Data is intact when the output
indicates that the indexes are in REBUILD-pending status and the table space is
not in RECOVER-pending status. If you do not have an image copy available,
you must rebuild the entire index by using the REBUILD INDEX utility.
However, for partitioning indexes and for secondary indexes that are in
REBUILD-pending (RBDP) status, you can use the PART option of REBUILD
INDEX to rebuild separate partitions of the index.
v If the data is not intact, you can either load the table again or recover it to a
prior point of consistency. Run the DISPLAY DATABASE command and examine
the output. The recovery puts the table space into COPY-pending status and
places all indexes in REBUILD-pending status.
289
DELETE YES
This option deletes invalid records and resets the status, but it is not the
default. Use DELETE NO, the default, to find out quickly how large your
problem is; you can choose to correct it by reloading, rather than correcting
the current situation.
Exception tables
With DELETE YES, you do not use a discard data set to receive copies of
the invalid records; instead, you use another DB2 table called an exception
table. This topic assumes that you already have an exception table
available for every table that is subject to referential or table check
constraints.
If you use DELETE YES, you must name an exception table for every
descendent of every table in every table space that is being checked.
Deletes that are caused by CHECK DATA are not subject to any of the SQL
delete rules; they cascade without restraint to the lowest-level descendent.
If table Y is the exception table for table X, name it with the following
clause in the CHECK DATA statement:
FOR EXCEPTION IN X USE Y
If the statement does not name error or work data sets, the JCL for the job must
contain DD statements similar to the following DD statements:
//SYSERR
DD UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//SYSUT1
DD UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//SORTOUT DD UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//UTPRINT DD SYSOUT=A
290
v If you enforced constraints when loading the project table, the table space is not
in CHECK-pending status.
v Because you did not enforce constraints on the project activity table, the table
space is in CHECK-pending status.
v Because you used LOAD RESUME (not LOAD REPLACE) when loading the
project activity table, its dependents (the employee-to-project-activity table) are
not in CHECK-pending status. That is, the operation might not delete any
parent rows from the project table, and therefore might not violate the referential
integrity of its dependent. However if you delete records from PROJACT when
checking, you still need an exception table for EMPPROJACT.
Therefore you should check the data in the project activity table.
DB2 records the identifier of the first row of the table that might violate referential
or table check constraints. For partitioned table spaces, that identifier is in
SYSIBM.SYSTABLEPART; for nonpartitioned table spaces, that identifier is in
SYSIBM.SYSTABLES. The SCOPE PENDING option speeds the checking by
confining it to just the rows that might be in error.
Example:
In the following example, CHECK DATA is to be run against the table space that
contains the project activity table after LOAD RESUME:
CHECK DATA TABLESPACE DSN8D91A.PROJACT
SCOPE PENDING
DELETE YES
FOR EXCEPTION IN DSN8910.PROJACT USE DSN8910.EPROJACT
IN DSN8910.EMPPROJACT USE DSN8910.EEPA
SORTDEVT SYSDA
SORTNUM 4
As before, the JCL for the job needs DD statements to define the error and sort
data sets.
Related reference
Create exception tables on page 76
291
As a result, you can recover the data to a point in time before the LOAD by using
RECOVER TORBA.
292
What is logged
LOG YES
NOT LOGGED
Non-LOB
No pending status or
ICOPY-pending1
LOG YES
NOT LOGGED
LOB
control information
No pending status
LOG NO
NOT LOGGED
Non-LOB
nothing
No pending status or
ICOPY-pending1
LOG NO
NOT LOGGED
LOB
nothing
No pending status
Note:
1. The table space is set to ICOPY-pending status if the records are discarded and no pending status if the records
are not discarded.
Related information
Table space versions (DB2 Administration Guide)
293
LOAD DATA
RESUME YES
INTO TABLE DSN8910.DEPT
(DEPTNO
POSITION (1:3)
CHAR(3),
DEPTNAME POSITION (4:39)
CHAR(36),
MGRNO
POSITION (40:45)
CHAR(6),
ADMRDEPT POSITION (46:48)
CHAR(3),
LOCATION POSITION (49:64)
CHAR(16))
Figure 34. Example of a LOAD statement that specifies field positions
000010A00USIBMSTODB21
000020A00USIBMSTODB21
000030A00USIBMSTODB21
A00USIBMSTODB21
The following table shows the result of executing the statement SELECT * FROM
DSN8910.DEPT after the preceding input records are loaded.
Table 49. Data that is loaded into a table
DEPTNO
DEPTNAME
A00
SPIFFY
000010
COMPUTER
SERVICE DIV.
PLANNING
000020
INFORMATION 000030
CENTER
DEVELOPMENT
CENTER
B01
C01
D01
MGRNO
ADMRDEPT
LOCATION
A00
USIBMSTODB21
A00
A00
USIBMSTODB21
USIBMSTODB21
A00
USIBMSTODB21
294
specifications are needed for those two INTO TABLE clauses. The third table has a
different format, so field specifications are required and are supplied in the
example.
The POSITION clauses specify the location of the fields in the input data for the
DEPT table. For each source record that is to be loaded into the DEPT table:
v The characters in positions 7 through 9 are loaded into the DEPTNO column.
v The characters in positions 10 through 35 are loaded into the DEPTNAME
column.
v The characters in positions 36 through 41 are loaded into the MGRNO column.
v The characters in positions 42 through 44 are loaded into the ADMRDEPT
column.
LOAD DATA INDDN EMPLDS
RESUME YES
INTO TABLE DSN8910.EMP
WHEN (1:3)='LKA'
INTO TABLE SMITH.EMPEMPL
WHEN (1:3)='ABC'
INTO TABLE DSN8910.DEPT
WHEN (1:3)='LKA'
(DEPTNO POSITION (7:9) CHAR,
DEPTNAME POSITION (10:35) CHAR,
MGRNO POSITION (36:41) CHAR,
ADMRDEPT POSITION (42:44) CHAR)
Figure 36. Example LOAD statement that loads selected records into multiple tables
295
CHAR(6),
CHAR(22),
CHAR(3),
CHAR(6),
DECIMAL EXTERNAL(5),
DATE EXTERNAL(10),
DATE EXTERNAL(10),
CHAR(6))
296
297
option indicates that LOAD is to concatenate any input records that have an X in
column 80 with the next record before loading the data.
LOAD DATA INDDN(SYSRECST) CONTINUEIF(80:80)='X' RESUME(YES)
INTO TABLE SYSIBM.SYSSTRINGS
(INCCSID POSITION( 1) INTEGER EXTERNAL(5),
OUTCCSID POSITION( 7) INTEGER EXTERNAL(5),
TRANSTYPE POSITION( 13) CHAR(2),
ERRORBYTE POSITION( 16) CHAR(1) NULLIF(ERRORBYTE=' '),
SUBBYTE POSITION( 18) CHAR(1) NULLIF(SUBBYTE=' '),
TRANSPROC POSITION( 20) CHAR(8),
IBMREQD POSITION( 29) CHAR(1),
TRANSTAB POSITION( 31) CHAR(256) DEFAULTIF(TRANSTYPE='GG'))
Figure 40. Example of loading null values
'))
298
The POSITION clauses define the starting positions of the fields in the input data
set. The ending positions of the fields in the input data set are implicitly defined
by the length specification of the data type (CHAR length). In this case, the
characters in positions 1 through 3 are loaded into the ACTNO column, the
characters in positions 5 through 10 are loaded into the ACTKWD column, and the
characters in position 13 onward are loaded into the ACTDESC column. Because
the ACTDESC column is of type VARCHAR, the input data needs to contain a
2-byte binary field that contains the length of the character field. This binary field
begins at position 13.
//STEP1
EXEC DSNUPROC,UID='IUIQU2UB.LOAD',
//
UTPROC='',
//
SYSTEM='DSN'
//SYSRECAC
DD DSN=IUIQU2UB.LOAD.DATA,DISP=SHR,VOL=SER=SCR03,
//
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//SYSUT1
DD DSN=IUIQU2UB.LOAD.STEP1.SYSUT1,
//
DISP=(MOD,DELETE,CATLG),
//
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//SORTOUT DD DSN=IUIQU2UB.LOAD.STEP1.SORTOUT,
//
DISP=(MOD,DELETE,CATLG),
//
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//SYSIN
DD *
LOAD DATA INDDN(SYSRECAC) RESUME YES
INTO TABLE DSN8910.ACT
(ACTNO
POSITION(1) INTEGER EXTERNAL(3),
ACTKWD
POSITION(5) CHAR(6),
ACTDESC POSITION(13) VARCHAR)
ENFORCE NO
//*
Figure 42. Example of loading data without enforcing referential constraints
299
EXEC DSNUPROC,UID='JUOSU339.LOAD1',TIME=1440,
UTPROC='',
SYSTEM='SSTR'
DD DSN=CUST.FM.CINT135.DATA,DISP=SHR,VOL=SER=FORDMD,
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
DD *
ERRDDN UNIT(SYSDA)
DSN(JUOSU339.T&TI..&ST..ERRDDN)
SPACE(50,10) TRK
TEMPLATE UT1
UNIT(SYSDA)
DSN(JUOSU339.T&TI..&ST..SYSUT1)
SPACE(50,10) TRK
TEMPLATE OUT
UNIT(SYSDA)
DSN(JUOSU339.T&TI..&ST..SYSOUT)
SPACE(50,10) TRK
TEMPLATE MAP
UNIT(SYSDA)
DSN(JUOSU339.T&TI..&ST..SYSMAP)
SPACE(50,10) TRK
300
EXEC DSNUPROC,UID='JUOSU339.LOAD1',TIME=1440,
UTPROC='',
SYSTEM='SSTR'
DD DSN=CUST.FM.CINT135.DATA,DISP=SHR,VOL=SER=FORDMD,
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
DD *
ERRDDN UNIT(SYSDA)
Chapter 16. LOAD
301
DSN(JUOSU339.T&TI..&ST..ERRDDN)
SPACE(50,10) TRK
TEMPLATE UT1
UNIT(SYSDA)
DSN(JUOSU339.T&TI..&ST..SYSUT1)
SPACE(50,10) TRK
TEMPLATE OUT
UNIT(SYSDA)
DSN(JUOSU339.T&TI..&ST..SYSOUT)
SPACE(50,10) TRK
TEMPLATE MAP
UNIT(SYSDA)
DSN(JUOSU339.T&TI..&ST..SYSMAP)
SPACE(50,10) TRK
TEMPLATE DISCARD UNIT(SYSDA)
DSN(JUOSU339.T&TI..&ST..DISCARD)
SPACE(50,10) TRK
TEMPLATE COPYT1
UNIT(SYSDA)
DSN(JUOSU339.COPY1.STEP1.&SN..COPY&LR.&PB.)
DISP(MOD,CATLG,CATLG)
SPACE(60,30) TRK
LOAD DATA INDDN SYSREC REPLACE
CONTINUEIF(79:80)='++'
COPYDDN(COPYT1)
STATISTICS
TABLE (TBOS3902) SAMPLE 53
COLUMN (QT_INV_TRANSACTION,
NO_DEPT,
NO_PART_PREFIX,
DT_TRANS_EFFECTIVE)
INDEX (IDOS3902 KEYCARD
FREQVAL NUMCOLS 4 COUNT 20)
REPORT YES UPDATE ALL HISTORY ALL
ERRDDN(ERRDDN)
WORKDDN(UT1,OUT)
MAPDDN(MAP)
DISCARDDN(DISCARD)
INTO TABLE
ADMF001.TBOS3902
( ID_PARTITION
POSITION(1)
CHAR(1),
CD_PLANT
POSITION(2)
CHAR(5),
NO_PART_BASE
POSITION(7)
CHAR(9),
NO_PART_PREFIX
POSITION(16) CHAR(7),
NO_PART_SUFFIX
POSITION(23) CHAR(8),
NO_PART_CONTROL
POSITION(31)
CHAR(3),
DT_TRANS_EFFECTIVE POSITION(34)
DATE EXTERNAL(10),
CD_INV_TRANSACTION POSITION(44)
CHAR(3),
TS_PROCESS
POSITION(47)
TIMESTAMP EXTERNAL(26),
QT_INV_TRANSACTION POSITION(73)
INTEGER,
CD_UNIT_MEAS_USAGE POSITION(77)
CHAR(2),
CD_USER_ID
POSITION(79)
CHAR(7),
NO_DEPT
POSITION(86)
CHAR(4),
NO_WORK_CENTER
POSITION(90)
CHAR(6))
/*
302
three coded character set identifiers for the input file: one for SBCS data, one for
mixed data, and one for DBCS data. LOG YES indicates that logging is to occur
during the LOAD job.
LOAD DATA INDDN REC1
LOG YES REPLACE
UNICODE CCSID(00367,01208,01200)
INTO TABLE "ADMF001 "."TBMG0301"
WHEN(00004:00005 = X'0003')
Example 14: Loading data from multiple input data sets by using
partition parallelism
The LOAD control statement in this example contains a series of INTO TABLE
statements that specify which data is to be loaded into which partitions of table
DBA01.TBLX3303. For each INTO TABLE statement:
v Data is to be loaded into the partition that is identified by the PART option. For
example, the first INTO TABLE statement specifies that data is to be loaded into
the first partition of table DBA01.TBLX3303.
v Data is to be loaded from the data set that is identified by the INDDN option.
For example, the data from the PART1 data set is to be loaded into the first
partition.
v Any discarded rows are to be written to the data set that is specified by the
DISCARDDN option. For example, rows that are discarded during the loading
of data from the PART1 data set are written to the DISC1 data set.
v The data is loaded into the specified columns (EMPNO, LASTNAME, and
SALARY).
LOAD uses partition parallelism to load the data into these partitions.
The TEMPLATE utility control statement defines the data set naming convention
for the data set that is to be dynamically allocated during the following LOAD job.
The name of the template is ERR3. The ERRDDN option in the LOAD statement
specifies that any errors are to be written to the data set that is defined by this
ERR3 template.
303
TEMPLATE ERR3
DSN &UT..&JO..&ST..ERR3&MO.&DAY.
UNIT SYSDA DISP(NEW,CATLG,CATLG)
LOAD DATA
REPLACE
ERRDDN ERR3
INTO TABLE DBA01.TBLX3303
PART 1
INDDN PART1
DISCARDDN DISC1
(EMPNO
POSITION(1)
CHAR(6),
LASTNAME
POSITION(8)
VARCHAR(15),
SALARY
POSITION(25)
DECIMAL(9,2))
.
.
.
INTO TABLE DBA01.TBLX3303
PART 5
INDDN PART5
DISCARDDN DISC5
(EMPNO
POSITION(1)
CHAR(6),
LASTNAME
POSITION(8)
VARCHAR(15),
SALARY
POSITION(25)
DECIMAL(9,2))
/*
Figure 46. Example of loading data from individual data sets
Example 15: Loading data from another table in the same system
by using a declared cursor
The following LOAD control statement specifies that all rows that are identified by
cursor C1 are to be loaded into table MYEMP. The INCURSOR option is used to
specify cursor C1, which is defined in the EXEC SQL utility control statement.
Cursor C1 points to the rows that are returned by executing the statement SELECT
* FROM DSN8810.EMP. In this example, the column names in table DSN8810.EMP
are the same as the column names in table MYEMP. Note that the cursor cannot be
defined on the same table into which DB2 is to load the data.
EXEC SQL
DECLARE C1 CURSOR FOR SELECT * FROM DSN8810.EMP
ENDEXEC
LOAD DATA
INCURSOR(C1)
REPLACE
INTO TABLE MYEMP
STATISTICS
304
MYEMPP.
EXEC SQL
DECLARE C1 CURSOR FOR SELECT * FROM CHICAGO.DSN8810.EMP
WHERE EMPNO <= '099999'
ENDEXEC
EXEC SQL
DECLARE C2 CURSOR FOR SELECT * FROM CHICAGO.DSN8810.EMP
WHERE EMPNO > '099999' AND EMPNO <= '199999'
ENDEXEC
EXEC SQL
DECLARE C3 CURSOR FOR SELECT * FROM CHICAGO.DSN8810.EMP
WHERE EMPNO > '199999' AND EMPNO <= '299999'
ENDEXEC
EXEC SQL
DECLARE C4 CURSOR FOR SELECT * FROM CHICAGO.DSN8810.EMP
WHERE EMPNO > '299999' AND EMPNO <= '999999'
ENDEXEC
LOAD DATA
INTO TABLE MYEMPP PART 1 REPLACE INCURSOR(C1)
INTO TABLE MYEMPP PART 2 REPLACE INCURSOR(C2)
INTO TABLE MYEMPP PART 3 REPLACE INCURSOR(C3)
INTO TABLE MYEMPP PART 4 REPLACE INCURSOR(C4)
Figure 47. Example of loading data partitions in parallel using a declared cursor
305
306
Output
Output from the MERGECOPY utility consists of one of the following types of
copies:
v A new single incremental image copy
v A new full image copy
You can create the new image copy for the local or recovery site.
Restrictions:
v MERGECOPY cannot merge image copies into a single incremental image copy
for the other site, that is:
At local sites, you cannot use RECOVERYDDN with NEWCOPY NO.
At recovery sites, you cannot use COPYDDN with NEWCOPY NO.
v When none of the keywords NEWCOPY, COPYDDN, or RECOVERYDDN is
specified, the default, NEWCOPY NO COPYDDN(SYSCOPY), is valid for the
local site only.
v You cannot run MERGECOPY on concurrent copies.
v You cannot run the MERGECOPY utility on the DSNDB01.DBD01,
DSNDB01.SYSUTILX, or DSNDB06.SYSCOPY table spaces because you cannot
make incremental copies of those table spaces.
Authorization required
To execute this utility, you must use a privilege set that includes one of the
following authorities:
v IMAGCOPY privilege for the database
v DBADM, DBCTRL, or DBMAINT authority for the database. If the object on
which the utility operates is in an implicitly created database, DBADM authority
on the implicitly created database or DSNDB04 is required.
v SYSCTRL or SYSADM authority
An ID with installation SYSOPR authority can also execute MERGECOPY, but only
on a table space in the DSNDB01 or DSNDB06 database.
307
Phase Description
UTILINIT
Performs initialization
MERGECOP
Merges incremental copies
UTILTERM
Performs cleanup
Syntax diagram
MERGECOPY
LIST
listdef-name
TABLESPACE
SYSUT1
WORKDDN
ddname
ALL
DSNUM
integer
CLONE
table-space-name
database-name.
WORKDDN
DSNUM
NEWCOPY
NO
COPYDDN
SYSCOPY
COPYDDN(ddname1
NEWCOPY
,ddname2
COPYDDN(,ddname2)
RECOVERYDDN(ddname3
,ddname4
COPYDDN SYSCOPY
COPYDDN(ddname1
RECOVERYDDN(ddname3
YES
)
,ddname2
)
,ddname4
COPYDDN(,ddname2)
Option descriptions
LIST listdef-name
Specifies the name of a previously defined LISTDEF list name that contains
only table spaces. You can specify one LIST keyword per MERGECOPY control
statement. Do not specify LIST with the TABLESPACE keyword. MERGECOPY
is invoked once for each table space in the list. This utility will only process
clone data if the CLONE keyword is specified. The use of CLONED YES on
the LISTDEF statement is not sufficient.
TABLESPACE database-name.table-space-name
Specifies the table space that is to be copied, and, optionally, the database to
which it belongs.
308
database-name
The name of the database that the table space belongs to. The default
value is DSNDB04.
table-space-name
The name of the table space whose incremental image copies are to be
merged.
You cannot run the MERGECOPY utility on the DSNDB01.DBD01,
DSNDB01.SYSUTILX, or DSNDB06.SYSCOPY table spaces because you cannot
make incremental copies of those table spaces. Because MERGECOPY does not
directly access the table space whose copies it is merging, it does not interfere
with concurrent access to that table space.
DSNUM
Identifies the table space or a partition or data set within the table space that is
to be merged. DSNUM is optional.
ALL
Merges the entire table space.
integer
Is the number of a partition or data set that is to be merged. The maximum
is 4096.
For a partitioned table space, the integer is its partition number.
For a nonpartitioned table space, find the integer at the end of the data set
name as cataloged in the VSAM catalog. The data set name has the
following format, where y is either I or J, z is either 1 or 2, and nnn is the
data set integer:
|
catname.DSNDBx.dbname.tsname.y000z.Annn
You cannot specify DSNUM and LIST in the same MERGECOPY control
statement. Use PARTLEVEL on the LISTDEF instead. If image copies were
taken by data set (rather than by table space), MERGECOPY must use the
copies by data set.
|
|
|
|
|
CLONE
Indicates that MERGECOPY is to process only image copy data sets that were
taken against clone objects. This utility will only process clone data if the
CLONE keyword is specified. The use of CLONED YES on the LISTDEF
statement is not sufficient.
WORKDDN ddname
Specifies a DD statement for a temporary data set or template, which is to be
used for intermediate merged output. WORKDDN is optional.
ddname is the DD name. The default value is SYSUT1.
Use the WORKDDN option if you are not able to allocate enough data sets to
execute MERGECOPY; in that case, a temporary data set is used to hold
intermediate output. If you omit the WORKDDN option, you might find that
only some of the image copy data sets are merged. When MERGECOPY has
ended, a message is issued that tells the number of data sets that exist and the
number of data sets that have been merged. To continue the merge, repeat
MERGECOPY with a new output data set.
NEWCOPY
Specifies whether incremental image copies are to be merged with the full
image copy. NEWCOPY is optional.
Chapter 17. MERGECOPY
309
NO
Merges incremental image copies into a single incremental image copy but
does not merge them with the full image copy.
YES
Merges all incremental image copies with the full image copy to form a
new full image copy.
COPYDDN (ddname1,ddname2)
Specifies the DD statements for the output image copy data sets at the local
site. ddname1 is the primary output image copy data set. ddname2 is the backup
output image copy data set. COPYDDN is optional.
The default value is COPYDDN(SYSCOPY), where SYSCOPY identifies the
primary data set.
The COPYDDN keyword specifies either a DD name or a TEMPLATE name
specification from a previous TEMPLATE control statement. If utility
processing detects that the specified name is both a DD name in the current job
step and a TEMPLATE name, the utility uses the DD name.
RECOVERYDDN (ddname3,ddname4)
Specifies the DD statements for the output image copy data sets at the
recovery site. You can have a maximum of two output data sets; the outputs
are identical. ddname3 is the primary output image copy data set. ddname4 is
the backup output image copy data set. RECOVERYDDN is optional. No
default value exists for RECOVERYDDN.
The RECOVERYDDN keyword specifies either a DD name or a TEMPLATE
name specification from a previous TEMPLATE control statement. If utility
processing detects that the specified name is both a DD name in the current job
step and a TEMPLATE name, the utility uses the DD name.
Related reference
Chapter 15, LISTDEF, on page 185
Chapter 31, TEMPLATE, on page 641
310
Data set
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
Yes
Description
Required?
Yes
No
Table space
Object whose copies are to be merged.
The following object is named in the utility control statement and does not require
a DD statement in the JCL:
Data sets
The input data sets for the merge operation are dynamically allocated. To merge
incremental copies, allocate in the JCL a work data set (WORKDDN) and up to
two new copy data sets (COPYDDN) for the utility job. You can allocate the data
sets to tape or disk. If you allocate them to tape, you need an additional tape drive
for each data set.
With the COPYDDN option of MERGECOPY, you can specify the DD names for
the output data sets. The option has the format COPYDDN (ddname1,ddname2), where
ddname1 is the DD name for the primary output data set in the system that
currently runs DB2, and ddname2 is the DD name for the backup output data set in
the system that currently runs DB2. The default for ddname1 is SYSCOPY.
The RECOVERYDDN option of MERGECOPY lets you specify the output image
copy data sets at the recovery site. The option has the format RECOVERYDDN
(ddname3, ddname4), where ddname3 is the DD name for the primary output image
copy data set at the recovery site, and ddname4 is the DD name for the backup
output data set at the recovery site.
311
MERGECOPY
UTRW
Legend:
UTRW - Utility restrictive state - read-write access allowed.
MERGECOPY can run concurrently on the same target object with any utility
except the following utilities:
v COPY TABLESPACE
v LOAD
v MERGECOPY
v MODIFY
v RECOVER
v REORG TABLESPACE
v UNLOAD (only when from the same image copy data set)
The target object can be a table space or partition.
312
image copy data sets and archive logs. A minimum number of tape drives are
allocated for MERGECOPY and RECOVER execution.
With the NEWCOPY YES option, however, you can merge a full image copy of a
table space with incremental copies of the table space and of individual data sets
to make a new full image copy of the table space.
If the image copy data sets that you want to merge reside tape, refer to How the
RECOVER utility retains tape mounts on page 413 for general information about
specifying the appropriate parameters on the DD statements.
313
To delete all log information that is included in a copy that MERGECOPY make
1. Find the record of the copy in the catalog table SYSIBM.SYSCOPY by selecting
database name, table space name, and date (columns DBNAME, TSNAME, and
ICDATE).
2. Column START_RBA contains the RBA of the last image copy that
MERGECOPY used. Find the record of the image copy that has the same value
of START_RBA.
3. In that record, find the date in column ICDATE. You can use MODIFY
RECOVERY to delete all copies and log records for the table space that were
made before that date.
RECOVER uses the LOG RBA of image copies to determine the starting point in
the log that is needed for recovery. Normally, a timestamp directly corresponds to
a LOG RBA. Because of this, and because MODIFY uses dates to clean up recovery
history, you might decide to use dates to delete old archive log tapes. This decision
might cause a problem if you use MERGECOPY. MERGECOPY inserts the LOG
RBA of the last incremental image copy into the SYSCOPY row that is created for
the new image copy. The date that is recorded in the ICDATE column of SYSCOPY
row is the date that MERGECOPY was executed.
314
incremental copies are not to be merged with the full image copy. The COPYDDN
option specifies that the output image copies are to be written to the data sets that
are defined by the COPY1 and COPY2 DD statements.
//STEP1
EXEC DSNUPROC,UID='IUJMU107.MERGE1',
//
UTPROC='',SYSTEM='DSN'
//COPY1 DD DSN=IUJMU107.MERGE1.STEP1.COPY1,DISP=(MOD,CATLG,CATLG),
//
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//COPY2 DD DSN=IUJMU107.MERGE1.STEP1.COPY2,DISP=(MOD,CATLG,CATLG),
//
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//SYSUT1
DD DSN=IUJMU107.MERGE1.STEP1.SYSUT1,DISP=(MOD,DELETE,CATLG),
//
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//SYSIN
DD *
MERGECOPY TABLESPACE DSN8D91P.DSN8S91C
COPYDDN
(COPY1,COPY2)
NEWCOPY NO
Figure 49. Example of creating a merged incremental copy
//STEP1
//
//
//SYSUT1
//
//SYSIN
TEMPLATE
EXEC DSNUPROC,UID='JULTU224.MERGE',
UTPROC='',
SYSTEM='SSTR'
DD DSN=JULTU224.MERGE.STEP1.SYSUT1,DISP=(MOD,DELETE,CATLG),
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
DD *
T1 UNIT(SYSDA) SPACE CYL
DSN(T1.&SN..T&TI..COPY&IC.&LOCREM.)
LIMIT(5 MB,T5)
TEMPLATE T5 UNIT(3BO)
DSN(T5.&SN..T&TI..COPY&IC.&LOCREM.)
MERGECOPY TABLESPACE DBLT2401.TPLT2401 DSNUM ALL NEWCOPY NO
COPYDDN(T1)
MERGECOPY TABLESPACE DBLT2401.TLLT24A1 DSNUM ALL NEWCOPY NO
COPYDDN(T1)
MERGECOPY TABLESPACE DBLT2401.TLLT24A2 DSNUM ALL NEWCOPY NO
COPYDDN(T1)
MERGECOPY TABLESPACE DBLT2401.TLLT24A3 DSNUM ALL NEWCOPY NO
COPYDDN(T1)
MERGECOPY TABLESPACE DBLT2401.TLLT24A4 DSNUM ALL NEWCOPY NO
COPYDDN(T1)
315
|
|
Related reference
Chapter 31, TEMPLATE, on page 641
316
Output
|
|
|
Authorization required
To execute this utility, you must use a privilege set that includes one of the
following authorities:
v IMAGCOPY privilege for the database to run MODIFY RECOVERY
v DBADM, DBCTRL, or DBMAINT authority for the database. If the object on
which the utility operates is in an implicitly created database, DBADM authority
on the implicitly created database or DSNDB04 is required.
v SYSCTRL or SYSADM authority
v DBADM, authority
Copyright IBM Corp. 1983, 2009
317
Syntax diagram
DSNUM ALL
MODIFY RECOVERY
LIST listdef-name
TABLESPACE
database-name.
table-space-name
DSNUM
integer
DELETE
AGE
CLONE
RETAIN
integer
(*)
DATE integer
(*)
LAST ( integer )
LOGLIMIT
GDGLIMIT
LAST ( integer
LOGLIMIT
Option descriptions
LIST listdef-name
Specifies the name of a previously defined LISTDEF list name that contains
318
only table spaces. You can specify one LIST keyword per MODIFY RECOVERY
control statement. Do not specify LIST with the TABLESPACE keyword.
MODIFY is invoked once for each table space in the list. This utility will only
process clone data if the CLONE keyword is specified. The use of CLONED
YES on the LISTDEF statement is not sufficient.
TABLESPACE database-name.table-space-name
Specifies the database and the table space for which records are to be deleted.
database-name
Specifies the name of the database to which the table space belongs.
database-name is optional.
The default value is DSNDB04.
table-space-name
Specifies the name of the table space.
DSNUM integer
Identifies a single partition or data set of the table space for which records are
to be deleted; ALL deletes records for the entire data set and table space.
integer is the number of a partition or data set.
The default value is ALL.
For a partitioned table space, integer is its partition number. The maximum is
4096.
|
|
|
|
|
|
|
For a nonpartitioned table space, use the data set integer at the end of the data
set name as cataloged in the VSAM catalog. If image copies are taken by
partition or data set and you specify DSNUM ALL, the table space is placed in
COPY-pending status if a full image copy of the entire table space does not
exist. The data set name has the following format, where y is either I or J, z is
either a 1 or 2, and nnn is the data set integer.
|
|
|
|
|
If you specify DSNUM n, MODIFY RECOVERY does not delete any SYSCOPY
records for the partitions that have an RBA greater than that of the earliest
point to which the entire table space could be recovered. That point might
indicate a full image copy, a LOAD operation with LOG YES or a REORG
operation with LOG YES.
catname.DSNDBx.dbname.tsname.y000z.Annn
CLONE
Indicates that MODIFY RECOVERY is to delete SYSCOPY records and
SYSLGRNX records for only clone objects. If CLONE is not specified, only
records for the base objects are deleted. This utility will only process clone data
if the CLONE keyword is specified. The use of CLONED YES on the LISTDEF
statement is not sufficient.
DELETE
Indicates that records are to be deleted. See the DSNUM description for
restrictions on deleting partition statistics.
AGE integer
Deletes all SYSCOPY and SYSLGRNX records that are older than a
319
|
|
specified number of days. SYSLGRNX records that meet the age deletion
criteria specified will be deleted even if no SYSCOPY records are deleted.
|
|
integer is the number of days, and can range from 0 to 32767. Records that
are created today are of age 0 and cannot be deleted by this option.
|
|
|
|
|
|
|
(*) deletes all records, regardless of the date on which they were written.
RETAIN
Indicates that records are to be retained. Older records are deleted.
|
|
|
|
|
|
|
|
|
|
|
LAST (integer)
Specifies the number of recent records to retain in SYSIBM.SYSCOPY.
|
|
|
|
|
|
LOGLIMIT
Queries the BSDS to determine the oldest archive log timestamp and
deletes records older than this timestamp, if the most recent record in
SYSIBM.SYSCOPY refers to a non-GDS. For data sharing, DB2 queries the
BSDS of all data sharing members to determine the overall oldest log
timestamp.
|
|
|
|
GDGLIMIT
Retrieves the GDG limit if the most recent record in SYSIBM.SYSCOPY
refers to a GDS (Generation data set). As many recent records (referring to
the same GDG) as specified in the GDG limit will be retained.
|
|
|
LAST (integer)
Specifies the number of recent records to retain in SYSIBM.SYSCOPY if
the most recent record in SYSIBM.SYSCOPY refers to a non-GDS.
|
|
|
|
|
|
LOGLIMIT
Queries the BSDS to determine the oldest archive log timestamp if the
most recent record in SYSIBM.SYSCOPY refers to a non-GDS. For data
sharing, DB2 queries the BSDS of all data sharing members to
determine the overall oldest log timestamp, and deletes records older
than this timestamp.
320
|
|
|
|
|
Related reference
Chapter 15, LISTDEF, on page 185
Chapter 31, TEMPLATE, on page 641
|
|
Certain activities might be required before you run the MODIFY RECOVERY
utility, depending on your situation.
|
|
|
|
|
If you use MODIFY RECOVERY to delete SYSCOPY records, use the REPORT
utility to view all SYSCOPY records for the object at the specified site to avoid
deleting the wrong records.
|
|
|
|
|
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
The following object is named in the utility control statement and does not require
a DD statement in the JCL:
Table space
Object for which records are to be deleted.
321
DB2 treats individual data and index partitions as distinct target objects. Utilities
that operate on different partitions of the same table space or index space are
compatible.
The following table shows the restrictive state that the utility sets on the target
object.
Table 53. Claim classes of MODIFY RECOVERY operations.
Target
MODIFY RECOVERY
UTRW
Legend:
UTRW - Utility restrictive state - Read-write access allowed.
MODIFY RECOVERY can run concurrently on the same target object with any
utility except the following utilities:
v COPY TABLESPACE
v LOAD
v MERGECOPY
v MODIFY RECOVERY
v RECOVER TABLESPACE
v REORG TABLESPACE
The target object can be a table space or partition.
322
v If image copies exist at both the data set level and the table space level for a
nonpartitioned table space, use DSNUM ALL.
Restriction: In this case, if you use DSNUM integer, MODIFY RECOVERY does
not delete any SYSCOPY or SYSLGRNX records that are newer than the oldest
recoverable point at the table space level.
The preceding guidelines pertain to all image copies, regardless of how they were
created, including those copies that were created by COPY, COPYTOCOPY, LOAD,
REORG or MERGECOPY.
|
|
|
323
324
v The value in the CURRENT_VERSION column is one less than the value in the
OLDEST_VERSION column.
v The value in the CURRENT_VERSION column is 255 for table spaces or 15 for
indexes, and the value in the OLDEST_VERSION column is 0 or 1.
To recycle version numbers for indexes that are defined with the COPY NO
attribute, run LOAD REPLACE, REBUILD INDEX, REORG INDEX, or REORG
TABLESPACE.
Related information
Table space versions (DB2 Administration Guide)
DSNUPROC,UID='FUN5U053.STEP2',UTPROC='',SYSTEM='SSTR'
325
|
|
|
|
|
|
Related reference
Chapter 15, LISTDEF, on page 185
Chapter 27, REPORT, on page 563
326
LAST (4)
Restriction: MODIFY STATISTICS does not delete statistics history records for
clone tables because statistics are not collected for these tables.
Output
|
|
Authorization required
To execute this utility, you must use a privilege set that includes one of the
following authorities:
v STATS privilege for the database to run MODIFY STATISTICS.
v DBADM, DBCTRL, or DBMAINT authority for the database. If the object on
which the utility operates is in an implicitly created database, DBADM authority
on the implicitly created database or DSNDB04 is required.
v SYSCTRL or SYSADM authority.
A user ID with installation SYSOPR authority can also execute MODIFY
STATISTICS, but only on a table space in the DSNDB01 or DSNDB06 database.
327
UTILTERM
Performs cleanup
Syntax diagram
MODIFY STATISTICS
DELETE
ALL
ACCESSPATH
SPACE
LIST listdef-name
TABLESPACE
table-space-name
database-name.
INDEXSPACE
index-space-name
database-name.
INDEX
index-name
creator-id.
AGE
(integer)
(*)
DATE
(integer)
(*)
Option descriptions
LIST listdef-name
Specifies the name of a previously defined LISTDEF list name. You cannot
repeat the LIST keyword or specify it with TABLESPACE, INDEXSPACE, or
INDEX.
The list can contain index spaces, table spaces, or both. MODIFY STATISTICS
is invoked once for each object in the list.
TABLESPACE database-name.table-space-name
Specifies the database and the table space for which catalog history records are
to be deleted.
database-name
Specifies the name of the database to which the table space belongs.
database-name is optional.
The default value is DSNDB04.
table-space-name
Specifies the name of the table space for which statistics are to be deleted.
INDEXSPACE database-name.index-space-name
Specifies the qualified name of the index space for which catalog history
information is to be deleted. The utility lists the name in the
SYSIBM.SYSINDEXES table.
328
database-name
Optionally specifies the name of the database to which the index space
belongs.
The default value is DSNDB04.
index-space-name
Specifies the name of the index space for which the statistics are to be
deleted.
INDEX creator-id.index-name
Specifies the index for which catalog history information is to be deleted.
creator-id
Optionally specifies the creator of the index.
The default value is DSNDB04.
index-name
Specifies the name of the index for which the statistics are to be deleted.
Enclose the index name in quotation marks if the name contains a blank.
DELETE
Indicates that records are to be deleted.
ALL
Deletes all statistics history rows that are related to the specified object
from all catalog history tables.
Rows from the following history tables are deleted only when you specify
DELETE ALL:
v SYSTABLES_HIST
v SYSTABSTATS_HIST
v SYSINDEXES_HIST
v SYSINDEXSTATS_HIST
|
v SYSKEYTARGETS_HIST
ACCESSPATH
Deletes all access-path statistics history rows that are related to the
specified object from the following history tables:
v SYSIBM.SYSCOLDIST_HIST
v SYSIBM.SYSCOLUMNS_HIST
v SYSKEYTGTDIST_HIST
SPACE
Deletes all space-tuning statistics history rows that are related to the
specified object from the following history tables:
v SYSIBM.SYSINDEXPART_HIST
v SYSIBM.SYSTABLEPART_HIST
v SYSIBM.SYSLOBSTATS_HIST
AGE (integer)
Deletes all statistics history rows that are related to the specified object and
that are older than a specified number of days.
(integer)
Specifies the number of days in a range from 0 to 32 767. This option
cannot delete records that are created today (age 0).
(*) Deletes all records, regardless of their age.
329
DATE (integer)
Deletes all statistics history rows that were written before a specified date.
(integer)
Specifies the date in an eight-character format. Specify a year (yyyy), month
(mm), and day (dd) in the form yyyymmdd.
(* )
Deletes all records, regardless of the date on which they were written.
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
The following object is named in the utility control statement and does not require
a DD statement in the JCL:
Table space or index space
Object for which records are to be deleted.
MODIFY STATISTICS
UTRW
Legend:
UTRW - Utility restrictive state - read-write access allowed.
330
331
Related concepts
Restart of an online utility on page 36
EXEC DSNUPROC,UID='JUOEU115.MDFYL9',
UTPROC='',
SYSTEM='SSTR'
DD SYSOUT=*
DD *
332
//STEP9
//
//
//SYSPRINT
//SYSIN
EXEC DSNUPROC,UID='JUOEU115.MOFYS9',
UTPROC='',
SYSTEM='SSTR'
DD SYSOUT=*
DD *
333
334
You can repeat an OPTIONS control statement within the SYSIN DD statement. If
you repeat the control statement, it entirely replaces any prior OPTIONS control
statement.
Output
The OPTIONS control statement sets the specified processing options for the
duration of the job step, or until replaced by another OPTIONS control statement
within the same job step.
Authorization required
The OPTIONS control statement performs setup for subsequent control statements.
The OPTIONS statement itself requires no privileges to execute.
335
Syntax diagram
OPTIONS
PREVIEW
LISTDEFDD
OFF
KEY key-value
ddname
TEMPLATEDD
ddname
FILSZ
integer
event-spec
event-spec:
ITEMERROR,HALT
WARNING,RC4
EVENT (
)
ITEMERROR,SKIP
WARNING,RC0
WARNING,RC8
Option descriptions
PREVIEW
Specifies that the utility control statements that follow are to run in PREVIEW
mode. The utility checks for syntax errors in all utility control statements, but
normal utility execution does not take place. If the syntax is valid, the utility
expands all LISTDEF lists and TEMPLATE DSNs that appear in SYSIN and
prints results to the SYSPRINT data set.
PREVIEW evaluates and expands all LISTDEF statements into an actual list of
table spaces or index spaces. It evaluates TEMPLATE DSNs and uses variable
substitution for actual data set names when possible. It also expands lists from
the SYSLISTD DD and TEMPLATE DSNs from the SYSTEMPL DD that a
utility invocation references.
A definitive preview of TEMPLATE DSN values is not always possible.
Substitution values for some variables, such as &DATE., &TIME., &SEQ. and
&PART., can change at execution time. In some cases, PREVIEW generates
approximate data set names. The OPTIONS utility substitutes unknown
character variables with the character string UNKNOWN and unknown
integer variables with zeroes.
Instead of OPTIONS PREVIEW, you can use a JCL PARM to activate preview
processing. Although the two functions are identical, use JCL PARM to
preview an existing set of utility control statements. Use the OPTION
PREVIEW control statement when you invoke DB2 utilities through a stored
procedure.
The JCL PARM is specified as the third JCL PARM of DSNUTILB and on the
UTPROC variable of DSNUPROC, as shown in the following JCL:
//STEP1
//
EXEC DSNUPROC,UID='JULTU106.RECOVE1',
UTPROC='PREVIEW',SYSTEM='SSTR'
The PARM value PREVIEW causes the utility control statements in that job
step to be processed for preview only. The LISTDEF and TEMPLATE control
statements are expanded, but the utility does not execute.
OPTIONS PREVIEW is identical to the PREVIEW JCL parameter, except that
you can specify a subsequent OPTIONS statement to turn off the preview for
336
FILSZ integer
Specifies a file size in megabytes and overrides the DFSORT file size when sort
work data sets are allocated by the utility with system parameter UTSORTAL
set to YES. Only use this keyword under the direction of IBM Software
Support.
EVENT
Specifies one or more pairs of utility processing events and the matching action
for the event. Not all actions are valid for all events.
|
|
The parentheses and commas in the EVENT operand are currently optional but
they may be required in a future release.
ITEMERROR
Specifies how utility processing is to handle errors during list processing.
Specifically, this keyword indicates the effect on processing in response to
return code 8. By default, utility processing stops (HALT). The ITEMERROR
event does not include abnormal terminations (abends).
Note that for the QUIESCE utility, the indexes for the table spaces in the list, if
any, are considered as list items for the purposes of the ITEMERROR event.
ITEMERROR affects how errors are handled on both the table spaces and the
indexes.
HALT
Specifies that the utility is to stop after the event.
SKIP
Ignores the event and skips the list item. Processing continues with the
next item in the list.
SKIP applies only during the processing of a valid list. SKIP does not
apply if a utility detects that a list is not valid for the utility that is
invoked. In that case, the list is rejected with an error message and the
processing of the list is not initiated.
If any of the items in a list is skipped, the utility produces a return code of
8, which terminates the job step. The following code shows an OPTIONS
statement with the SKIP option:
OPTIONS EVENT (ITEMERROR, SKIP)
COPY LISTA
COPY LISTB
Chapter 20. OPTIONS
337
If LISTA contains ten objects and one object produces a return code 8
during the COPY, the other nine objects in the list are copied successfully.
The job step ends with a return code 8 and COPY LISTB is not executed.
WARNING
Specifies a response to the return code message event.
Use WARNING to alter the return code for warning messages. You can alter
the return code from message DSNU010I with this option. If you alter the
message return code, message DSNU1024I is issued to document the new
return code.
Action choices are as follows:
RC0
Lowers the final return code of a single utility invocation that ends in a
return code 4 to a return code of 0. Use RC0 to force a return code of 0 for
warning messages.
Use this option only when return code 4 is expected, is acceptable, and
other mechanisms are in place to validate the results of a utility execution.
RC4
Specifies that return codes for warning messages are to remain unchanged.
Use RC4 to override a previous OPTIONS WARNING specification in the
same job step.
RC8
Raises the final return code of a single utility invocation that ends in a
return code 4 to a return code of 8. Use RC8 to force a return code of 8 for
warning messages. The return code of 8 causes the job step to terminate
and subsequent utility control statements are not executed.
OFF
Specifies that all default options are to be restored. OPTIONS OFF does not
override the PREVIEW JCL parameter, which, if specified, remains in effect for
the entire job step. You cannot specify any other OPTIONS keywords with
OPTIONS OFF.
OPTIONS OFF is equivalent to OPTIONS LISTDEFDD SYSLISTD
TEMPLATEDD SYSTEMPL EVENT (ITEMERROR, HALT, WARNING, RC4).
KEY
Specifies an option that you should use only when you are instructed by IBM
Software Support. OPTIONS KEY is followed by a single operand that IBM
Software Support provides when needed.
338
339
340
delete all SYSCOPY and SYSLGRNX records for table space A.B. The second
OPTIONS control statement restores the default options, so that no return codes
will be overridden for the second MODIFY RECOVERY control statement.
OPTIONS EVENT(WARNING,RC0)
MODIFY RECOVERY TABLESPACE A.B DELETE AGE(*)
OPTIONS OFF
MODIFY RECOVERY TABLESPACE C.D DELETE AGE(30)
341
Figure 58. Example OPTIONS statements for checking syntax and skipping errors
342
Output
A quiesce point is the current log RBA or log record sequence number (LRSN).
QUIESCE then records the quiesce point in the SYSIBM.SYSCOPY catalog table.
With RECOVER to a prior point-in-time with consistency, a quiesce point is no
longer essential when planning for point-in-time recoveries since the objects will be
recovered with transactional consistency (the objects will only contain data that has
been committed). However, recovering objects to a quiesce point will be faster
because no work has to be backed out. Also, you may still want to establish
quiesce points for related sets of objects if there is a need to plan for a
point-in-time recovery for the entire set.
You can recover a table space to its quiesce point by using the RECOVER
TABLESPACE utility.
With the WRITE(YES) option, QUIESCE writes changed pages for the table spaces
and their indexes from the DB2 buffer pool to disk. The catalog table SYSCOPY
records the current RBA and the timestamp of the quiesce point. A row with
ICTYPE=Q is inserted into SYSIBM.SYSCOPY for each table space that is
quiesced. DB2 also inserts a SYSCOPY row with ICTYPE=Q for any indexes
(defined with the COPY YES attribute) over a table space that is being quiesced.
(Table spaces DSNDB06.SYSCOPY, DSNDB01.DBD01, and DSNDB01.SYSUTILX are
an exception; their information is written to the log.)
Authorization required
To execute this utility, you must use a privilege set that includes one of the
following authorities:
v IMAGCOPY privilege for the database
v DBADM, DBCTRL, or DBMAINT authority for the database. If the object on
which the utility operates is in an implicitly created database, DBADM authority
on the implicitly created database or DSNDB04 is required.
v SYSCTRL or SYSADM authority
An ID with installation SYSOPR authority can also execute QUIESCE, but only on
a table space in the DSNDB01 or DSNDB06 database.
You can specify DSNDB01.SYSUTILX, but you cannot include it in a list with other
table spaces to be quiesced. Recover to current of the catalog/directory table spaces
is preferred and recommended. However, if a point-in-time recovery of the
catalog/directory table spaces is desired, a separate quiesce of DSNDB06.SYSCOPY
is required after a quiesce of the other catalog/directory table spaces.
343
UTILINIT
Initialization and setup
QUIESCE
Determining the quiesce point and updating the catalog
UTILTERM
Cleanup
Syntax diagram
QUIESCE
LIST listdef-name
TABLESPACE
database-name.
TABLESPACESET
TABLESPACE
table-space-name
PART integer
table-space-name
database-name.
WRITE YES
CLONE
WRITE NO
Option descriptions
LIST listdef-name
Specifies the name of a previously defined LISTDEF list name that contains
only table spaces. The utility allows one LIST keyword for each QUIESCE
control statement. Do not specify LIST with the TABLESPACE or
TABLESPACESET keyword. QUIESCE is invoked once for the entire list. For
the QUIESCE utility, the related index spaces are considered to be list items for
the purposes of OPTIONS ITEMERROR processing. You can alter the utility
behavior during processing of related indexes with the OPTIONS ITEMERROR
statement. This utility will only process clone data if the CLONE keyword is
specified. The use of CLONED YES on the LISTDEF statement is not sufficient.
TABLESPACE database-name.table-space-name
For QUIESCE TABLESPACE, specifies the table space that is to be quiesced.
For QUIESCE TABLESPACESET, specifies a table space in the table space set
that is to be quiesced. For QUIESCE TABLESPACESET, the TABLESPACE
keyword is optional.
344
database-name
Optionally specifies the name of the database to which the table space
belongs.
The default value is DSNDB04.
table-space-name
Specifies the name of the table space that is to be quiesced. You can specify
DSNDB01.SYSUTILX, but do not include that name in a list with other
table spaces that are to be quiesced. If a point-in-time recovery is planned
for the catalog and directory, DSNDB06.SYSCOPY must be quiesced
separately after all other catalog and directory table spaces.
PART integer
Identifies a partition that is to be quiesced.
integer is the number of the partition and must be in the range from 1 to the
number of partitions that are defined for the table space. The maximum is
4096.
TABLESPACESET
Indicates that all of the referentially related table spaces in the table space set
are to be quiesced. For the purposes of the QUIESCE utility, a table space set is
one of these:
v A group of table spaces that have a referential relationship
v A base table space with all of its LOB table spaces
v A base table space with all of its XML table spaces
|
|
|
|
CLONE
Indicates that QUIESCE is to create a quiesce point for only the specified clone
table space. This utility will only process clone data if the CLONE keyword is
specified. The use of CLONED YES on the LISTDEF statement is not sufficient.
WRITE
Specifies whether the changed pages from the table spaces and index spaces
are to be written to disk.
YES
Establishes a quiesce point and writes the changed pages from the table
spaces and index spaces to disk.
NO
Establishes a quiesce point but does not write the changed pages from the
table spaces and index spaces to disk.
|
|
345
Related concepts
Resetting COPY-pending status on page 288
Resetting REBUILD-pending status on page 288
Related tasks
Resetting CHECK-pending status on page 78
Related reference
Appendix C, Advisory or restrictive states, on page 925
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
The following object is named in the utility control statement and does not require
a DD statement in the JCL:
Table space
Object that is to be quiesced. (If you want to quiesce only one partition of
a table space, you must use the PART option in the control statement.)
Claims
The following table shows which claim classes QUIESCE drains and any restrictive
state that the utility sets on the target object.
Table 57. Claim classes of QUIESCE operations.
Target
WRITE YES
WRITE NO
DW/UTRO
DW/UTRO
DW/UTRO
DW/UTRO
Legend:
v DW - Drain the write claim class - concurrent access for SQL readers
v UTRO - Utility restrictive state - read-only access allowed
346
Compatibility
The following table shows which utilities can run concurrently with QUIESCE on
the same target object. The target object can be a table space, an index space, or a
partition of a table space or index space. If compatibility depends on particular
options of a utility, that information is also documented in the table. QUIESCE
does not set a utility restrictive state if the target object is DSNDB01.SYSUTILX.
Table 58. Compatibility of QUIESCE with other utilities
Action
Compatible with
QUIESCE?
Yes
No
CHECK INDEX
Yes
CHECK LOB
Yes
No
Yes
No
Yes
DIAGNOSE
Yes
LOAD
No
MERGECOPY
Yes
MODIFY
Yes
QUIESCE
Yes
REBUILD INDEX
No
RECOVER INDEX
No
RECOVER TABLESPACE
No
REORG INDEX
No
No
Yes
No
Yes
REPORT
Yes
RUNSTATS
Yes
STOSPACE
Yes
UNLOAD
Yes
347
|
|
|
|
348
v If you specify a list of table spaces or table space sets to quiesce and duplicate a
table space, utility processing continues, and the table space is quiesced only
once. QUIESCE issues return code 4 and warning message DSNU533I to alert
you of the duplication.
v If you specify the same table space twice in a list, using PART n in one
specification, and PART m for the other specification, each partition is quiesced
once.
When you run QUIESCE on a table space or index space that is in COPY-pending,
CHECK-pending, or RECOVER-pending status, you might also receive one or
more of the messages that are shown in the following figure.
DSNU202I
DSNU203I
DSNU204I
DSNU208I
DSNU209I
DSNU210I
DSNU211I
DSNU214I
DSNU215I
DSNU471I
DSNU568I
349
|
|
|
|
|
|
The following example shows the output that the preceding command produces.
DSNU000I
DSNU1044I
DSNU050I
DSNU477I
DSNU477I
DSNU477I
DSNU474I
DSNU475I
DSNU010I
=
=
=
=
Figure 61. Example output from a QUIESCE job that establishes a quiesce point for three
table spaces
350
//STEP1
EXEC DSNUPROC,UID='IUIQU2UD.QUIESC2',
//
UTPROC='',SYSTEM='DSN'
//SYSIN
DD *
//DSNUPROC.SYSIN
DD *
LISTDEF QUIESCELIST INCLUDE TABLESPACE DSN8D81A.DSN8S81D
INCLUDE TABLESPACE DSN8D81A.DSN8S81E
INCLUDE TABLESPACE DSN8D81A.DSN8S81P
QUIESCE LIST QUIESCELIST
//*
The following example shows the output that the preceding command produces.
DSNU000I
DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = TEMP
DSNU1044I
DSNUGTIS - PROCESSING SYSIN AS EBCDIC
DSNU050I
DSNUGUTC - LISTDEF QUIESCELIST INCLUDE TABLESPACE DSN8D81A.DSN8S81D
INCLUDE TABLESPACE DSN8D81A.DSN8S81E
INCLUDE TABLESPACE DSN8D81A.DSN8S81P
DSNU1035I
DSNUILDR - LISTDEF STATEMENT PROCESSED SUCCESSFULLY
0DSNU050I
DSNUGUTC - QUIESCE LIST QUIESCELIST
DSNU477I = DSNUQUIA - QUIESCE SUCCESSFUL FOR TABLESPACE DSN8D81A.DSN8S81D
DSNU477I = DSNUQUIA - QUIESCE SUCCESSFUL FOR TABLESPACE DSN8D81A.DSN8S81E
DSNU477I = DSNUQUIA - QUIESCE SUCCESSFUL FOR TABLESPACE DSN8D81A.DSN8S81P
DSNU474I = DSNUQUIA - QUIESCE AT RBA 000004E56419 AND AT LRSN 000004E56419
DSNU475I
DSNUQUIB - QUIESCE UTILITY COMPLETE, ELAPSED TIME= 00:00:00
DSNU010I
DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST RETURN CODE=0
Figure 62. Example output from a QUIESCE job that establishes a quiesce point for a list of
objects
The following example shows the output that the preceding command produces.
DSNU000I
DSNU050I
DSNU477I
DSNU477I
DSNU477I
DSNU477I
DSNU477I
DSNU477I
DSNU477I
DSNU477I
DSNU474I
DSNU475I
DSNU010I
DSNUGUTC
DSNUGUTC
DSNUQUIA
DSNUQUIA
DSNUQUIA
DSNUQUIA
DSNUQUIA
DSNUQUIA
DSNUQUIA
DSNUQUIA
DSNUQUIA
DSNUQUIB
DSNUGBAC
Figure 63. Example output from a QUIESCE job that establishes a quiesce point for a table
space set
351
disk.) In this example, a quiesce point is established for COPY YES indexes, but
not for COPY NO indexes. Note that QUIESCE jobs with the WRITE YES option,
which is the default, process both COPY YES indexes and COPY NO indexes. For
both QUIESCE WRITE YES jobs and QUIESCE WRITE NO jobs, the utility inserts
a row in SYSIBM.SYSCOPY for each COPY YES index.
//STEP1
EXEC DSNUPROC,UID='IUIQU2UD.QUIESC2',
//
UTPROC='',SYSTEM='DSN'
//SYSIN
DD *
//DSNUPROC.SYSIN
DD *
QUIESCE TABLESPACE DSN8D81A.DSN8S81D WRITE NO
//*
The preceding command produces the output that is shown in the following
example. Notice that the COPY YES index EMPNOI is placed in informational
COPY-pending (ICOPY) status:
DSNU000I
DSNU1044I
DSNU050I
DSNU477I
DSNU477I
DSNU474I
DSNU568I
DSNU475I
DSNU010I
=
=
=
=
DSNUGUTC
DSNUGTIS
DSNUGUTC
DSNUQUIA
DSNUQUIA
DSNUQUIA
DSNUGSRX
DSNUQUIB
DSNUGBAC
Figure 64. Example output from a QUIESCE job that establishes a quiesce point, without
writing the changed pages to disk.
|
|
|
352
Authorization required
To execute this utility, you must use a privilege set that includes one of the
following authorities:
v RECOVERDB privilege for the database
v STATS privilege for the database is required if the STATISTICS keyword is
specified.
v DBADM or DBCTRL authority for the database. If the object on which the utility
operates is in an implicitly created database, DBADM authority on the implicitly
created database or DSNDB04 is required.
v SYSCTRL or SYSADM authority
To run REBUILD INDEX STATISTICS REPORT YES, you must use a privilege set
that includes the SELECT privilege on the catalog tables.
353
You can create a control statement with the ISPF/PDF edit function. After creating
it, save it in a sequential or partitioned data set. When you create the JCL for
running the job, use the SYSIN DD statement to specify the name of the data set
that contains the utility control statement.
Syntax diagram
REBUILD
,
(1)
INDEX
creatorid.index-name
)
PART
integer
(ALL) table-space-spec
LIST listdef-name
,
INDEXSPACE
index-space-name
database-name.
(ALL) table-space-spec
PART
SHRLEVEL REFERENCE
integer
SCOPE ALL
drain-spec
SHRLEVEL CHANGE
change-spec
SCOPE PENDING
CLONE
REUSE
SORTDEVT
device-type
SORTNUM integer
stats-spec
Notes:
|
table-space-spec:
TABLESPACE
table-space-name
database-name.
PART
integer
change-spec:
MAXRO
integer
LONGLOG CONTINUE
DELAY
1200
LONGLOG TERM
LONGLOG DRAIN
DELAY
integer
MAXRO DEFER
354
drain-spec:
RETRY
UTIMOUT value
DRAIN_WAIT integer
RETRY
integer
RETRY_DELAY
integer
stats-spec:
REPORT NO
STATISTICS
UPDATE ALL
correlation-stats-spec
REPORT YES
UPDATE
ACCESSPATH
SPACE
NONE
HISTORY
ALL
ACCESSPATH
SPACE
NONE
FORCEROLLUP
YES
NO
correlation-stats-spec:
FREQVAL NUMCOLS 1
COUNT 10
KEYCARD
FREQVAL NUMCOLS
integer
COUNT
integer
Option descriptions
INDEX creator-id.index-name
Indicates the qualified name of the index to be rebuilt. Use the form
creator-id.index-name to specify the name.
creator-id
Specifies the creator of the index. This qualifier is optional. If you omit the
qualifier creator-id, DB2 uses the user identifier for the utility job.
index-name
Specifies the qualified name of the index that is to be rebuilt. For an index,
you can specify either an index name or an index space name. Enclose the
index name in quotation marks if the name contains a blank.
To rebuild multiple indexes, separate each index name with a comma. All
listed indexes must reside in the same table space. If more than one index is
listed and the TABLESPACE keyword is not specified, DB2 locates the first
Chapter 22. REBUILD INDEX
355
valid index name that is cited and determines the table space in which that
index resides. That table space is used as the target table space for all other
valid index names that are listed.
INDEXSPACE database-name.index-space-name
Specifies the qualified name of the index space that is obtained from the
SYSIBM.SYSINDEXES table.
database-name
Specifies the name of the database that is associated with the index. This
qualifier is optional.
index-space-name
Specifies the qualified name of the index space to copy. For an index, you
can specify either an index name or an index space name.
If you specify more than one index space, they must all be defined on the
same table space.
For an index, you can specify either an index name or an index space name.
(ALL)
Specifies that all indexes in the table space that is referred to by the
TABLESPACE keyword are to be rebuilt. If you specify ALL, only indexes on
the base table are included.
|
|
|
|
TABLESPACE database-name.table-space-name
Specifies the table space from which all indexes are to be rebuilt.
database-name
Identifies the database to which the table space belongs.
The default value is DSNDB04.
table-space-name
Identifies the table space from which all indexes are to be rebuilt.
PART integer
Specifies the physical partition of a partitioning index or a data-partitioned
secondary index in a partitioned table that is to be rebuilt. When the target of
the REBUILD operation is a nonpartitioned secondary index, the utility
reconstructs logical partitions. If any of the following situations are true for a
nonpartitioned index, you cannot rebuild individual logical partitions:
v the index was created with DEFER YES
v the index must be completely rebuilt (This situation is likely in a disaster
recovery scenario)
v the index is in page set REBUILD-pending (PSRBD) status
For these cases, you must rebuild the entire index.
integer is the number of the partition and must be in the range from 1 to the
number of partitions that are defined for the table space. The maximum value
is 4096.
You cannot specify PART with the LIST keyword. Use LISTDEF PARTLEVEL
instead.
LIST listdef-name
Specifies the name of a previously defined LISTDEF list name. The utility
allows one LIST keyword for each REBUILD INDEX control statement. The list
must contain either all index spaces or all table spaces. For a table space list,
356
REBUILD is invoked once per table space. For an index space list, DB2 groups
indexes by their related table space and executes the rebuild once per table
space. This utility will only process clone data if the CLONE keyword is
specified. The use of CLONED YES on the LISTDEF utility control statement is
not sufficient.
|
|
|
SHRLEVEL
Indicates the type of access that is to be allowed for the index, table space, or
partition that is to be checked during REBUILD INDEX processing.
|
|
|
|
REFERENCE
Specifies that applications can read from but cannot write to the table
space or partition that REBUILD accesses. Applications cannot read or
write from the index REBUILD is building.
|
|
|
|
CHANGE
Specifies that applications can read from and write to the table space or
partition. The index is placed in RBDP and can be avoided by dynamic
SQL. CHANGE is invalid for indexes over XML tables.
|
|
Restriction:
v SHRLEVEL CHANGE is not well suited for unique indexes and
concurrent DML because the index is placed in RBDP while being built.
Inserts and updates of the index will fail with a resource unavailable
(-904) because uniqueness checking cannot be done while the index is in
RBDP.
v SHRLEVEL CHANGE is not allowed on not logged tables, XML indexes,
or spatial indexes.
|
|
|
|
|
|
|
|
|
|
MAXRO
Specifies the maximum amount of time for the last iteration of log processing.
During that iteration, applications have read-only access.
|
|
The actual execution time of the last iteration might exceed the specified value
for MAXRO.
|
|
|
|
|
|
integer
integer is the number of seconds. Specifying a small positive value reduces
the length of the period of read-only access, but it might increase the
elapsed time for REBUILD INDEX to complete. If you specify a huge
positive value, the second iteration of log processing is probably the last
iteration.
|
|
The default value is the value of the lock timeout system parameter
IRLMRWT.
|
|
|
|
|
|
LONGLOG
Specifies the action that DB2 is to perform, after sending a message to the
console, if the number of records that the next iteration of logging is to process
is not sufficiently lower than the number that the previous iterations processed.
This situation means that the reading of the log by the REBUILD INDEX utility
is not being done at the same time as the writing of the application log.
|
|
CONTINUE
Specifies that until the time on the JOB statement expires, DB2 is to
357
|
|
|
|
|
|
TERM
Specifies that DB2 is to terminate the reorganization after the delay that is
specified by the DELAY parameter.
|
|
|
|
DRAIN
Specifies that DB2 is to drain the write claim class after the delay that is
specified by the DELAY parameter. This action forces the final iteration of
log processing to occur.
DELAY integer
Specifies the minimun integer between the time that REBUILD send the
LONGLOG message to the console and the time that REBUILD performs the
action the LONGLOG parameter specifies.
|
|
|
|
|
|
|
|
|
|
integer can be any integer from 0 to 1800. If you do not specify DRAIN_WAIT
or specify a value of 0, the utility uses the value of the lock timeout subsystem
parameter IRLMRWT.
|
|
|
|
|
RETRY integer
Specifies the maximum number of retries that REBUILD INDEX is to attempt.
|
|
|
integer can be any integer from 0 to 255. If you do not specify RETRY,
REBUILD INDEX uses the value of the utility multiplier system parameter
UTIMOUT.
|
|
|
|
|
|
|
|
CLONE
Indicates that REBUILD INDEX is to reconstruct only the specified indexes that
are on clone tables. This utility will only process clone data if the CLONE
keyword is specified. The use of CLONED YES on the LISTDEF statement is
not sufficient. If you specify CLONE, you cannot specify STATISTICS. Statistics
are not collected for clone objects.
|
|
|
|
|
|
SCOPE
Indicates the scope of the rebuild organization of the specified index or
indexes.
ALL
Indicates that you want the specified index or indexes to be rebuilt.
358
PENDING
Indicates that you want the specified index or indexes with one or more
partitions in REBUILD-pending (RBDP), REBUILD-pending star (RBDP*),
page set REBUILD-pending (PSRBD), RECOVER-pending (RECP), or
advisory REORG-pending (AREO*) state to be rebuilt.
REUSE
Specifies that REBUILD should logically reset and reuse DB2-managed data
sets without deleting and redefining them. If you do not specify REUSE, DB2
deletes and redefines DB2-managed data sets to reset them.
If you are rebuilding the index because of a media failure, do not specify
REUSE.
If a data set has multiple extents, the extents are not released if you use the
REUSE parameter.
SORTDEVT device-type
Specifies the device type for temporary data sets that are to be dynamically
allocated by DFSORT. For device-type, you can specify any disk device that is
valid on the DYNALLOC parameter of the SORT or OPTION options for
DFSORT. For more information about these options, see DFSORT Application
Programming: Guide.
|
|
|
|
|
|
You need at least two sort work data sets for each sort. The SORTNUM value
applies to each sort invocation in the utility. For example, if there are three
indexes, SORTKEYS is specified, there are no constraints limiting parallelism,
and SORTNUM is specified as 8, then a total of 24 sort work data sets will be
allocated for a job.
|
|
|
|
Each sort work data set consumes both above the line and below the line
virtual storage, so if you specify too high a value for SORTNUM, the utility
may decrease the degree of parallelism due to virtual storage constraints, and
possibly decreasing the degree down to one, meaning no parallelism.
|
|
359
REPORT
Indicates whether a set of messages to report the collected statistics is to be
generated.
NO
Indicates that the set of messages is not to be sent as output to SYSPRINT.
YES
Indicates that the set of messages is to be sent as output to SYSPRINT. The
generated messages are dependent on the combination of keywords (such
as TABLESPACE, INDEX, TABLE, and COLUMN) that you specify with
the RUNSTATS utility. However, these messages are not dependent on the
specification of the UPDATE option. REPORT YES always generates a
report of SPACE and ACCESSPATH statistics.
KEYCARD
Specifies that all of the distinct values in all of the 1 to n key column
combinations for the specified indexes are to be collected. n is the number of
columns in the index.
FREQVAL
Controls the collection of frequent-value statistics. If you specify FREQVAL, it
must be followed by two additional keywords:
NUMCOLS
Indicates the number of key columns that are to be concatenated when
collecting frequent values from the specified index. If you specify 3, the
utility collects frequent values on the concatenation of the first three key
columns.
The default value is 1, which means that DB2 is to collect frequent values
only on the first key column of the index.
COUNT
Indicates the number of frequent values that are to be collected. If you
specify 15, the utility collects 15 frequent values from the specified key
columns.
The default value is 10.
UPDATE
Indicates whether the collected statistics are to be inserted into the catalog
tables. UPDATE also allows you to select statistics that are used for access path
selection or statistics that are used by database administrators.
ALL
Indicates that all collected statistics are to be updated in the catalog.
ACCESSPATH
Indicates that the only catalog table columns that are to be updated are
those that provide statistics that are used for access path selection.
SPACE
Indicates that the only catalog table columns that are to be updated are
those that provide statistics to help the database administrator assess the
status of a particular table space or index.
NONE
Indicates that catalog tables are not to be updated with the collected
statistics. This option is valid only when REPORT YES is specified.
360
HISTORY
Records all catalog table inserts or updates to the catalog history tables.
The default is supplied by the value that is specified in STATISTICS HISTORY
on panel DSNTIPO.
ALL
Indicates that all collected statistics are to be updated in the catalog history
tables.
ACCESSPATH
Indicates that the only catalog history table columns that are to be updated
are those that provide statistics that are used for access path selection.
SPACE
Indicates that only space-related catalog statistics are to be updated in
catalog history tables.
NONE
Indicates that catalog history tables are not to be updated with the
collected statistics.
FORCEROLLUP
Specifies whether aggregation or rollup of statistics is to take place when you
execute RUNSTATS even if some indexes or index partitions are empty. This
keyword enables the optimizer to select the best access path.
The following options are available for the FORCEROLLUP keyword:
YES
Indicates that forced aggregation or rollup processing is to be done, even
though some indexes or index partitions might not contain data.
NO
Indicates that aggregation or rollup is to be done only if data is available
for all indexes or index partitions.
If data is not available, the utility issues DSNU623I message if you have set the
installation value for STATISTICS ROLLUP on panel DSNTIPO to NO.
361
|
|
|
|
|
|
|
If you run REBUILD INDEX against an index with the following characteristics,
REBUILD INDEX fails:
v The index was created on a VARBINARY column or a column with a distinct
type that is based on a VARBINARY data type.
v The index column has the DESC attribute.
|
|
To fix the problem, alter the column data type to BINARY, and then run REBUILD
INDEX.
|
|
Data set
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
STPRIN01
No
Yes
No1, 2, 3
UTPRINT
Yes
Note:
1. Required when collecting inline statistics on at least one data-partitioned secondary
index.
2. If the DYNALLOC parm of the SORT program is not turned on, you need to allocate the
data set. Otherwise, DFSORT dynamically allocates the temporary data set.
3. It is recommended that you use dynamic allocation by specifying SORTDEVT in the
utility statement because dynamic allocation reduces the maintenance required of the
utility job JCL.
|
|
|
The following object is named in the utility control statement and does not require
a DD statement in the JCL:
362
Table space
Object whose indexes are to be rebuilt.
A value as follows:
v 10 if the indexes that are being rebuilt are a mix of data-partitioned
secondary indexes and nonpartitioned indexes
v 8 if the indexes that are being rebuilt are partitioned, or if none of them
are data-partitioned secondary indexes.
number of keys
The number of keys from all indexes that the subtask sorts and processes.
Using two or three large SORTWKnn data sets are preferable to several small ones.
DB2 utilities use DFSORT to perform sorts. Sort work data sets cannot span
volumes. Smaller volumes require more sort work data sets to sort the same
amount of data; therefore, large volume sizes can reduce the number of needed
sort work data sets. When you allocate sort work data sets on disk, the
recommended amount of space to allow provides at least 1.2 times the amount of
data that is to be sorted. For more information about DFSORT, see DFSORT
Application Programming: Guide.
Chapter 22. REBUILD INDEX
363
|
|
|
|
|
|
Claims
The following table shows which claim classes REBUILD INDEX drains and any
restrictive state that the utility sets on the target object.
|
|
|
|
|
Target
REBUILD
INDEX
SHRLEVEL
REFERENCE
REBUILD
INDEX PART
SHRLEVEL
REFERENCE
REBUILD
INDEX
SHRLEVEL
CHANGE
DW/UTRO
DW/UTRO
CR/UTRW
|
|
|
DA/UTUT
CR/UTRW
DA/UTUT
DR
CR/UTRW
N/A
DA/UTUT
CR/UTRW
|
|
|
|
|
|
|
|
|
Legend:
v CR - Claim the read claim class
v DA - Drain all claim classes; no concurrent SQL access
v DW - Drain the write claim class; concurrent access for SQL readers
v DR - Drains the repeatable-read claim class
v N/A - Not applicable
v UTUT - Utility restrictive state; exclusive control
v UTRO - Utility restrictive state; read-only access allowed
v UTRW - Utility restrictive state; read and write access allowed
|
|
|
|
|
|
Note:
1. Includes document ID indexes and node ID indexes over partitioned XML table spaces
2. Includes document ID indexes and node ID indexes over nonpartitioned XML table
spaces and XML indexes
3. Includes logical partitions of an XML index over partitioned XML table spaces
364
Compatibility
The following table shows which utilities can run concurrently with REBUILD
INDEX on the same target object. The target object can be an index space or a
partition of an index space. If compatibility depends on particular options of a
utility, that information is also shown. REBUILD INDEX does not set a utility
restrictive state if the target object is DSNDB01.SYSUTILX.
Table 61. Compatibility of REBUILD INDEX with other utilities
Action
REBUILD INDEX
CHECK DATA
No
CHECK INDEX
No
CHECK LOB
Yes
COPY INDEX
No
No
Yes
DIAGNOSE
Yes
LOAD
No
MERGECOPY
Yes
MODIFY
Yes
QUIESCE
No
REBUILD INDEX
No
RECOVER INDEX
No
RECOVER TABLESPACE
No
REORG INDEX
No
No
No
Yes
No
No
Yes
No
No
Yes
REPORT
Yes
RUNSTATS INDEX
No
RUNSTATS TABLESPACE
Yes
STOSPACE
Yes
UNLOAD
Yes
365
Operator actions
LONGLOG specifies the action that DB2 is to perform if log processing is not
occurring quickly enough. If the operator does not respond to the console message
DSNU377I, the LONGLOG option automatically goes into effect. You can take one
of the following actions:
v Execute the TERM UTILITY command to terminate the rebuild process.
DB2 does not take the action specified in the LONGLOG phrase if any one of these
events occurs before the delay expires:
v A TERM UTILITY command is issued.
v DB2 estimates that the time to perform the next iteration is likely to be less than
or equal to the time specified on the MAXRO keyword.
v REBUILD terminates for any reason (including the deadline).
366
Schedule REBUILD with SHRLEVEL CHANGE when the rate of writing is low
and transactions are short. Avoid scheduling REBUILD with SHRLEVEL CHANGE
when low-tolerance applications are executing.
|
|
|
|
|
The DRAIN_WAIT option provides improved control over the time online
REBUILD waits for drains. Also, because the DRAIN_WAIT is the aggregate time
that online REBUILD is to wait to perform a drain on a table space and associated
indexes, the length of drains is more predictable than it is when each partition and
index has its own individual waiting-time limit.
|
|
|
|
|
By specifying a short delay time (less than the system timeout value, IRLMRWT),
you can reduce the impact on applications by reducing time-outs. You can use the
RETRY option to give the online REBUILD INDEX utility chances to complete
successfully. If you do not want to use RETRY processing, you can still use
DRAIN_WAIT to set a specific and more consistent limit on the length of drains.
367
|
|
|
RETRY allows an online REBUILD that is unable to drain the objects that it
requires to try again after a set period (RETRY_DELAY). Objects will remain in
their original state if the drain fails in the LOG phase.
|
|
|
Because application SQL statements can queue behind any unsuccessful drain that
the online REBUILD has tried, define a reasonable delay before you retry to allow
this work to complete; the default is lock timeout subsystem parameter IRLMRWT.
|
|
|
|
|
|
When the default DRAIN WRITERS is used with SHRLEVEL CHANGE and
RETRY, multiple read-only log iterations can occur. Because online REBUILD can
have to do more work when RETRY is specified, multiple or extended periods of
restricted access might occur. Applications that run with REBUILD must perform
frequent commits. During the interval between retries, the utility is still active;
consequently, other utility activity against the table space and indexes is restricted.
|
|
368
Figure 65. How a partitioning index is rebuilt during a parallel index build
The following figure shows the flow of a REBUILD INDEX job with a parallel
index build. DB2 starts multiple subtasks to unload all partitions of a partitioned
table space and to sort index keys in parallel. The keys are then merged and
passed to the build subtask, which builds the nonpartitioned secondary index. If
you specify STATISTICS, a separate subtask collects the sorted keys and updates
the catalog table.
Figure 66. How a nonpartitioned secondary index is rebuilt during a parallel index build
369
Method 1:
REBUILD INDEX determines the optimal number of sort work
data sets and message data sets.
1. Specify the SORTDEVT keyword in the utility statement.
2. Allow dynamic allocation of sort work data sets by not
supplying SORTWKnn DD statements in the REBUILD INDEX
utility JCL.
3. Allocate UTPRINT to SYSOUT.
Method 2:
You control allocation of sort work data sets, and REBUILD INDEX
allocates message data sets.
1. Provide DD statements with DD names in the form
SWnnWKmm.
2. Allocate UTPRINT to SYSOUT.
Method 3:
You have the most control over rebuild processing; you must
specify both sort work data sets and message data sets.
1. Provide DD statements with DD names in the form
SWnnWKmm.
2. Provide DD statements with DD names in the form UTPRINnn.
370
SW02WK02
Is the second sort work data set that is used by the subtask that builds the
second index.
The DD names UTPRINnn define the sort work message data sets that are used by
the utility subtask pairs. nn identifies the subtask pair.
If you allocate the UTPRINT DD statement to SYSOUT in the job statement, the
sort message data sets and the merge message data set, if required, are
dynamically allocated. If you want the sort message data sets, merge message data
sets, or both, allocated to a disk or tape data set rather than to SYSOUT, you must
supply the UTPRINnn or the UTMERG01 DD statements (or both) in the utility
JCL. If you do not allocate the UTPRINT DD statement to SYSOUT, and you do
not supply a UTMERG01 DD statement in the job statement, partitions are not
unloaded in parallel.
371
when collecting frequency statistics (You can obtain this value from the
RECLENGTH column in SYSTABLES.)
numcols
Number of key columns to concatenate when you collect frequent values
from the specified index.
count
372
You can reset the REBUILD-pending status for an index with any of these
operations:
v REBUILD INDEX
v REORG TABLESPACE SORTDATA
v REPAIR SET INDEX with NORBDPEND
v START DATABASE command with ACCESS FORCE
Attention: Use the START DATABASE command with ACCESS FORCE only as a
means of last resort.
You must either make these table spaces available, or run the RECOVER
TABLESPACE utility on the catalog or directory, using an authorization ID with the
installation SYSADM or installation SYSOPR authority.
373
The OLDEST_VERSION column contains the oldest used version number, and the
CURRENT_VERSION column contains the current version number.
When you run REBUILD INDEX, the utility updates this range of used version
numbers for indexes that are defined with the COPY NO attribute. REBUILD
INDEX sets the OLDEST_VERSION column to the current version number, which
indicates that only one version is active; DB2 can then reuse all of the other
version numbers.
Recycling of version numbers is required when all of the version numbers are
being used. All version numbers are being used when one of the following
situations is true:
v The value in the CURRENT_VERSION column is one less than the value in the
OLDEST_VERSION column
v The value in the CURRENT_VERSION column is 15, and the value in the
OLDEST_VERSION column is 0 or 1.
You can also run LOAD REPLACE, REORG INDEX, or REORG TABLESPACE to
recycle version numbers for indexes that are defined with the COPY NO attribute.
To recycle version numbers for indexes that are defined with the COPY YES
attribute or for table spaces, run MODIFY RECOVERY.
Related information
Table space versions (DB2 Administration Guide)
374
indicated by the PART option. The SORTDEVT and SORTNUM keywords indicate
that the utility is to use dynamic data set and message set allocation. Parallelism is
used by default.
If sufficient virtual storage resources are available, DB2 starts one pair of utility
sort subtasks for each partition. This example does not require UTPRINnn DD
statements because it uses DSNUPROC to invoke utility processing. DSNUPROC
includes a DD statement that allocates UTPRINT to SYSOUT.
//SAMPJOB JOB ...
//STEP1
EXEC DSNUPROC,UID='SAMPJOB.RBINDEX',UTPROC='',SYSTEM='DSN'
//SYSIN
DD *
REBUILD INDEX (DSN8910.XEMP1 PART 2, DSN8910.XEMP1 PART 3)
SORTDEVT SYSWK
SORTNUM 4
/*
375
|
|
|
|
|
|
|
|
The following control statement specifies that during the rebuild, applications can
read from and write to ADMF001.IUKQAI01.
376
Output
Output from RECOVER consists of recovered data (a table space, index, partition
or data set, error range, or page within a table space).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If you use the RECOVER utility to recover a point-in-time object that is part of a
referentially related table space set, a base table space and LOB table space set, or a
base table space and XML table space set, you must ensure that you recover the
entire set of table spaces. If you do not include every member of the set, or if you
do not recover the entire set to the same point in time, RECOVER sets the
Auxiliary CHECK-pending status on for all dependent table spaces, base table
spaces, or LOB table spaces in the set.
Recommendation: If you use the RECOVER utility to recover data to an image
copy by specifying TOCOPY, TOLASTCOPY, or TOLASTFULLCOPY, specify a
copy that was made with the SHRLEVEL REFERENCE option.
Authorization required
To execute this utility, you must use a privilege set that includes one of the
following authorities:
v RECOVERDB privilege for the database
v DBADM or DBCTRL authority for the database. If the object on which the utility
operates is in an implicitly created database, DBADM authority on the implicitly
created database or DSNDB04 is required.
v SYSCTRL or SYSADM authority
An ID with installation SYSOPR authority can also execute RECOVER, but only on
a table space in the DSNDB01 or DSNDB06 database.
Copyright IBM Corp. 1983, 2009
377
|
|
|
|
|
|
|
|
v You cannot run RECOVER on a table space or index space on which mixed
specific and non-specific volume IDs were defined with CREATE STOGROUP or
ALTER STOGROUP.
LOGCSR
Analyzes log records and constructs information about inflight, indoubt,
inabort, and postponed abort units of recovery. This phase is executed if
either the TORBA and TOLOGPOINT option has been specified. If a
recover job fails in the middle of the LOGCSR phase, it can be restarted
from the beginning of the LOGCSR phase. For those DB2 members that
have finished the LOGCSR phase before the RECOVER job failure, they
will go through the LOGCSR phase again.
|
|
|
|
|
|
|
LOGUNDO
Rolls back any uncommitted changes that the active units of recovery
made to the recovered objects. This phase is executed if either the TORBA
and TOLOGPOINT option has been specified. If you need to restart the
recover job after it enters into the LOGUNDO phase, objects that were not
changed by URs that were active during the recover to point in time will
be marked as finished and no need for further processing.
378
UTILTERM
Performs cleanup.
Syntax diagram
RECOVER
LIST listdef-name
list-options-spec
CLONE
DSNUM ALL
object
(1)
DSNUM integer
DSNUM ALL
object
recover-options-spec
(1)
DSNUM integer
object PAGE page-number
CONTINUE
LOGRANGES YES
LOCALSITE
RECOVERYSITE
(2)
LOGRANGES NO
Notes:
1
Use the LOGRANGES NO option only at the direction of IBM Software Support. This option can
cause the LOGAPPLY phase to run much longer and, in some cases, apply log records that
should not be applied.
object:
TABLESPACE
table-space-name
database-name.
INDEXSPACE
INDEX
index-space-name
database-name.
index-name
creator-id.
379
list-options-spec:
TORBA Xbyte-string
TOLOGPOINT Xbyte-string
non-LOGONLY-options-spec
LOGONLY
non-LOGONLY-options-spec:
REUSE
CURRENTCOPYONLY
PARALLEL
(num-objects)
TAPEUNITS (
num-tape-units
)
RESTOREBEFORE Xbyte-string
FROMDUMP
DUMPCLASS (dcl)
recover-options-spec:
TOCOPY data-set
TOVOLUME
CATALOG
vol-ser
REUSE
CURRENTCOPYONLY
TOSEQNO integer
TOLASTCOPY
REUSE
CURRENTCOPYONLY
TOLASTFULLCOPY
REUSE
CURRENTCOPYONLY
ERROR RANGE
Option descriptions
You can specify a list of objects by repeating the TABLESPACE, INDEX, or
INDEXSPACE keywords. If you use a list of objects, the valid keywords are:
DSNUM, TORBA, TOLOGPOINT, LOGONLY, PARALLEL, and either LOCALSITE
or RECOVERYSITE.
The options TOCOPY, TOLASTCOPY, TOLASTFULLCOPY, TORBA and
TOLOGPOINT are all referred to as point-in-time recovery options.
LIST listdef-name
Specifies the name of a previously defined LISTDEF list name. The utility
allows one LIST keyword for each control statement of RECOVER. The list can
contain a mixture of table spaces and index spaces. RECOVER is invoked once
for the entire list.
This utility will only process clone data if the CLONE keyword is specified.
The use of CLONED YES on the LISTDEF statement is not sufficient.
380
TABLESPACE database-name.table-space-name
Specifies the table space (and optionally, the database to which it belongs) that
is to be recovered.
You can specify a list of table spaces by repeating the TABLESPACE keyword.
You can recover an individual catalog or directory table space in a list with its
IBM-defined indexes. You cannot recover multiple catalog or directory table
spaces in a list.
database-name
Is the name of the database to which the table space belongs.
The default value is DSNDB04.
table-space-name
Is the name of the table space that is to be recovered.
INDEXSPACE database-name.index-space-name
Specifies the index space that is to be recovered.
database-name
Specifies the name of the database to which the index space belongs.
The default value is DSNDB04.
index-space-name
Specifies the name of the index space that is to be recovered.
INDEX creator-id.index-name
Specifies the index in the index space that is to be recovered. The RECOVER
utility can recover only indexes that were defined with the COPY YES attribute
and subsequently copied.
creator-id
Optionally specifies the creator of the index.
The default value is the user identifier for the utility.
index-name
Specifies the name of the index in the index space that is to be recovered.
Enclose the index name in quotation marks if the name contains a blank.
DSNUM
Identifies a partition within a partitioned table space or a partitioned index, or
identifies a data set within a nonpartitioned table space that is to be recovered.
You cannot specify a single data set of a nonpartitioned index or a logical
partition of a nonpartitioned index. Alternatively, the option can recover the
entire table space or index space.
ALL
Specifies that the entire table space or index space is to be recovered.
integer
Specifies the number of the partition or data set that is to be recovered.
The maximum value is 4096.
Specifying DSNUM is not valid for nonpartitioning indexes.
For a partitioned table space or index space:
The integer is its partition number.
For a nonpartitioned table space:
Find the integer at the end of the data set name. The data set name has
the following format:
Chapter 23. RECOVER
381
catname.DSNDBx.dbname.tsname.y000z.Annn
catname
Is the VSAM catalog name or alias.
x
Is C or D.
dbname
Is the database name.
tsname Is the table space name.
Is I or J.
Is 1 or 2.
nnn
PAGE page-number
Specifies a particular page that is to be recovered. You cannot specify this
option if you are recovering from a concurrent copy.
page-number is the number of the page, in either decimal or hexadecimal
notation. For example, both 999 and X3E7 represent the same page. PAGE is
invalid with the LIST specification.
CONTINUE
Specifies that the recovery process is to continue. Use this option only if an
error causes RECOVER to terminate during reconstruction of a page. In
this case, the page is marked as broken. After you repair the page, you
can use the CONTINUE option to recover the page, starting from the point
of failure in the recovery log.
TORBA Xbyte-string
Specifies, in a non-data-sharing environment, a point on the log to which
RECOVER is to recover. Specify an RBA value.
In a data sharing environment, use TORBA only when you want to recover to
a point before the originating member joined the data sharing group. If you
specify an RBA after this point, the recovery fails.
For a NOT LOGGED table space, the value must be a recoverable point.
Using TORBA terminates the recovery process with the last log record whose
relative byte address (RBA) is not greater than byte-string, which is a string of
up to 12 hexadecimal characters. If byte-string is the RBA of the first byte of a
log record, that record is included in the recovery.
Uncommitted work by units of recovery that are active at the specified RBA
will be backed out by RECOVER, leaving each object in a consistent state.
|
|
TOLOGPOINT Xbyte-string
Specifies a point on the log to which RECOVER is to recover. Specify either an
RBA or an LRSN value.
The LRSN is a string of 12 hexadecimal characters and is reported by the
DSN1LOGP utility.
|
For a NOT LOGGED table space, the value must be a recoverable point.
|
|
|
Uncommitted work by units of recovery that are active at the specified LRSN
or RBA will be backed out by RECOVER, leaving each object in a consistent
state.
REUSE
Specifies that RECOVER is to logically reset and reuse DB2-managed data sets
382
without deleting and redefining them. If you do not specify REUSE, DB2
deletes and redefines DB2-managed data sets to reset them.
If you are recovering an object because of a media failure, do not specify
REUSE.
If a data set has multiple extents, the extents are not released if you use the
REUSE parameter.
CURRENTCOPYONLY
Specifies that RECOVER is to improve the performance of restoring concurrent
copies (copies that were made by the COPY utility with the CONCURRENT
option) by using only the most recent primary copy for each object in the list.
When you specify CURRENTCOPYONLY for a concurrent copy, RECOVER
builds a DFSMSdss RESTORE command for each group of objects that is
associated with a concurrent copy data set name. If the RESTORE fails,
RECOVER does not automatically use the next most recent copy or the backup
copy, and the object fails. If you specify DSNUM ALL with
CURRENTCOPYONLY and one partition fails during the restore process, the
entire utility job on that object fails.
If you specify CURRENTCOPYONLY and the most recent primary copy of the
object to be recovered is not a concurrent copy, DB2 ignores this keyword.
|
|
For objects in the recovery list whose recovery base is a system-backup, the
default is CURRENTCOPYONLY.
PARALLEL
|
|
|
|
Specifies the maximum number of objects in the list that are to be restored in
parallel from image copies on disk or tape. RECOVER attempts to retain tape
mounts for tapes that contain stacked image copies when the PARALLEL
keyword is specified. In addition, to maximize performance, RECOVER
determines the order in which objects are to be restored. PARALLEL also
specifies the maximum number of objects in the list that are to be restored in
parallel from system-level backups that have been dumped to tape. The
processing may be limited by DFSMShsm.
If you specify TAPEUNITS with PARALLEL, you control the number of tape
drives that are dynamically allocated for the recovery function. The
TAPEUNITS keyword applies only to tape drives that are dynamically
allocated. The TAPEUNITS keyword does not apply to JCL-allocated tape
drives. The total number of tape drives that are allocated for the RECOVER job
is the sum of the JCL-allocated tape drives, and the number of tape drives,
which is determined as follows:
v The specified value for TAPEUNITS.
v The value that is determined by the RECOVER utility if you omit the
TAPEUNITS keyword. The number of tape drives that RECOVER attempts
to allocate is determined by the object in the list that requires the most tape
drives.
If you specify PARALLEL, you cannot specify TOCOPY, TOLASTCOPY, or
TOLASTFULLCOPY.
(num-objects)
Specifies the number of objects in the list that are to be processed in
parallel. If storage constraints are encountered, you can adjust this value to
a smaller value.
383
|
|
|
(num-tape-units)
Specifies the number of tape drives to allocate. If you specify 0 or do not
specify a value for num-tape-units, RECOVER determines the maximum
number of tape units to use at one time. RECOVER TAPEUNITS has a max
value of 32767.
FROMDUMP
Specifies that only dumps of the database copy pool are used for the restore of
the data sets.
|
|
|
|
|
DUMPCLASS (dcl)
Indicates the DFSMShsm dump class to use to restore the data sets.
|
|
|
|
The FROMDUMP and DUMPCLASS options that you specify for the
RECOVER utility override the RESTORE/RECOVER FROM DUMP and
DUMPCLASS NAME install options that you specify on installation panel
DSNTIP6.
|
|
|
|
|
|
|
|
|
|
|
|
RESTOREBEFORE Xbyte-string
Specifies that RECOVER is to search for an image copy, concurrent copy, or
system-level backup (if yes has been specified for SYSTEM-LEVEL BACKUPS
on install panel DSNTIP6) with an RBA or LRSN value earlier than the
specified Xbyte-string value to use in the RESTORE phase. To avoid specific
image copies, concurrent copies, or system-level backups with matching or
more recent RBA or LRSN values in START_RBA, the RECOVER utility applies
the log records and restores the object to its current state or the specified
TORBA or TOLOGPOINT value. The RESTOREBEFORE value is compared
with the RBA or LRSN value in the START_RBA column in the
SYSIBM.SYSCOPY record for those copies. For system-level backups, the
RESTOREBEFORE value is compared with the data complete LRSN.
If you specify a TORBA or TOLOGPOINT value with the RESTOREBEFORE
option, the RBA or LRSN value for RESTOREBEFORE must be lower than the
specified TORBA OR TOLOGPOINT value. If you specify RESTOREBEFORE,
you cannot specify TOCOPY, TOLASTCOPY, or TOLASTFULLCOPY.
|
|
|
|
LOGONLY
Specifies that the target objects are to be recovered from their existing data sets
by applying only log records to the data sets. DB2 applies all log records that
were written after a point that is recorded in the data set itself.
To recover an index space by using RECOVER LOGONLY, you must define the
index space with the COPY YES attribute.
Use the LOGONLY option when the data sets of the target objects have already
been restored to a point of consistency by another process offline, such as
DFSMSdss concurrent copy.
384
|
|
LOGONLY is not allowed on a table space or index space with the NOT
LOGGED attribute.
TOCOPY data-set
Specifies the particular image copy data set that DB2 is to use as a source for
recovery.
data-set is the name of the data set.
If the data set is a full image copy, it is the only data set that is used in the
recovery. If it is an incremental image copy, RECOVER also uses the previous
full image copy and any intervening incremental image copies.
If you specify the data set as the local backup copy, DB2 first tries to allocate
the local primary copy. If the local primary copy is unavailable, DB2 uses the
local backup copy.
If you use TOCOPY or TORBA to recover a single data set of a nonpartitioned
table space, DB2 issues message DSNU520I to warn that the table space can
become inconsistent following the RECOVER job. This point-in-time recovery
can cause compressed data to exist without a dictionary or can even overwrite
the data set that contains the current dictionary.
If you use TOCOPY with a particular partition or data set (identified with
DSNUM), the image copy must be for the same partition or data set, or for the
whole table space or index space. If you use TOCOPY with DSNUM ALL, the
image copy must be for DSNUM ALL. You cannot specify TOCOPY with a
LIST specification.
If the image copy data set is a z/OS generation data set, supply a fully
qualified data set name, including the absolute generation and version number.
If the image copy data set is not a generation data set and more than one
image copy data set with the same data set name exists, use one of the
following options to identify the data set exactly:
TOVOLUME
Identifies the image copy data set.
CATALOG
Indicates that the data set is cataloged. Use this option only for an image
copy that was created as a cataloged data set. (Its volume serial is not
recorded in SYSIBM.SYSCOPY.)
RECOVER refers to the SYSIBM.SYSCOPY catalog table during execution.
If you use TOVOLUME CATALOG, the data set must be cataloged. If you
remove the data set from the catalog after creating it, you must catalog the
data set again to make it consistent with the record for this copy that
appears in SYSIBM.SYSCOPY.
vol-ser
Identifies the data set by an alphanumeric volume serial identifier of its
first volume. Use this option only for an image copy that was created as a
noncataloged data set. Specify the first vol-ser in the SYSCOPY record to
locate a data set that is stored on multiple tape volumes.
TOSEQNO integer
Identifies the image copy data set by its file sequence number. integer is
the file sequence number.
TOLASTCOPY
Specifies that RECOVER is to restore the object to the last image copy that was
taken. If the last image copy is a full image copy, it is restored to the object. If
Chapter 23. RECOVER
385
the last image copy is an incremental image copy, the most recent full copy
along with any incremental copies are restored to the object.
TOLASTFULLCOPY
Specifies that the RECOVER utility is to restore the object to the last full image
copy that was taken. Any incremental image copies that were taken after the
full image copy are not restored to the object.
ERROR RANGE
Specifies that all pages within the range of reported I/O errors are to be
recovered. Recovering an error range is useful when the range is small, relative
to the object that contains it; otherwise, recovering the entire object is
preferred. You cannot specify this option if you are recovering from a
concurrent copy.
In some situations, recovery using the ERROR RANGE option is not possible,
such as when a sufficient quantity of alternate tracks cannot be obtained for all
bad records within the error range. You can use the IBM Device Support
Facility, ICKDSF service utility to determine whether this situation exists. In
such a situation, redefine the error data set at a different location on the
volume or on a different volume, and then run the RECOVER utility without
the ERROR RANGE option.
You cannot specify ERROR RANGE with a LIST specification.
CLONE
Indicates that RECOVER is to recover only clone table data in the specified
table spaces, index spaces or indexes that contain indexes on clone tables. This
utility will only process clone data if the CLONE keyword is specified. The use
of CLONED YES on the LISTDEF statement is not sufficient.
|
|
|
|
|
LOCALSITE
Specifies that RECOVER is to use image copies from the local site. If you
specify neither LOCALSITE or RECOVERYSITE, RECOVER uses image copies
from the current site of invocation. (The current site is identified on the
installation panel DSNTIPO under SITE TYPE and in the macro DSN6SPRM
under SITETYP.)
RECOVERYSITE
Specifies that RECOVER is to use image copies from the recovery site. If you
specify neither LOCALSITE or RECOVERYSITE, RECOVER uses image copies
from the current site of invocation. (The current site is identified on the
installation panel DSNTIPO under SITE TYPE and in the macro DSN6SPRM
under SITETYP.)
LOGRANGES YES
Specifies that RECOVER should use SYSLGRNX information for the
LOGAPPLY phase. This option is the default.
LOGRANGES NO
Specifies that RECOVER should not use SYSLGRNX information for the
LOGAPPLY phase. Use this option only under the direction of IBM Software
Support.
This option can cause RECOVER to run much longer. In a data sharing
environment this option can result in the merging of all logs from all members
that were created since the last image copy.
This option can also cause RECOVER to apply logs that should not be applied.
For example, assume that you take an image copy of a table space and then
run REORG LOG YES on the same table space. Assume also that the REORG
386
utility abends and you then issue the TERM UTILITY command for the
REORG job. The SYSLGRNX records that are associated with the REORG job
are deleted, so a RECOVER job with the LOGRANGES YES option (the
default) skips the log records from the REORG job. However, if you run
RECOVER LOGRANGES NO, the utility applies these log records.
You do not always need to recover both the data and indexes. If you recover the
table space or index space to a current RBA or LRSN, any referentially related
objects do not need to be recovered. If you plan to recover a damaged object to a
point in time, use a consistent point in time for all of its referentially related
objects, including related LOB and XML table spaces, for optimal performance. You
must rebuild the indexes from the data if one of the following conditions is true:
v The table space is recovered to a point in time.
v An index is damaged.
v An index is in REBUILD-pending status.
v No image copy of the index is available.
If you need to recover both the data and the indexes, and no image copies of the
indexes are available:
1. Use RECOVER TABLESPACE to recover the data.
2. Run REBUILD INDEX on any related indexes to rebuild them from the data.
If you have image copies of both the table spaces and the indexes, you can recover
both sets of objects in the same RECOVER utility statement. The objects are
recovered from the image copies and logs.
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
auth-id.job-name.HSM
387
The following objects are named in the utility control statement and do not require
DD statements in the JCL:
Table space, index space, or index
Object that is to be recovered. If you want to recover less than an entire
table space:
v Use the DSNUM option to recover a partition or data set.
v Use the PAGE option to recover a single page.
v Use the ERROR RANGE option to recover a range of pages with I/O
errors.
|
|
System-level backups
The RECOVER utility chooses the most recent backup (an image copy, a
concurrent copy, or a system-level backup) to restore based on the recovery
point for the table spaces or indexes (with the COPY YES attribute) being
recovered. The RESTORE SYSTEM utility uses the most recent system-level
backup of the database copy pool that DB2 took prior to the SYSPITR log
truncation point.
Related concepts
|
|
|
|
|
|
Claims
Table 63. Claim classes of RECOVER operations.
RECOVER (no
option)
RECOVER
TORBA or
TOCOPY
RECOVER
PART TORBA
or TOCOPY
RECOVER
ERRORRANGE
Table space or
partition
DA/UTUT
DA/UTUT
DA/UTUT
DA/UTUT
CW/UTRW1
Partitioning index,
data-partitioned
secondary index, or
physical partition2
DA/UTUT
DA/UTUT
DA/UTUT
DA/UTUT
CW/UTRW1
Target
388
RECOVER
TORBA or
TOCOPY
RECOVER
PART TORBA
or TOCOPY
RECOVER
ERRORRANGE
Nonpartitioned
secondary index3
DA/UTUT
DA/UTUT
DA/UTUT
DA/UTUT
CW/UTRW1
RI dependents
none
CHKP (YES)
CHKP (YES)
none
Target
Legend:
v CHKP (YES): Concurrently running applications enter CHECK-pending after commit
v CW: Claim the write claim class
v DA: Drain all claim classes, no concurrent SQL access
v DR: Drain the repeatable read class, no concurrent access for SQL repeatable readers
v RI: Referential integrity
v UTRW: Utility restrictive state, read-write access allowed
v UTUT: Utility restrictive state, exclusive control
v none: Object is not affected by this utility
Note:
1. During the UTILINIT phase, the claim and restrictive states change from DA/UTUT to
CW/UTRW.
|
|
|
2. Includes document ID indexes and node ID indexes over nonpartitioned XML table
spaces and XML indexes.
3. Includes document ID indexes and node ID indexes over partitioned XML table spaces.
RECOVER does not set a utility restrictive state if the target object is
DSNDB01.SYSUTILX.
Compatibility
The following table shows which utilities can run concurrently with RECOVER on
the same target object. The target object can be a table space, an index space, or a
partition of a table space or index space. If compatibility depends on particular
options of a utility, that information is also documented in the table.
Table 64. Compatibility of RECOVER with other utilities
Action
Compatible with
Compatible with RECOVER
RECOVER (no
TOCOPY or
option)?
TORBA?
Compatible with
RECOVER
ERRORRANGE?
CHECK DATA
No
No
No
CHECK INDEX
No
No
No
CHECK LOB
No
No
No
COPY INDEXSPACE
No
No
No
COPY TABLESPACE
No
No
No
DIAGNOSE
Yes
Yes
Yes
LOAD
No
No
No
MERGECOPY
No
No
No
MODIFY
No
No
No
QUIESCE
No
No
No
REBUILD INDEX
No
No
No
REORG INDEX
Yes
No
Yes
Chapter 23. RECOVER
389
Action
Compatible with
Compatible with RECOVER
RECOVER (no
TOCOPY or
option)?
TORBA?
Compatible with
RECOVER
ERRORRANGE?
REORG TABLESPACE
No
No
No
Yes
No
Yes
No
No
No
REPORT
Yes
Yes
Yes
RUNSTATS INDEX
No
No
No
RUNSTATS TABLESPACE
No
No
No
STOSPACE
Yes
Yes
Yes
UNLOAD
No
No
No
To run on DSNDB01.SYSUTILX, RECOVER must be the only utility in the job step
and the only utility running in the DB2 subsystem.
RECOVER on any catalog or directory table space is an exclusive job; such a job
can interrupt another job between job steps, possibly causing the interrupted job to
time out.
|
|
|
|
|
|
|
|
|
390
|
|
|
|
v If you do not specify a dump class name in the DUMP CLASS NAME field on
installation panel DSNTIP6, or you do not specify the DUMPCLASS option in
the RECOVER utility statement, RESTORE SYSTEM issues the DFSMShsm LIST
COPYPOOL command and uses the first dump class listed in the output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Restoring data sets for objects in the database copy pool to be recovered from a
system-level backup on disk occurs virtually instantaneously. Restoring data sets
for objects to be recovered from a system-level backup on tape volumes takes
much longer.
|
|
|
|
|
|
|
|
|
To determine whether the system-level backups of the database copy pool reside
on the disk or tape:
1. Run the DFSMShsm LIST COPYPOOL command with the ALLVOLS option.
2. Run the DSNJU004 utility output. For data sharing, run the DSNJU004 utility
output on each member.
3. Review the output from the DFSMShsm LIST COPYPOOL command with the
ALLVOLS option.
|
|
|
|
|
|
|
If the system-level backup chosen as the recovery base for the database copy pool
no longer resides on DASD and the FROMDUMP option has not been specified,
then the recovery of the object will fail. You can then specify the RECOVER
FROMDUMP option, or specify it on install panel DSNTIP6, to direct the utility to
use the system-level backup that was dumped to tape. The RECOVER
RESTOREBEFORE option can also be used to direct the utility to use a recovery
base prior to the system-level backup.
391
To recover multiple table spaces, create a list of table spaces that are to be
recovered; repeat the TABLESPACE keyword before each specified table space. The
following RECOVER statement specifies that the utility is to recover partition 2 of
the partitioned table space DSN8D91A.DSN8S91E, and recover the table space
DSN8D91A.DSN8S91D to the quiesce point (RBA X000007425468).
RECOVER TABLESPACE DSN8D91A.DSN8S91E DSNUM 2
TABLESPACE DSN8D91A.DSN8S91D
TORBA X'000007425468'
The following example shows the RECOVER statement for recovering four data
sets in database DSN8D91A, table space DSN8S91E:
RECOVER PARALLEL (4)
TABLESPACE DSN8D91A.DSN8S91E DSNUM 1
TABLESPACE DSN8D91A.DSN8S91E DSNUM 2
TABLESPACE DSN8D91A.DSN8S91E DSNUM 3
TABLESPACE DSN8D91A.DSN8S91E DSNUM 4
Each of the 4 partitions will be restored in parallel. You can also schedule the
recovery of these data sets to run in four separate jobs.
If a table space or data set is in the COPY-pending status, recovering it might not
be possible.
Related concepts
Resetting COPY-pending status on page 288
|
|
RECOVER does not place dependent table spaces that are related by informational
referential constraints into CHECK-pending status.
The RECOVER utility merges incremental copies serially and dynamically. As a
result, recovery of a table space list with numerous incremental copies can be
time-consuming and operator-intensive.
If referential integrity violations are not an issue, you can run a separate job to
recover each table space.
When you specify the PARALLEL keyword, DB2 supports parallelism during the
RESTORE phase and performs recovery as follows:
392
v During initialization and setup (the UTILINIT recover phase), the utility locates
the full and incremental copy information for each object in the list from
SYSIBM.SYSCOPY.
|
|
|
|
|
|
v The utility sorts the list of objects for recovery into lists to be processed in
parallel according to the number of tape volumes, file sequence numbers, and
sizes of each image copy.
v The number of objects that can be restored in parallel depends on the maximum
number of available tape devices and on how many tape devices the utility
requires for the incremental and full image copy data sets. You can control the
number of objects that are to be processed in parallel on the PARALLEL
keyword. You can control the number of dynamically allocated tape drives on
the TAPEUNITS keyword, which is specified with the PARALLEL keyword.
v If an object in the list requires a DB2 concurrent copy, the utility sorts the object
in its own list and processes the list in the main task, while the objects in the
other sorted lists are restored in parallel. If the concurrent copies that are to be
restored are on tape volumes, the utility uses one tape device and counts it
toward the maximum value that is specified for TAPEUNITS.
v If objects in the list require a system-level backup that has been dumped to tape
as its recovery base (that is, the FROMDUMP option has been specified), the
DB2 RECOVER Utility will invoke DFSMShsm to restore the data sets for the
objects in parallel, with the degree of parallelism being capped by the maximum
number of tasks that can be started by the RECOVER. DFSMShsm will restore
the data sets in parallel based on its install options.
393
incremental copy, recovery proceeds to merge pages to table spaces and apply the
log. If a point is reached where an incremental copy cannot be allocated,
RECOVER notes the log RBA or LRSN of the last successfully allocated data set.
Attempts to allocate incremental copies cease, and the merge proceeds using only
the allocated data sets. The log is applied from the noted RBA or LRSN, and the
incremental image copies that were not allocated are ignored.
Recovering a page
Using RECOVER PAGE enables you to recover data on a page that is damaged. In
some situations, you can determine (usually from an error message) which page of
an object has been damaged. You can use the PAGE option to recover a single
page. You can use the CONTINUE option to continue recovering a page that was
damaged during the LOGAPPLY phase of a RECOVER operation.
394
Recovering an error range is useful when the range is small, relative to the object
containing it; otherwise, recovering the entire object is preferable.
Message DSNU086I indicates that I/O errors were detected on a table space and
that you need to recover it. Before you attempt to use the ERROR RANGE option
of RECOVER, you should run the ICKDSF service utility to correct the disk error.
If an I/O error is detected during RECOVER processing, DB2 issues message
DSNU538I to identify the affected target tracks are involved. The message provides
enough information to run ICKDSF correctly.
In some situations, which are announced by error messages, recovery of only an
error range is not possible. In such a situation, recovering the entire object is
preferable.
During the recovery of the entire table space or index space, DB2 might still
encounter I/O errors that indicate DB2 is still using a bad volume. For
user-defined data sets, you should use Access Method Services to delete the data
sets and redefine them with the same name on a new volume. If you use DB2
storage groups, you can remove the bad volume from the storage group by using
ALTER STOGROUP. If you use DFSMS storage groups, you should also remove
the bad volume from the DFSMS storage group.
|
|
You can recover NOT LOGGED table spaces to any recoverable point.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To recover a set of objects with LOB relationships, you should run RECOVER with
the TOLOGPOINT option to identify a common recoverable point for all objects.
For a non-LOB table space, or a LOB table space with a base table space that has
the NOT LOGGED attribute, the logging attribute of the table space must meet
these following conditions:
v For recovery to the current point in time, the current value of the logging
attribute of the object must match the logging attribute at the most current
recoverable point.
v For recovery to a prior point in time, the current value of the logging attribute
of the object must match the logging attribute at the time that is specified by
TOLOGPOINT, TORBA, TOCOPY, TOLASTCOPY, or TOLASTFULLCOPY
395
After recovery to the point of consistency, if you choose to continue and recover to
the current point in time, you do not want RECOVER to begin processing by
restoring the data set from a DB2 image copy. Therefore, use the LOGONLY option
of RECOVER, which causes RECOVER to skip the RESTORE phase and apply the
log records only, starting from the first log record that was written after the data
set was backed up.
Because the data sets are restored offline without DB2 involvement, RECOVER
LOGONLY checks that the data set identifiers match those that are in the DB2
catalog. If the identifiers do not match, message DSNU548I is issued, and the job
terminates with return code 8.
You can use the LOGONLY option on a list of objects.
To ensure that no other transactions can access DB2 objects between the time that
you restore a data set and the time that you run RECOVER LOGONLY, follow
these steps:
1. Stop the DB2 objects that are being recovered by issuing the following
command:
-STOP DATABASE(database-name) SPACENAM(space-name)
With the LOGONLY option, when recovering a single piece of a multi-piece linear
page set, RECOVER opens the first piece of the page set. If the data set is migrated
by DFSMShsm, the data set is recalled by DFSMShsm. Without LOGONLY, no data
set recall is requested.
Backing up a single piece of a multi-piece linear page set is not recommended.
This action can cause a data integrity problem if the backup is used to restore the
data set at a later time.
396
|
|
|
|
|
|
|
|
|
|
indexes, use the RECOVER utility to recover your indexes. Otherwise, use the
REBUILD INDEX utility to rebuild those indexes.
1. DSNDB01.SYSUTILX.
2. All indexes on SYSUTILX.
3. DSNDB01.DBD01.
4. DSNDB06.SYSCOPY.
5. All indexes on SYSIBM.SYSCOPY. If no user-defined indexes that are
stogroup-managed are defined on SYSIBM.SYSCOPY, execute the following
utility statement to rebuild IBM-defined and any user-defined indexes on
SYSIBM.SYSCOPY:
REBUILD INDEX (ALL) TABLESPACE DSNDB06.SYSCOPY
13. DSNDB06.SYSDBASE.
14. All indexes on SYSDBASE and SYSUSER. If no user-defined indexes that are
stogroup-managed are defined on SYSDBASE or SYSUSER, execute the
following utility statement to rebuild IBM-defined and any user-defined
indexes on SYSDBASE and SYSUSER:
REBUILD INDEX (ALL) TABLESPACE DSNDB06.SYSxxxx
397
|
|
|
|
|
|
|
|
|
The two remaining directory table spaces are DSNDB01.SCT02, which has
index SYSIBM.DSNSCT02, and DSNDB01.SPT01, which has indexes
SYSIBM.DSNSPT01 and SYSIBM.DSNSPT02. If a point in time recovery is
performed, the DSNDB06.SYSOBJ tablespace, its lob tablespace
DSNDB06.SYSPLUXA, and the auxiliary index has to be recovered in one list;
otherwise, DSNDB06.SYSOBJ will be in ACHKP.
All user-defined indexes on the catalog that have not been rebuilt or recovered
yet.
System utility table spaces, such as DB2 QMF.
If used, real-time statistics objects, the object and application registration
tables, and the resource limit specification tables.
User table spaces.
16.
17.
18.
19.
For all catalog and directory table spaces, you can list the IBM-defined indexes that
have the COPY YES attribute in the same RECOVER utility statement.
The catalog and directory objects that are listed in step 15 in the preceding list can
be grouped together for recovery. You can specify them as a list of objects in a
single RECOVER utility statement. When you specify all of these objects in one
statement, the utility needs to make only one pass of the log for all objects during
the LOGAPPLY phase and can use parallelism when restoring the image copies in
the RESTORE phase. Thus, these objects are recovered faster.
Recovery of the items on the list can be done concurrently or included in the same
job step. However, some restrictions apply:
1. When you recover the following table spaces or indexes, the job step in which
the RECOVER statement appears must not contain any other utility statements.
No other utilities can run while the RECOVER utility is running.
v DSNDB01.SYSUTILX
v All indexes on SYSUTILX
v DSNDB01.DBD01
2. When you recover the following table spaces, no other utilities can run while
the RECOVER utility is running. Other utility statements can exist in the same
job step.
v DSNDB06.SYSCOPY
v DSNDB01.SYSLGRNX
v DSNDB06.SYSDBAUT
v DSNDB06.SYSUSER
v DSNDB06.SYSDBASE
If the logging environment requires adding or restoring active logs, restoring
archive logs, or performing any action that affects the log inventory in the BSDS,
you should recover the BSDS before catalog and directory objects. To copy active
log data sets, use the Access Method Services REPRO function. For information
about the JCL for the Access Method Services REPRO function, see one of the
following publications:
v DFSMS/MVS: Access Method Services for the Integrated Catalog
v z/OS DFSMS Access Method Services for Catalogs
398
DSNDB01.SYSUTILX
DSNDB01.DBD01
DSNDB06.SYSCOPY
DSNDB01.SYSLGRNX
DSNDB06.SYSDBAUT, DSNDB06.SYSUSER
DSNDB06.SYSDBASE
399
current state. You can use sample queries and documentation, which are provided
in DSNTESQ in the SDSNSAMP sample library, to check the consistency of the
catalog.
Indexes are rebuilt by REBUILD INDEX. If the only items you have recovered are
table spaces in the catalog or directory, you might need to rebuild their indexes.
Use the CHECK INDEX utility to determine whether an index is inconsistent with
the data it indexes. You can use the RECOVER utility to recover catalog and
directory indexes if the index was defined with the COPY YES attribute and if you
have a full index image copy.
You must recover the catalog and directory before recovering user table spaces.
Be aware that the following table spaces, along with their associated indexes, do
not have entries in SYSIBM.SYSLGRNX, even if they were defined with COPY
YES:
v DSNDB01.SYSUTILX
v DSNDB01.DBD01
v DSNDB01.SYSLGRNX
v DSNDB06.SYSCOPY
v DSNDB06.SYSGROUP
v DSNDB01.SCT02
v DSNDB01.SPT01
These objects are assumed to be open from the point of their last image copy, so
the RECOVER utility processes the log from that point forward.
Point-in-time recovery
Full recovery of the catalog and directory table spaces and indexes is strongly
recommended. However, if you need to plan for point-in-time recovery of the
catalog and directory, here is a way to create a point of consistency:
1. Quiesce all catalog and directory table spaces in a list, except for
DSNDB06.SYSCOPY and DSNDB01.SYSUTILX.
2. Quiesce DSNDB06.SYSCOPY.
Recommendation: Quiesce DSNDB06.SYSCOPY in a separate utility statement;
when you recover DSNDB06.SYSCOPY to its own quiesce point, it contains the
ICTYPE = Q (quiesce) SYSCOPY records for the other catalog and directory
table spaces.
3. Quiesce DSNDB01.SYSUTILX in a separate job step.
If you need to recover to a point in time, recover DSNDB06.SYSCOPY and
DSNDB01.SYSUTILX to their own quiesce points, and recover other catalog and
directory table spaces to their common quiesce point. The catalog and directory
objects must be recovered in a particular order, as described in the previous table.
400
Related information
Management of the bootstrap data set (DB2 Administration Guide)
Reinitializing DSNDB01.SYSUTILX
You need to reinitialize the DSNDB01.SYSUTILX directory table space if you
cannot successfully execute the -DIS UTIL and -TERM UTIL commands, because
DSNDB01.SYSUTILX is damaged and you cannot recover DSNDB01.SYSUTILX,
because errors occur in the LOGAPPLY phase.
Because DSNDB01.SYSUTILX contains information about active and outstanding
utilities, the process of reinitializing this table space involves determining which
objects have a utility in progress and resolving any pending states to make the
object available for access.
If DSNDB01.SYSUTILX must be reinitialized, use the following procedure with
caution:
1. Issue the -DIS DB(*) SPACENAM(*) RESTRICT command and analyze the
output. Write down the following items:
v All of the objects with a utility in progress (The objects in UTUT, UTRO, or
UTRW status have utilities in progress.)
v Any pending states for these objects (RECP, CHKP, and COPY are examples
of pending states.
2. Edit the following installation jobs so that they contain only the commands that
pertain to DSNDB01.SYSUTILX:
a. DSNTIJDEDelete VSAM LDS for DSNDB01.SYSUTILX.
b. DSNTIJINDefine VSAM LDS for DSNDB01.SYSUTILX and tailor the
AMS DEFINE command to fit the needs of your DB2 system.
3.
4.
5.
6.
c. DSNTIJIDInitialize DSNDB01.SYSUTILX.
Run the three edited installation jobs in the order listed.
Issue the -START DB(dbname) ACCESS(UT) command for each database that
has objects with a utility in progress.
Issue the -START DB(dbname)SPACENAM(spname) ACCESS(FORCE) command
on each object with a utility in progress. This action clears all utilities that are
in progress or in pending states. (Any pending states are cleared, but you still
need to resolve the pending states as directed in the next step.)
Resolve the pending states for each object by running the appropriate utility.
For example, if an object was in the RECP status, run the RECOVER utility.
|
|
The RECOVER utility can set the auxiliary warning status for a LOB table space or
XML table space if it finds at least one invalid LOB or XML column.
|
|
|
|
|
DB2 marks a LOB or XML column invalid if all of the following conditions are
true:
v The LOB table space or XML table space was defined with the LOG(NO)
attribute.
v The LOB table space or XML table space was recovered.
Chapter 23. RECOVER
401
v The LOB or XML was updated since the last image copy.
|
|
|
|
|
|
|
|
The status of an object that is related to a LOB or XML table space can change due
to a recovery operation, depending on the type of recovery that is performed. If all
of the following objects for all LOB or XML columns are recovered in a single
RECOVER utility statement to the present point in time, no pending status exists:
v Base table space
v Index on the auxiliary table
v LOB table space
v XML table space
|
|
|
Refer to the following table for information about the status of a base table space,
index on the auxiliary table, LOB table space, or XML table space that was
recovered without its related objects.
| Table 66. Object status after being recovered without its related objects
|
|
| Object
|
|
|
Recovery type
LOB or XML
table space
status
Index on a LOB
or XML table
None
None
None
None
Prior point-in-time
AUX-CHECKpending1
REBUILD
pending
None
None
None
None
None
None
None
CHECKpending1
None
None
| Index on a LOB
| or XML table
None
None
None
None
| Index a LOB or
| XML table
Prior point-in-time
None
None
None
CHECK pending
| LOB or XML
| table space
|
TOCOPY,
TOLASTCOPY,
TOLASTFULLCOPY
AUX-CHECKpending1
None
None
REBUILD
pending
| LOB or XML
| table space
TORBA or
TOLOGPOINT
AUX-CHECKpending1
None
Auxiliary
warning
REBUILD
pending
| Notes:
| 1. For LOB table spaces defined with LOG NO, the update event is logged, even though the data change is not. If
such a log record is applied to the LOB table space and a LOB is consequently marked invalid, the LOB or XML
|
table space is set to auxiliary warning status.
|
|
Related reference
|
Appendix C, Advisory or restrictive states, on page 925
|
|
|
|
|
The recovery guidelines and considerations for a cloned table space or cloned
index are the same as for a base table space or base index except in the
point-in-time recovery case.
|
|
|
|
|
For an object currently involved in cloning, or one that was previously involved in
cloning, a point-in-time recovery cannot be done to a time the precedes the most
recent EXCHANGE statement. The time of the most recent EXCHANGE for a table
space can be determined by querying SYSIBM.COPY for the table space to be
recovered where ICTYPE = A and STYPE = E.
402
|
|
|
|
|
|
|
|
|
Point-in-time recovery
A recovery operation that is done with one of the point in time recovery options is
known as a point-in-time recovery. You can recover objects to any RBA or LRSN
using TORBA or TOLOGPOINT unless the objects are currently, or were
previously, involved with cloning.
|
|
|
With TORBA or TOLOGPOINT, the RBA or LRSN does not have to be a consistent
point in time. The RECOVER utility automatically handles any uncommitted units
of work and the data is left in a consistent state.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
403
After recovering a set of table spaces to a point in time, you can use CHECK
DATA to check for inconsistencies. The auxiliary CHECK-pending status (ACHKP)
is set when the CHECK DATA utility detects an inconsistency between a base table
space with defined LOB or XML columns and a LOB or XML table space.
|
|
|
|
You can also use point-in-time recovery and the point-in-time recovery options to
recover all user-defined table spaces and indexes that are in refresh-pending status
(REFP).
404
You can recover the partition to a point in time after the alter. The utility can
use a recovery base, (for example, a full image copy, a REORG LOG YES
operation, or a LOAD REPLACE LOG YES operation) that occurred prior to
the alter.
You cannot recover the partition to a point in time prior to the alter; the
recover fails with MSGDSNU556I and RC8.
v If you change partition boundaries with ALTER or REORG REBALANCE:
You can recover the partition to the current time if a recovery base (for
example, a full image copy, a REORG LOG YES operation, or a LOAD
REPLACE LOG YES operation) exists.
You can recover the partition to a point in time after the alter.
You can recover the partitions that are affected by the boundary change to a
point in time prior to the alter; RECOVER sets REORG-pending status on the
affected partitions and you must reorganize the table space or range of
partitions. All affected partitions must be in the recovery list of a single
RECOVER statement.
v If you alter a table to add a partition:
You can recover the partition to the current time.
You can recover the partition to a point in time after the alter.
You can recover the partition to a point in time prior to the alter; RECOVER
resets the partition to be empty.
When you perform the following actions before you recover an index to a prior
point in time or to the current time, the recovery status is affected as described:
v If you alter the data type of a column to a numeric data type, you cannot
recover the index until you take a full image copy of the index. However, the
index can be rebuilt.
v If you alter an index to NOT PADDED or PADDED , you cannot recover the
index until you take a full image copy of the index. However, the index can be
rebuilt.
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
|
|
v RECOVER cannot recover a piece of a linear table space to a point in time when
the table space was in basic row format and is now in reordered row format, or
when the table space was in reordered row format and is now in basic row
format. Instead, the entire table space must be recovered.
v RECOVER cannot recover a point-in-time RECOVER INDEX if the recovery
point precedes the first ALTER INDEX, in Version 8 new-function mode, that
created a new index version.
v RECOVER cannot use system-level backups as a recovery base unless
DFSMShsm is at z/OS 1.8 or higher.
|
|
|
|
|
Ensuring consistency
You can use RECOVER TORBA, RECOVER TOLOGPOINT, and RECOVER
TOCOPY to recover one of the following single objects:
v Partition of a partitioned table space
v Partition of a partitioning index space
v Data set of a simple table space
For any of the previously listed objects, restore all data sets to the same level;
otherwise, the data becomes inconsistent.
If possible, specify a table space and all of its indexes (or a set of table spaces and
all related indexes) in the same RECOVER utility statement, and specify
TOLOGPOINT or TORBA to identify a QUIESCE point. This action avoids placing
indexes in the CHECK-pending or REBUILD-pending status. If the TOLOGPOINT
is not a common QUIESCE point for all objects, use the following procedure:
1. RECOVER table spaces to the value for TOLOGPOINT (either an RBA or
LRSN).
2. Use concurrent REBUILD INDEX jobs to recover the indexes over each table
space.
This procedure ensures that the table spaces and indexes are synchronized, and it
eliminates the need to run the CHECK INDEX utility.
|
|
|
|
|
|
|
|
|
When using RECOVER with the TORBA or TOLOGPOINT option, ensure that all
of the objects that are changed by the active units of recovery at the recovery point
are recovered to the same point-in-time so that they are synchronized:
v DB2 rolls back changes made to units of recovery that are inflight, inabort,
postponed abort, or indoubt during the recovery point-in-time.
406
|
|
|
v DB2 does not roll back changes made to units of recovery that are INCOMMIT
during the recovery point-in-time.
v DB2 rolls back only changes to objects in the RECOVER statement.
|
|
|
|
The TORBA and TOLOGPOINT options set the CHECK-pending status for table
spaces when you perform any of the following actions:
v Recover all members of a set of table spaces that are to be recovered to the same
point in time, but referential constraints were defined for a dependent table after
that point in time. Table spaces that contain those dependent tables are placed in
CHECK-pending status.
v Recover table spaces with defined LOB or XML columns without recovering
their LOB or XML table spaces.
To avoid setting CHECK-pending status, you must perform both of the following
steps:
v Recover all dependent objects to the same point in time.
If you do not recover each table space to the same quiesce point, and if any of
the table spaces are part of a referential integrity structure, the following actions
occur:
All dependent table spaces that are recovered are placed in CHECK-pending
status with the scope of the whole table space.
All dependent table spaces of the recovered table spaces are placed in
CHECK-pending status with the scope of the specific dependent tables.
|
|
|
|
v Do not add table check constraints or referential constraints after the point in
time to which you want to recover.
If you recover each table space of a table space set to the same point in time, but
referential constraints were defined after the same point in time, the
CHECK-pending status is set for the table space that contains the table with the
referential constraint.
The TORBA and TOLOGPOINT options set the CHECK-pending status for indexes
when you recover one or more of the indexes to a previous point in time, but you
do not recover the related table space in the same RECOVER statement.
|
|
|
|
|
You can turn off CHECK-pending status for an index by using the TORBA and
TOLOGPOINT options. Recover indexes along with the related table space to the
same point in time (preferably a quiesce point) or SHRLEVEL REFERENCE point.
RECOVER processing resets the CHECK-pending status for all indexes in the same
RECOVER statement.
Compressed data
Use caution when recovering a portion of a table space or partition (for example,
one data set) to a prior point in time. If the data set that is being recovered has
Chapter 23. RECOVER
407
been compressed with a different dictionary, you can no longer read the data.
Related concepts
Resetting the REBUILD-pending status on page 372
How the RECOVER utility performs fallback recovery on page 412
Related tasks
Reviewing CHECK INDEX output on page 98
Related reference
Appendix C, Advisory or restrictive states, on page 925
REBUILD-pending status on page 929
REORG-pending status on page 931
Related information
Compressing your data (DB2 Performance Monitoring and Tuning Guide)
Recovery of data to a prior point of consistency (DB2 Administration Guide)
|
|
|
|
|
By replying NO, you can initiate the fallback to the previous image copy.
RECOVER responds with messages DSNU030I and DSNU508I, as shown in the
following example:
DSNU030I
DSNU508I
Reason code X0484 means that the request was denied by the operator.
408
Reason code X1708 means that the ICF catalog entry cannot be found.
|
|
|
|
|
|
409
Any log records that are not found in the active logs are read from the archive log
data sets, which are dynamically allocated to satisfy the requests. The type of
storage that is used for archive log data sets is a significant factor in the
performance. Consider the following actions to improve performance:
v RECOVER a list of objects in one utility statement to take only a single pass of
the log.
v Keep archive logs on disk to provide the best possible performance.
v Control archive logs data sets by using DFSMShsm to provide the next best
performance. DB2 optimizes recall of the data sets. After the data set is recalled,
DB2 reads it from disk.
v If the archive log must be read from tape, DB2 optimizes access by means of
ready-to-process and look-ahead mount requests. DB2 also permits delaying the
deallocation of a tape drive if subsequent RECOVER jobs require the same
archive log tape. Those methods are described in more detail in the subsequent
paragraphs.
The BSDS contains information about which log data sets to use and where they
reside. You must keep the BSDS information current. If the archive log data sets
are cataloged, the ICF catalog indicates where to allocate the required data set.
410
The DISPLAY ARCHIVE READ command shows the currently mounted tape
volumes and their statuses.
Delayed deallocation
DB2 can delay deallocating the tape units used to read the archive logs. This is
useful when several RECOVER utility statements run in parallel. By delaying
deallocation, DB2 can re-read the same volume on the same tape unit for different
RECOVER jobs, without taking time to allocate it again.
You can dynamically change the amount of time that DB2 delays deallocation by
using the TIME option of the SET ARCHIVE command. For example, to specify a
60 minute delay, issue the following command:
-SET ARCHIVE TIME(60)
In a data sharing environment, you might want to specify zero (0) to avoid having
one member hold onto a data set that another member needs for recovery.
Performance summary
1. Achieve the best performance by allocating archive logs on disk.
2. Consider staging cataloged tape data sets to disk before allocation by the log
read process.
3. If the data sets are read from tape, set both the COUNT and the TIME values
to the maximum allowable values within the system constraints.
411
412
Related concepts
Preparing for recovery on page 139
|
|
|
Termination
Terminating a RECOVER job with the TERM UTILITY command leaves the table
space that is being recovered in RECOVER-pending status, and the index space
that is being recovered in the REBUILD-pending status. If you recover a table
space to a previous point in time, its indexes are left in the REBUILD-pending
status. The data or index is unavailable until the object is successfully recovered or
rebuilt. If the utility fails in the LOGAPPLY, LOGCSR, or LOGUNDO phases, fix
the problem that caused the job to stop and restart the job rather than terminate
the job. For the rest of objects in the recover job, the RECOVER utility restores the
Chapter 23. RECOVER
413
original image copy and repeats the LOGAPPLY, LOGCSR, and LOGUNDO
process again for this subset of objects. All the objects being recovered in one
recover job will be available to the application at the end of the RECOVER utility,
even if some of the objects do not have any active URs operating on them and
therefore no rollback is needed for these objects.
Restart
You can restart RECOVER from the last commit point (RESTART(CURRENT)) or
the beginning of the phase (RESTART(PHASE)). By default, DB2 uses
RESTART(CURRENT).
If you attempt to recover multiple objects by using a single RECOVER statement
and the utility fails in:
v The RESTORE phase: All objects in the process of being restored are placed in
the RECOVER-pending or REBUILD-pending status. The status of the remaining
objects is unchanged.
v The LOGAPPLY phase: All objects that are specified in the RECOVER statement
are placed in the RECOVER-pending or REBUILD-pending status.
In both cases, you must identify and fix the causes of the failure before performing
a current restart.
|
|
If RECOVER fails in the LOGCSR phase and you restart the utility, the utility
restart behavior is RESTART(PHASE).
|
|
|
|
If RECOVER fails in the LOGUNDO phase and you restart the utility, the utility
repeats the RESTORE, LOGAPPLY, LOGCSR, and LOGUNDO phases for only
those objects that had active units of recovery that needed to be handled and that
did not complete undo processing prior to the failure.
Related concepts
Restart of an online utility on page 36
414
415
//STEP1
//
//
//UTPRINT
//SYSUT1
//
//
//SORTOUT
//
//
//SYSIN
EXEC DSNUPROC,UID='JUOLU210.RCVR4',
UTPROC='',
SYSTEM='SSTR'
DD SYSOUT=*
DD DSN=JUOLU210.RCVR4.STEP1.SYSUT1,
DISP=(MOD,DELETE,CATLG),
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
DD DSN=JUOLU210.RCVR4.STEP1.SORTOUT,
DISP=(MOD,DELETE,CATLG),
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
DD *
LISTDEF RCVR4_LIST
INCLUDE TABLESPACES
INCLUDE TABLESPACES
INCLUDE TABLESPACES
INCLUDE TABLESPACES
INCLUDE TABLESPACES
INCLUDE INDEXSPACES
INCLUDE INDEXSPACES
INCLUDE INDEXSPACES
TABLESPACE
TABLESPACE
TABLESPACE
TABLESPACE
TABLESPACE
INDEXSPACE
INDEXSPACE
INDEXSPACE
DBOL1002.TSOL1002
DBOL1003.TPOL1003
DBOL1003.TPOL1003
DBOL1003.TPOL1004
DBOL1003.TPOL1004
DBOL1003.IPOL1051
DBOL1003.IPOL1061
DBOL1003.IXOL1062
PARTLEVEL
PARTLEVEL
PARTLEVEL
PARTLEVEL
PARTLEVEL
PARTLEVEL
3
6
5
9
22
10
|
|
|
|
|
|
|
416
|
|
|
use to optimize the process. Note that any uncommitted work for all of the objects
at the specified RBA have been backed out by the recover to point in time with
consistency.
LISTDEF RCVRLIST INCLUDE TABLESPACE DSN8D81A.DSN8S81D
INCLUDE INDEX DSN8810.XDEPT1
INCLUDE INDEX DSN8810.XDEPT2
INCLUDE INDEX DSN8810.XDEPT3
INCLUDE TABLESPACE DSN8D81A.DSN8S81E
INCLUDE INDEX DSN8810.XEMP1
INCLUDE INDEX DSN8810.XEMP2
RECOVER LIST RCVRLIST TOLOGPOINT X'00000551BE7D' PARALLEL(4)
|
|
|
|
|
|
The following control statement specifies that the RECOVER utility is to search for
an image copy with an RBA or LRSN value earlier than the specified
X00000551BE7D value to use in the RESTORE phase. Only specified dumps of the
database copy pool are used for the restore of the data sets.
RECOVER LIST RCVRLIST RESTOREBEFORE X'00000551BE7D' PARALLEL(4)
FROMDUMP DUMPCLASS(dcname)
417
418
Output
The following list summarizes REORG INDEX output:
REORG specified
Results
REORG INDEX
Reorganizes the entire index (all parts if partitioning).
REORG INDEX PART n
Reorganizes PART n of a partitioning index or of a data-partitioned
secondary index
Authorization required
To execute this utility, you must use a privilege set that includes one of the
following authorities:
v REORG privilege for the database
v DBADM or DBCTRL authority for the database. If the object on which the utility
operates is in an implicitly created database, DBADM authority on the implicitly
created database or DSNDB04 is required.
v SYSCTRL authority
v SYSADM authority
To execute this utility on an index space in the catalog or directory, you must use a
privilege set that includes one of the following authorities:
v REORG privilege for the DSNDB06 (catalog) database
v DBADM or DBCTRL authority for the DSNDB06 (catalog) database.
v Installation SYSOPR authority
v SYSCTRL authority
v SYSADM or Installation SYSADM authority
v STATS privilege for the database is required if STATISTICS keyword is specified.
While trying to reorganize an index space in the catalog or directory, a user with
authority other than installation SYSADM or installation SYSOPR might receive the
following message:
DSNT500I "resource unavailable"
419
the REORG INDEX utility again, using an authorization ID with the installation
SYSADM or installation SYSOPR authority.
An ID with installation SYSOPR authority can also execute REORG INDEX, but
only on an index in the DSNDB06 database.
To run REORG INDEX STATISTICS REPORT YES, ensure that the privilege set
includes the SELECT privilege on the catalog tables and on the tables for which
statistics are to be gathered.
SWITCH
Switches access between original and new copy of index space or partition.
Used only if you specify SHRLEVEL REFERENCE or CHANGE.
UTILTERM
Performs cleanup. For DB2-managed data sets and either SHRLEVEL
CHANGE or SHRLEVEL REFERENCE, the utility deletes the original copy
of the table space or index space.
420
Syntax diagram
REORG
REUSE
CLONE
SHRLEVEL NONE
FASTSWITCH YES
SHRLEVEL
REFERENCE
deadline-spec
CHANGE
deadline-spec
drain-spec
drain-spec
change-spec
FASTSWITCH NO
UNLOAD CONTINUE
(1)
LEAFDISTLIMIT
integer
REPORTONLY
UNLOAD
PAUSE
ONLY
(2)
stats-spec
WORKDDN (SYSUT1)
WORKDDN (ddname)
PREFORMAT
Notes:
1
You cannot specify any options in stats-spec with the UNLOAD ONLY option.
index-name-spec:
INDEX
index-name
creator-id.
INDEXSPACE
index-space-name
database-name.
PART
integer
deadline-spec:
DEADLINE NONE
DEADLINE
timestamp
labeled-duration-expression
drain-spec:
421
(1)
(2)
(3)
DRAIN_WAIT
integer
RETRY integer
RETRY_DELAY
integer
Notes:
|
The default for DRAIN_WAIT is the value of the IRLMRWT subsystem parameter.
The default for RETRY is the value of the UTIMOUT subsystem parameter.
|
|
The default for RETRY_DELAY is the smaller of the following two values: DRAIN_WAIT value
RETRY value, DRAIN_WAIT value 10
change-spec:
DRAIN WRITERS
LONGLOG CONTINUE
DELAY 1200
DRAIN ALL
LONGLOG
DELAY
(1)
MAXRO
integer
DEFER
TERM
DRAIN
integer
TIMEOUT TERM
TIMEOUT ABEND
Notes:
1
labeled-duration-expression:
CURRENT_DATE
CURRENT_TIMESTAMP
stats-spec:
422
+
-
constant
YEAR
YEARS
MONTH
MONTHS
DAY
DAYS
HOUR
HOURS
MINUTE
MINUTES
SECOND
SECONDS
MICROSECOND
MICROSECONDS
REPORT NO
UPDATE ALL
STATISTICS
REPORT YES
correlation-stats-spec
UPDATE
ACCESSPATH
SPACE
NONE
HISTORY
ALL
ACCESSPATH
SPACE
NONE
FORCEROLLUP
YES
NO
correlation-stats-spec:
FREQVAL NUMCOLS 1
COUNT 10
KEYCARD
SORTDEVT
FREQVAL NUMCOLS
integer
COUNT
device-type
integer
SORTNUM
integer
Option descriptions
INDEX creator-id.index-name
Specifies an index that is to be reorganized.
creator-id. specifies the creator of the index and is optional. If you omit the
qualifier creator id, DB2 uses the user identifier for the utility job. index-name is
the qualified name of the index to copy. For an index, you can specify either an
index name or an index space name. Enclose the index name in quotation
marks if the name contains a blank.
INDEXSPACE database-name.index-space-name
Specifies the qualified name of the index space that is obtained from the
SYSIBM.SYSINDEXES table.
database-name specifies the name of the database that is associated with the
index and is optional.
The default value is DSNDB04.
index-space-name specifies the qualified name of the index space that is to be
reorganized; the name is obtained from the SYSIBM.SYSINDEXES table.
LIST listdef-name
Specifies the name of a previously defined LISTDEF list name. The INDEX
keyword is required to differentiate this REORG INDEX LIST from REORG
TABLESPACE LIST. The utility allows one LIST keyword for each control
statement of REORG INDEX. The list must not contain any table spaces.
REORG INDEX is invoked once for each item in the list. This utility will only
Chapter 24. REORG INDEX
423
process clone data if the CLONE keyword is specified. The use of CLONED
YES on the LISTDEF statement is not sufficient.
Do not specify STATISTICS INDEX index-name with REORG INDEX LIST. If
you want to collect inline statistics for a list of indexes, just specify
STATISTICS.
You cannot specify DSNUM and PART with LIST on any utility.
PART integer
Identifies a partition that is to be reorganized. You can reorganize a single
partition of a partitioning index. You cannot specify PART with LIST. integer
must be in the range from 1 to the number of partitions that are defined for
the partitioning index. The maximum value is 4096.
integer designates a single partition.
If you omit the PART keyword, the entire index is reorganized.
REUSE
When used with SHRLEVEL NONE, specifies that REORG is to logically reset
and reuse DB2-managed data sets without deleting and redefining them. If you
do not specify REUSE and SHRLEVEL NONE, DB2 deletes and redefines
DB2-managed data sets to reset them.
If a data set has multiple extents and you use the REUSE parameter, the
extents are not released.
If you specify SHRLEVEL REFERENCE or CHANGE with REUSE, REUSE
does not apply
CLONE
Indicates that REORG INDEX is to reorganize only the specified index spaces
and indexes that are defined on clone tables. This utility will only process
clone data if the CLONE keyword is specified. The use of CLONED YES on
the LISTDEF statement is not sufficient.
|
|
|
|
|
SHRLEVEL
Specifies the method for performing the reorganization. The parameter
following SHRLEVEL indicates the type of access that is to be allowed during
the RELOAD phase of REORG.
NONE
Specifies that reorganization is to operate by unloading from the area that
is being reorganized (while applications can read but cannot write to the
area), building into that area (while applications have no access), and then
allowing read-write access again.
If you specify NONE (explicitly or by default), you cannot specify the
following parameters:
v MAXRO
v LONGLOG
v DELAY
v DEADLINE
v DRAIN_WAIT
v RETRY
v RETRY_DELAY
REFERENCE
Specifies that reorganization is to operate as follows:
424
v Unload from the area that is being reorganized while applications can
read but cannot write to the area.
v Build into a shadow copy of that area while applications can read but
cannot write to the original copy.
v Switch the future access of the applications from the original copy to the
shadow copy by exchanging the names of the data sets, and then
allowing read-write access again.
If you specify REFERENCE, you cannot specify the following parameters:
v UNLOAD (Reorganization with REFERENCE always performs
UNLOAD CONTINUE.)
v MAXRO
v LONGLOG
v DELAY
CHANGE
Specifies that reorganization is to operate as follows:
v Unload from the area that is being reorganized while applications can
read and write to the area.
v Build into a shadow copy of that area while applications can read and
write to the original copy.
v Apply the log of the original copy to the shadow copy while
applications can read and usually write to the original copy.
v Switch the future access of the applications from the original copy to the
shadow copy by exchanging the names of the data sets, and then
allowing read-write access again.
If you specify CHANGE, you cannot specify the UNLOAD parameter.
Reorganization with CHANGE always performs UNLOAD CONTINUE.
|
|
SHRLEVEL CHANGE cannot be specified if the table space has the NOT
LOGGED attribute.
DEADLINE
Specifies the deadline for the SWITCH phase to begin. If DB2 estimates that
the SWITCH phase does not begin by the deadline, DB2 issues the messages
that the DISPLAY UTILITY command issues and then terminates
reorganization.
NONE
Specifies that no deadline exists by which the switch phase of log
processing must begin.
timestamp
Specifies the deadline for the switch phase of log processing to begin. This
deadline must not have already occurred when REORG is executed.
|
|
|
labeled-duration-expression
Calculates the deadline for the switch phase of log processing to begin. The
calculation is based on either CURRENT TIMESTAMP or CURRENT
DATE. You can add or subtract one or more constant values to specify the
deadline. This deadline must not have already occurred when REORG is
executed. CURRENT TIMESTAMP and CURRENT DATE are evaluated
once, when the REORG statement is first processed. If a list of objects is
specified, the same value will be in effect for all objects in the list.
425
CURRENT_DATE
Specifies that the deadline is to be calculated based on the CURRENT
DATE.
CURRENT_TIMESTAMP
Specifies that the deadline is to be calculated based on the CURRENT
TIMESTAMP.
constant
Indicates a unit of time and is followed by one of the seven duration
keywords: YEARS, MONTHS, DAYS, HOURS, MINUTES, SECONDS,
or MICROSECONDS. The singular form of these words is also
acceptable: YEAR, MONTH, DAY, HOUR, MINUTE, SECOND,
MICROSECOND.
If REORG SHRLEVEL REFERENCE or SHRLEVEL CHANGE terminates
because of a DEADLINE specification, DB2 issues message DSNU374I with
reason code 2 but does not set a restrictive status.
DRAIN_WAIT integer
Specifies the number of seconds that the utility waits when draining for SQL
statements (inserts, updates, deletes, and selects). The specified time is the
aggregate time for all partitions of the index that is to be reorganized. This
value overrides the values specified by IRLMRWT and UTIMOUT, for these
SQL statements only. For operations like commands, the IRLMRWT and
UTIMOUT values are used. Valid values for integer are from 0 to 1800. If the
keyword is omitted or if a value of 0 is specified, the utility uses the value of
the lock timeout system parameter IRLMRWT.
RETRY integer
Specifies the maximum number of retries that REORG is to attempt. Valid
values for integer are from 0 to 255.
Specifying RETRY can lead to increased processing costs and can result in
multiple or extended periods of read-only access.
The default value is the value of the UTIMOUT subsystem parameter.
RETRY_DELAY integer
Specifies the minimum duration, in seconds, between retries. Valid values
for integer are from 1 to 1800.
If you do not specify RETRY_DELAY, REORG INDEX uses the smaller of
the following two values:
|
|
|
|
426
elapsed time for REORG to complete. If you specify a huge positive value,
the second iteration of log processing is probably the last iteration.
The default value is 300 seconds.
DEFER
Specifies that the iterations of log processing with read-write access can
continue indefinitely. REORG never begins the final iteration with
read-only access, unless you change the MAXRO value by using the
ALTER UTILITY command.
If you specify DEFER, you should also specify LONGLOG CONTINUE.
If you specify DEFER, and DB2 determines that the actual time for an
iteration and the estimated time for the next iteration are both less than 5
seconds, DB2 adds a 5-second pause to the next iteration. This pause
reduces consumption of processor time. The first time this situation occurs
for a given execution of REORG, DB2 sends message DSNU362I to the
console. The message states that the number of log records that must be
processed is small and that the pause occurs. To change the MAXRO value
and thus cause REORG to finish, execute the ALTER UTILITY command.
DB2 adds the pause whenever the situation occurs; however, DB2 sends
the message only if 30 minutes have elapsed since the last message was
sent for a given execution of REORG.
DRAIN
Specifies drain behavior at the end of the log phase after the MAXRO
threshold is reached and when the last iteration of the log is to be applied.
WRITERS
Specifies the current default action, in which DB2 drains only the writers
during the log phase after the MAXRO threshold is reached and
subsequently issues DRAIN ALL on entering the switch phase.
ALL
Specifies that DB2 is to drain all readers and writers during the log phase,
after the MAXRO threshold is reached.
Consider specifying DRAIN ALL if the following conditions are both true:
v SQL update activity is high during the log phase.
v The default behavior results in a large number of -911 SQL error
messages.
LONGLOG
Specifies the action that DB2 is to perform, after sending a message to the
console, if the number of records that the next iteration of log process is to
process is not sufficiently lower than the number that the previous iterations
processed. This situation means that REORG INDEX is not reading the
application log quickly enough to keep pace with the writing of the application
log.
CONTINUE
Specifies that until the time on the JOB statement expires, DB2 is to
continue performing reorganization, including iterations of log processing,
if the estimated time to perform an iteration exceeds the time that is
specified with MAXRO.
A value of DEFER for MAXRO and a value of CONTINUE for LONGLOG
together mean that REORG INDEX is to continue allowing access to the
original copy of the area that is being reorganized and does not switch to
427
the shadow copy. The user can execute the ALTER UTILITY command
with a large value for MAXRO when the switching is desired.
TERM
Specifies that DB2 is to terminate reorganization after the delay specified
by the DELAY parameter.
DRAIN
Specifies that DB2 is to drain the write claim class after the delay that is
specified by the DELAY parameter. This action forces the final iteration of
log processing to occur.
DELAY integer
Specifies the minimum interval between the time that REORG sends the
LONGLOG message to the console and the time REORG that performs the
action that is specified by the LONGLOG parameter.
integer is the number of seconds.
The default value is 1200.
TIMEOUT
Specifies the action that is to be taken if the REORG INDEX utility gets a
time-out condition while trying to drain objects in either the log or switch
phases.
TERM
Indicates that DB2 is to behave as follows if you specify the TERM option
and a time out condition occurs:
1. DB2 issues an implicit TERM UTILITY command, causing the utility to
end with a return code 8.
2. DB2 issues the DSNU590I and DSNU170I messages.
3. DB2 leaves the objects in a RW state.
ABEND
Indicates that if a time-out condition occurs, DB2 is to leave the objects in a
UTRO or UTUT state.
FASTSWITCH
Specifies which switch methodology is to be used for a given reorganization.
|
|
|
|
|
YES
Enables the SWITCH phase to use the FASTSWITCH methodology. This
option is not allowed for the catalog (DSNDB06) or directory (DSNDB01).
|
|
NO
Causes the SWITCH phase to use IDCAMS RENAME.
LEAFDISTLIMIT integer
Specifies that the value for integer is to be compared to the LEAFDIST value
for the specified partitions of the specified index in SYSIBM.SYSINDEXPART. If
any LEAFDIST value exceeds the specified LEAFDISTLIMIT value, REORG is
performed or, if you specify REPORTONLY, recommended.
The default value is 200.
REPORTONLY
Specifies that REORG is only to be recommended, not performed. REORG
produces a report with one of the following return codes:
1
No limit met; no REORG performed or recommended.
2
REORG performed or recommended.
428
UNLOAD
Specifies whether the utility job is to continue processing or terminate after the
data is unloaded.
CONTINUE
Specifies that, after the data has been unloaded, the utility is to continue
processing.
PAUSE
Specifies that, after the data has been unloaded, processing is to end. The
utility stops and the RELOAD status is stored in SYSIBM.SYSUTIL so that
processing can be restarted with RELOAD RESTART(PHASE).
This option is useful if you want to redefine data sets during
reorganization. For example, with a user-defined data set, you can:
v Run REORG with the UNLOAD PAUSE option.
v Redefine the data set using Access Method Services.
v Restart REORG by resubmitting the previous job and specifying
RESTART(PHASE).
If no records are unloaded during an UNLOAD PAUSE, when REORG is
restarted, the RELOAD and BUILD phases are bypassed.
You cannot use UNLOAD PAUSE if you specify the LIST option.
ONLY
Specifies that, after the data has been unloaded, the utility job ends and the
status in SYSIBM.SYSUTIL that corresponds to this utility ID is removed.
STATISTICS
Specifies that statistics for the index are to be collected; the statistics are either
reported or stored in the DB2 catalog. You cannot collect inline statistics for
indexes on the catalog and directory tables.
Restrictions:
v If you specify STATISTICS for encrypted data, DB2 might not provide useful
information on this data.
v You cannot specify STATISTICS for clone objects.
REPORT
Indicates whether a set of messages is to be generated to report the collected
statistics.
NO
Indicates that the set of messages is not to be sent as output to SYSPRINT.
YES
Indicates that the set of messages is to be sent as output to SYSPRINT. The
generated messages are dependent on the combination of keywords (such
as TABLESPACE, INDEX, TABLE, and COLUMN) that are specified with
the RUNSTATS utility. However, these messages are not dependent on the
specification of the UPDATE option. REPORT YES always generates a
report of SPACE and ACCESSPATH statistics.
KEYCARD
Indicates that all of the distinct values in all of the 1 to n key column
combinations for the specified indexes are to be collected. n is the number of
columns in the index.
429
FREQVAL
Specifies that frequent value statistics are to be collected. If you specify
FREQVAL, you must also specify NUMCOLS and COUNT.
NUMCOLS
Indicates the number of key columns to concatenate together when you
collect frequent values from the specified index. Specifying 3 means that
DB2 is to collect frequent values on the concatenation of the first three key
columns.
The default value is 1, which means DB2 is to collect frequent values on
the first key column of the index.
COUNT
Indicates the number of frequent values that are to be collected. Specifying
15 means that DB2 is to collect 15 frequent values from the specified key
columns.
The default value is 10.
SORTDEVT device-type
Specifies the device type for temporary data sets that are to be dynamically
allocated by DFSORT. For device-type, specify any disk device that is valid on
the DYNALLOC parameter of the SORT or OPTION options for DFSORT. See
DFSORT Application Programming: Guide for more information.
|
|
|
|
SORTNUM integer
Specifies the number of temporary data sets that are to be dynamically
allocated when collecting statistics for a data-partitioned secondary index. If
you omit SORTDEVT, SORTNUM is ignored. If you use SORTDEVT and omit
SORTNUM, no value is passed to DFSORT; DFSORT uses its own default.
integer is the number of temporary data sets that can range from 2 to 255.
|
|
REORG INDEX does not sort index keys. Only one sort can be performed, and
that is if inline statistics are being collected for a DPSI.
|
|
430
HISTORY
Indicates that all catalog table inserts or updates to the catalog history tables
are to be recorded.
The default is supplied by the specified value in STATISTICS HISTORY on
panel DSNTIPO.
ALL
Indicates that all collected statistics are to be updated in the catalog history
tables.
ACCESSPATH
Indicates that only the catalog history table columns that provide statistics
used for access path selection are to be updated.
SPACE
Indicates that only space-related catalog statistics are to be updated in
catalog history tables.
NONE
Indicates that catalog history tables are not to be updated with the
collected statistics.
FORCEROLLUP
Specifies whether aggregation or rollup of statistics are to take place when
RUNSTATS is executed even when some parts are empty. This option enables
the optimizer to select the best access path.
YES
Indicates that forced aggregation or rollup processing is to be done, even
though some parts might not contain data.
NO
Indicates that aggregation or rollup is to be done only if data is available
for all parts.
If data is not available for all parts and if the installation value for STATISTICS
ROLLUP on panel DSNTIPO is set to NO, DSNU623I message is issued.
WORKDDN(ddname)
ddname specifies the DD statement for the unload data set.
ddname
Is the DD name of the temporary work file for build input.
The default value is SYSUT1.
The WORKDDN keyword specifies either a DD name or a TEMPLATE
name from a previous TEMPLATE control statement. If utility processing
detects that the specified name is both a DD name in the current job step
and a TEMPLATE name, the utility uses DD name.
Even though WORKDDN is an optional keyword, a DD statement for the
unload output data set is required in the JCL. If you do not specify
WORKDDN, or if you specify it without ddname, the JCL must have a DD
statement with the name SYSUT1. If ddname is given, you must provide a DD
statement or TEMPLATE that matches the DD name.
PREFORMAT
Specifies that the remaining pages are to be preformatted up to the
high-allocated RBA in the index space. The preformatting occurs after the
index is built.
Chapter 24. REORG INDEX
431
Region size
The recommended minimum region size is 4096 KB.
432
logical partition in RECP does not restrict access to other logical partitions
that are not in RECP. You can reset RECP by recovering only the single
logical partition.
The REBUILD-pending restrictive states are:
RBDP REBUILD-pending status is set on a physical or logical index partition. The
individual physical or logical partition is inaccessible; you must rebuild the
object using the REBUILD INDEX utility.
PSRBD
Page set REBUILD-pending (PSRBD) is set for nonpartitioning indexes. The
entire index space is inaccessible; you must rebuild the object by using the
REBUILD INDEX utility.
RBDP*
A REBUILD-pending status is set only on logical partitions of
nonpartitioning indexes. The entire index is inaccessible, but it is made
available again when you rebuild the affected partitions by using the
REBUILD INDEX utility.
CHECK-pending status
You cannot reorganize an index when the data is in the CHECK-pending status.
|
|
|
|
|
|
|
If you run REORG INDEX against an index with the following characteristics,
REORG INDEX fails:
v The index was created on a VARBINARY column or a column with a distinct
type that is based on a VARBINARY data type.
v The index column has the DESC attribute.
|
|
To fix the problem, alter the column data type to BINARY, and then rebuild the
index.
Related reference
Chapter 8, CHECK DATA, on page 61
REBUILD-pending status on page 929
RECOVER-pending status on page 930
Description
Required?
SYSIN
SYSPRINT
Yes
433
|
|
Data set
Description
Required?
STPRIN01
No
No1, 2, 3
UTPRINT
Yes
Note:
1. Required when collecting inline statistics on at least one data-partitioned secondary
index.
2. If the DYNALLOC parm of the SORT program is not turned on, you need to allocate the
data set. Otherwise, DFSORT dynamically allocates the temporary data set.
3. It is recommended that you use dynamic allocation by specifying SORTDEVT in the
utility statement because dynamic allocation reduces the maintenance required of the
utility job JCL.
|
|
|
The following objects are named in the utility control statement and do not require
DD statements in the JCL:
Index Object to be reorganized.
where
number of keys = #tablerows
434
DB2 utilities use DFSORT to perform sorts. Sort work data sets cannot span
volumes. Smaller volumes require more sort work data sets to sort the same
amount of data; therefore, large volume sizes can reduce the number of needed
sort work data sets. When you allocate sort work data sets on disk, the
recommended amount of space to allow provides at least 1.2 times the amount of
data that is to be sorted. For more information about DFSORT, see DFSORT
Application Programming: Guide.
catname.DSNDBx.dbname.psname.y000z.Lnnn
In the preceding name, the variables have the following meanings:
variable
meaning
catname
The VSAM catalog name or alias
Chapter 24. REORG INDEX
435
C or D
dbname
Database name
psname
Table space name or index name
I or J
1 or 2
Lnnn
To determine the names of existing data sets, execute one of the following
queries against the SYSTABLEPART or SYSINDEXPART catalog tables:
|
|
|
|
|
|
|
|
|
|
|
|
436
Claims
The following table shows which claim classes REORG INDEX drains and any
restrictive state the utility sets on the target object. The target is an index or index
partition.
Table 68. Claim classes of REORG INDEX operations
Phase
REORG INDEX
SHRLEVEL NONE
REORG INDEX
SHRLEVEL
REFERENCE
REORG INDEX
SHRLEVEL CHANGE
UNLOAD
DW/UTRO
DW/UTRO
CR/UTRW
BUILD
DA/UTUT
none
none
Last iteration of
LOG
n/a
DA/UTUT
SWITCH
n/a
DA/UTUT
DW/UTRO
DA/UTUT
Legend:
v CR: Claim the read claim class.
v DA: Drain all claim classes, no concurrent SQL access.
v DR: Drain the repeatable read class, no concurrent access for SQL repeatable readers.
v DW: Drain the write claim class, concurrent access for SQL readers.
v UTRO: Utility restrictive state, read only access allowed.
v UTUT: Utility restrictive state, exclusive control.
v none: Any claim, drain, or restrictive state for this object does not change in this phase.
Note:
1. Applicable if you specified DRAIN ALL.
437
Compatibility
The following table shows which utilities can run concurrently with REORG
INDEX on the same target object. The target object can be an index space or a
partition. If compatibility depends on particular options of a utility, that is also
shown. REORG INDEX does not set a utility restrictive state if the target object is
an index on DSNDB01.SYSUTILX.
Table 69. Compatibility of REORG INDEX with other utilities
438
Action
CHECK DATA
No
CHECK INDEX
No
CHECK LOB
Yes
COPY INDEXSPACE
No
COPY TABLESPACE
Yes
DIAGNOSE
Yes
LOAD
No
MERGECOPY
Yes
MODIFY
Yes
QUIESCE
No
REBUILD INDEX
No
RECOVER INDEX
No
RECOVER INDEXSPACE
No
Yes
Yes
No
No
No
No
Yes
No
No
No
Yes
Yes
REPORT
Yes
RUNSTATS INDEX
No
RUNSTATS TABLESPACE
Yes
STOSPACE
Yes
UNLOAD
Yes
439
1. Run the REORG INDEX utility and specify the LEAFDISTLIMIT option and the
REPORTONLY option. REORG produces a report with one of the following
return codes; but a REORG is not performed.
1
No limit met; no REORG performed or recommended.
2
REORG performed or recommended.
2. Optional: Alternatively, information from the SYSINDEXPART catalog table can
tell you which indexes qualify for reorganization.
440
Operator actions
LONGLOG specifies the action that DB2 is to perform if log processing is not
occurring quickly enough. If the operator does not respond to the console message
DSNU377I, the LONGLOG option automatically goes into effect. You can take one
of the following actions:
v Execute the START DATABASE(db) SPACENAM(ts)... ACCESS(RO) command
and the QUIESCE utility to drain the write claim class. DB2 performs the last
iteration, if MAXRO is not DEFER. After the QUIESCE, you should also execute
the ALTER UTILITY command, even if you do not change any REORG
parameters.
v Execute the START DATABASE(db) SPACENAM(ts)... ACCESS(RO) command
and the QUIESCE utility to drain the write claim class. Then, after
reorganization has made some progress, execute the START DATABASE(db)
SPACENAM(ts)... ACCESS(RW) command. This action increases the likelihood
that log processing can improve. After the QUIESCE, you should also execute
the ALTER UTILITY command, even if you do not change any REORG
parameters.
v Execute the ALTER UTILITY command to change the value of MAXRO.
Changing it to a huge positive value, such as 9999999, causes the next iteration
to be the last iteration.
v Execute the ALTER UTILITY command to change the value of LONGLOG.
v Execute the TERM UTILITY command to terminate reorganization.
v Adjust the amount of buffer space that is allocated to reorganization and to
applications. This adjustment can increase the likelihood that log processing
improve after adjusting the space, you should also execute the ALTER UTILITY
command, even if you do not change any REORG parameters.
v Adjust the scheduling priorities of reorganization and applications. This
adjustment can increase the likelihood that log processing improve. After
adjusting the priorities, you should also execute the ALTER UTILITY command,
even if you do not change any REORG parameters.
DB2 does not take the action specified in the LONGLOG phrase if any one of these
events occurs before the delay expires:
v An ALTER UTILITY command is issued.
v A TERM UTILITY command is issued.
v DB2 estimates that the time to perform the next iteration is likely to be less than
or equal to the time specified on the MAXRO keyword.
v REORG terminates for any reason (including the deadline).
441
While REORG is interrupted by PAUSE, you can re-define the table space
attributes for user defined table spaces. PAUSE is not required for
STOGROUP-defined table spaces. Attribute changes are done automatically by a
REORG following an ALTER INDEX.
Improving performance
You can improve the performance of the REORG INDEX utility by taking certain
actions.
Recommendation: Run online REORG during light periods of activity on the table
space or index.
To improve REORG performance,
v Run REORG concurrently on separate partitions of a partitioned index space.
The processor time for running REORG INDEX on partitions of a partitioned
index is approximately the same as the time for running a single REORG index
job. The elapsed time is a fraction of the time for running a single REORG job
on the entire index.
v Schedule REORG with SHRLEVEL CHANGE when the rate of writing is low
and transactions are short. Avoid scheduling REORG with SHRLEVEL CHANGE
when low-tolerance applications are executing.
v Run REORG with DRAIN_WAIT.
The DRAIN_WAIT option provides improved control over the time online
REORG waits for drains. Also, because the DRAIN_WAIT is the aggregate time
that online REORG is to wait to perform a drain on a table space and associated
indexes, the length of drains is more predictable than it is when each partition
and index has its own individual waiting-time limit.
By specifying a short delay time (less than the system timeout value,
IRLMRWT), you can reduce the impact on applications by reducing time-outs.
You can use the RETRY option to give the online REORG INDEX utility chances
to complete successfully. If you do not want to use RETRY processing, you can
still use DRAIN_WAIT to set a specific and more consistent limit on the length
of drains.
RETRY allows an online REORG that is unable to drain the objects it requires to
try again after a set period (RETRY_DELAY). If the drain fails in the SWITCH
phase, the objects remain in their original state (read-only mode for SHRLEVEL
REFERENCE or read-write mode for SHRLEVEL CHANGE). Likewise, objects
will remain in their original state if the drain fails in the LOG phase.
Because application SQL statements can queue behind any unsuccessful drain
that the online REORG has tried, define a reasonable delay before you retry to
allow this work to complete; the default is 5 minutes.
When the default DRAIN WRITERS is used with SHRLEVEL CHANGE and
RETRY, multiple read-only log iterations can occur. Because online REORG can
have to do more work when RETRY is specified, multiple or extended periods of
restricted access might occur. Applications that run with REORG must perform
frequent commits. During the interval between retries, the utility is still active;
consequently, other utility activity against the table space and indexes is
restricted.
442
If you terminate REORG with the TERM UTILITY command during the UNLOAD
phase, objects have not yet been changed, and you can rerun the job.
If you terminate REORG with the TERM UTILITY command during the build
phase, the behavior depends on the SHRLEVEL option:
v For SHRLEVEL NONE, the index is left in RECOVER-pending status. After you
recover the index, rerun the REORG job.
v For SHRLEVEL REFERENCE or CHANGE, the index keys are reloaded into a
shadow index, so the original index has not been affected by REORG. You can
rerun the job.
If you terminate REORG with the TERM UTILITY command during the log phase,
the index keys are reloaded into a shadow index, so the original index has not
been affected by REORG. You can rerun the job.
If you terminate REORG with the TERM UTILITY command during the switch
phase, all data sets that were renamed to their shadow counterparts are renamed
back, so the objects are left in their original state. You can rerun the job. If a
problem occurs in renaming to the original data sets, the objects are left in
RECOVER-pending status. You must recover the index.
The REORG-pending status is not reset until the UTILTERM execution phase. If the
REORG INDEX utility abnormally terminates or is terminated, the objects are left
in RECOVER-pending status.
The following table lists any restrictive states that are set based on the phase in
which REORG INDEX terminated.
Table 70. Restrictive states set based on the phase in which REORG INDEX terminated
Phase
UNLOAD
No effect.
BUILD
LOG
No effect.
SWITCH
Related reference
Appendix C, Advisory or restrictive states, on page 925
443
If you restart REORG in the outlined phase, it re-executes from the beginning of
the phase. DB2 always uses RESTART(PHASE) by default unless you restart the
job in the UNLOAD phase. In this case, DB2 uses RESTART(CURRENT) by
default.
If REORG abnormally terminates or a system failure occurs while it is in the
UTILTERM phase, you must restart the job with RESTART(PHASE).
The following table provides information about restarting REORG INDEX. For
each phase of REORG and for each type of REORG INDEX (with SHRLEVEL
NONE, with SHRLEVEL REFERENCE, and with SHRLEVEL CHANGE), the table
indicates the types of restart that are allowed (CURRENT and PHASE). None
indicates that no restart is allowed. The Data sets required column lists the data
sets that must exist to perform the specified type of restart in the specified phase.
Table 71. REORG INDEX utility restart information
Phase
Type of restart
allowed for
SHRLEVEL NONE
Type of restart
allowed for
SHRLEVEL
REFERENCE
Type of restart
allowed for
SHRLEVEL
CHANGE
UNLOAD
CURRENT, PHASE
SYSUT1
BUILD
CURRENT, PHASE
SYSUT1
LOG
SWITCH
None
Notes
None
originals and shadows
Note:
1. You can restart the utility with either RESTART or RESTART(PHASE). However, because this phase does not take
checkpoints, RESTART always re-executes from the beginning of the phase.
If you restart a REORG STATISTICS job that was stopped in the BUILD phase by
using RESTART CURRENT, inline statistics collection does not occur. To update
catalog statistics, run the RUNSTATS utility after the restarted job completes.
Restarting a REORG STATISTICS job with RESTART(PHASE) is conditional after
executing UNLOAD PAUSE. To determine if catalog table statistics are to be
updated when you restart a REORG STATISTICS job, see the following table. This
table lists whether or not statistics are updated based on the execution phase and
whether the job is restarted with RESTART(CURRENT) or RESTART(PHASE).
Table 72. Whether statistics are updated when REORG INDEX STATISTICS jobs are restarted in certain phases
Phase
RESTART CURRENT
RESTART PHASE
UTILINIT
No
Yes
UNLOAD
No
Yes
BUILD
No
Yes
Related concepts
Restart of an online utility on page 36
Related tasks
Restarting after the output data set is full on page 40
444
The following table summarizes the results of REORG INDEX based upon what
you specified.
Table 73. Summary of the results of REORG INDEX
Specification
Results
REORG INDEX
When reorganizing an index, REORG leaves free pages and free space on each
page in accordance with the current values of the FREEPAGE and PCTFREE
parameters. (You can set those values by using the CREATE INDEX or ALTER
INDEX statement.) REORG leaves one free page after reaching the FREEPAGE
limit for each table in the index space.
Catalog updates: REORG INDEX updates SYSINDEXPART OLDEST_VERSION
and SYSINDEXES OLDEST_VERSION (if applicable).
445
446
//STEP2
EXEC DSNUPROC,UID='HUHRU257.REORGI',TIME=1440,
//
UTPROC='',
//
SYSTEM='SSTR',DB2LEV=DB2A
//SYSIN
DD *
OPTIONS PREVIEW
TEMPLATE SREC
UNIT(SYSDA) DISP(NEW,CATLG,CATLG)
DSN(HUHRU257.REORG.&ST..SREC)
TEMPLATE SUT1
UNIT(SYSDA) DISP(NEW,DELETE,CATLG)
DSN(HUHRU257.REORG.&ST..SUT1)
TEMPLATE SOUT
UNIT(SYSDA) DISP(NEW,DELETE,CATLG)
DSN(HUHRU257.REORG.&ST..SOUT)
LISTDEF REORG_INDX INCLUDE INDEX ADMF001.IPHR5701
INCLUDE INDEX ADMF001.IXHR570*
OPTIONS OFF
REORG INDEX LIST REORG_INDX
PREFORMAT
SHRLEVEL CHANGE
DEADLINE 2010-2-4-23.10.12
MAXRO 100
WORKDDN (SUT1)
/*
Figure 71. Example statements for job that reorganizes a list of indexes
The following control statement specifies that REORG INDEX is to reorganize only
the specified index spaces that contain indexes on clone tables. The SHRLEVEL
CHANGE option indicates that during this processing, applications can read and
write to the area.
REORG INDEX ADMF001.IPJM0901 SHRLEVEL CHANGE CLONE
447
448
Output
If the table space or partition has the COMPRESS YES attribute, the data is
compressed when it is reloaded. If you specify the KEEPDICTIONARY option of
REORG, the current dictionary is used; otherwise a new dictionary is built.
You can execute the REORG TABLESPACE utility on the table spaces in the DB2
catalog database (DSNDB06) and on some table spaces in the directory database
(DSNDB01). It cannot be executed on any table space in the DSNDB07 database.
The following table summaries the results of REORG TABLESPACE according to
the type of REORG specified.
Table 74. Summary of REORG TABLESPACE output
Type of REORG specified
Results
REORG TABLESPACE
449
Results
Note: When SCOPE PENDING is also specified, the REORG TABLESPACE utility
reorganizes the specified table space only if it is in REORG-pending or advisory
REORG-pending status. For a partitioned table space, REORG TABLESPACE SCOPE
PENDING reorganizes only the partitions that are in REORG-pending or advisory
REORG-pending status.
Authorization required
To execute this utility on a user table space, you must use a privilege set that
includes one of the following authorities:
v REORG privilege for the database
v DBADM or DBCTRL authority for the database. If the object on which the utility
operates is in an implicitly created database, DBADM authority on the implicitly
created database or DSNDB04 is required.
v SYSCTRL authority
v SYSADM authority
To execute this utility on a table space in the catalog or directory, you must use a
privilege set that includes one of the following authorities:
v REORG privilege for the DSNDB06 (catalog) database
v DBADM or DBCTRL authority for the DSNDB06 (catalog) database
v Installation SYSOPR authority
v SYSCTRL authority
v SYSADM or Installation SYSADM authority
v STATS privilege for the database is required if STATISTICS keyword is specified.
If you specify REORG TABLESPACE SHRLEVEL CHANGE , you must create a
mapping table. You must use a privilege set that includes DELETE, INSERT, and
UPDATE privileges on the mapping table.
To run REORG TABLESPACE STATISTICS REPORT YES, you must use a privilege
set that includes the SELECT privilege on the catalog tables and tables for which
statistics are to be gathered.
An authority other than installation SYSADM or installation SYSOPR can receive
message DSNT500I resource unavailable, while trying to reorganize a table space
in the catalog or directory. This message can be issued when the
DSNDB06.SYSDBAUT or DSNDB06.SYSUSER catalog table space or one of the
indexes is unavailable. If this problem occurs, run the REORG TABLESPACE utility
again using an authorization ID with the installation SYSADM or installation
SYSOPR authority.
If you use RACF access control with multilevel security and REORG TABLESPACE
is to process a table space that contains a table that has multilevel security with
row-level granularity, you must be identified to RACF and have an accessible valid
security label. You must also meet the following authorization requirements: .
450
v For REORG statements that include the UNLOAD EXTERNAL option, each row
is unloaded only if your security label dominates the data security label. If your
security label does not dominate the data security label, the row is not unloaded,
but DB2 does not issue an error message.
v For REORG statements that include the DISCARD option, qualifying rows are
discarded only if one of the following situations is true:
Write-down rules are in effect, you have write-down privilege, and your
security label dominates the datas security label.
Write-down rules are not in effect and your security label dominates the
datas security label.
Your security label is equivalent to the data security label.
|
|
|
|
UNLOAD
Unloads the table space and sorts data if a clustering index exists and the
utility job includes either the SORTDATA or SHRLEVEL CHANGE options.
If you specify NOSYSREC, the utility passes rows in memory to the
RELOAD phase; otherwise, it writes them to a sequential data set. If PART
SHRLEVEL REFERENCE or PART SHRLEVEL CHANGE is specified,
during UNLOAD one or more subtasks unload nonpartitioned indexes and
build shadow nonpartitioned indexes.
RELOAD
Reloads data from the sequential data set into the table space and creates
full image copies if you specify COPYDDN, RECOVERYDDN, SHRLEVEL
REFERENCE, or SHRLEVEL CHANGE. A subtask sorts the index keys.
The utility also updates table and table space statistics.
SORT Sorts index keys. The sorted keys are passed in memory to the BUILD
phase.
BUILD
Builds indexes and updates index statistics.
SORTBLD
If parallel index build occurs, all activities that normally occur in both the
SORT and BUILD phases occur in the SORTBLD phase instead.
|
|
|
LOG
Processes the log iteratively and appends changed pages to the full image
copies. This phase occurs only if you specify SHRLEVEL CHANGE or
SHRLEVEL REFERENCE PART x.
SWITCH
Switches access to shadow copy of table space or partition. This phase
occurs only if you specify SHRLEVEL REFERENCE or CHANGE.
UTILTERM
Performs cleanup.
451
|
|
|
|
|
|
|
|
|
SWITCH
Switches access to shadow copy of table space or partition.
|
|
UTILTERM
Performs cleanup.
You cannot restart REORG TABLESPACE on a LOB table space in the REORGLOB
phase. Before executing REORG TABLESPACE SHRLEVEL NONE on a LOB table
space that is defined with LOG NO, you should take a full image copy to ensure
recoverability. For SHRLEVEL REFERENCE, an inline image copy is required to
ensure recoverability.
|
|
|
|
|
v UNLOAD
v STATISTICS
v SAMPLEinteger
v PART
v INDREFLIMIT
|
|
452
Syntax diagram
REORG
TABLESPACE
LIST
listdef-name
table-space-name
database-name.
CLONE
PART
SCOPE ALL
LOG
YES
LOG
NO
integer
integer1:integer2
SORTDATA
YES
NO
copy-spec
REUSE
SCOPE PENDING
REBALANCE
NOSYSREC
SHRLEVEL NONE
FASTSWITCH YES
SHRLEVEL
REFERENCE
deadline-spec
CHANGE
deadline-spec
drain-spec
drain-spec
table-change-spec
FASTSWITCH NO
10
10
OFFPOSLIMIT
INDREFLIMIT
integer
UNLOAD
integer
REPORTONLY
CONTINUE
PUNCHDDN
SYSPUNCH
PUNCHDDN
ddname
(1)
KEEPDICTIONARY
statistics-spec
UNLOAD PAUSE
UNLOAD ONLY
UNLOAD EXTERNAL
NOPAD
DISCARDDN
FROM-TABLE-spec
SYSDISC
DISCARDDN ddname
DISCARD
FROM-TABLE-spec
NOPAD
Notes:
1
copy-spec:
453
(1)
COPYDDN(SYSCOPY)
COPYDDN(
ddname1
RECOVERYDDN(ddname3
,ddname2
)
,ddname4
,ddname2
Notes:
1
COPYDDN(SYSCOPY) is not the default if you specify SHRLEVEL NONE and no partitions are
in REORG-pending status.
deadline-spec:
DEADLINE NONE
DEADLINE
timestamp
labeled-duration-expression
drain-spec:
(1)
(2)
(3)
DRAIN_WAIT
integer
RETRY integer
RETRY_DELAY
integer
(4)
MAXRO
DRAIN WRITERS
LONGLOG CONTINUE
DELAY 1200
DRAIN ALL
LONGLOG
DELAY
MAXRO
integer
DEFER
TERM
DRAIN
integer
TIMEOUT TERM
TIMEOUT ABEND
Notes:
|
The default for DRAIN_WAIT is the value of the IRLMRWT subsystem parameter.
The default for RETRY is the value of the UTIMOUT subsystem parameter.
|
|
The default for RETRY_DELAY is the smaller of the following two values: DRAIN_WAIT value
RETRY value, DRAIN_WAIT value 10
table-change-spec:
454
MAPPINGTABLE table-name
labeled-duration-expression:
CURRENT_DATE
CURRENT_TIMESTAMP
+
-
constant
YEAR
YEARS
MONTH
MONTHS
DAY
DAYS
HOUR
HOURS
MINUTE
MINUTES
SECOND
SECONDS
MICROSECOND
MICROSECONDS
statistics-spec:
STATISTICS
TABLE (
ALL
)
SAMPLE integer
COLUMN ALL
TABLE (
table-name )
SAMPLE integer
,
COLUMN ( column-name
INDEX (
ALL
REPORT NO
correlation-stats-spec
,
INDEX (
index-name
REPORT YES
correlation-stats-spec
UPDATE ALL
UPDATE
ACCESSPATH
SPACE
NONE
HISTORY
ALL
ACCESSPATH
SPACE
NONE
FORCEROLLUP
YES
NO
455
correlation-stats-spec:
FREQVAL NUMCOLS 1
COUNT 10
KEYCARD
FREQVAL NUMCOLS
integer
COUNT
integer
FROM-TABLE-spec:
FROM
TABLE
table-name
WHEN
selection-condition-spec
selection-condition-spec:
predicate
selection condition
AND
OR
predicate
selection condition
predicate:
basic predicate
BETWEEN predicate
IN predicate
LIKE predicate
NULL predicate
basic predicate:
456
(1)
=
<>
>
<
>=
<=
column-name
constant
labeled-duration-expression
Notes:
1
The following forms of the comparison operators are also supported in basic and quantified
predicates: !=, !<, and !>. For details, see comparison operators.
BETWEEN predicate:
column-name
BETWEEN
constant
labeled-duration-expression
NOT
AND
constant
labeled-duration-expression
IN predicate:
,
IN ( constant
column-name
NOT
LIKE predicate:
column-name
LIKE string-constant
NOT
ESCAPE
string-constant
NULL predicate:
column-name IS
NULL
NOT
457
UNLDDN SYSREC
UNLDDN
ddname
SORTDEVT device-type
SORTNUM
integer
PREFORMAT
Option descriptions
TABLESPACE database-name.table-space-name
Specifies the table space (and, optionally, the database to which it belongs) that
is to be reorganized.
If you reorganize a table space, its indexes are also reorganized.
database-name
Is the name of the database to which the table space belongs. The name
cannot be DSNDB07.
The default value is DSNDB04.
table-space-name
Is the name of the table space that is to be reorganized. The name cannot
be SYSUTILX if the specified database name is DSNDB01.
LIST listdef-name
Specifies the name of a previously defined LISTDEF list name. The utility
allows one LIST keyword for each control statement of REORG TABLESPACE.
The list must contain only table spaces.
Do not specify FROM TABLE, STATISTICS TABLE table-name, or STATISTICS
INDEX index-name with REORG TABLESPACE LIST. If you want to collect
inline statistics for a list of table spaces, specify STATISTICS TABLE (ALL). If
you want to collect inline statistics for a list of indexes, specify STATISTICS
INDEX (ALL). Do not specify PART with LIST.
REORG TABLESPACE is invoked once for each item in the list. This utility will
only process clone data if the CLONE keyword is specified. The use of
CLONED YES on the LISTDEF statement is not sufficient.
CLONE
Indicates that REORG TABLESPACE is to reorganize only clone tables from the
specified table spaces. This utility will only process clone data if the CLONE
keyword is specified. The use of CLONED YES on the LISTDEF statement is
not sufficient. Base tables in the specified table spaces are not reorganized. If
you specify CLONE, you cannot specify STATISTICS. Statistics are not
collected for clone tables.
|
|
|
|
|
|
|
REUSE
When used with SHRLEVEL NONE, specifies that REORG is to logically reset
and reuse DB2-managed data sets without deleting and redefining them. If you
do not specify REUSE and SHRLEVEL NONE, DB2 deletes and redefines
DB2-managed data sets to reset them.
If a data set has multiple extents, the extents are not released if you use the
REUSE parameter.
REUSE does not apply if you also specify SHRLEVEL REFERENCE or
CHANGE.
SCOPE
Indicates the scope of the reorganization of the specified table space or of one
or more specified partitions.
458
ALL
Indicates that you want the specified table space or one or more partitions
to be reorganized. The default is ALL.
PENDING
Indicates that you want the specified table space or one or more partitions
to be reorganized only if they are in REORG-pending (REORP or AREO*)
status.
PART integer
PART integer1:integer2
Identifies a partition range that is to be reorganized. You can reorganize a
single partition of a partitioned table space, or a range of partitions within a
partitioned table space. integer must be in the range from 1 to the number of
partitions that are defined for the table space or partitioning index. The
maximum is 4096.
integer
Designates a single partition.
integer1:integer2
Designates a range of existing table space partitions from integer1 through
integer2.integer2 must be greater than integer1.
If you omit the PART keyword, the entire table space is reorganized.
If you specify the PART keyword for a LOB table space, DB2 issues an error
message, and utility processing terminates with return code 8.
If you specify a partition range and the high or low partitions in the list are in
a REORG-pending state, the adjacent partition that is outside the specified
range must not be in REORG-pending state; otherwise, the utility terminates
with an error.
|
|
|
|
|
|
|
|
|
|
|
|
v
v
v
v
459
|
|
|
|
|
If the table space has the NOT LOGGED attribute, and SHRLEVEL NONE
is specified, DB2 does the LOAD with LOG NO.
NO
|
|
|
Specifies that records are not to be logged. This option puts the table space
in COPY-pending status if REORG is executed at the remote site, and
RECOVERYDDN is not specified.
|
|
You must specify LOG NO for REORG of a LOB table space if you specify
SHRLEVEL REFERENCE.
SORTDATA
YES
Specifies that the data is to be unloaded by a table space scan, and sorted
in clustering order.
The default value is SORTDATA YES unless you specify UNLOAD ONLY
or UNLOAD EXTERNAL. If you specify one of these options, the default
is SORTDATA NO.
NO
Specifies that the data is to be unloaded in the order of the clustering
index. SORTDATA NO cannot be specified with SHRLEVEL CHANGE.
Specify SORTDATA NO if one of the following conditions is true:
v The data is in or near perfect clustering order, and the REORG utility is
used to reclaim space from dropped tables.
460
|
|
461
NONE
Specifies that reorganization is to operate as follows:
v Unloading from the area that is being reorganized (while applications
can read but cannot write to the area)
v Reloading into that area (while applications have no access), and then
allowing read-write access again
If you specify NONE (explicitly or by default), you cannot specify the
following parameters:
v MAPPINGTABLE
v MAXRO
v LONGLOG
v DELAY
v DEADLINE
v DRAIN_WAIT
v RETRY
v RETRY_DELAY
REFERENCE
Specifies that reorganization is to operate as follows:
v Unloading from the area that is being reorganized (while applications
can read but cannot write to the area)
v Reloading into a shadow copy of that area (while applications can read
but cannot write to the original copy)
v Switching the future access of an application from the original copy to
the shadow copy by exchanging the names of the data sets, and then
allowing read-write access again
If you specify REFERENCE for a LOB table space, you must take an inline
copy during the reorganization.
|
|
To determine which data sets are required when you execute REORG
SHRLEVEL REFERENCE.
If you specify REFERENCE, you cannot specify the following parameters:
v LOG. Reorganization with REFERENCE always creates an image copy
and always refrains from logging records during reloading.
v UNLOAD. Reorganization with REFERENCE always performs
UNLOAD CONTINUE.
v MAPPINGTABLE.
Restriction: You cannot specify SHRLEVEL REFERENCE when REORG
TABLESPACE with PART is run on a NOT LOGGED table space on which
nonpartitioned indexes are defined.
CHANGE
Specifies that reorganization is to operate as follows:
v By unloading from the area that is being reorganized (while applications
can read and write to the area)
v Reloading into a shadow copy of that area (while applications have
read-write access to the original copy of the area)
v Applying the log of the original copy to the shadow copy (while
applications can read and usually write to the original copy)
462
|
|
Restrictions:
v You cannot specify SHRLEVEL CHANGE for a LOB table space, catalog,
or directory table space with links.
v You cannot specify SHRLEVEL CHANGE if the table space has the NOT
LOGGED attribute.
DEADLINE
Specifies the deadline for the SWITCH phase to begin. If DB2 estimates that
the SWITCH phase will not begin by the deadline, DB2 issues the messages
that the DISPLAY UTILITY command would issue and then terminates the
reorganization.
If REORG SHRLEVEL REFERENCE or SHRLEVEL CHANGE terminates
because of a DEADLINE specification, DB2 issues message DSNU374I with
reason code 2 but does not set a restrictive status.
NONE
Specifies that a deadline by which the SWITCH phase of log processing
must begin does not exist.
timestamp
Specifies the deadline for the SWITCH phase of log processing to begin.
This deadline must not have already occurred when REORG is executed.
|
|
|
labeled-duration-expression
Calculates the deadline for the SWITCH phase of log processing to begin.
The calculation is based on either CURRENT TIMESTAMP or CURRENT
DATE. You can add or subtract one or more constant value to specify the
deadline. This deadline must not have already occurred when REORG is
executed. CURRENT TIMESTAMP and CURRENT DATE are evaluated
once, when the REORG statement is first processed. If a list of objects is
specified, the same value will be in effect for all objects in the list.
CURRENT_DATE
Specifies that the deadline is to be calculated based on the CURRENT
DATE.
CURRENT_TIMESTAMP
Specifies that the deadline is to be calculated based on the CURRENT
TIMESTAMP.
constant
Indicates a unit of time and is followed by one of the seven duration
keywords: YEARS, MONTHS, DAYS, HOURS, MINUTES, SECONDS,
Chapter 25. REORG TABLESPACE
463
|
|
|
|
|
|
RETRY integer
Specifies the maximum number of retries that REORG is to attempt. Valid
values for integer are from 0 to 255.
Specifying RETRY can lead to increased processing costs and can result in
multiple or extended periods of read-only access. For example, when you
specify RETRY and SHRLEVEL CHANGE, the size of the copy that is taken by
REORG might increase.
The default value is the value of the UTIMOUT subsystem parameter.
RETRY_DELAY integer
Specifies the minimum duration, in seconds, between retries. Valid values
for integer are from 1 to 1800.
|
|
|
|
|
|
|
|
|
The actual execution time of the last iteration might exceed the specified value
for MAXRO.
The ALTER UTILITY command can change the value of MAXRO.
The default value is the RETRY_DELAY default value.
integer
integer is the number of seconds. Specifying a small positive value reduces
the length of the period of read-only access, but it might increase the
elapsed time for REORG to complete. If you specify a huge positive value,
the second iteration of log processing is probably the last iteration.
DEFER
Specifies that the iterations of log processing with read-write access can
464
|
|
DRAIN
Specifies drain behavior at the end of the log phase after the MAXRO
threshold is reached and when the last iteration of the log is to be applied.
DRAIN is a log phase parameter. If DRAIN is specified when a log phase is
not needed, an error message is issued.
WRITERS
Specifies the current default action, in which DB2 drains only the writers
during the log phase after the MAXRO threshold is reached and
subsequently issues DRAIN ALL on entering the switch phase.
ALL
Specifies that DB2 is to drain all readers and writers during the log phase,
after the MAXRO threshold is reached.
Consider specifying DRAIN ALL if the following conditions are both true:
v SQL update activity is high during the log phase.
v The default behavior results in a large number of -911 SQL error codes.
|
|
LONGLOG
Specifies the action that DB2 is to perform, after sending a message to the
console, if the number of records that the next iteration of logging is to process
is not sufficiently lower than the number that the previous iterations processed.
This situation means that the reading of the log by the REORG TABLESPACE
utility is not being done at the same time as the writing of the application
log.LONGLOG is a log phase parameter. If LONGLOG is specified when a log
phase is not needed, an error message is issued.
CONTINUE
Specifies that until the time on the JOB statement expires, DB2 is to
continue performing reorganization, including iterations of log processing,
if the estimated time to perform an iteration exceeds the time that is
specified for MAXRO.
A value of DEFER for MAXRO and a value of CONTINUE for LONGLOG
together mean that REORG is to continue allowing access to the original
copy of the area that is being reorganized and does not switch to the
shadow copy. The user can execute the ALTER UTILITY command with a
large value for MAXRO to initiate switching.
465
TERM
Specifies that DB2 is to terminate the reorganization after the delay that is
specified by the DELAY parameter.
DRAIN
Specifies that DB2 is to drain the write claim class after the delay that is
specified by the DELAY parameter. This action forces the final iteration of
log processing to occur. DRAIN is a log phase parameter. If DRAIN is
specified when a log phase is not needed, an error message is issued.
|
|
DELAY integer
Specifies the minimum interval between the time that REORG sends the
LONGLOG message to the console and the time that REORG performs the
action that is specified by the LONGLOG parameter. DELAY is a log phase
parameter. If DELAY is specified when a log phase is not needed, an error
message is issued.
|
|
|
|
|
|
|
|
YES
Enables the SWITCH phase to use the FASTSWITCH methodology. This
option is not allowed for the catalog (DSNDB06) or directory (DSNDB01).
|
|
NO
Causes the SWITCH phase to use IDCAMS RENAME.
OFFPOSLIMIT integer
Indicates that the specified value is to be compared to the value that DB2
calculates for the explicit clustering indexes of every table in the specified
partitions that are in SYSIBM.SYSINDEXPART. The calculation is computed as
follows:
(NEAROFFPOSF + FAROFFPOSF) 100 / CARDF
466
467
|
|
|
468
Although the LOAD utility processes records with variable-length columns that
were unloaded or discarded with the NOPAD option, these records cannot be
processed by applications that process only fields that are in fixed positions.
For the generated LOAD statement to provide a NULLIF condition for fields
that are not in a fixed position, DB2 generates an input field definition with a
name in the form of DSN_NULL_IND_nnnnn, where nnnnn is the number of
the associated column.
For example, the LOAD statement that is generated for the EMP sample table
looks similar to the LOAD statement that is in the following figure:
LOAD DATA INDDN SYSREC
LOG NO RESUME YES
EBCDIC CCSID(00500,00000,00000)
INTO TABLE "DSN8910 "."EMP
"
WHEN(00004:00005 = X'0012')
( "EMPNO
" POSITION(00007:00012) CHAR(006)
, "FIRSTNME
" POSITION(00013)
VARCHAR
, "MIDINIT
" POSITION(*)
CHAR(001)
, "LASTNAME
" POSITION(*)
VARCHAR
, DSN_NULL_IND_00005 POSITION(*)
CHAR(1)
, "WORKDEPT
" POSITION(*)
CHAR(003)
NULLIF(DSN_NULL_IND_00005)=X'FF'
, DSN_NULL_IND_00006 POSITION(*)
CHAR(1)
, "PHONENO
" POSITION(*)
CHAR(004)
NULLIF(DSN_NULL_IND_00006)=X'FF'
, DSN_NULL_IND_00007 POSITION(*)
CHAR(1)
, "HIREDATE
" POSITION(*)
DATE EXTERNAL
NULLIF(DSN_NULL_IND_00007)=X'FF'
, DSN_NULL_IND_00008 POSITION(*)
CHAR(1)
, "JOB
" POSITION(*)
CHAR(008)
NULLIF(DSN_NULL_IND_00008)=X'FF'
, DSN_NULL_IND_00009 POSITION(*)
CHAR(1)
, "EDLEVEL
" POSITION(*)
SMALLINT
NULLIF(DSN_NULL_IND_00009)=X'FF'
, DSN_NULL_IND_00010 POSITION(*)
CHAR(1)
, "SEX
" POSITION(*)
CHAR(001)
NULLIF(DSN_NULL_IND_00010)=X'FF'
, DSN_NULL_IND_00011 POSITION(*)
CHAR(1)
, "BIRTHDATE
" POSITION(*)
DATE EXTERNAL
NULLIF(DSN_NULL_IND_00011)=X'FF'
, DSN_NULL_IND_00012 POSITION(*)
CHAR(1)
, "SALARY
" POSITION(*)
DECIMAL
NULLIF(DSN_NULL_IND_00012)=X'FF'
, DSN_NULL_IND_00013 POSITION(*)
CHAR(1)
, "BONUS
" POSITION(*)
DECIMAL
NULLIF(DSN_NULL_IND_00013)=X'FF'
, DSN_NULL_IND_00014 POSITION(*)
CHAR(1)
, "COMM
" POSITION(*)
DECIMAL
NULLIF(DSN_NULL_IND_00014)=X'FF'
)
Figure 72. Sample LOAD statement generated by REORG TABLESPACE with the NOPAD
keyword
|
|
FROM TABLE
Specifies the tables that are to be reorganized. The table space that is specified
in REORG TABLESPACE can store more than one table. All tables that are
specified by FROM TABLE statements must be unique. All tables are unloaded
for UNLOAD EXTERNAL, and all tables might be subject to DISCARD. If you
specify UNLOAD EXTERNAL and want to limit which tables and rows are
469
unloaded, specify FROM TABLE with the WHEN option. If you specify
DISCARD, you must qualify the rows that you want to discard by specifying
FROM TABLE with the WHEN option.
Do not specify FROM TABLE with REORG TABLESPACE LIST.
table-name
Specifies the name of the table that is to be qualified by the following
WHEN clause. The table must be described in the catalog and must not be
a catalog table. If the table name is not qualified by a schema name, the
authorization ID of the person who invokes the utility job step is used as
the schema qualifier of the table name. Enclose the table name in quotation
marks if the name contains a blank.
|
|
|
|
|
|
WHEN
Indicates which records in the table space are to be unloaded (for UNLOAD
EXTERNAL) or discarded (for DISCARD). If you do not specify a WHEN
clause for a table in the table space, all of the records are unloaded (for
UNLOAD EXTERNAL), or none of the records is discarded (for DISCARD).
The option following WHEN describes the conditions for UNLOAD or
DISCARD of records from a table and must be enclosed in parentheses.
selection condition
Specifies a condition that is true, false, or unknown about a specific row.
When the condition is true, the row qualifies for UNLOAD or DISCARD.
When the condition is false or unknown, the row does not qualify.
A selection condition consists of at least one predicate and any logical
operators (AND, OR, NOT). The result of a selection condition is derived by
applying the specified logical operators to the result of each specified
predicate. If logical operators are not specified, the result of the selection
condition is the result of the specified predicate.
Selection conditions within parentheses are evaluated first. If the order of
evaluation is not specified by parentheses, AND is applied before OR.
If the control statement is in the same encoding scheme as the input data,
you can code character constants in the control statement. Otherwise, if the
control statement is not in the same encoding scheme as the input data,
you must code the condition with hexadecimal constants. If the target table
is ASCII, any character constants must be specified in hexadecimal. For
example, if the table space is in EBCDIC and the control statement is in
UTF-8, use (1:1)=XF1 in the condition rather than (1:1)=1.
|
|
|
|
|
|
|
470
column-name = constant
The column is equal to the constant or labeled duration
expression.
column-name < > constant
The column is not equal to the constant or labeled duration
expression.
column-name > constant
The column is greater than the constant or labeled duration
expression.
column-name < constant
The column is less than the constant or labeled duration
expression.
column-name > = constant
The column is greater than or equal to the constant or labeled
duration expression.
column-name < = constant
The column is less than or equal to the constant or labeled
duration expression.
Comparison operators: The following forms of the comparison
operators are also supported in basic and quantified predicates: !=, !<,
and !>, where ! means not. In addition, in code pages 437, 819, and
850, the forms =, <, and > are supported. All these product-specific
forms of the comparison operators are intended only to support
existing REORG statements that use these operators and are not
recommended for use in new REORG statements.
A not sign (), or the character that must be used in its place in certain
countries, can cause parsing errors in statements that are passed from
one DBMS to another. The problem occurs if the statement undergoes
character conversion with certain combinations of source and target
CCSIDs. To avoid this problem, substitute an equivalent operator for
any operator that includes a not sign. For example, substitute < > for
=, <= for >, and >= for <.
BETWEEN predicate
Indicates whether a given value lies between two other given values
that are specified in ascending order. Each of the predicates two forms
(BETWEEN and NOT BETWEEN) has an equivalent search condition,
as shown in the following table. If relevant, the table also shows any
equivalent predicates.
Table 75. BETWEEN predicates and their equivalent search conditions
Predicate
Equivalent predicate
None
For example, the following predicate is true for any row when salary is
greater than or equal to 10 000 and less than or equal to 20 000:
SALARY BETWEEN 10000 AND 20000
Chapter 25. REORG TABLESPACE
471
labeled-duration-expression
Specifies an expression that begins with the following special register
values:
v CURRENT DATE (CURRENT_DATE is acceptable.)
v CURRENT TIMESTAMP (CURRENT_TIMESTAMP is acceptable.)
Optionally, the expression contains the arithmetic operations of
addition or subtraction, expressed by a number followed by one of the
seven duration keywords:
v YEARS (or YEAR)
v MONTHS (or MONTH)
v DAYS (or DAY)
v HOURS (or HOUR)
v MINUTES (or MINUTE)
v SECONDS (or SECOND)
v MICROSECONDS (or MICROSECOND)
Utilities evaluate a labeled-duration-expression as a timestamp and
implicitly perform a conversion to a date if the comparison is with a
date column.
Incrementing and decrementing CURRENT DATE: The result of
adding a duration to a date, or of subtracting a duration from a date, is
itself a date. (For the purposes of this operation, a month denotes the
equivalent of a calendar page. Adding months to a date, then, is like
turning the pages of a calendar, starting with the page on which the
date appears.) The result must fall between the dates January 1, 0001
and December 31, 9999 inclusive.
The following table describes the effects of adding and subtracting
years, months, days, and other dates.
Table 76. Effects of adding durations to and subtracting durations from CURRENT DATE
Value that is added or
subtracted
Years
Months
Effect
Adding or subtracting a duration of years affects only the year
portion of the date. The month is unchanged, as is the day unless
the result would be February 29 of a non-leap-year. In this case,
the day portion of the result is set to 28.
Adding or subtracting a duration of months affects only months
and, if necessary, years. The day portion of the date is unchanged
unless that day does not exist in the resulting month. (September
31, for example). In this case the day is set to the last day of the
month.
Adding a month to a date gives the same day one month later
unless that day does not exist in the later month. In that case, the
day in the result is set to the last day of the later month. For
example, January 28 plus one month gives February 28; one
month added to January 29, 30, or 31 results in either February 28
or, for a leap year, February 29. If one or more months is added
to a given date and then the same number of months is
subtracted from the result, the final date is not necessarily the
same as the original date.
472
Table 76. Effects of adding durations to and subtracting durations from CURRENT
DATE (continued)
Value that is added or
subtracted
Effect
Days
Dates
The order in which labeled date durations are added to and subtracted
from dates can affect the results. When you add labeled date durations
to a date, specify them in the order of YEARS + MONTHS + DAYS.
When you subtract labeled date durations from a date, specify them in
the order of DAYS - MONTHS - YEARS. For example, to add one year
and one day to a date, specify the following code:
CURRENT DATE + 1 YEAR + 1 DAY
To subtract one year, one month, and one day from a date, specify the
following code:
CURRENT DATE - 1 DAY - 1 MONTH - 1 YEAR
For example, the following predicate is true for any row with an
employee in department D11, B01, or C01:
WORKDEPT IN ('D11', 'B01', 'C01')
LIKE predicate
Qualifies strings that have a certain pattern. Specify the pattern by
using a string in which the underscore and percent sign characters can
Chapter 25. REORG TABLESPACE
473
474
475
v If the data is being converted from basic row format to reordered row
format, REORG will build a new dictionary for the new format. DB2 ignores
the KEEPDICTIONARY option if the REORG utility changes the table space
from basic row format to reordered row format.
|
|
|
|
|
|
STATISTICS
Specifies that statistics for the table space or associated index, or both, are to be
gathered; the statistics are reported or stored in the DB2 catalog. If statistics are
collected with the default options, only the statistics for the table space are
updated.
If you specify a table space partition or a range of partitions along with the
STATISTICS keyword, DB2 collects statistics only for the specified table space
partitions. This option is valid for non-LOB table spaces only.
|
|
If you specify a base table space with the STATISTICS keyword, DB2 does not
gather statistics for the related XML table space or its indexes.
Restrictions:
v If you specify STATISTICS for encrypted data, DB2 might not provide useful
statistics on this data.
v You cannot specify STATISTICS if you specify the CLONE keyword.
TABLE
Specifies the table for which column information is to be gathered. All tables
must belong to the table space that is specified in the TABLESPACE option.
Do not specify STATISTICS TABLE table-name with REORG TABLESPACE LIST.
Instead, specify STATISTICS TABLE (ALL).
(ALL)
Specifies that information is to be gathered for all columns of all tables in
the table space.
(table-name)
Specifies the tables for which column information is to be gathered. If you
omit the qualifier, the user identifier for the utility job is used. Enclose the
table name in quotation marks if the name contains a blank.
If you specify more than one table, you must repeat the TABLE option.
Multiple TABLE options must be specified entirely before or after any
INDEX keyword that may also be specified. For example, the INDEX
keyword may not be specified between any two TABLE keywords.
476
SAMPLE integer
Indicates the percentage of rows to be sampled when collecting non-indexed
column statistics. You can specify any value from 1 through 100.
The default value is 25. The SAMPLE option is not allowed for LOB table
spaces.
COLUMN
Specifies columns for which column information is to be gathered.
You can specify this option only if you specify a particular table for which
statistics are to be gathered (TABLE (table-name)). If you specify particular
tables and do not specify the COLUMN option, the default, COLUMN(ALL), is
used. If you do not specify a particular table when using the TABLE option,
you cannot specify the COLUMN option; however, COLUMN(ALL) is
assumed.
(ALL)
Specifies that statistics are to be gathered for all columns in the table.
(column-name, ...)
Specifies the columns for which statistics are to be gathered.
You can specify a list of column names; the maximum is 10. If you specify
more than one column, separate each name with a comma.
INDEX
Specifies indexes for which information is to be gathered. Column information
is gathered for the first column of the index. All the indexes must be associated
with the same table space, which must be the table space that is specified in
the TABLESPACE option.
Do not specify STATISTICS INDEX index-name with REORG TABLESPACE
LIST. Instead, specify STATISTICS INDEX (ALL).
(ALL)
Specifies that the column information is to be gathered for all indexes that
are defined on tables that are contained in the table space.
(index-name)
Specifies the indexes for which information is to be gathered. Enclose the
index name in quotation marks if the name contains a blank.
KEYCARD
Indicates that all of the distinct values in all of the 1 to n key column
combinations for the specified indexes are to be collected. n is the number of
columns in the index.
FREQVAL
Specifies that frequent-value statistics are to be collected. If you specify
FREQVAL, you must also specify NUMCOLS and COUNT.
NUMCOLS
Indicates the number of key columns to concatenate together when you
collect frequent values from the specified index. Specifying 3 means that
DB2 is to collect frequent values on the concatenation of the first three key
columns.
The default value is 1, which means DB2 is to collect frequent values on
the first key column of the index.
477
COUNT
Indicates the number of frequent values that are to be collected. For
example, specifying 15 means that DB2 is to collect 15 frequent values from
the specified key columns.
The default value is 10.
REPORT
Specifies whether a set of messages is to be generated to report the collected
statistics.
NO
Indicates that the set of messages is not to be sent as output to SYSPRINT.
YES
Indicates that the set of messages is to be sent as output to SYSPRINT. The
generated messages are dependent on the combination of keywords (such
as TABLESPACE, INDEX, TABLE, and COLUMN) that are specified with
the RUNSTATS utility. However, these messages are not dependent on the
specification of the UPDATE option. REPORT YES always generates a
report of SPACE and ACCESSPATH statistics.
UPDATE
Indicates whether the collected statistics are to be inserted into the catalog
tables. UPDATE also allows you to select statistics that are used for access path
selection or statistics that are used by database administrators.
ALL
Indicates that all collected statistics are to be updated in the catalog.
ACCESSPATH
Indicates that only the catalog table columns that provide statistics that are
used for access path selection are to be updated.
SPACE
Indicates that only the catalog table columns that provide statistics to help
database administrators assess the status of a particular table space or
index are to be updated.
NONE
Indicates that no catalog tables are to be updated with the collected
statistics. This option is valid only when REPORT YES is specified.
HISTORY
Specifies that all catalog table inserts or updates to the catalog history tables
are to be recorded.
The default value is whatever value is specified in the STATISTICS HISTORY
field on panel DSNTIPO.
ALL
Indicates that all collected statistics are to be updated in the catalog history
tables.
ACCESSPATH
Indicates that only the catalog history table columns that provide statistics
that are used for access path selection are to be updated.
SPACE
Indicates that only space-related catalog statistics are to be updated in
catalog history tables.
478
NONE
Indicates that no catalog history tables are to be updated with the collected
statistics.
FORCEROLLUP
Specifies whether aggregation or rollup of statistics is to take place when
RUNSTATS is executed even if statistics have not been gathered on some
partitions; for example, partitions have not had any data loaded. Aggregate
statistics are used by the optimizer to select the best access path.
YES
Indicates that forced aggregation or rollup processing is to be done, even
though some partitions might not contain data.
NO
Indicates that aggregation or rollup is to be done only if data is available
for all partitions.
If data is not available for all partitions, DSNU623I message is issued if the
installation value for STATISTICS ROLLUP on panel DSNTIPO is set to NO.
PUNCHDDN ddname
Specifies the DD statement for a data set that is to receive the LOAD utility
control statements that are generated by REORG TABLESPACE UNLOAD
EXTERNAL or REORG TABLESPACE DISCARD FROM TABLE ... WHEN.
ddname is the DD name.
The default value is SYSPUNCH.
PUNCHDDN is required if the limit key of the last partition of a partitioned
table space has been reduced.
The PUNCHDDN keyword specifies either a DD name or a TEMPLATE name
specification from a previous TEMPLATE control statement. If utility
processing detects that the specified name is both a DD name in the current job
step and a TEMPLATE name, the utility uses the DD name.
DISCARDDN ddname
Specifies the DD statement for a discard data set, which contains copies of
records that meet the DISCARD FROM TABLE ... WHEN specification.
ddname is the DD name.
If you omit the DISCARDDN option, the utility saves discarded records only if
a SYSDISC DD statement is in the JCL input.
The default value is SYSDISC.
The DISCARDDN keyword specifies either a DD name or a TEMPLATE name
specification from a previous TEMPLATE control statement. If utility
processing detects that the specified name is both a DD name in the current job
step and a TEMPLATE name, the utility uses the DD name.
UNLDDN ddname
Specifies the name of the unload data set.
ddname is the DD name of the unload data set.
The default value is SYSREC.
The UNLDDN keyword specifies either a DD name or a TEMPLATE name
specification from a previous TEMPLATE control statement. If utility
479
processing detects that the specified name is both a DD name in the current job
step and a TEMPLATE name, the utility uses the DD name.
SORTDEVT device-type
Specifies the device type for temporary data sets that are to be dynamically
allocated by DFSORT.
device-type is the device type; it can be any disk device that is acceptable to the
DYNALLOC parameter of the SORT or OPTION control statement for
DFSORT.
|
|
|
If you omit SORTDEVT and require a sort of the index keys, you must provide
the DD statements that the sort program needs for the temporary data sets.
SORTDEVT is ignored for the catalog and directory table spaces that are listed
in Reorganizing the catalog and directory on page 502.
SORTDEVT cannot be used for LOB table spaces.
The utility does not allow a TEMPLATE specification to dynamically allocate
sort work data sets. The SORTDEVT keyword controls dynamic allocation of
these data sets.
SORTNUM integer
Specifies the number of temporary data sets that are to be dynamically
allocated for all sorts that REORG performs.
integer is the number of temporary data sets that can range from 2 to 255.
If you omit SORTDEVT, SORTNUM is ignored. If you use SORTDEVT and
omit SORTNUM, no value is passed to DFSORT. DFSORT uses its own default.
|
|
|
|
|
You need at least two sort work data sets for each sort. The SORTNUM value
applies to each sort invocation in the utility. For example, if there are three
indexes, SORTKEYS is specified, there are no constraints limiting parallelism,
and SORTNUM is specified as 8, then a total of 24 sort work data sets will be
allocated for a job.
|
|
|
|
Each sort work data set consumes both above the line and below the line
virtual storage,so if you specify too high a value for SORTNUM, the utility
may decrease the degree of parallelism due to virtual storage constraints, and
possibly decreasing the degree down to one, meaning no parallelism.
|
|
480
You cannot specify DISCARD for a base table with XML columns or for an
XML table space.
Related reference
Chapter 15, LISTDEF, on page 185
Chapter 31, TEMPLATE, on page 641
Related information
Compressing your data (DB2 Performance Monitoring and Tuning Guide)
Region size
|
|
|
The recommended minimum region size is 4096 KB. Region sizes greater than 32
MB enable increased parallelism for index builds. Data unload and reload
parallelism can also benefit from a greater region size value.
481
must be segmented and cannot be the table space to be reorganized. To create the
mapping table, use a CREATE TABLESPACE statement similar to the following
statement:
CREATE TABLESPACE table-space-name SEGSIZE integer
The number of rows in the mapping table should not exceed 110% of the number
of rows in the table space or partition that is to be reorganized. The mapping table
must have only the columns and the index that are created by the following SQL
statements:
CREATE TABLE table-name1
(TYPE
CHAR(1) NOT NULL,
SOURCE_RID CHAR(5) NOT NULL,
TARGET_XRID CHAR(9) NOT NULL,
LRSN
CHAR(6) NOT NULL);
CREATE UNIQUE INDEX index-name1 ON table-name1
(SOURCE_RID ASC, TYPE, TARGET_XRID, LRSN);
The REORG utility removes all rows from the mapping table when the utility
completes.
You must specify the TARGET_XRID column as CHAR(9), even though the RIDs
are 5 bytes long.
You must have DELETE, INSERT, and UPDATE authorization on the mapping
table.
You can run more than one REORG SHRLEVEL CHANGE job concurrently on
separate table spaces. You can also run also run more than one REORG SHRLEVEL
CHANGE job concurrently on different partitions of the same table space, but only
if the table space does not have any NPIs. When you run concurrently with other
jobs, each REORG job must have a separate mapping table. The mapping tables do
not need to reside in separate table spaces. If only one mapping table exists, the
REORG jobs must be scheduled to run serially. If more than one REORG job tries
to access the same mapping table at the same time, one of the REORG jobs fails.
|
|
|
|
|
|
|
|
482
CHECK-pending status
If a table space is in both REORG-pending and CHECK-pending status (or
auxiliary CHECK-pending status), run REORG first, and then run CHECK DATA
to clear the respective states. Otherwise, if a table space is not in REORG-pending
status, you cannot reorganize a table space or range of partitions if the table space
or any partition in the range is in CHECK-pending status until the
CHECK-pending status is removed.
REORG-pending status
You must allocate a discard data set (SYSDISC) or specify the DISCARDDN option
if the last partition of the table space is in REORG-pending status.
483
Recommendation:
Immediately following an ALTER INDEX operation that modifies key values,
create a new recovery point by taking one of the following actions:
v Run REORG and specify COPYDDN and SHRLEVEL NONE.
v Take a full image copy immediately after REORG completes.
If you performed a REORG to reset REORG-pending status (REORP), you should
also take an inline image copy or run the COPY utility. Image copies that are taken
prior to resetting the REORG-pending status cannot be used for recovery to the
current RBA or LRSN.
Successful REORG LOG NO processing inserts a row into SYSIBM.SYSCOPY with
ICTYPE=W for each index that was defined with COPY YES. REORG also places a
reorganized index in informational COPY-pending (ICOPY) status. You should take
a full image copy of the index after the REORG job completes to create a valid
point of recovery.
484
Table 78. Mapping of physical and logical partition numbers when a table space with three
partitions is created.
Logical partition number
Assume that you then try to execute a REORG TABLESPACE REBALANCE PART
1:2. This statement requests a reorganization and rebalancing of physical partitions
1 and 2. Note that physical partition 1 is logical partition 2, and physical partition
2 is logical partition 4. Thus, the utility is processing logical partitions 2 and 4. If
during the course of rebalancing, the utility needs to move keys from logical
partition 2 to logical partition 3, the job fails, because logical partition 3 is not
within the specified physical partition range.
485
|
|
|
|
|
|
|
If you run REORG against a table space, and that table space includes a table that
has an index with the following characteristics, REORG fails:
v The index was created on a VARBINARY column or a column with a distinct
type that is based on a VARBINARY data type.
v The index column has the DESC attribute.
|
|
To fix the problem, drop the index, or alter the column data type to BINARY, and
then rebuild the index
Related reference
CHECK-pending status on page 927
REBUILD-pending status on page 929
RECOVER-pending status on page 930
Related information
Job DSNTEJ1 (DB2 Installation Guide)
Data set
Description
Required?
|
|
SYSIN
Yes
SYSUT1
No
SYSPRINT
Yes
|
|
|
|
|
STPRIN01
No1
|
|
|
SYSDISC
No2
|
|
|
|
|
|
SYSPUNCH
No3
|
|
UTPRINT
Yes
486
Data set
Description
|
|
|
|
|
|
|
|
Yes4
Data set that contains the unloaded data
that is to be reloaded during the RELOAD
phase. Specify its DD or template name with
the UNLDDN option or with the RECDSN
field on the DB2I Utilities panel. The data
set must be a sequential data set that is
readable by BSAM. The default DD name is
SYSREC.
|
|
|
|
|
|
|
|
Required?
|
|
|
|
|
Copies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
No1, 8
|
|
Yes9
|
|
Yes9, 10
No6
487
Data set
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note:
1. Required when collecting inline statistics on at least one data-partitioned secondary
index.
2. Required if you specify DISCARDDN
3. Required you specify PUNCHDDN
4. Required unless NOSYSREC or SHRLEVEL CHANGE is specified.
5. Required if a partition is in REORG-pending status or REBALANCE, COPYDDN,
RECOVERYDDN, SHRLEVEL REFERENCE, or SHRLEVEL CHANGE is specified.
6. Required if NOSYSREC or SHRLEVEL CHANGE is specified, but SORTDEVT is not
specified.
7. Required if any indexes exist and SORTDEVT is not specified.
8. If the DYNALLOC parm of the SORT program is not turned on, you need to allocate
the data set. Otherwise, DFSORT dynamically allocates the temporary data set.
9. If you specify the SORTDEVT keyword, the data sets are dynamically allocated. It is
recommended that you use dynamic allocation by specifying SORTDEVT in the utility
statement because dynamic allocation reduces the maintenance required of the utility
job JCL.
10. If UTPRINT is allocated to SYSOUT, the data sets are dynamically allocated.
Description
Required?
The following objects are named in the utility control statement and do not require
DD statements in the JCL:
Table space
Object that is to be reorganized.
The maximum row length is the row length, including the 6-byte record prefix,
plus the length of the longest clustering key. If multiple tables exist in the table
space, use the following formula to determine the maximum row length:
|
|
For SHRLEVEL CHANGE, also add the result of the following formula to the
preceding result:
(21 * ((NEARINDREF + FARINDREF) * 1.1))
488
NEARINDREF
Is the value that is obtained from the NEARINDREF column of the
SYSIBM.SYSTABLEPART catalog table. The accuracy of the data set size
calculation depends on recent information in the SYSTABLEPART
catalog table.
FARINDREF
Is the value that is obtained from the FARINDREF column of the
SYSIBM.SYSTABLEPART catalog table.
3. If you have variable-length fields, the calculation in step 2 on page 488 might
result in excessive space. Use the average uncompressed row length, multiplied
by the number of rows.
4. If you use REORG with UNLOAD PAUSE or CONTINUE with the DISCARD
option, and the table has variable length fields, use the maximum row length in
the calculation. The DISCARD option without the NOPAD option pads the
variable length fields.
For certain table spaces in the catalog and directory, the unload data set for the
table spaces have a different format. The calculation for the size of this data set is
as follows:
data set size in bytes = (28 + longrow) * numrows
DB2 utilities use DFSORT to perform sorts. Sort work data sets cannot span
volumes. Smaller volumes require more sort work data sets to sort the same
amount of data; therefore, large volume sizes can reduce the number of needed
sort work data sets. When you allocate sort work data sets on disk, the
recommended amount of space to allow provides at least 1.2 times the amount of
data that is to be sorted. For more information about DFSORT, see DFSORT
Application Programming: Guide.
489
SYSOUT=A
Related concepts
Reorganizing the catalog and directory on page 502
C or D
dbname
Database name
490
psname
Table space name or index name
I or J
1 or 2
Lnnn
|
|
|
|
|
|
|
|
|
|
|
|
To determine the names of existing data sets, execute one of the following
queries against the SYSTABLEPART or SYSINDEXPART catalog tables:
SELECT DBNAME, TSNAME, IPREFIX
FROM SYSIBM.SYSTABLEPART
WHERE DBNAME = 'dbname'
AND TSNAME = 'psname';
SELECT DBNAME, IXNAME, IPREFIX
FROM SYSIBM.SYSINDEXES X, SYSIBM.SYSINDEXPART Y
WHERE X.NAME = Y.IXNAME
AND X.CREATOR = Y.IXCREATOR
AND X.DBNAME = 'dbname'
AND X.INDEXSPACE = 'psname';
|
For a partitioned table space, DB2 returns rows from which you select the row for
the partitions that you want to reorganize.
For example, assume that you have a ten-partition table space and you want to
determine a naming convention for the data set in order to successfully execute the
REORG utility with the SHRLEVEL CHANGE PART 2:6 options. The following
queries of the DB2 catalog tables SYSTABLEPART and SYSINDEXPART provide
the required information:
SELECT DBNAME, TSNAME, PARTITION, IPREFIX FROM SYSIBM.SYSTABLEPART
WHERE DBNAME = 'DBDV0701' AND TSNAME = 'TPDV0701'
ORDER BY PARTITION;
SELECT IXNAME, PARTITION, IPREFIX FROM SYSIBM.SYSINDEXPART
WHERE IXNAME = 'IXDV0701
ORDER BY PARTITION;
The preceding queries produce the information that is shown in the following
table.
The following table shows the results from the first query.
Table 83. Query results from the first preceding query
DBNAME
TSNAME
PARTITION
IPREFIX
DBDV0701
TPDV0701
DBDV0701
TPDV0701
DBDV0701
TPDV0701
DBDV0701
TPDV0701
491
Table 83. Query results from the first preceding query (continued)
DBNAME
TSNAME
PARTITION
IPREFIX
DBDV0701
TPDV0701
DBDV0701
TPDV0701
DBDV0701
TPDV0701
DBDV0701
TPDV0701
DBDV0701
TPDV0701
DBDV0701
TPDV0701
10
The following table shows the results from the second query.
Table 84. Query results from the second preceding query
IXNAME
PARTITION
IPREFIX
IXDV0701
10
IXDV0701
IXDV0701
IXDV0701
IXDV0701
IXDV0701
IXDV0701
IXDV0701
IXDV0701
IXDV0701
To execute REORG SHRLEVEL CHANGE PART 2:6, you need to preallocate the
following shadow objects. The naming convention for these objects use information
from the query results that are shown in the previous tables.
vcatnam.DSNDBC.DBDV0701.TPDV0701.J0001.A002
vcatnam.DSNDBC.DBDV0701.TPDV0701.I0001.A003
vcatnam.DSNDBC.DBDV0701.TPDV0701.J0001.A004
vcatnam.DSNDBC.DBDV0701.TPDV0701.I0001.A005
vcatnam.DSNDBC.DBDV0701.TPDV0701.I0001.A006
vcatnam.DSNDBC.DBDV0701.IXDV0701.J0001.A002
vcatnam.DSNDBC.DBDV0701.IXDV0701.I0001.A003
vcatnam.DSNDBC.DBDV0701.IXDV0701.J0001.A004
vcatnam.DSNDBC.DBDV0701.IXDV0701.I0001.A005
vcatnam.DSNDBC.DBDV0701.IXDV0701.I0001.A006
492
If you specify a secondary space quantity, DB2 does not use it. Instead, DB2 uses
the SECQTY value for the table space or index space.
Recommendation: Use the MODEL option, which causes the new shadow data set
to be created like the original data set. This method is shown in the following
example:
DEFINE CLUSTER +
(NAME('catname.DSNDBC.dbname.psname.x0001.L001') +
MODEL('catname.DSNDBC.dbname.psname.y0001.L001')) +
DATA
+
(NAME('catname.DSNDBD.dbname.psname.x0001.L001') +
MODEL('catname.DSNDBD.dbname.psname.y0001.L001') )
When you preallocate data sets for indexes, create the shadow data sets as follows:
v Create shadow data sets for the partition of the table space and the
corresponding partition in each partitioning index and data-partitioned
secondary index.
v Create a shadow data set for each nonpartitioned secondary index.
Use the same naming scheme for these index data sets as you use for other data
sets that are associated with the base index, except use J0001 instead of I0001. For
more information about this naming scheme, see the information about the shadow
data set naming convention at the beginning of this topic.
If you have not changed the value of FREEPAGE or PCTFREE, the amount of
required space for a shadow data set is comparable to the amount of required
space for the original data set.
DB2 treats individual data and index partitions, and individual logical partitions of
nonpartitioning indexes as distinct target objects. Utilities that operate on different
partitions of the same table space or index space are compatible. However, REORG
SHRLEVEL CHANGE or REFERENCE on a partition or range of partitions rebuild
493
|
|
|
|
|
|
|
|
|
Claims
For SHRLEVEL NONE, the following table shows which claim classes REORG
drains and any restrictive state that the utility sets on the target object. For each
column, the table indicates the claim or drain that is acquired and the restrictive
state that is set in the corresponding phase. UNLOAD CONTINUE and UNLOAD
PAUSE, unlike UNLOAD ONLY, include the RELOAD phase and thus include the
drains and restrictive states of that phase.
Table 85. Claim classes of REORG TABLESPACE SHRLEVEL NONE operations
UNLOAD phase of
REORG
Target
RELOAD phase of
REORG if UNLOAD
CONTINUE or
PAUSE
UNLOAD phase of
REORG PART
RELOAD phase of
REORG PART if
UNLOAD
CONTINUE or
PAUSE
DA/UTUT
DW/UTRO
DA/UTUT
DW/UTRO
DA/UTUT
DW/UTRO
DA/UTUT
DA/UTUT
None
DR
None
Logical partition of
nonpartitioning index3
None
DW/UTRO
DA/UTUT
Partitioning index,
data-partitioned
secondary index, or
partition of either
type of index1
494
Table 85. Claim classes of REORG TABLESPACE SHRLEVEL NONE operations (continued)
Target
UNLOAD phase of
REORG
RELOAD phase of
REORG if UNLOAD
CONTINUE or
PAUSE
UNLOAD phase of
REORG PART
RELOAD phase of
REORG PART if
UNLOAD
CONTINUE or
PAUSE
Legend:
v DA: Drain all claim classes, no concurrent SQL access.
v DR: Drain the repeatable read class, no concurrent access for SQL repeatable readers.
v DW: Drain the write claim class, concurrent access for SQL readers.
v UTUT: Utility restrictive state, exclusive control.
v UTRO: Utility restrictive state, read-only access allowed.
v None: Any claim, drain, or restrictive state for this object does not change in this phase.
Note:
|
|
|
1. Includes document ID indexes and node ID indexes over partitioned XML table spaces.
2. Includes document ID indexes and node ID indexes over nonpartitioned XML table spaces and XML indexes.
3. Includes logical partitions of an XML index over partitioned XML table spaces.
For SHRLEVEL REFERENCE, the following table shows which claim classes
REORG drains and any restrictive state that the utility sets on the target object. For
each column, the table indicates the claim or drain that is acquired and the
restrictive state that is set in the corresponding phase.
Table 86. Claim classes of REORG TABLESPACE SHRLEVEL REFERENCE operations
UNLOAD phase of
REORG
SWITCH phase of
REORG
UNLOAD phase of
REORG PART
SWITCH phase of
REORG PART
Table space or
partition of table
space
DW/UTRO
DA/UTUT
DW/UTRO
DA/UTUT
Partitioning index,
data-partitioned
secondary index, or
partition of either1
DW/UTRO
DA/UTUT
DW/UTRO
DA/UTUT
DW/UTRO
DA/UTUT
CR/UTRW
DA/UTUT
None
DW/UTRO
DA/UTUT
Target
| Nonpartitioned
secondary index2
None
Logical partition of
nonpartitioning index3
Legend:
v DA: Drain all claim classes, no concurrent SQL access.
v DDR: Dedrain the read claim class, concurrent SQL access.
v DR: Drain the repeatable read class, no concurrent access for SQL repeatable readers.
v DW: Drain the write claim class, concurrent access for SQL readers.
v UTUT: Utility restrictive state, exclusive control.
v UTRO: Utility restrictive state, read-only access allowed.
v None: Any claim, drain, or restrictive state for this object does not change in this phase.
Note:
| 1. Includes document ID indexes and node ID indexes over partitioned XML table spaces.
| 2. Includes document ID indexes and node ID indexes over nonpartitioned XML table spaces and XML indexes.
| 3. Includes logical partitions of an XML index over partitioned XML table spaces.
495
For REORG of an entire table space with SHRLEVEL CHANGE, the following
table shows which claim classes REORG drains and any restrictive state that the
utility sets on the target object.
Table 87. Claim classes of REORG TABLESPACE SHRLEVEL CHANGE operations
Target
SWITCH phase
CR/UTRW
DW/UTRO
DA/UTUT
CR/UTRW
DW/UTRO
DA/UTUT
UNLOAD phase
Table space
Index
Legend:
v CR: Claim the read claim class.
v DA: Claim all claim classes, no concurrent SQL access.
v DW: Drain the write claim class, concurrent access for SQL readers.
v UTUT: Utility restrictive state, exclusive control.
v UTRO: Utility restrictive state, read-only access allowed.
v UTRW: Utility restrictive state, read-write access allowed.
For REORG of a partition with SHRLEVEL CHANGE, the following table shows
which claim classes REORG drains and any restrictive state that the utility sets on
the target object.
Table 88. Claim classes of REORG TABLESPACE SHRLEVEL CHANGE operations on a partition
Target
UNLOAD phase
CR/UTRW
DA/UTUT
DA/UTUT
Partition of partitioning
index1
CR/UTRW
DW/UTRO or DA/UTUT
Nonpartitioning index2
None
None
Logical partition of
nonpartitioning index3
CR/UTRW
SWITCH phase
4
DW/UTRO or DA/UTUT
DR
4
DA/UTUT
Legend:
v CR: Claim the read claim class.
v DA: Drain all claim classes, no concurrent SQL access.
v DDR: Dedrain the read claim class, no concurrent access for SQL repeatable readers.
v DR: Drain the repeatable read class, no concurrent access for SQL repeatable readers.
v DW: Drain the write claim class, concurrent access for SQL readers.
v UTUT: Utility restrictive state, exclusive control.
v UTRO: Utility restrictive state, read-only access allowed.
v UTRW: Utility restrictive state, read-write access allowed.
v None: Any claim, drain, or restrictive state for this object does not change in this phase.
Note:
|
|
|
|
1. Includes document ID indexes and node ID indexes over partitioned XML table spaces.
2. Includes document ID indexes and node ID indexes over nonpartitioned XML table spaces and XML indexes.
3. Includes logical partitions of an XML index over partitioned XML table spaces.
4. DA/UTUT applies if you specify DRAIN ALL.
Compatibility
The following table shows which utilities can run concurrently with REORG on the
same target object. The target object can be a table space, an index space, or a
partition of a table space or index space. If compatibility depends on particular
options of a utility, that information is also shown.
496
Action
REORG SHRLEVEL
NONE UNLOAD
CONTINUE or PAUSE,
REORG SHRLEVEL
REFERENCE, or
REORG SHRLEVEL
CHANGE
REORG SHRLEVEL
REORG SHRLEVEL
NONE UNLOAD ONLY NONE UNLOAD ONLY
without clustering index with clustering index
CATMAINT
No
No
No
CHECK DATA
No
No
No
CHECK INDEX
No
Yes
Yes
CHECK LOB
No
No
No
COPY INDEXSPACE
No
Yes
Yes
COPY TABLESPACE
No
Yes
Yes
DIAGNOSE
Yes
Yes
Yes
LOAD
No
No
No
MERGECOPY
No
No
No
MODIFY
No
No
No
QUIESCE
No
Yes
Yes
REBUILD INDEX
No
Yes
No
RECOVER INDEX
No
Yes
No
RECOVER INDEXSPACE
No
No
No
RECOVER TABLESPACE
No
No
No
REORG INDEX
No
Yes
No
No
No
No
No
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
No
No
No
No
REPORT
Yes
Yes
Yes
RUNSTATS
No
Yes
Yes
STOSPACE
No
Yes
Yes
UNLOAD
No
Yes
Yes
The following table shows which DB2 operations can be affected when
reorganizing catalog table spaces.
497
Table 90. DB2 operations that are affected by reorganizing catalog table spaces
Catalog table space
Utilities
Recommendation: Run RUNSTATS if the statistics are not current. If you have an
object that should also be reorganized, run REORG with STATISTICS and take
inline copies. If you run REORG PART and nonpartitioning indexes exist,
subsequently run RUNSTATS for each nonpartitioning index.
To determine when an object requires reorganization:
v Run the REORG TABLESPACE utility and specify the OFFPOSLIMIT and
INDREFLIMIT catalog query options with the REPORTONLY option. REORG
produces a report with one of the following return codes; but a REORG is not
performed.
1
No limit met; no REORG is performed or recommended.
2
REORG is performed or recommended.
v Alternatively, use the SYSTABLEPART and SYSINDEXPART catalog tables to
find which table spaces and indexes qualify for reorganization. The information
in these catalog tables can also be used to determine when the DB2 catalog table
spaces require reorganization. For catalog table spaces SYSDBASE, SYSVIEWS,
and SYSPLAN, you should not use the value for columns FAROFFPOSF and
NEAROFFPOSF of SYSINDEXPART to determine whether to reorganize.
Information from the SYSTABLEPART catalog table can also tell you how well
disk space is being used. If you want to find the number of varying-length rows
that were relocated to other pages because of an update, run RUNSTATS, and
then issue the following statement:
SELECT CARD, NEARINDREF, FARINDREF
FROM SYSIBM.SYSTABLEPART
WHERE DBNAME = 'XXX'
AND TSNAME = 'YYY';
v Reorganize table spaces or partitions that are in REORG-pending status. Use the
DISPLAY DATABASE RESTRICT command to display those table spaces and
partitions that require reorganization.
v A large number (relative to previous values that you have received) for
FARINDREF indicates that I/O activity on the table space is high. If you find
that this number increases over a period of time, you probably need to
498
Issue the following statement to determine whether the rows of a table are
stored in the same order as the entries of its clustering index:
SELECT NEAROFFPOSF, FAROFFPOSF
FROM SYSIBM.SYSINDEXPART
WHERE IXCREATOR = 'index_creator_name'
AND IXNAME = 'index_name';
v Several indicators are available to signal a time for reorganizing table spaces. A
large value for FAROFFPOSF might indicate that clustering is deteriorating. In
this case, reorganize the table space to improve query performance.
A large value for NEAROFFPOSF might indicate also that reorganization might
improve performance. However, in general NEAROFFPOSF is not as critical a
factor as FAROFFPOSF.
FAROFFPOSF and NEAROFFPOSF do not have query performance
considerations for the following DB2 catalog tables:
DSNDB06.SYSDBASE
DSNDB06.SYSDBAUT
DSNDB06.SYSGROUP
DSNDB06.SYSPLAN
DSNDB06.SYSVIEWS
For any table, the REORG utility repositions rows into the sequence of the key of
the clustering index that is defined on that table.
For nonclustering indexes, the statistical information that is recorded by
RUNSTATS in SYSINDEXES and SYSINDEXPART might appear even worse after
the clustering index is used to reorganize the data. This applies only to the
CLUSTERING and CLUSTERED columns in SYSINDEXES and to the
NEAROFFPOS and FAROFFPOS columns in SYSINDEXPART.
499
PART jobs.) For nonpartitioned secondary indexes, the option corrects the
indexes. Using REORG SHRLEVEL NONE is the only access level that resets
REORG-pending status.
v REORG with SHRLEVEL REFERENCE reloads the reorganized data into a new
(shadow) copy of the area that is being reorganized. Near the end of
reorganization, DB2 switches the future access of the application from the
original data to the shadow copy. For SHRLEVEL REFERENCE, applications
have read-only access during unloading and reloading, and a brief period of no
access during switching.
v REORG with SHRLEVEL CHANGE reloads the reorganized data into a shadow
copy of the area that is being reorganized. For REORG TABLESPACE
SHRLEVEL CHANGE, a mapping table correlates RIDs in the original copy of
the table space or partition with RIDs in the shadow copy. Applications can read
from and write to the original area, and DB2 records the writing in the log. DB2
then reads the log and applies it to the shadow copy to bring the shadow copy
up to date. This step executes iteratively, with each iteration processing a
sequence of log records. Near the end of reorganization, DB2 switches the future
access of the application from the original data to the shadow copy. Applications
have read-write access during unloading and reloading, a brief period of
read-only access during the last iteration of log processing, and a brief period of
no access during switching.
Operator actions
LONGLOG specifies the action that DB2 performs if the pace of processing log
records between iterations is slow. If no action is taken after message DSNU377I is
sent to the console, the LONGLOG option automatically goes into effect. Some
examples of possible actions that you can take:
v Execute the START DATABASE(database) SPACENAM(tablespace) ... ACCESS(RO)
command and the QUIESCE utility to drain the write claim class. DB2 performs
the last iteration, if MAXRO is not DEFER. After the QUIESCE, you should also
execute the ALTER UTILITY command, even if you do not change any REORG
parameters.
500
501
502
DSNDB06.SYSDBASE
DSNDB01.DBD01
DSNDB06.SYSPLAN
DSNDB01.SCT02
DSNDB06.SYSPKAGE
DSNDB01.SPT01
503
DSNDB06.SYSDBASE
DSNDB06.SYSDBAUT
DSNDB06.SYSGROUP
DSNDB06.SYSPLAN
DSNDB06.SYSVIEWS
DSNDB01.DBD01
504
If you specify UNLOAD PAUSE, REORG pauses after unloading the table space
into the unload data set. You cannot use NOSYSREC and PAUSE. The job
completes with return code 4. You can restart REORG by using the phase restart or
current restart. Do not alter the REORG statement.
The REORG utility remains in stopped status until REORG is restarted or
terminated.
While REORG is interrupted by PAUSE, you can redefine the table space attributes
for user-defined table spaces. PAUSE is not required for STOGROUP-defined table
spaces. Attribute changes are done automatically by a REORG following an ALTER
TABLESPACE.
505
You can reorganize a range of partitions, even if the partitions are not in
REORG-pending status. If you specify the STATISTICS keyword, REORG collects
data about the specified range of partitions.
If you perform a REORG on partitions that are in the REORG-pending status, be
aware that:
v You must specify SHRLEVEL NONE if the object is in REORG-pending status.
Otherwise, REORG terminates and issues message DSNU273I and return code 8.
v REORG ignores the KEEPDICTIONARY option for any partition that is in
REORG-pending status; REORG automatically rebuilds the dictionaries for the
affected partitions. However, if you specify a range of partitions that includes
some partitions that are not in REORG-pending restrictive status, REORG honors
the KEEPDICTIONARY option for those nonrestricted partitions.
v If any partition is in REORG-pending status when REORG executes, DB2 writes
a SYSCOPY record with STYPE=A for each partition that is specified on the
REORG job.
v If you take an inline image copy of a range of partitions, DB2 writes one
SYSCOPY record with ICTYPE=F for each partition, and each record has the
same data set name.
v Specify the DISCARDDN and PUNCHDDN data sets for a table space that is
defined as LARGE or DSSIZE, but has had the limit key for the last partition of
the table space reduced by a subsequent ALTER INDEX statement. Otherwise,
REORG terminates and issues message DSNU035I and return code 8.
You cannot reorganize a subset of a range of partitions that are in REORG-pending
status; you must reorganize the entire range to reset the restrictive status.
506
CREATE TABLESPACE TS IN DB
USING STOGROUP SG
NUMPARTS 4 BUFFERPOOL BP0;
CREATE TABLE TB (C01 CHAR(5) NOT NULL,
C02 CHAR(5) NOT NULL,
C03 CHAR(5) NOT NULL)
IN DB.TS
PARTITION BY (C01)
(PART 1 VALUES ('00001'),
PART 2 VALUES ('00002'),
PART 3 VALUES ('00003'),
PART 4 VALUES ('00004'));
CREATE INDEX IX ON TB(C02) CLUSTER;
To rebalance the data across the four partitions, use the following REORG
TABLESPACE control statement:
REORG TABLESPACE DB.TS REBALANCE
After the preceding utility job completes, the table space is placed in AREO* status
to indicate that a subsequent reorganization is recommended to ensure that the
rows are in clustering order. For this subsequent reorganization, use the following
REORG TABLESPACE control statement:
REORG TABLESPACE DB.TS
|
|
The REORG utility attempts to unload and reload partitions in parallel in some
situations and does not attempt to unload and reload in other situations.
|
|
|
|
|
|
REORG attempts to unload and reload table space partitions in parallel in the
following situations:
v If you specify the NOSYSREC keyword.
v If the NOSYSREC keyword is defaulted like it is for SHRLEVEL CHANGE
v If you specify the UNLDDN keyword with a template name, where the
templates data set name pattern includes a partition number.
|
|
|
REORG does not attempt to unload and reload table space partitions in parallel in
the following situations:
v If the DATAWKnn DD statements are coded in the JCL.
|
|
|
|
507
To create an inline copy, use the COPYDDN and RECOVERYDDN keywords. You
can specify up to two primary copies and two secondary copies. Inline copies are
produced during the RELOAD phase of REORG processing.
The SYSCOPY record that is produced by an inline copy contains ICTYPE=F,
SHRLEVEL=R. The STYPE column contains an X if the image copy was produced
by REORG TABLESPACE LOG(YES), and a W if the image copy was produced by
REORG TABLESPACE LOG(NO). The data set that is produced by the inline copy
is logically equivalent to a full image copy with SHRLEVEL REFERENCE, but the
data within the data set differs in some respects:
v Data pages might be out of sequence and some might be repeated. If pages are
repeated, the last one is always the correct copy.
v Space map pages are out of sequence and might be repeated
The total number of duplicate pages is small, with a negligible effect on the
amount of space that is required for the data set. One exception to this guideline is
the case of running REORG SHRLEVEL CHANGE, in which the number of
duplicate pages varies with the number of records that are applied during the LOG
phase.
|
|
|
|
|
|
|
|
Use inline copy and inline statistics instead of running separate COPY and
RUNSTATS utilities.
508
v Schedule REORG with SHRLEVEL CHANGE when the rate of writing is low
and transactions are short. Avoid scheduling REORG with SHRLEVEL CHANGE
when critical applications are executing.
Under certain circumstances, the log records that REORG SHRLEVEL CHANGE
uses contain additional information, as if DATA CAPTURE CHANGES were
used. Generation of the additional information can slow applications and
increase consumption of log space. The additional information is generated for
all the tables in the table space if at least one table satisfies all these conditions:
The table has undergone ALTER TABLE ADD column.
The table does not use DATA CAPTURE CHANGES.
One of these conditions is true:
- The area that is being reorganized uses data compression.
- The area is a partitioned table space, and at least one partition uses data
compression.
v Run REORG with DRAIN_WAIT.
The DRAIN_WAIT option gives you greater control over the time that online
REORG is to wait for drains. Also because the DRAIN_WAIT is the aggregate
time that online REORG is to wait to perform a drain on a table space and
associated indexes, the length of drains is more predictable than if each partition
and index has its own individual waiting time limit.
By specifying a short delay time (less than the system timeout value,
IRLMRWT), you can reduce the impact on applications by reducing time-outs.
You can use the RETRY option to give the online REORG more chances to
complete successfully. If you do not want to use RETRY processing, you can still
use DRAIN_WAIT to set a specific and more consistent limit on the length of
drains.
RETRY allows an online REORG that is unable to drain the objects that it
requires so that DB2 can try again after a set period (RETRY_DELAY). During
the RETRY_DELAY period, all the objects are available for read-write access in
the case of SHRLEVEL CHANGE. For SHRLEVEL REFERENCE, the objects
remain with the access that existed prior to the attempted drain (that is if the
drain fails in the UNLOAD phase the object remains in read-write access; if the
drain fails in the SWITCH phase, objects remain in read-only access).
Because application SQL statements can queue behind any unsuccessful drain
that the online REORG has tried, define a reasonable delay before you retry to
allow this work to complete; the default is 5 minutes.
When you specify DRAIN WRITERS (the default) with SHRLEVEL CHANGE
and RETRY, multiple read-only log iterations can occur. Generally, online
REORG might need to do more work when RETRY is specified, and this might
result in multiple or extended periods of restricted access. Applications that run
alongside online REORG need to perform frequent commits. During the interval
between retries, the utility is still active, and consequently other utility activity
against the table space and indexes is restricted.
509
The following figure shows the flow of a REORG TABLESPACE job that uses a
parallel index build. DB2 starts multiple subtasks to sort index keys and build
indexes in parallel. If you specify STATISTICS, additional subtasks collect the
sorted keys and update the catalog table in parallel, eliminating the need for a
second scan of the index by a separate RUNSTATS job.
Figure 73. How indexes are built during a parallel index build
REORG TABLESPACE uses parallel index build if more than one index needs to be
built (including the mapping index for SHRLEVEL CHANGE). You can either let
the utility dynamically allocate the data sets that SORT needs for this parallel
index build or provide the necessary data sets yourself.
Select one of the following methods to allocate sort work and message data sets:
Method 1:
REORG TABLESPACE determines the optimal number of sort work data sets and
message data sets.
1. Specify the SORTDEVT keyword in the utility statement.
2. Allow dynamic allocation of sort work data sets by not supplying SORTWKnn
DD statements in the REORG TABLESPACE utility JCL.
3. Allocate UTPRINT to SYSOUT.
Method 2:
Control allocation of sort work data sets, while REORG TABLESPACE allocates
message data sets.
1. Provide DD statements with DD names in the form SWnnWKmm.
2. Allocate UTPRINT to SYSOUT.
Method 3:
Exercise the most control over rebuild processing; specify both sort work data sets
and message data sets.
1. Provide DD statements with DD names in the form SWnnWKmm.
2. Provide DD statements with DD names in the form UTPRINnn.
510
511
During parallel index build processing, REORG distributes all indexes among the
subtask pairs according to the index creation date, assigning the first created index
to the first subtask pair. For SHRLEVEL CHANGE, the mapping index is assigned
last.
A value as follows:
v 10 if the indexes that are rebuilt are a mix of data-partitioned secondary
indexes and nonpartitioned indexes
v 8 if all indexes are partitioned or none of them are data-partitioned
secondary indexes.
512
v Clustering index: DB2 uses this option for simple table spaces that contain one
table and have an index, and for tables in a segmented table space that have an
index.
When you reorganize an entire partition-by-growth table space that does not
contain LOB columns, the REORG TABLESPACE utility condenses the data into
the minimum number of required partitions.
|
|
|
|
|
Because the REORG TABLESPACE utility cannot reclaim physical space, the excess
partition will be empty. If the data needs additional space, the REORG
TABLESPACE utility triggers the process to add additional partitions if the
maximum number of partitions has not been reached. If the maximum number of
partitions has been reached, the REORG TABLESPACE utility fails.
|
|
|
|
|
|
|
|
513
When you reorganize a partition-by-growth table space at the partition level, the
REORG TABLESPACE utility minimizes partitions by eliminating existing holes.
If there is a compression dictionary, the compression dictionary is copied to all
partitions even if the partition is empty.
|
|
LOG YES
No pending status
514
LOG YES
Table 92. LOAD LOG and REORG LOG impact for a LOB table space (continued)
LOAD LOG/ REORG LOB table space LOG
LOG keyword
attribute
What is logged
LOG YES
LOG NO
Control information
No pending status
LOG NO
LOG YES
Nothing
COPY-Pending1
LOG NO
LOG NO
Nothing
COPY-Pending1
Note:
1. REORG LOG NO of a LOB table space requires SHRLEVEL REFERENCE, which requires that an inline copy be
taken during the REORG. This means that you never set COPY-pending for REORG of LOB table spaces under
any circumstances
|
|
|
For SHRLEVEL REFERENCE, LOBs are unloaded to a shadow data set and
physical space is reclaimed. If you specify SHRLEVEL REFERENCE, LOG NO and
an inline image copy are required and no updates are logged during the REORG.
515
utility during the SWITCH phase with the TERM UTILITY command, during the
rename process, the renaming occurs, and the SWITCH phase completes. The
image copy that REORG created is available for use by the RECOVER utility.
The REORG-pending status is not reset until the UTILTERM execution phase. If the
REORG utility abnormally terminates or is terminated, the objects remain in
REORG-pending status and RECOVER-pending status, depending on the phase in
which the failure occurred.
The following table lists the restrictive states that REORG TABLESPACE sets
according to the phase in which the utility terminated.
Table 93. Restrictive states that REORG TABLESPACE sets.
Phase
UNLOAD
No effect.
RELOAD
SHRLEVEL NONE:
v Places table space in RECOVER-pending status at the beginning of the
phase and resets the status at the end of the phase.
v Places indexes in RECOVER-pending status.
v Places the table space in COPY-pending status. If COPYDDN is
specified and SORTKEYS is ignored, the COPY-pending status is reset
at the end of the phase. SORTKEYS is ignored for several catalog and
directory table spaces
SHRLEVEL REFERENCE or CHANGE has no effect.
SORT
No effect.
BUILD
SORTBLD
No effect during the sort portion of the SORTBLD phase. During the
build portion of the SORTBLD phase, the effect is the same as for the
BUILD phase.
LOG
No effect.
SWITCH
516
Related concepts
Termination of an online utility with the TERM UTILITY command on page 36
Reorganizing the catalog and directory on page 502
Related reference
Appendix C, Advisory or restrictive states, on page 925
|
|
|
517
Table 94. REORG TABLESPACE utility restart information for SHRLEVEL NONE, REFERENCE, and CHANGE
Type of
restart
allowed for
SHRLEVEL
NONE
Type of
restart
allowed for
SHRLEVEL
REFERENCE
Type of
restart
allowed for
SHRLEVEL
CHANGE
UNLOAD
CURRENT,
PHASE
CURRENT,
PHASE6
None
SYSREC
RELOAD
CURRENT,
PHASE
CURRENT,
PHASE6
None
SYSREC
1, 2
SORT
CURRENT,
PHASE
CURRENT,
PHASE6
None
None
2, 3
BUILD
CURRENT,
PHASE
CURRENT,
PHASE6
None
None
2, 3, 4
SORTBLD
CURRENT,
PHASE
CURRENT,
PHASE6
None
None
LOG
Phase does
not occur
Phase does
not occur6
None
None
SWITCH
Phase does
not occur
CURRENT,
PHASE
CURRENT,
PHASE
Phase
|
|
|
|
|
|
|
|
|
|
Notes
3, 5
Note:
1. For None, if you specify NOSYSREC, restart is not possible, and you must execute the RECOVER TABLESPACE
utility for the table space or partition. For REFERENCE, if the REORG job includes both SORTDATA and
NOSYSREC, RESTART or RESTART(PHASE) restarts at the beginning of the UNLOAD phase.
2. If you specify SHRLEVEL NONE or SHRLEVEL REFERENCE, and the job includes the SORTKEYS option, use
RESTART or RESTART(PHASE) to restart at the beginning of the RELOAD phase.
3. You can restart the utility with RESTART or RESTART(PHASE). However, because this phase does not take
checkpoints, RESTART restarts from the beginning of the phase.
4. If you specify the PART option with REORG TABLESPACE, you cannot restart the utility at the beginning of the
BUILD phase if any nonpartitioning index is in a page set REBUILD-pending (PSRBD) status.
5. If you specify REORG TABLESPACE SHRLEVEL REFERENCE PART with one or more nonpartitioned indexes,
restart is allowed only in the SWITCH phase.
6. For REORG TABLESPACE with SHRLEVEL REFERENCE and PART, if a nonpartitioned index is defined on the
table space, REORG TABLESPACE cannot be restarted before the SWITCH phase.
518
Phase
CURRENT
PHASE
UTILINIT
NO
YES
UNLOAD
NO
YES
RELOAD
NO
YES
SORT
NO
NO
BUILD
NO
YES
SORTBLD
NO
YES
Related tasks
Restarting after the output data set is full on page 40
Chapter 3, Invoking DB2 online utilities, on page 13
Results
REORG TABLESPACE All data + entire partitioning index + all nonpartitioning indexes
REORG TABLESPACE Data for PART n + PART n of the partitioning index + index entries
PART n
for PART n in all nonpartitioning indexes
REORG TABLESPACE
Data for PART n1 through n2 + PART n1 through n2 of the
PART n1:n2
partitioning index + index entries for those partitions in all
nonpartitioning indexes
REORG TABLESPACE Specified table space or partitions that are in REORG-pending
SCOPE PENDING
status.
|
|
|
|
REORG SHRLEVEL
CHANGE PART and
SHRLEVEL
REFERENCE PART
When reorganizing a segmented table space, REORG leaves free pages and free
space on each page in accordance with the current values of the FREEPAGE and
PCTFREE parameters. (You can set those values by using the CREATE
TABLESPACE, ALTER TABLESPACE, CREATE INDEX, or ALTER INDEX
statements). REORG leaves one free page after reaching the FREEPAGE limit for
each table in the table space. When reorganizing a nonsegmented table space,
REORG leaves one free page after reaching the FREEPAGE limit, regardless of
whether the loaded records belong to the same or different tables.
519
The table space can be easily loaded again in the event of failure.
v If you use COPYDDN, SHRLEVEL REFERENCE, or SHRLEVEL CHANGE, and
the object that you are reorganizing is not a catalog or directory table space for
which COPYDDN is ignored, you do not need to take an image copy.
v Use the RUNSTATS utility on the table space and its indexes if inline statistics
were not collected, so that the DB2 catalog statistics take into account the newly
reorganized data, and SQL paths can be selected with accurate information. You
need to run RUNSTATS on nonpartitioning indexes only if you reorganized a
subset of the partitions.
v If you use REORG TABLESPACE SHRLEVEL CHANGE, you can drop the
mapping table and its index.
v If you use SHRLEVEL REFERENCE or CHANGE, and a table space, partition, or
index resides in user-managed data sets, you can delete the user-managed
shadow data sets.
v If you specify DISCARD on a REORG of a table that is involved in a referential
integrity set, you need to run CHECK DATA for any affected referentially
related objects that were placed in CHECK-pending status.
Related reference
Chapter 11, COPY, on page 113
520
v The value in the CURRENT_VERSION column is 255 for table spaces or 15 for
indexes, and the value in the OLDEST_VERSION column is 0 or 1.
You can also run LOAD REPLACE, REBUILD INDEX, or REORG INDEX to
recycle version numbers for indexes that are defined with the COPY NO attribute.
To recycle version numbers for indexes that are defined with the COPY YES
attribute or for table spaces, run MODIFY RECOVERY.
|
|
|
|
|
If you run REORG on a catalog or directory table space, the catalog or directory
table space remains in basic row format.
What is logged
LOG YES
NOT LOGGED
Non-LOB
No pending status or
ICOPY-pending1
LOG YES
NOT LOGGED
LOB
control information
No pending status
LOG NO
NOT LOGGED
Non-LOB
nothing
No pending status or
ICOPY-pending1
LOG NO
NOT LOGGED
LOB
nothing
No pending status
Note:
1. The table space is set to ICOPY-pending status if the records are discarded and no pending status is the records
are not discarded.
521
522
523
524
collect 10 frequent values on the first key column of the index. UPDATE NONE
indicates that the catalog tables are not to be updated. This option requires that
REPORT YES also be specified.
REORG TABLESPACE DSN8D91A.DSN8S91E SORTDATA STATISTICS
TABLE
INDEX(ALL) KEYCARD FREQVAL NUMCOLS 1
COUNT 10 REPORT YES UPDATE NONE
On successful completion, DB2 returns output that is similar to the output in the
following sample output. This sample output shows that the limits have been met.
DSNU000I
DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = HUHRU252.REORG2
DSNU1044I DSNUGTIS - PROCESSING SYSIN AS EBCDIC
DSNU050I
DSNUGUTC - REORG TABLESPACE DBHR5201.TPHR5201 PART 11 NOSYSREC REPORTONLY SHRLEVEL CHANGE
MAPPINGTABLE ADMF001.MAP1 COPYDDN(SYSCOPY) OFFPOSLIMIT 11 INDREFLIMIT 15
DSNU286I = DSNURLIM - REORG TABLESPACE DBHR5201.TPHR5201 OFFPOSLIMIT SYSINDEXPART ROWS
* CREATOR.IXNAME : ADMF001.IPHR5201
CREATOR.TBNAME : ADMF001.TBHR5201
PART:
1 CARDF: 6.758E+03
FAROFFPOSF:
2.892E+03
NEAROFFPOSF: 8.18E+02
STATSTIME: 2003-04-11
13.32.06
DSNU287I = DSNURLIM - REORG TABLESPACE DBHR5201.TPHR5201 INDREFLIMIT SYSTABLEPART ROWS
DBNAME .TSNAME
PART
CARD FARINDREF NEARINDREF
STATSTIME
DBHR5201.TPHR5201
1
6758
0
0 2003-04-11-13.32.06
DSNU289I
DSNU010I
Figure 77. Sample output showing that REORG limits have been met
525
On successful completion, DB2 returns output for the REORG TABLESPACE job
that is similar to the output in the following sample output.
DSNU050I
DSNUGUTC - REORG TABLESPACE DBHR5201.TPHR5201 SHRLEVEL CHANGE MAPPINGTABLE
MAP1 COPYDDN(SYSCOPY1)
OFFPOSLIMIT 9 INDREFLIMIT 9
DSNU286I = DSNURLIM - REORG TABLESPACE DBHR5201.TPHR5201 OFFPOSLIMIT SYSINDEXPART ROWS
* CREATOR.IXNAME : ADMF001.IPHR5201
CREATOR.TBNAME : ADMF001.TBHR5201
PART: 1 CARDF: 3.6E+01
FAROFFPOSF:
0.0E0
NEAROFFPOSF: 1.2E+01
STATSTIME: 2002-05-28-16.22.18
CREATOR.IXNAME : ADMF001.IPHR5201
CREATOR.TBNAME : ADMF001.TBHR5201
PART: 2 CARDF: 5.0E+00
FAROFFPOSF:
0.0E0
NEAROFFPOSF: 0.0E0
STATSTIME: 2002-05-28-16.22.18
...
* CREATOR.IXNAME : ADMF001.IPHR5201
CREATOR.TBNAME : ADMF001.TBHR5201
PART: 11 CARDF: 6.758E+03
FAROFFPOSF:
2.892E+03
NEAROFFPOSF: 8.18E+02
STATSTIME: 2002-05-28-16.22.18
DSNU287I = DSNURLIM - REORG TABLESPACE DBHR5201.TPHR5201 INDREFLIMIT SYSTABLEPART ROWS
DBNAME .TSNAME
PART
CARD FARINDREF NEARINDREF
STATSTIME
DBHR5201.TPHR5201
1
36
0
0 2002-05-28-16.22.18
DBHR5201.TPHR5201
2
5
0
0 2002-05-28-16.22.18
DBHR5201.TPHR5201
3
54
0
0 2002-05-28-16.22.18
DBHR5201.TPHR5201
4
30
0
0 2002-05-28-16.22.18
DBHR5201.TPHR5201
5
21
0
0 2002-05-28-16.22.18
DBHR5201.TPHR5201
6
5
0
0 2002-05-28-16.22.18
DBHR5201.TPHR5201
7
4
0
0 2002-05-28-16.22.18
DBHR5201.TPHR5201
8
35
0
0 2002-05-28-16.22.18
DBHR5201.TPHR5201
9
25
0
0 2002-05-28-16.22.18
526
DBHR5201.TPHR5201
10
1
0
0 2002-05-28-16.22.18
DBHR5201.TPHR5201
11
6758
0
0 2002-05-28-16.22.18
DSNU289I = DSNURLIM - REORG LIMITS HAVE BEEN MET
DSNU290I = DSNURLIM - REORG WILL BE PERFORMED
DSNU252I
DSNUGSRT - UNLOAD PHASE STATISTICS - NUMBER OF RECORDS UNLOADED=6985 FOR
TABLESPACE DBHR5201.TPHR5201
DSNU250I
DSNUGSRT - UNLOAD PHASE COMPLETE, ELAPSED TIME=00:00:01
DSNU304I = DSNURWT - (RE)LOAD PHASE STATISTICS - NUMBER OF RECORDS=6985 FOR TABLE
ADMF001.TBHR5201
DSNU302I
DSNURILD - (RE)LOAD PHASE STATISTICS - NUMBER OF INPUT RECORDS PROCESSED=6985
DSNU300I
DSNURILD - (RE)LOAD PHASE COMPLETE, ELAPSED TIME=00:00:29
DSNU042I
DSNUGSOR - SORT PHASE STATISTICS NUMBER OF RECORDS=34925
ELAPSED TIME=00:00:00
DSNU348I
DSNU348I
...
DSNU349I
DSNU258I
DSNU259I
DSNU386I
RECORDS =
DSNU385I
DSNU400I
DSNU387I
DSNU428I
= DSNURBXA - BUILD PHASE STATISTICS - NUMBER OF KEYS=36 FOR INDEX ADMF001.IPHR5201 PART 1
= DSNURBXA - BUILD PHASE STATISTICS - NUMBER OF KEYS=5 FOR INDEX ADMF001.IPHR5201 PART 2
= DSNURBXA
DSNURBXD
DSNURBXD
DSNURLGD
194
DSNURLGD
DSNURBID
527
//STEP1
EXEC DSNUPROC,UID='HUHRU257.REORG',TIME=1440,
//
UTPROC='',
//
SYSTEM='DSN'
//UTPRINT DD SYSOUT=*
//SYSIN
DD *
OPTIONS PREVIEW
TEMPLATE CPYTMP UNIT(SYSDA)
DSN(HUHRU257.REORG.T&TI..SYSCOPY1)
TEMPLATE SREC
UNIT(SYSDA) DISP(NEW,CATLG,CATLG)
DSN(HUHRU257.REORG.&ST..SREC)
TEMPLATE SDISC
UNIT(SYSDA) DISP(NEW,CATLG,CATLG)
DSN(HUHRU257.REORG.&ST..SDISC)
TEMPLATE SPUNCH
UNIT(SYSDA) DISP(NEW,CATLG,CATLG)
DSN(HUHRU257.REORG.&ST..SPUNCH)
LISTDEF REORG_TBSP INCLUDE TABLESPACE DBHR5701.TPHR5701
OPTIONS OFF
REORG TABLESPACE LIST REORG_TBSP
DRAIN_WAIT 30
RETRY 4
RETRY_DELAY 10
STATISTICS
TABLE (ALL) SAMPLE 60
INDEX (ALL KEYCARD FREQVAL NUMCOLS 2 COUNT 15)
SHRLEVEL CHANGE MAPPINGTABLE MAP5702
LONGLOG DRAIN MAXRO DEFER DELAY 30
COPYDDN (CPYTMP)
SORTDEVT SYSDA SORTNUM 8
PUNCHDDN SPUNCH
DISCARDDN SDISC
UNLDDN SREC
Figure 80. Example of reorganizing a table space by using DRAIN WAIT, RETRY, and
RETRY_DELAY
DSNU050I
DSNU1035I
DSNU050I
TABLE(ALL)
SAMPLE 60 INDEX(ALL KEYCARD FREQVAL NUMCOLS 2 COUNT 15) SHRLEVEL CHANGE MAPPINGTABLE MAP5702 LONGLOG DRAIN
MAXRO
DEFER DELAY 30 COPYDDN(CPYTMP) SORTDEVT SYSDA SORTNUM 8 PUNCHDDN SPUNCH DISCARDDN
528
PART 11
529
Figure 81. Sample output of REORG TABLESPACE job with DRAIN WAIT, RETRY, and RETRY_DELAY options
530
MAPPINGTABLE MYMAPPING_TABLE
MAXRO 240 LONGLOG DRAIN DELAY 900
SORTDEVT SYSDA SORTNUM 4
STATISTICS TABLE(ALL)
INDEX(ALL)
EXEC SQL
DROP TABLE MYMAPPING_TABLE
ENDEXEC
531
532
//STEP1
//
//SYSREC
//
//
//SYSCOPY
//
//
//SYSUT1
//
//
//SORTOUT
//
//
//SYSIN
REORG
/*
EXEC DSNUPROC,UID='JUKQU1AA.REORG6',
UTPROC='',SYSTEM='SSTR'
DD DSN=JUKQU1AA.REORG6.STEP1.SYSREC,
DISP=(MOD,DELETE,CATLG),
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
DD DSN=JUKQU1AA.REORG6.STEP1.SYSCOPY,
DISP=(MOD,DELETE,CATLG),
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
DD DSN=JUKQU1AA.REORG6.STEP1.SYSUT1,
DISP=(MOD,DELETE,CATLG),
UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
DD DSN=JUKQU1AA.REORG6.STEP1.SORTOUT,
DISP=(MOD,DELETE,CATLG),UNIT=SYSDA,
SPACE=(4000,(20,20),,,ROUND)
DD *
TABLESPACE DBKQAA01.TPKQAA01 SCOPE PENDING PART 2:10
Related reference
DROP (DB2 SQL Reference)
CREATE TABLE (DB2 SQL Reference)
CREATE INDEX (DB2 SQL Reference)
533
534
Repair DBDs
Reset a pending status on a table space or index
Verify the contents of data areas in table spaces and indexes
Replace the contents of data areas in table spaces and indexes
Delete a single row from a table space
Produce a hexadecimal dump of an area in a table space or index
Delete an entire LOB from a LOB table space
Dump LOB pages
Output
The output from the REPAIR utility can consist of one or more modified pages in
the specified DB2 table space or index and a dump of the contents.
Authorization required
To execute this utility, you must use a privilege set that includes one of the
following authorities:
v REPAIR privilege for the database
v DBADM or DBCTRL authority for the database. If the object on which the utility
operates is in an implicitly created database, DBADM authority on the implicitly
created database or DSNDB04 is required.
v SYSCTRL or SYSADM authority
An ID with installation SYSOPR authority can also execute REPAIR, but only on a
table space in the DSNDB01 or DSNDB06 database.
To execute REPAIR with the DBD option, you must use a privilege set that
includes SYSADM, SYSCTRL, or installation SYSOPR authority.
REPAIR should be used only by a person that is knowledgeable in DB2 and your
data. Grant REPAIR authorization only to the appropriate people.
535
UTILINIT
Performs initialization
REPAIR
Repairs data
UTILTERM
Performs cleanup
REPAIR
CLONE
OBJECT
LOG
YES
LOG
NO
set statement
locate block
dbd-statement
level-id statement
versions statement
level-id statement:
LEVELID
TABLESPACE
table-space-name
database-name.
index-name-spec
PART
integer
versions statement:
VERSIONS
TABLESPACE
database-name.
index-name-spec
index-name-spec:
536
table-space-name
INDEX
index-name
creator-id.
INDEXSPACE
index-space-name
database-name.
537
index-name
Specifies the name of the index. Enclose the index name in quotation
marks if the name contains a blank.
You can specify either INDEX or INDEXSPACE to identify an index. To specify
multiple indexes, repeat the keyword.
INDEXSPACE
Specifies the index space for the index whose level identifier is to be reset (if
you specify LEVELID) or whose version identifier is to be updated (if you
specify VERSIONS). You can obtain the index space name for an index from
the SYSIBM.SYSINDEXES catalog table. The index space name must be
qualified.
database-name.
Specifies the name of the database to which the index space belongs.
index-space-name
Specifies the name of the index space.
You can specify either INDEX or INDEXSPACE to identify an index. To specify
multiple indexes, repeat the keyword.
PART
Identifies a partition of the table space or index (including a partition of a
data-partitioned secondary index).
integer is the number of the partition and must be in the range from one to the
number of partitions that are defined for the object. The maximum is 4096.
VERSIONS
Updates the version information in the catalog and directory for the specified
table space or index with the version information from the system pages of the
object. Use REPAIR VERSIONS in the following situations:
v When you run the DSN1COPY utility with the OBIDXLAT option to move
objects from one system to another. For more information about this process,
see Updating version information when moving objects to another
subsystem on page 557.
v Run REPAIR VERSIONS only when moving objects.
For more information about version number management, see Part 2 of DB2
Administration Guide.
|
|
|
|
|
|
CLONE
Indicates that REPAIR is to process only the specified objects that are table
spaces that contain clone tables, indexes on clone tables, or index spaces that
contain indexes on clone tables. If you specify CLONE, you cannot specify
VERSIONS because clone tables do not have versions. Clones cannot be
created for tables with active versions.
|
|
|
|
If you specify SET with CLONE, the status is changed for only the specified
table spaces and their indexes. The CLONE keyword applies to all SET
statements and LOCATE statements within the same REPAIR utility control
statement.
538
space or data set. The SET INDEX statement resets the informational
COPY-pending (ICOPY), RECOVER-pending, REBUILD-pending, CHECK-pending,
and advisory REORG-pending (AREO* and AREOR) statuses for an index.
The SET TABLESPACE statement resets the COPY-pending, RECOVER-pending,
CHECK-pending, auxiliary warning (AUXW), and auxiliary CHECK-pending
(ACHKP) statuses for a table space or data set. The SET INDEX statement resets
the informational COPY-pending (ICOPY), RECOVER-pending, REBUILD-pending,
or CHECK-pending status for an index.
set statement:
SET
table-space-spec
INDEX
NOCOPYPEND
NORCVRPEND
NOCHECKPEND
NOAUXWARN
NOAUXCHKP
NOAREORPENDSTAR
(index-name
PART
integer
NOCOPYPEND
NORCVRPEND
( ALL )
NORBDPEND
NOCHECKPEND
NOAREORPENDSTAR
INDEXSPACE (
index-space-name
database-name.
PART integer
( ALL )
table-space-spec
PART integer
table-space-spec
table-space-spec:
TABLESPACE
table-space-name
database-name.
539
(index-name)
Specifies the index that is to be processed. Enclose the index name in
quotation marks if the name contains a blank.
(ALL)
Specifies that all indexes in the table space will be processed.
The keyword INDEXES is accepted following a table-space-spec and causes all
indexes to be processed. You can also repair all indexes by specifying
INDEX(ALL) followed by a table-space-spec.
SET INDEXSPACE
Specifies the index space for the index whose RECOVER-pending,
CHECK-pending, REBUILD-pending, or informational COPY-pending status is
to be reset.
(database-name.index-space-name)
Specifies the index space that is to be processed.
(ALL)
Specifies that all indexes in the table space will be processed.
PART integer
Specifies a particular partition whose COPY-pending, or RECOVER-pending
status is to be reset. If you do not specify PART, REPAIR resets the pending
status of the entire table space or index.
integer is the number of the partition and must be in the range from one to the
number of partitions that are defined for the
You can specify PART for NOCHECKPEND on a table space, and for
NORCVRPEND on indexes.
The PART keyword is not valid for a LOB table space or an index on the
auxiliary table.
NOCOPYPEND
Specifies that the COPY-pending status of the specified table space, or the
informational COPY-pending (ICOPY) status of the specified index is to be
reset.
NORCVRPEND
Specifies that the RECOVER-pending (RECP) status of the specified table space
or index is to be reset.
NORBDPEND
Specifies that the REBUILD-pending (RBDP) status, the page set
REBUILD-pending status (PSRBDP), or the RBDP* status of the specified index
is to be reset.
NOCHECKPEND
Specifies that the CHECK-pending (CHKP) status of the specified table space
or index is to be reset.
NOAUXWARN
Specifies that the auxiliary warning (AUXW) status of the specified table space
is to be reset. The specified table space must be a base table space or a LOB
table space.
|
|
|
NOAUXCHKP
Specifies that the auxiliary CHECK-pending (ACHKP) status of the specified
table space is to be reset. The specified table space must be a base table space.
540
NOAREORPENDSTAR
Resets the advisory REORG-pending (AREO*) status of the specified table
space or index.
|
LOCATE
table-space-spec
table-options spec
INDEX index-name
index-options-spec
INDEXSPACE index-space-name
index-options-spec
table-space-spec
ROWID
Xbyte-string
VERSION
verify statement
replace statement
SHRLEVEL CHANGE
delete statement
dump statement
Xbyte-string
delete statement
dump statement
table-space-spec:
TABLESPACE
table-space-name
database-name.
table-options-spec:
byte-string
PAGE integer
PART integer
RID X byte-string
KEY literal INDEX index-name
PAGE X
index-options-spec:
PAGE X
PART
byte-string
PAGE integer
integer
541
542
literal is any SQL constant that can be compared with the key values of the
named index.
Character constants that are specified within the LOCATE KEY option cannot
be specified as ASCII or Unicode character strings. No conversion of the values
is performed. To use this option when the table space is ASCII or Unicode, you
should specify the values as hexadecimal constants.
If more than one row has the value literal in the key column, REPAIR returns a
list of record identifiers (RIDs) for records with that key value, but does not
perform any other operations (verify, replace, delete, or dump) until the next
LOCATE TABLESPACE statement is encountered. To repair the proper data,
write a LOCATE TABLESPACE statement that selects the desired row, using
the RID option, the PAGE option, or a different KEY and INDEX option. Then
execute REPAIR again.
|
|
|
SHRLEVEL
Indicates the type of access that is to be allowed for the index, table space, or
partition that is to be repaired during REPAIR processing.
|
|
|
|
|
|
|
CHANGE
Specifies that applications can read and write during the VERIFY,
REPLACE, DELETE, and DUMP operation.
ROWID Xbyte-string
Specifies that the data that is to be located is a LOB in a LOB table space.
byte-string is the row ID that identifies the LOB column.
Use the ROWID keyword to repair an orphaned LOB row. You can find the
ROWID in the output from the CHECK LOB utility. If you specify the ROWID
keyword, the specified table space must be a LOB table space.
VERSION Xbyte-string
Specifies that the data that is to be located is a LOB in a LOB table space.
byte-string is the version number that identifies the version of the LOB column.
Use the VERSION keyword to repair an orphaned LOB column. You can find
the VERSION number in the output of the CHECK LOB utility or an
out-of-synch LOB that is reported by the CHECK DATA utility. If you specify
the VERSION keyword, the specified table space must be a LOB table space.
543
INDEX index-name
Specifies a particular index that is to be used to find the row that contains the
key. When you are locating an index by key, the index that you specify must
be a single-column index.
index-name is the qualified or unqualified name of the index. If you omit the
qualifier creator ID, the user identifier for the utility job is used. Enclose the
index name in quotation marks if the name contains a blank.
INDEXSPACE index-space-name
Specifies the index space for a particular index that is to be used to find the
row that contains the key. Look in the SYSIBM.SYSINDEXES catalog table to
find the index space name for an index. When you are locating an index by
key, the index that you specify must be a single-column index.
index-space-name is the qualified name of the index space, in the form
database-name.index-space-name.
PAGE integer
Specifies the relative page number within the index space that is to be
operated on. The first page is 0 (zero).
integer
integer is a decimal number from one to six digits in length.
Xbyte-string
Specifies that the data of interest is an entire page. The specified offsets in
byte-string and in subsequent statements are relative to the beginning of the
page. The first byte of the page is at offset 0.
byte-string is a hexadecimal value from one to eight characters in length.
You do not need to enter leading zeros. Enclose the byte-string between
apostrophes, and precede it with X.
PART integer
Specifies the partition number of the partitioning index that contains the page
that is to be located. The PART keyword is valid only for indexes of
partitioned table spaces.
integer is the number of the partitioning index.
544
OFFSET 0
VERIFY
DATA
OFFSET
integer
Xbyte-string
Xbyte-string
character-string
REPLACE
RESET
OFFSET 0
DATA
OFFSET
integer
Xbyte-string
Xbyte-string
character-string
545
546
In any LOCATE block, you can include no more than one DELETE option.
If you have coded any of the following options, you cannot use DELETE:
v The LOG NO option on the REPAIR statement
v A LOCATE INDEX statement to begin the LOCATE block
v The PAGE option on the LOCATE TABLESPACE statement in the same LOCATE
block
v A REPLACE statement for the same row of data
When you specify LOCATE ROWID for a LOB table space, the LOB that is
specified by ROWID is deleted with its index entry. All pages that are occupied by
the LOB are converted to free space. The DELETE statement does not remove any
reference to the deleted LOB from the base table space.
delete statement:
DELETE
OFFSET 0
DUMP
OFFSET
integer
Xbyte-string
LENGTH
Xbyte-string
integer
PAGES
Xbyte-string
integer
*
MAP
pages
DATA
pages
547
Xbyte-string
Specifies the offset as one to four hexadecimal characters. You do not need
to enter leading zeros. Enclose the byte string between apostrophes, and
precede it with X.
LENGTH
Optionally, specifies the number of bytes of data that are to be dumped. If you
omit both LENGTH and PAGE, the dump begins at the specified OFFSET and
continues to the end of the row or page.
If you specify a number of bytes (with LENGTH) and a number of pages (with
PAGE), the dump contains the same relative bytes from each page. That is,
from each page you see the same number of bytes, beginning at the same
offset.
Xbyte-string
Specifies one to four hexadecimal characters. You do not need to enter
leading zeros. Enclose the byte string between apostrophes, and precede it
with X.
integer
Specifies the length as an integer.
PAGES
Optionally, specifies a number of pages that are to be dumped. You can use
this option only if you used PAGE in the preceding LOCATE TABLESPACE
control statement.
Xbyte-string
Specifies one to four hexadecimal characters. You do not need to enter
leading zeros. Enclose the byte string between apostrophes, and precede it
with X.
integer
Specifies the number of pages as an integer.
*
Specifies that all pages from the starting point to the end of the table space
or partition are to be dumped.
MAP pages
Specifies that only the LOB map pages are to be dumped.
pages specifies the number of LOB map pages that are to be dumped. If you do
not specify pages, all LOB map pages of the LOB that is specified by ROWID
and version are dumped.
DATA pages
Specifies that only the LOB data pages are to be dumped.
pages specifies the number of LOB data pages that are to be dumped. If you do
not specify pages, all LOB data pages of the LOB that is specified by ROWID
and version are dumped.
548
v Drop an inconsistent database definition from the DB2 catalog and the DB2
directory
The REPAIR utility assumes that the links in table spaces DSNDB01.DBD01,
DSNDB06.SYSDBAUT, and DSNDB06.SYSDBASE are intact. Before executing
REPAIR with the DBD statement, run the DSN1CHKR utility on these table spaces
to ensure that the links are not broken.
|
|
The database on which REPAIR DBD REBUILD is run must be started for access
by utilities only. DB2 performs this step automatically.
|
|
|
|
|
You can use REPAIR DBD on declared temporary tables, which must be created in
a database that is defined with the AS TEMP clause. No other DB2 utilities can be
used on a declared temporary table, its indexes, or its table spaces. When REPAIR
DBD REBUILD is running, an S-lock is acquired for the appropriate catalog tables.
If the S-lock fails, REPAIR DBD fails.
dbd statement:
DBD
ddname
549
TEST
Specifies that a DBD is to be built from information in the DB2 catalog, and is
to be compared with the DBD in the DB2 directory. If you specify TEST, DB2
reports significant differences between the two DBDs.
If the condition code is 0, the DBD in the DB2 directory is consistent with the
information in the DB2 catalog.
If the condition code is not 0, then the information in the DB2 catalog and the
DBD in the DB2 directory might be inconsistent. Run REPAIR DBD with the
DIAGNOSE option to gather information that is necessary for resolving any
possible inconsistency.
DIAGNOSE
Specifies that information that is necessary for resolving an inconsistent
database definition is to be generated. Like the TEST option, DIAGNOSE
builds a DBD that is based on the information in the DB2 catalog and
compares it with the DBD in the DB2 directory. In addition, DB2 reports any
differences between the two DBDs, and produces hexadecimal dumps of the
inconsistent DBDs.
If the condition code is 0, the information in the DB2 catalog and the DBD in
the DB2 directory is consistent.
If the condition code is 8, the information in the DB2 catalog and the DBD in
the DB2 directory might be inconsistent.
For further assistance in resolving any inconsistencies, you can contact IBM
Software Support.
REBUILD
Specifies that the DBD that is associated with the specified database is to be
rebuilt from the information in the DB2 catalog.
Attention: Use the REBUILD option with extreme care, as you can cause
more damage to your data. For more assistance, you can contact IBM Software
Support.
OUTDDN ddname
Specifies the DD statement for an optional output data set. This data set
contains copies of the DB2 catalog records that are used to rebuild the DBD.
ddname is the name of the DD statement.
550
Data set
Required?
SYSIN
Yes
SYSPRINT
Yes
No
The following objects are named in the utility control statement and do not require
a DD statement in the JCL:
Table space or index
Object that is to be repaired.
In this formula, n = the total number of DB2 catalog records that relate to the
database on which REPAIR DBD is being executed.
You can calculate an estimate for n by summing the results of SELECT COUNT(*)
from all of the catalog tables in the SYSDBASE table space, where the name of the
database that is associated with the record matches the database on which REPAIR
DBD is being executed.
551
DB2 treats individual data and index partitions as distinct target objects. Utilities
that operate on different partitions of the same table space or index space are
compatible.
Claims
The following table shows which claim classes REPAIR drains and any restrictive
state that the utility sets on the target object.
Table 99. Claim classes of REPAIR operations
Table space or
partition
Index or partition
Action
REPAIR LOCATE KEY DUMP or VERIFY
DW/UTRO
DW/UTRO
DA/UTUT
DA/UTUT
DW/UTRO
None
DA/UTUT
DA/UTUT
DA/UTUT
None
DW/UTRO
None
DA/UTUT
None
None
DW/UTRO
None
DA/UTUT
Legend:
v DA - Drain all claim classes - no concurrent SQL access.
v DW - Drain the write claim class - concurrent access for SQL readers.
v UTUT - Utility restrictive state - exclusive control.
v UTRO - Utility restrictive state - read-only access allowed.
v None - Object is not affected by this utility.
REPAIR does not set a utility restrictive state if the target object is
DSNDB01.SYSUTILX.
Compatibility
The following tables show which utilities can run concurrently with REPAIR on the
same target object. The target object can be a table space, an index space, or a
partition of a table space or index space. If compatibility depends on particular
options of a utility, that information is also shown in the table.
The following table shows which utilities can run concurrently with REPAIR
LOCATE by KEY or RID.
Table 100. Utility compatibility with REPAIR, LOCATE by KEY or RID
Utility
552
DUMP or VERIFY
DELETE or REPLACE
CHECK DATA
No
No
CHECK INDEX
Yes
No
CHECK LOB
Yes
No
COPY INDEXSPACE
Yes
No
COPY TABLESPACE
Yes
No
Table 100. Utility compatibility with REPAIR, LOCATE by KEY or RID (continued)
Utility
DUMP or VERIFY
DELETE or REPLACE
DIAGNOSE
Yes
Yes
LOAD
No
No
MERGECOPY
Yes
Yes
MODIFY
Yes
Yes
QUIESCE
Yes
No
No
No
No
No
REBUILD INDEX
RECOVER INDEX
RECOVER TABLESPACE
No
No
No
No
No
No
Yes
No
No
No
Yes
No
REPORT
Yes
Yes
Yes
Yes
Yes
No
RUNSTATS TABLESPACE
Yes
No
STOSPACE
Yes
Yes
UNLOAD
Yes
No
REORG INDEX
Notes:
1. REORG INDEX is compatible with LOCATE by RID, DUMP, VERIFY, or REPLACE.
2. RECOVER INDEX is compatible with LOCATE by RID, DUMP, or VERIFY.
3. REPAIR LOCATE INDEX PAGE REPLACE is compatible with LOCATE by RID or
REPLACE.
The following table shows which utilities can run concurrently with REPAIR
LOCATE by PAGE.
Table 101. Utility compatibility with REPAIR, LOCATE by PAGE
Utility or action
TABLESPACE
DUMP or VERIFY
TABLESPACE
REPLACE
INDEX DUMP or
VERIFY
INDEX REPLACE
SQL read
Yes
No
Yes
No
SQL write
No
No
No
No
CHECK DATA
No
No
No
No
CHECK INDEX
Yes
No
Yes
No
CHECK LOB
Yes
No
Yes
No
COPY INDEXSPACE
Yes
Yes
Yes
No
COPY TABLESPACE
Yes
No
Yes
No
DIAGNOSE
Yes
Yes
Yes
Yes
Chapter 26. REPAIR
553
TABLESPACE
DUMP or VERIFY
TABLESPACE
REPLACE
INDEX DUMP or
VERIFY
INDEX REPLACE
LOAD
No
No
No
No
MERGECOPY
Yes
Yes
Yes
Yes
MODIFY
Yes
Yes
Yes
Yes
QUIESCE
Yes
No
Yes
No
REBUILD INDEX
Yes
No
No
N/A
RECOVER INDEX
Yes
No
No
No
RECOVER TABLESPACE
(with no option)
No
No
Yes
Yes
RECOVER TABLESPACE
ERROR RANGE
No
No
Yes
Yes
RECOVER TABLESPACE
TOCOPY or TORBA
No
No
No
No
REORG INDEX
Yes
Yes
No
No
REORG TABLESPACE
UNLOAD CONTINUE or
PAUSE
No
No
No
No
REORG TABLESPACE
UNLOAD ONLY or
EXTERNAL
Yes
No
Yes
Yes
REPAIR DELETE or
REPLACE
No
No
No
No
Yes
No
Yes
No
REPORT
Yes
Yes
Yes
Yes
RUNSTATS INDEX
Yes
Yes
Yes
No
RUNSTATS TABLESPACE
Yes
No
Yes
Yes
STOSPACE
Yes
Yes
Yes
Yes
UNLOAD
Yes
No
Yes
Yes
Note:
1. REPAIR LOCATE INDEX PAGE REPLACE is compatible with LOCATE TABLESPACE PAGE.
554
referential integrity constraints of the table space set, whereas with REPAIR, you
are responsible for checking all the referential integrity constraints violations.
To reset the CHECK-pending status for a LOB table space:
1. Run the CHECK DATA utility again with the AUXERROR INVALIDATE
keywords specified.
2. Update the invalid LOBs.
To reset the auxiliary warning (AUXW) status for a LOB table space:
1. Update or correct the invalid LOB columns, then
2. Run the CHECK LOB utility with the AUXERROR INVALIDATE option if
invalid LOB columns were corrected.
When REPAIR DBD REBUILD is running, an S-lock is acquired for the appropriate
catalog tables. If the S-lock fails, REPAIR DBD fails.
To use the DBD statement:
1. Run the DSN1CHKR utility on the DSNDB01.DBD01, DSNDB06.SYSDBAUT,
and DSNDB06.SYSDBASE table spaces.
555
2. Run REPAIR DBD with the TEST option to determine if the information in the
DB2 catalog is consistent with the DBD in the DB2 directory. REPAIR DBD
TEST obtains environment information, such as the character that is used for
the decimal point, from the DSNHDECP module for the subsystem.
3. If inconsistencies exist (condition code is not 0), use the DIAGNOSE option
with the OUTDDN keyword to produce diagnostic information. Contact IBM
Software Support for assistance in analyzing this information. REPAIR DBD
DIAGNOSE obtains environment information, such as the character that is used
for the decimal point, from the DSNHDECP module for the subsystem.
4. If IBM Software Support instructs you to do so, replace the existing DBD with
the REBUILD option. Do not use this option if you suspect that information in
the catalog is causing the inconsistency. REBUILD uses information in the
catalog to rebuild the DBD; if the catalog is incorrect, the rebuilt DBD cannot be
correct.
DB2 reads each table space in the database during the REBUILD process to
gather information. If the data sets for the table spaces do not exist or are not
accessible to DB2, the REBUILD abnormally terminates.
REPAIR DBD REBUILD obtains environment information, such as the character
that is used for the decimal point, from the DSNHDECP module for the
subsystem.
5. If you suspect an inconsistency in the DBD of the work file database, run
REPAIR DBD DROP or DROP DATABASE (SQL), and then recreate it. If you
receive errors when you drop the work file database, contact IBM Software
Support for assistance.
6. If the database is started for utility-only access, issue the STOP DATABASE
(database-name) and then issue the START DATABASE (database-name)
ACCESS(RW) command to allow full access to the database. You need to
complete this step if you ran REPAIR DBD REBUILD. DB2 starts the database
for utility-only access when you execute this utility.
|
|
|
|
|
|
|
|
|
|
When you run REPAIR DBD REBUILD on a database, all trigger packages that
are associated with tables in the database are invalidated. After you run
REPAIR DBD REBUILD, you need to rebind those trigger packages. The DB2
release on which you rebind the trigger packages must be the same as the DB2
release on which you run REPAIR DBD REBUILD.
556
DSNUCBRL
DSNUCBRL
DSNUCBRL
DSNUCBRL
DSNUCBRL
DSNUCBRP
DSNUGBAC
Multiple-column indexes
The KEY option supports only single-column indexes. The following message is
issued if you try to locate a row by using a multiple-column index.
DSNUCBRK - INDEX USED HAS MULTIPLE-FIELD KEY
Recommendation: Use the same ALTER TABLE statement on both the source
and target objects.
2. If you are copying indexes that have not been altered in Version 8, check the
SYSIBM.SYSINDEXES catalog table on both subsystems to ensure that the value
in both the CURRENT_VERSION column and the OLDEST_VERSION column
is 0.
3. If the object has been altered since its creation and has never been reorganized,
run the REORG utility on the object. You can determine if an object has been
altered but not reorganized by checking the values of the OLDEST_VERSION
and CURRENT_VERSION columns in SYSIBM.SYSTABLESPACE or
SYSIBM.SYSINDEXES. If OLDEST_VERSION is 0 and CURRENT_VERSION is
greater than 0, run REORG. If you do not own the REORG utility, ensure that
you do can insert after the last ALTER to force the creation of a system page.
4. Ensure that enough version numbers are available. For a table space, the
combined active number of versions for the object on both the source and
target subsystems must be less than 255. For an index, the combined active
557
number of versions must be less than 16. Use the following guidelines to
calculate the active number of versions for the object on both the source and
target subsystems:
v If the value in the CURRENT_VERSION column is less than the value in the
OLDEST_VERSION column, add the maximum number of versions (255 for
a table space or 16 for an index) to the value in the CURRENT_VERSION
column.
v Use the following formula to calculate the number of active versions:
number of active_versions =
MAX(target.CURRENT_VERSION,source.CURRENT_VERSION)
- MIN(target.OLDEST_VERSION,source.OLDEST_VERSION) + 1
If the number of active versions is too high, you must reduce the number of
active versions by running REORG on both the source and target objects. Then,
use the COPY utility to take a copy, and run MODIFY RECOVERY to recycle
the version numbers.
5. Run the DSN1COPY utility with the OBIDXLAT option. On the control
statement, specify the proper mapping of table database object identifiers
(OBIDs) for the table space or index from the source to the target subsystem.
6. Run REPAIR VERSIONS on the object on the target subsystem. For table
spaces, the utility updates the following columns:
v OLDEST_VERSION and CURRENT_VERSION in SYSTABLEPART
v VERSION in SYSTABLES
v OLDEST_VERSION and CURRENT_VERSION in SYSTABLESPACE
MAX(target.CURRENT_VERSION,source.CURRENT_VERSION)
MIN(target.OLDEST_VERSION,source.OLDEST_VERSION)
Related information
Table space versions (DB2 Administration Guide)
Error messages
At each LOCATE statement, the last data page and the new page that are being
located are checked for a few common errors, and messages are issued.
558
Data checks
Although REPAIR enables you to manipulate both user and DB2 data by bypassing
SQL, it does perform some checking of data. For example, if REPAIR tries to write
a page with the wrong page number, DB2 abnormally terminates with a 04E code
and reason code C200B0. If the page is broken because the broken page bit is on or
the incomplete page flag is set, REPAIR issues the following message:
DSNU670I + DSNUCBRP - PAGE X'000004' IS A BROKEN PAGE
CHECK-pending status
You are responsible for violations of referential constraints that are a result of
running REPAIR. These violations cause the target table space to be placed in the
CHECK-pending status.
Related reference
Chapter 8, CHECK DATA, on page 61
559
To resolve this error condition, submit the following control statement, which
specifies that REPAIR is to delete the nonindexed row and log the change. (The
LOG keyword is not required; the change is logged by default.) The RID option
identifies the row that REPAIR is to delete.
REPAIR
LOCATE TABLESPACE DSNDB04.TS1 RID (X'0000000503')
DELETE
If the condition code is 0, the DBDs are consistent. If the condition code is not 0,
the DBDs might be inconsistent. In this case, run REPAIR DBD with the
DIAGNOSE option, as shown in example 4, to find out more detailed information
about any inconsistencies.
Setting the pointer to zeros prevents the next step from updating link pointers
while deleting the orphan. Updating the link pointers can cause DB2 to
abnormally terminate if the orphans pointers are incorrect.
560
561
562
Output
The output from REPORT TABLESPACESET consists of the names of all table
spaces in the table space set that you specify. It also lists all tables in the table
spaces and all tables that are dependent on those tables.
The output from REPORT RECOVERY consists of the recovery history from the
SYSIBM.SYSCOPY catalog table, log ranges from the SYSIBM.SYSLGRNX directory
table, and volume serial numbers where archive log data sets from the BSDS
reside. In addition, REPORT RECOVERY output includes information about any
indexes on the table space that are in the informational COPY-pending status
because this information affects the recoverability of an index.
|
|
|
Authorization required:
To execute this utility, you must use a privilege set that includes one of the
following authorities:
v RECOVERDB privilege for the database
v DBADM or DBCTRL authority for the database. If the object on which the utility
operates is in an implicitly created database, DBADM authority on the implicitly
created database or DSNDB04 is required.
v SYSCTRL or SYSADM authority
An ID with DBCTRL or DBADM authority over database DSNDB06 can run the
REPORT utility on any table space in DSNDB01 (the directory) or DSNDB06 (the
catalog), as can any ID with installation SYSOPR, SYSCTRL, or SYSADM authority.
563
Phase Description
UTILINIT
Performs initialization
REPORT
Collects information
UTILTERM
Performs cleanup
Related concepts
Preparing for recovery on page 139
Syntax diagram
REPORT
RECOVERY
INDEX NONE
TABLESPACE
LIST listdef-name
table-space-name-spec
index-list-spec
TABLESPACESET
table-space-name-spec
TABLESPACE
INDEX ALL
info options
SHOWDSNS
index-list-spec:
INDEXSPACE
INDEX
index-space-name
database-name.
LIST listdef-name
index-name
creator-id.
LIST listdef-name
info options:
564
DSNUM ALL
DSNUM
integer
CURRENT
SUMMARY
LOCALSITE
RECOVERYSITE
ARCHLOG 1
ARCHLOG
2
ALL
table-space-name-spec:
table-space-name
database-name.
Option descriptions
RECOVERY
Indicates that recovery information for the specified table space or index is to
be reported.
TABLESPACE database-name.table-space-name
For REPORT RECOVERY, specifies the table space (and, optionally, the
database to which it belongs) that is being reported.
For REPORT TABLESPACESET, specifies a table space (and, optionally, the
database to which it belongs) in the table space set.
database-name
Optionally specifies the database to which the table space belongs.
table-space-name
Specifies the table space.
LISTlistdef-name
Specifies the name of a previously defined LISTDEF list name. The utility
allows one LIST keyword for each control statement of REPORT. The list
must contain only table spaces. Do not specify LIST with the
TABLESPACE...table-space-name specification. The TABLESPACE keyword is
required in order to validate the contents of the list. REPORT RECOVERY
TABLESPACE is invoked once per item in the list.
|
|
|
|
|
|
|
SHOWDSNS
Specifies that the VSAM data set names for each table space or index space
are to be included in the TABLESPACESET report. Data set names for base
objects are shown in the section titled TABLESPACE SET REPORT. Data set
names for CLONE objects are shown in the section titled CLONE
TABLESPACE SET REPORT. The later report is only prepared if the base
objects have been cloned.
INDEXSPACE database-name.index-space-name
Specifies the index space that is being reported.
database-name
Optionally specifies the database to which the index space belongs.
Chapter 27. REPORT
565
index-space-name
Specifies the index space name for the index that is being reported.
LIST listdef-name
Specifies the name of a previously defined LISTDEF list name. The utility
allows one LIST keyword for each control statement of REPORT. The list
must contain only index spaces. Do not specify LIST with the
INDEXSPACE index-space-name specification. The INDEXSPACE keyword is
required in order to validate the contents of the list. REPORT RECOVERY
INDEXSPACE is invoked once for each item in the list.
INDEX creator-id.index-name
Specifies the index in the index space that is being reported.
creator-id
Optionally specifies the creator of the index.
index-name
Specifies the index name that is to be reported. Enclose the index name in
quotation marks if the name contains a blank.
LIST listdef-name
Specifies the name of a previously defined LISTDEF list name. The utility
allows one LIST keyword for each control statement of REPORT. The list
must contain only index spaces. Do not specify LIST with the
INDEX...index-name specification. The INDEX keyword is required in order
to validate the contents of the list. REPORT RECOVERY INDEX is invoked
once for each item in the list.
The following REPORT keywords are optional:
INDEX NONE
Specifies that recovery information for index spaces that are associated
with the specified table space is not to be reported.
INDEX ALL
Specifies that recovery information for index spaces that are associated
with the specified table space is to be reported.
DSNUM
Identifies a partition or data set for which information is to be reported.
Alternatively, DSNUM specifies that information is to be reported for the
entire table space or index space.
ALL
Specifies that information is to be reported for the entire table space or
index space.
integer
Is the number of a partition or data set for which information is to be
reported. The maximum is 4096.
For a partitioned table space or partitioned index space, the integer is
its partition number.
For a nonpartitioned table space, find the integer at the end of the data
set name, as cataloged in the VSAM catalog. The data set name has the
following format:
catname.DSNDBx.dbname.tsname.y0001.Annn
In this format:
566
catname
Is the VSAM catalog name or alias.
x
Is C or D.
dbname
Is the database name.
tsname Is the table space name.
y
Is I or J.
nnn
CURRENT
Specifies that only the SYSCOPY entries that were written after the last
recovery point of the table space are to be reported. The last recovery point
is the last full image copy, LOAD REPLACE LOG YES image copy, or
REORG LOG YES image copy. If you specify DSNUM ALL, the last
recovery point is a full image copy that was taken for the entire table space
or index space. However, if you specify the CURRENT option, but the last
recovery point does not exist on the active log, DB2 prompts you to mount
archive tapes until this point is found.
CURRENT also reports only the SYSLGRNX rows and archive log volumes
that were created after the last incremental image copy entry. If no
incremental image copies were created, only the SYSLGRNX rows and
archive log volumes that were created after the last recovery point are
reported.
If you do not specify CURRENT or if no last recovery point exists, all
SYSCOPY and SYSLGRNX entries for that table space or index space are
reported, including those on archive logs. If you do not specify CURRENT,
the entries that were written after the last recovery point are marked with
an asterisk (*) in the report.
SUMMARY
Specifies that only a summary of volume serial numbers is to be reported.
It reports the following volume serial numbers:
v Where the archive log data sets from the BSDS reside
v Where the image copy data sets from SYSCOPY reside
If you do not specify SUMMARY, recovery information is reported, in
addition to the summary of volume serial numbers.
LOCALSITE
Specifies that all SYSCOPY records that were copied from a local site
system are to be reported.
RECOVERYSITE
Specifies that all SYSCOPY records that were copied from the recovery site
system are to be reported.
ARCHLOG
Specifies which archive log data sets are to be reported.
1
ALL
Reports both archive log data sets 1 and 2.
567
TABLESPACESET
Indicates that the names of all table spaces in the table space set, as well as
the names of all indexes on tables in the table space set, are to be reported.
Related reference
Chapter 15, LISTDEF, on page 185
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
The following object is named in the utility control statement and does not require
a DD statement in the JCL:
Table space
Object that is to be reported.
568
You can use REPORT TABLESPACESET to find the names of all members of a
table space set.
You can also use REPORT to obtain recovery information about the catalog and
directory. When doing so, use the CURRENT option to avoid unnecessary
mounting of archive tapes.
REPORT uses asterisks to denote any non-COPY entries that it finds in the
SYSIBM.SYSCOPY catalog table. For example, an entry that is added by the
QUIESCE utility is marked with asterisks in the REPORT output.
Recommendation: For image copies of partitioned table spaces that are taken with
the DSNUM ALL option, run REPORT RECOVERY DSNUM ALL. If you run
REPORT RECOVERY DSNUM ALL CURRENT, DB2 reports additional historical
information that dates back to the last full image copy that was taken for the entire
table space.
The REPORT RECOVERY utility output indicates whether any image copies are
unusable; image copies that were taken prior to REORG or LOAD events that reset
REORG-pending status are marked as unusable. In the REPORT RECOVERY
output, look at the IC TYPE and STYPE fields to help you determine which image
copies are unusable.
For example, in the sample REPORT RECOVERY output in the following figure,
the value in the first IC TYPE field, *R*, indicates that a LOAD REPLACE LOG
YES operation occurred. The value in the second IC TYPE field, <F> indicates that
a full image copy was taken.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DSNU582I ) 271 15:02:09.92 DSNUPPCP - REPORT RECOVERY TABLESPACE DBKQAA01.TPKQAA01 SYSCOPY ROWS
TIMESTAMP = 2006-09-28-15.00.07.773906, IC TYPE = *C*, SHR LVL = , DSNUM
= 0000,
START LRSN =000037940EEC
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
= DBKQAA01.TPKQAA01
, MEMBER NAME =
,
INSTANCE = 01, RELCREATED = M
TIMESTAMP = 2006-09-28-15.00.36.940517, IC TYPE = *R*, SHR LVL = , DSNUM
= 0000,
START LRSN =000037A07DAC
DEV TYPE =
,
IC BACK =
,
STYPE
= , FILE SEQ = 0000,
PIT LRSN = 000000000000
LOW DSNUM = 0000,
HIGH DSNUM = 0000,
OLDEST VERSION = 0000,
LOGICAL PART = 0000,
LOGGED = Y,
TTYPE =
JOBNAME = TJI11004,
AUTHID =
ADMF001 ,
COPYPAGESF = -1.0E+00
NPAGESF = -1.0E+00
,
CPAGESF = -1.0E+00
DSNAME
= DBKQAA01.TPKQAA01
, MEMBER NAME =
,
INSTANCE = 01, RELCREATED = M
Figure 87. Sample REPORT RECOVERY output before table space placed in REORG-pending status
After this image copy was taken, assume that an event occurred that put the table
space in REORG-pending status. The following figure shows the next several rows
of REPORT RECOVERY output for the same table space. The value in the first
ICTYPE field, *X* indicates that a REORG LOG YES event occurred. In the same
SYSCOPY record, the value in the STYPE field, A, indicates that this REORG job
reset the REORG-pending status. Any image copies that are taken before this status
Chapter 27. REPORT
569
was reset are unusable. (Thus, the full image copy in the REPORT output in the
previous figure is unusable.) The next record contains an F in the IC TYPE field
and an X in the STYPE field, which indicates that a full image copy was taken
during the REORG job. This image copy is usable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0000,
= 0000,
0000,
Figure 88. Sample REPORT RECOVERY output after REORG-pending status is reset
Related reference
SYSIBM.SYSCOPY table (DB2 SQL Reference)
570
Related concepts
Restart of an online utility on page 36
270
270
270
270
14:18:14.71
14:18:14.91
14:18:14.92
14:18:14.94
DSNUGUTC
DSNUGTIS
DSNUGUTC
DSNUPSET
:
:
:
:
:
:
:
:
:
:
:
DSN8D91A.DSN8S91D
DSN8910.DEPT
DSN8D91A.XDEPT1
DSN8910.XDEPT11
DSN8D91A.XDEPT2
DSN8910.XDEPT22
DSN8D91A.XDEPT3
DSN8910.XDEPT33
DSN8D91A.IRDOCIDD
DSN8910.I_DOCIDDEPT
DSN8910.DEPT
DSN8910.EMP
DSN8910.PROJ
TABLESPACE
TABLE
INDEXSPACE
INDEX
INDEXSPACE
INDEX
DEP TABLE
:
:
:
:
:
:
:
DSN8D91A.DSN8S91E
DSN8910.EMP
DSN8D91A.XEMP1
DSN8910.XEMP11
DSN8D91A.XEMP2
DSN8910.XEMP22
DSN8910.DEPT
DSN8910.EMPPROJACT
DSN8910.PROJ
TABLESPACE
TABLE
INDEXSPACE
INDEX
INDEXSPACE
INDEX
DEP TABLE
:
:
:
:
:
:
:
DSN8D91A.DSN8S91P
DSN8910.ACT
DSN8D91A.XACT1
DSN8910.XACT11
DSN8D91A.XACT2
DSN8910.XACT22
DSN8910.PROJACT
TABLE
INDEXSPACE
: DSN8910.EMPPROJACT
: DSN8D91A.XEMPPROJ
Chapter 27. REPORT
571
INDEX
INDEXSPACE
INDEX
: DSN8910.XEMPPROJACT1
: DSN8D91A.XEMP1AQJ
: DSN8910.XEMPPROJACT2
TABLE
INDEXSPACE
INDEX
INDEXSPACE
INDEX
DEP TABLE
:
:
:
:
:
:
DSN8910.PROJ
DSN8D91A.XPROJ1
DSN8910.XPROJ11
DSN8D91A.XPROJ2
DSN8910.XPROJ22
DSN8910.PROJ
DSN8910.PROJACT
TABLE
INDEXSPACE
INDEX
DEP TABLE
:
:
:
:
DSN8910.PROJACT
DSN8D91A.XPROJAC1
DSN8910.XPROJAC11
DSN8910.EMPPROJACT
: DSN8D91A.DSN8S91D
BASE TABLE
:
COLUMN
:
XML TABLESPACE
:
XML TABLE
:
XML NODEID INDEXSPACE:
XML NODEID INDEX
:
DSNU580I
DSNU010I
DSN8910.DEPT
XML1
DSN8D91A.XDEP0000
DSN8910.XDEPT
DSN8D91A.IRNODEID
DSN8910.I_NODEIDXDEPT
572
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/DSNU583I
UCDATE
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
UCTIME
11541904
11541916
11541929
11541940
11541952
11541964
11541975
11541987
11541998
11542010
11542022
11542035
11542046
11542059
11542074
11542087
11542199
11542201
11542202
11542202
11542203
11542205
11542205
11542206
11542207
11542209
START RBA
0000374F86EC
0000374FB0E1
0000374FDACA
000037500483
000037502E23
00003750582E
0000375081E7
00003750AB87
00003750D540
00003750FEE0
0000375128A2
00003751525B
000037517BFB
00003751A674
00003751D02D
00003751FA0B
00003752B0F9
00003752B4C1
00003752B84D
00003752BBD9
00003752BF65
00003752C31E
00003752C6AA
00003752CA36
00003752CDC2
00003752D1A4
STOP RBA
00003752195A
00003752195A
00003752195A
00003752195A
00003752195A
00003752195A
00003752195A
00003752195A
00003752195A
00003752195A
00003752195A
00003752195A
00003752195A
00003752195A
00003752195A
00003752195A
0000375C2734
0000375C275E
0000375C27D2
0000375C2846
0000375C28BA
0000375C292E
0000375C29A2
0000375C2A16
0000375C2A8A
0000375C2AFE
START LRSN
BF8110CF0ADF
BF8110CF26BE
BF8110CF4606
BF8110CF6209
BF8110CF7F04
BF8110CF9AFD
BF8110CFB7D6
BF8110CFD3C4
BF8110CFEFD4
BF8110D00D2F
BF8110D02A7E
BF8110D04860
BF8110D06558
BF8110D083D9
BF8110D0A7D6
BF8110D0C759
BF8110D1D925
BF8110D1DDFD
BF8110D1E02B
BF8110D1E252
BF8110D1E495
BF8110D1E75F
BF8110D1E9C9
BF8110D1EC01
BF8110D1EE6B
BF8110D1F14C
STOP LRSN
BF8110D0EB95
BF8110D0EC6F
BF8110D0ECEE
BF8110D0ED64
BF8110D0EE47
BF8110D0EED8
BF8110D0EF51
BF8110D0EFCC
BF8110D0F052
BF8110D0F0D6
BF8110D0F157
BF8110D0F204
BF8110D0F350
BF8110D0F413
BF8110D0F4DF
BF8110D0F567
BF8110F9EE17
BF8110F9EF2E
BF8110F9EFC8
BF8110F9F050
BF8110F9F0DB
BF8110F9F160
BF8110F9F1E2
BF8110F9F27D
BF8110F9F2FF
BF8110F9F390
PARTITION
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
MEMBER ID
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
573
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
100406
11542210
11542211
11542212
11542213
11542214
11542215
11555014
11555015
11555017
11555022
11555025
11555027
11555028
11555031
11555032
11555033
11555035
11555036
11555037
11555039
11555041
11555042
11555264
11555266
11555270
11555273
11555276
11555279
11555282
11555285
11555287
00003752D530
00003752D8BC
00003752DC48
00003752E000
00003752E38C
00003752E718
000037641512
0000376434E7
00003764A0F2
00003764C7F9
00003764E702
00003765060B
000037652514
00003765441D
000037656326
00003765822F
00003765A138
00003765C041
00003765E033
000037660033
000037662033
000037664033
00003767877D
00003767C8C1
000037682610
0000376856B9
00003768D63D
0000376936AB
00003769A5DE
00003769F6C1
0000376A3819
0000375C2B72
0000375C2BE6
0000375C2C5A
0000375C2CCE
0000375C2D42
0000375C2DB6
000037666079
0000376661A7
000037666303
00003766645F
0000376665BB
000037666717
000037666873
0000376669CF
000037666B2B
000037666C87
000037666DE3
000037666F3F
0000376670E8
000037667244
0000376673A0
0000376674FC
0000376FB01E
0000376FB452
0000376FB6C6
0000376FB93A
0000376FBBAE
0000376FBE22
0000376FC10C
0000376FC380
0000376FC5F4
BF8110D1F3C8
BF8110D1F65D
BF8110D1F8B9
BF8110D1FB35
BF8110D1FE1E
BF8110D20107
BF811125EB99
BF811125EDEB
BF811125F276
BF811125FD5C
BF8111260503
BF81112609DA
BF8111260DA8
BF8111261384
BF81112616B4
BF81112619C9
BF8111261D27
BF811126207C
BF8111262398
BF811126281F
BF8111262BA7
BF8111262F1D
BF8111284DEB
BF8111285307
BF8111285B65
BF8111286213
BF8111286AB6
BF81112870D0
BF8111287812
BF811128800C
BF8111288438
BF8110F9F469
BF8110F9F4ED
BF8110F9F58E
BF8110F9F64A
BF8110F9F6DF
BF8110F9F7A1
BF8111266663
BF8111266709
BF8111266796
BF811126682C
BF81112668A9
BF8111266922
BF81112669F5
BF8111266A77
BF8111266B08
BF8111266BA3
BF8111266C63
BF8111266CE5
BF8111266D5F
BF8111266DD6
BF8111266E50
BF8111266F25
BF8111357B9B
BF811135809D
BF811135868A
BF8111358C26
BF8111359150
BF811135970F
BF8111359D87
BF811135A49D
BF811135AA33
0011
0012
0013
0014
0015
0016
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0001
0002
0003
0004
0005
0006
0007
0008
0009
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
100406
100406
100406
100406
100406
100406
100406
11555288
11555291
11560588
11560591
11560594
11560597
11560599
0000376A88FC
0000376B1487
0000376BB087
0000376C2F10
0000376C9EB8
0000376D0CE6
0000376D4ED1
0000376FC868
0000376FCADC
0000376FCD50
0000376FD000
0000376FD274
0000376FD4E8
0000376FD75C
BF811128887F
BF8111288E59
BF811134ED6F
BF811134F463
BF811134FC1B
BF8111350379
BF81113507F8
BF811135AF57
BF811135B50D
BF811135B990
BF811135BFE2
BF811135C5E9
BF811135CB34
BF811135CF65
0010
0011
0012
0013
0014
0015
0016
0000
0000
0000
0000
0000
0000
0000
The following figure shows sample output for the statement REPORT RECOVERY
TABLESPACE ARCHLOG. Under message DSNU584I, the archive log entries after
the last recovery point are marked with an asterisk (*). If you code the CURRENT
option, the output from message DSNU584I would include only the archive logs
after the last recovery point and the asterisk (*) would not be included in the
report.
DSNU000I
DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = D7058005.RCVR3
DSNU1044I DSNUGTIS - PROCESSING SYSIN AS EBCDIC
DSNU050I
DSNUGUTC - REPORT RECOVERY TABLESPACE DB580501.TS580501 ARCHLOG ALL
DSNU581I = DSNUPREC - REPORT RECOVERY TABLESPACE DB580501.TS580501
DSNU593I = DSNUPREC - REPORT RECOVERY ENVIRONMENT RECORD:
'
MINIMUM
RBA: 000000000000
574
'
MAXIMUM
RBA: FFFFFFFFFFFF
'
MIGRATING RBA: 000000000000
DSNU582I = DSNUPPCP - REPORT RECOVERY TABLESPACE DB580501.TS580501 SYSCOPY ROWS
TIMESTAMP = 2002-09-17-10.03.16.784238, IC TYPE = *Q*, SHR LVL = , DSNUM
= 0000,
START LRSN =00001E58E60D
DEV TYPE =
,
IC BACK =
,
STYPE
= W, FILE SEQ = 0000,
PIT LRSN = 000000000000
LOW DSNUM = 0000,
HIGH DSNUM = 0000,
OLDEST VERSION = 0000,
LOGICAL PART = 3648 ,
LOGGED = Y,
TTYPE =
JOBNAME = T3951105,
AUTHID =
ADMF001 ,
COPYPAGESF = -1.0E+00
NPAGESF = -1.0E+00
,
CPAGESF = -1.0E+00
DSNAME
= DB580501.TS580501
,
MEMBER NAME =
INSTANCE = 01, RELCREATED = M
TIMESTAMP = 2002-09-17-10.03.22.937931, IC TYPE = *Z*, SHR LVL = , DSNUM
= 0000,
START LRSN =00001E5956A3
DEV TYPE =
,
IC BACK =
,
STYPE
= , FILE SEQ = 0000,
PIT LRSN = 000000000000
LOW DSNUM = 0000,
HIGH DSNUM = 0000,
OLDEST VERSION = 0000,
LOGICAL PART = 0000 ,
LOGGED = Y,
TTYPE =
JOBNAME = T3951105,
AUTHID =
ADMF001 ,
COPYPAGESF = -1.0E+00
NPAGESF = -1.0E+00
,
CPAGESF = -1.0E+00
DSNAME
= DB580501.TS580501
,
MEMBER NAME =
INSTANCE = 01, RELCREATED = M
TIMESTAMP = 2002-09-17-10.03.43.118193, IC TYPE = *Q*, SHR LVL = , DSNUM
= 0000,
START LRSN =00001E5A7B9D
DEV TYPE =
,
IC BACK =
,
STYPE
= W, FILE SEQ = 0000,
PIT LRSN = 000000000000
LOW DSNUM = 0000,
HIGH DSNUM = 0000,
OLDEST VERSION = 0000,
LOGICAL PART = 3648 ,
LOGGED = Y,
TTYPE =
JOBNAME = T3951106,
AUTHID =
ADMF001 ,
COPYPAGESF = -1.0E+00
NPAGESF = -1.0E+00
,
CPAGESF = -1.0E+00
DSNAME
= DB580501.TS580501
,
MEMBER NAME =
INSTANCE = 01, RELCREATED = M
TIMESTAMP = 2002-09-17-10.03.53.881540, IC TYPE = *Z*, SHR LVL = , DSNUM
= 0000,
START LRSN =00001E5ADC6E
DEV TYPE =
,
IC BACK =
,
STYPE
= , FILE SEQ = 0000,
PIT LRSN = 000000000000
LOW DSNUM = 0000,
HIGH DSNUM = 0000,
OLDEST VERSION = 0000,
LOGICAL PART = 0000 ,
LOGGED = Y,
TTYPE =
JOBNAME = T3951106,
AUTHID =
ADMF001 ,
COPYPAGESF = -1.0E+00
NPAGESF = -1.0E+00
,
CPAGESF = -1.0E+00
DSNAME
= DB580501.TS580501
,
MEMBER NAME =
INSTANCE = 01, RELCREATED = M
TIMESTAMP = 2002-09-17-10.04.02.955333, IC TYPE = *Q*, SHR LVL = , DSNUM
= 0000,
START LRSN =00001E624A3C
DEV TYPE =
,
IC BACK =
,
STYPE
= W, FILE SEQ = 0000,
PIT LRSN = 000000000000
LOW DSNUM = 0000,
HIGH DSNUM = 0000,
OLDEST VERSION = 0000,
LOGICAL PART = 3648 ,
LOGGED = Y,
TTYPE =
JOBNAME = T3951106,
AUTHID =
ADMF001 ,
COPYPAGESF = -1.0E+00
NPAGESF = -1.0E+00
,
CPAGESF = -1.0E+00
DSNAME
= DB580501.TS580501
,
MEMBER NAME =
INSTANCE = 01, RELCREATED = M
DSNU586I = DSNUPSUM - REPORT RECOVERY TABLESPACE DB580501.TS580501 SUMMARY
DSNU588I = DSNUPSUM - NO DATA TO BE REPORTED
DSNU583I
UCDATE
091702
091702
091702
091702
= DSNUPPLR
UCTIME
10025977
10030124
10032302
10035391
DSNU584I
MEMBER ID
0000
0000
0000
0000
*
*
*
*
575
START TIME
END TIME
START RBA
END RBA
UNIT VOLSER
DATA SET NAME
20022601702454 20022601704156 00001E48B000 00001E629FFF SYSDA SCR03 DSNC810.ARCHLOG1.A0000005
DSNU584I = DSNUPPBS - REPORT RECOVERY TABLESPACE DB580501.TS580501 ARCHLOG2 BSDS VOLUMES
DSNU588I = DSNUPPBS - NO DATA TO BE REPORTED
DSNU586I = DSNUPSUM - REPORT RECOVERY TABLESPACE DB580501.TS580501 SUMMARY
ARCHLOG1 BSDS VOLSER(S)
SCR03 *
DSNU589I = DSNUPREC - REPORT RECOVERY TABLESPACE DB580501.TS580501 COMPLETE
DSNU580I
DSNUPORT - REPORT UTILITY COMPLETE - ELAPSED TIME=00:00:00
DSNU010I
DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST RETURN CODE=0
DSNU000I
DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = D7058005.RCVR3
DSNU1044I DSNUGTIS - PROCESSING SYSIN AS EBCDIC
DSNU050I
DSNUGUTC - REPORT RECOVERY TABLESPACE DB580501.TS580501 CURRENT
DSNU581I = DSNUPREC - REPORT RECOVERY TABLESPACE DB580501.TS580501
DSNU585I = DSNUPREC - REPORT RECOVERY TABLESPACE DB580501.TS580501 CURRENT
DSNU593I = DSNUPREC - REPORT RECOVERY ENVIRONMENT RECORD:
'
MINIMUM
RBA: 000000000000
'
MAXIMUM
RBA: FFFFFFFFFFFF
'
MIGRATING RBA: 000000000000
DSNU582I = DSNUPPCP - REPORT RECOVERY TABLESPACE DB580501.TS580501 SYSCOPY ROWS
TIMESTAMP = 2002-09-17-10.03.16.784238, IC TYPE = *Q*, SHR LVL = , DSNUM
= 0000,
START LRSN =00001E58E60D
DEV TYPE =
,
IC BACK =
,
STYPE
= W, FILE SEQ = 0000,
PIT LRSN = 000000000000
LOW DSNUM = 0000,
HIGH DSNUM = 0000,
OLDEST VERSION = 0000,
LOGICAL PART = 3648 ,
LOGGED = Y,
TTYPE =
JOBNAME = T3951105,
AUTHID =
ADMF001 ,
COPYPAGESF = -1.0E+00
NPAGESF = -1.0E+00
,
CPAGESF = -1.0E+00
DSNAME
= DB580501.TS580501
,
MEMBER NAME =
,
INSTANCE = 01, RELCREATED = M
TIMESTAMP = 2002-09-17-10.03.22.937931, IC TYPE = *Z*, SHR LVL = , DSNUM
= 0000,
START LRSN =00001E5956A3
DEV TYPE =
,
IC BACK =
,
STYPE
= , FILE SEQ = 0000,
PIT LRSN = 000000000000
LOW DSNUM = 0000,
HIGH DSNUM = 0000,
OLDEST VERSION = 0000,
LOGICAL PART = 0000 ,
LOGGED = Y,
TTYPE =
JOBNAME = T3951105,
AUTHID =
ADMF001 ,
COPYPAGESF = -1.0E+00
NPAGESF = -1.0E+00
,
CPAGESF = -1.0E+00
DSNAME
= DB580501.TS580501
,
MEMBER NAME =
,
INSTANCE = 01, RELCREATED = M
...
TIMESTAMP = 2002-09-17-10.04.02.955333, IC TYPE = *Q*, SHR LVL = , DSNUM
= 0000,
START LRSN =00001E624A3C
DEV TYPE =
,
IC BACK =
,
STYPE
= W, FILE SEQ = 0000,
PIT LRSN = 000000000000
LOW DSNUM = 0000,
HIGH DSNUM = 0000,
OLDEST VERSION = 0000,
LOGICAL PART = 3648 ,
LOGGED = Y,
TTYPE =
JOBNAME = T3951106,
AUTHID =
ADMF001 ,
COPYPAGESF = -1.0E+00
NPAGESF = -1.0E+00
,
CPAGESF = -1.0E+00
DSNAME
= DB580501.TS580501
,
MEMBER NAME =
,
INSTANCE = 01, RELCREATED = M
DSNU586I
DSNU588I
DSNU583I
UCDATE
091702
091702
091702
091702
= DSNUPPLR
UCTIME
10025977
10030124
10032302
10035391
MEMBER ID
0000
0000
0000
0000
576
DSNU586I
DSNU589I
DSNU580I
Related reference
SYSIBM.SYSCOPY table (DB2 SQL Reference)
577
DSNU583I
UCDATE
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
092706
DSNU584I
) 270 13:00:51.61 DSNUPPBS - REPORT RECOVERY TABLESPACE DSN8D91A.DSN8S91E ARCHLOG1 BSDS VOLUMES
578
DSNU588I
DSNU586I
DSNU588I
DSNU589I
DSNU580I
DSNU010I
277
277
277
277
11:19:09.40
11:19:09.59
11:19:09.59
11:19:09.62
DSNUGUTC
DSNUGTIS
DSNUGUTC
DSNUPSET
:
:
:
:
DSN8D91L.DSN8S91B
DSN8910.EMP_PHOTO_RESUME
DSN8D91L.XEMPRPHO
DSN8910.XEMP_PHOTO_RESUME
: DSN8D91L.DSN8S91B
BASE TABLE
COLUMN
LOB TABLESPACE
AUX TABLE
AUX INDEXSPACE
AUX INDEX
COLUMN
LOB TABLESPACE
AUX TABLE
AUX INDEXSPACE
AUX INDEX
COLUMN
LOB TABLESPACE
AUX TABLE
AUX INDEXSPACE
AUX INDEX
DSNU580I
DSNU010I
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
DSN8910.EMP_PHOTO_RESUME
PSEG_PHOTO
DSN8D91L.DSN8S91L
DSN8910.AUX_PSEG_PHOTO
DSN8D91L.XAUXRPSE
DSN8910.XAUX_PSEG_PHOTO
BMP_PHOTO
DSN8D91L.DSN8S91M
DSN8910.AUX_BMP_PHOTO
DSN8D91L.XAUXRBMP
DSN8910.XAUX_BMP_PHOTO
RESUME
DSN8D91L.DSN8S91N
DSN8910.AUX_EMP_RESUME
DSN8D91L.XAUXREMP
DSN8910.XAUX_EMP_RESUME
579
580
DSNU583I
UCDATE
092706
092706
092706
092706
092706
092706
DSNU584I
DSNU588I
) 271 18:15:27.66 DSNUPPBS - REPORT RECOVERY TABLESPACE DSN8D91A.DSN8S91E ARCHLOG1 BSDS VOLUMES
) 271 18:15:27.66 DSNUPPBS - NO DATA TO BE REPORTED
DSNU586I
DSNU588I
DSNU589I
DSNU580I
DSNU010I
581
DSNU583I
DSNU588I
) 270 13:51:09.05 DSNUPPLR - SYSLGRNX ROWS FROM REPORT RECOVERY FOR INDEX DSN8910.XDEPT1
) 270 13:51:09.05 DSNUPPLR - NO DATA TO BE REPORTED
DSNU584I
DSNU588I
DSNU586I
DSNU588I
DSNU589I
SUMMARY
DSNU580I
DSNU010I
SUMMARY
COMPLETE
|
|
|
|
582
:
:
:
:
DBKQAN01.TPKQAN01
ADMF001.TBKQAN01
DBKQAN01.IPKQAN11
ADMF001.IPKQAN111
INDEXSPACE
INDEX
INDEXSPACE
INDEX
:
:
:
:
DBKQAN01.IRDOCIDT
ADMF001.I_DOCIDTBKQAN01
DBKQAN01.IXKQAN12
ADMF001.IXKQAN122
: DBKQAN01.TPKQAN01
BASE TABLE
:
COLUMN
:
XML TABLESPACE
:
XML TABLE
:
XML NODEID INDEXSPACE:
XML NODEID INDEX
:
XML INDEXSPACE
:
XML INDEX
:
COLUMN
:
XML TABLESPACE
:
XML TABLE
:
XML NODEID INDEXSPACE:
XML NODEID INDEX
:
XML INDEXSPACE
:
XML INDEX
:
ADMF001.TBKQAN01
XML1
DBKQAN01.XTBK0000
ADMF001.XTBKQAN01
DBKQAN01.IRNODEID
ADMF001.I_NODEIDXTBKQAN01
DBKQAN01.XVIXLC11
ADMF001.XVIXLC11
XML2
DBKQAN01.XTBK0001
ADMF001.XTBKQAN01000
DBKQAN01.IRNO1MH2
ADMF001.I_NODEIDXTBKQAN01000
DBKQAN01.XVIXLC12
ADMF001.XVIXLC12
The following control statement specifies that the REPORT utility is to provide
recovery information for table space DSN8D81A.DSN8S81E.
REPORT TABLESPACESET TABLESPACE DBKQBG01.TPKQBG01 SHOWDSNS
583
584
To be able to use system-level backups that have been dumped to tape, the level of
DFSMShsm must be V1R8 or higher.
By default, RESTORE SYSTEM recovers the data from the database copy pool
during the RESTORE phase and then applies logs to the point in time at which the
existing logs were truncated during the LOGAPPLY phase. The RESTORE utility
never restores logs from the log copy pool.
Restriction: RESTORE SYSTEM does not restore logs; the utility only applies the
logs. If you specified BACKUP SYSTEM FULL to create copies of both the data
and the logs, you can restore the logs by another method.
Output:
Output for RESTORE SYSTEM is the recovered copy of the data volume or
volumes.
Authorization required
To run this utility, you must use a privilege set that includes SYSADM authority.
585
UTILTERM
Performs cleanup
Related reference
Chapter 5, BACKUP SYSTEM, on page 43
Related information
System-level point-in-time recovery using the BACKUP SYSTEM utility (DB2
Administration Guide)
Syntax diagram
RESTORE SYSTEM
LOGONLY
FROMDUMP
TAPEUNITS
DUMPCLASS
dcl
RSA
key-label
(num-tape-units)
Option descriptions
LOGONLY
Specifies that the database volumes have already been restored, so the
RESTORE phase is skipped. Use this option when the database volumes have
already been restored outside of DB2. If the subsystem is at a tracker site, you
must specify the LOGONLY option.
FROMDUMP
Indicates that you want to dump only the database copy pool to tape during
the restore.
|
|
|
|
|
DUMPCLASS (dcl)
Indicates what DFSMShsm dump class to use for the restore.
|
|
RSA (key-label)
Specifies that the key-label in the utility control statement will be passed to
586
|
|
|
|
|
|
|
The FROMDUMP and DUMPCLASS options that you specify for the RESTORE
SYSTEMS utility override the RESTORE/RECOVER FROM DUMP and
DUMPCLASS NAME install options that you specify on installation panel
DSNTIP6.
|
|
|
|
TAPEUNITS
Specifies the limit on the number of table drives that the utility should
dynamically allocate during the restore of the database copy pool from dumps
on tape.
|
|
|
The default is the option that you specified on the installation panel DSNTIP6.
If no default is specified, then the RESTORE SYSTEM utility will try to use all
of the tape drives in your system.
|
|
|
|
|
(num-tape-units)
Specifies the maximum number of tape drives to allocate. If you specify
zero, or you do not specify a value, the utility determines the optimal
number of tape units to use. RESTORE SYSTEM TAPEUNITS has a max
value of 255.
Related information
Recovering from disasters by using a tracker site (DB2 Administration Guide)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To determine whether the system level backup will be restored from disk or from
tape:
v If FROMDUMP was not specified and the system-level backup resides on disk,
DB2 uses it for the restore.
Chapter 28. RESTORE SYSTEM
587
|
|
|
|
|
|
|
588
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
auth-id.job-name.HSM
589
Related concepts
Restart of an online utility on page 36
|
|
|
|
|
590
//STEP1
EXEC DSNUPROC,TIME=1440,
//
UTPROC='',
//
SYSTEM='DSN'
//SYSIN
DD *
RESTORE SYSTEM LOGONLY
/*
The following control statement specifies that the RESTORE SYSTEM utility is to
only consider dumps on tape of the database copy pool for restore. During the
restore, the utility will dynamically allocate a maximum of 4 tape units.
//SYSOPRB JOB (ACCOUNT),'NAME',CLASS=K
//UTIL EXEC DSNUPROC,SYSTEM=V91A,UID='TEMB',UTPROC=''
//*
//*
//DSNUPROC.SYSUT1 DD DSN=SYSOPR.SYSUT1,
//
DISP=(MOD,DELETE,CATLG),
//
SPACE=(16384,(20,20),,,ROUND),
//
UNIT=SYSDA
//DSNUPROC.SYSIN
DD *
RESTORE SYSTEM FROMDUMP TAPEUNITS 4
//
Related information
System-level point-in-time recovery using the BACKUP SYSTEM utility (DB2
Administration Guide)
591
592
When you run RUNSTATS TABLESPACE, you can use the HISTOGRAM option,
with the COLGROUP option, to indicate that histogram statistics are to be
gathered for the specified group of columns. RUNSTATS TABLESPACE will ignore
HISTOGRAM when processing XML table spaces and indexes. When you run
RUNSTATS INDEX, histogram statistics can only be collected on the prefix
columns with the same order. Key columns with a mixed order are not allowed for
histogram statistics. RUNSTATS INDEX will ignore HISTOGRAM when processing
XML NODEID or VALUES indexes.
Output
RUNSTATS updates the DB2 catalog with table space or index space statistics,
prints a report, or both.
Authorization required
To execute this utility, you must use
following authorities:
v STATS privilege for the database
v DBADM, DBCTRL, or DBMAINT
which the utility operates is in an
on the implicitly created database
Copyright IBM Corp. 1983, 2009
593
594
RUNSTATS TABLESPACE
LIST
listdef-name
table-space-name
database-name.
FORCEROLLUP NO
PART integer
FORCEROLLUP YES
(1)
ALL
TABLE
sample-spec
TABLE
(1)
(table-name)
sample-spec
column-spec
colgroup-spec
SHRLEVEL REFERENCE
(
ALL
SHRLEVEL CHANGE
INDEX
correlation-stats-spec
,
( index-name
correlation-stats-spec
PART integer
(2)
REPORT NO
UPDATE ALL
HISTORY NONE
REPORT YES
UPDATE
HISTORY
ACCESSPATH
SPACE
NONE
ALL
ACCESSPATH
SPACE
SORTDEVT device-type
SORTNUM integer
Notes:
1
You can change the default HISTORY value by modifying the STATISTICS HISTORY subsystem
parameter. By default, this value is NONE.
sample-spec:
SAMPLE
25
integer
column-spec:
595
COLUMN (
ALL
,
COLUMN (
column-name
colgroup-spec:
,
COLGROUP (
column-name
colgroup-stats-spec
colgroup-stats-spec:
MOST
FREQVAL COUNT
NUMQUANTILES 100
integer
HISTOGRAM
BOTH
LEAST
NUMQUANTILES
integer
correlation-stats-spec:
|
FREQVAL NUMCOLS 1
COUNT 10
MOST
MOST
KEYCARD
FREQVAL NUMCOLS
integer
COUNT
integer
BOTH
LEAST
NUMCOLS 1
NUMQUANTILES 100
HISTOGRAM
NUMQUANTILES 100
NUMCOLS integer
NUMQUANTILES
integer
596
LIST listdef-name
Specifies the name of a previously defined LISTDEF list name. You can
specify one LIST keyword for each RUNSTATS control statement. When
you specify this keyword with RUNSTATS TABLESPACE, the list must
contain only table spaces. Do not specify LIST with keywords from the
TABLE...(table-name) specification. Instead, specify LIST with TABLE (ALL).
Likewise, do not specify LIST with keywords from the
INDEX...(index-name) specification. You cannot specify index names with a
list. Use INDEX(ALL) instead.
If you specify LIST, you cannot specify the PART option. Instead, use the
PARTLEVEL option on the LISTDEF statement. The TABLESPACE
keyword is required in order to validate the contents of the list.
RUNSTATS TABLESPACE is invoked once for each item in the list.
database-name
Identifies the name of the database to which the table space belongs.
The default value is DSNDB04.
table-space-name
Identifies the name of the table space on which statistics are to be
gathered.
If the table space that is specified by the TABLESPACE keyword is a LOB table
space, you can specify only the following additional keywords: SHRLEVEL
REFERENCE or CHANGE, REPORT YES or NO, and UPDATE ALL or NONE.
PART integer
Identifies a table space partition on which statistics are to be collected.
integer is the number of the partition and must be in the range from 1 to the
number of partitions that are defined for the table space. The maximum is
4096.
You cannot specify PART with LIST.
TABLE
Specifies the table on which column statistics are to be gathered. All tables
must belong to the table space that is specified in the TABLESPACE option.
You cannot specify the TABLE option for a LOB table space.
(ALL)
Specifies that column statistics are to be gathered on all columns of all
tables in the table space.
(table-name)
Specifies the tables on which column statistics are to be gathered. If you
omit the qualifier, RUNSTATS uses the user identifier for the utility job as
the qualifier. Enclose the table name in quotation marks if the name
contains a blank.
If you specify more than one table, you must repeat the TABLE option.
Multiple TABLE options must be specified entirely before or after any
INDEX keyword that may also be specified. For example, the INDEX
keyword may not be specified between any two TABLE keywords.
SAMPLE integer
Indicates the percentage of rows that RUNSTATS is to sample when collecting
statistics on non-indexed columns. You can specify any value from 1 through
100.
597
|
|
|
|
FREQVAL
Indicates, when specified with the COLGROUP option, that frequency statistics
are also to be gathered for the specified group of columns. (COLGROUP
indicates that cardinality statistics are to be gathered.) One group of statistics is
gathered for each column. You must specify COUNT integer with COLGROUP
FREQVAL. RUNSTATS TABLESPACE will ignore FREQVAL
MOST/LEAST/BOTH when processing XML table spaces and indexes.
COUNT integer
Indicates the number of frequently occurring values to be collected from
the specified column group. For example, COUNT 20 means that DB2
collects 20 frequently occurring values from the column group. You must
specify a value for integer; no default value is assumed.
Be careful when specifying a high value for COUNT. Specifying a value of
1000 or more can increase the prepare time for some SQL statements.
598
MOST
Indicates that the utility is to collect the most frequently occurring values
for the specified set of columns when COLGROUP is specified.
BOTH
Indicates that the utility is to collect the most and the least frequently
occurring values for the specified set of columns when COLGROUP is
specified.
LEAST
Indicates that the utility is to collect the least frequently occurring values
for the specified set of columns when COLGROUP is specified.
|
|
|
|
|
|
HISTOGRAM
Indicates, when specified with the COLGROUP option, that histogram statistics
are to be gathered for the specified group of columns. RUNSTATS
TABLESPACE will ignore HISTOGRAM when processing XML table spaces
and indexes.
NUMQUANTILES integer
|
|
|
|
|
Indicates how many quantiles that the utility is to collect. The integer value
must be equal to or greater than one. The number of quantiles that you
specify should never exceed the total number of distinct values in the
column or the column group. The maximum number of quantiles allowed
is 100.
|
|
|
599
FREQVAL
Controls, when specified with the INDEX option, the collection of
frequent-value statistics. If you specify FREQVAL with INDEX, this keyword
must be followed by the NUMCOLS and COUNT keywords.
|
|
|
|
NUMCOLS integer
Indicates the number of columns in the index for which RUNSTATS is to
collect frequently occurring values. integer can be a number between 1 and
the number of indexed columns. If you specify a number greater than the
number of indexed columns, RUNSTATS uses the number of columns in
the index.
|
|
|
|
|
|
|
|
|
|
|
For example, suppose that you have an index defined on three columns: A,
B, and C. If you specify NUMCOLS 1, DB2 collects frequently occurring
values for column A. If you specify NUMCOLS 2, DB2 collects frequently
occurring values for the column set A and B. If you specify NUMCOLS 3,
DB2 collects frequently occurring values for the column set A, B, and C.
|
|
|
|
|
|
|
|
|
|
|
|
|
HISTOGRAM
Indicates, when specified with the INDEX option, that histogram statistics are
to be gathered for the specified key columns. Histogram statistics can only be
collected on the prefix columns with the same order. Key columns for
histogram statistics with a mixed order are not allowed.
|
|
When RUNSTATS collects histogram statistics for partition table spaces, it will
aggregate them into SYSCOLDIST.
NUMQUANTILES integer
|
|
|
|
Indicates how many quantiles that the utility is to collect. The integer value
must be equal to or greater than one. The number of quantiles that you
specify should never exceed the total number of distinct values in the key
columns specified. The maximum number of quantiles allowed is 100.
|
|
|
600
REPORT
Specifies whether RUNSTATS is to generate a set of messages that report the
collected statistics.
NO
Indicates that RUNSTATS is not to generate the set of messages.
YES
Indicates that the set of messages is to be sent as output to SYSPRINT. The
messages that RUNSTATS generates are dependent on the combination of
keywords in the utility control statement. However, these messages are not
dependent on the value of the UPDATE option. REPORT YES always
generates a report of space and access path statistics.
UPDATE
Indicates which collected statistics are to be inserted into the catalog tables.
ALL
Indicates that all collected statistics are to be updated in the catalog.
ACCESSPATH
Indicates that DB2 is to update the catalog with only those statistics that
are used for access path selection.
SPACE
Indicates that DB2 is to update the catalog with only space-related
statistics.
NONE
Indicates that no catalog tables are to be updated with the collected
statistics.
Executing RUNSTATS always invalidates the dynamic cache; however,
when you specify UPDATE NONE REPORT NO, RUNSTATS invalidates
statements in the dynamic statement cache without collecting statistics,
updating catalogs tables, or generating reports.
HISTORY
Indicates which statistics are to be recorded in the catalog history tables. The
value that you specify for HISTORY does not depend on the value that you
specify for UPDATE.
The default is the value of the STATISTICS HISTORY subsystem parameter on
the DSNTIPO installation panel. By default, this parameter value is NONE.
ALL
Indicates that all collected statistics are to be updated in the catalog history
tables.
ACCESSPATH
Indicates that DB2 is to update the catalog history tables with only those
statistics that are used for access path selection.
SPACE
Indicates that DB2 is to update the catalog history tables with only
space-related statistics.
NONE
Indicates that no catalog history tables are to be updated with the collected
statistics.
601
SORTDEVT
Specifies the device type that DFSORT uses to dynamically allocate the sort
work data sets that are required.
|
|
|
|
|
|
device-type
Specifies any device type that is acceptable for the DYNALLOC parameter
of the SORT or OPTIONS option of DFSORT. For information about valid
device types, see DFSORT Application Programming: Guide.
|
|
|
|
If you omit SORTDEVT, a sort is required, and you have not provided the DD
statements that the SORT program requires for the temporary data sets,
SORTDEVT will default to SYSALLDA and the temporary data sets will be
dynamically allocated.
|
|
|
|
|
|
|
You need at least two sort work data sets for each sort. The SORTNUM value
applies to each sort invocation in the utility. For example, if there are three
indexes, SORTKEYS is specified, there are no constraints limiting parallelism,
and SORTNUM is specified as 8, then a total of 24 sort work data sets will be
allocated for a job.
|
|
|
|
Each sort work data set consumes both above the line and below the line
virtual storage, so if you specify too high a value for SORTNUM, the utility
may decrease the degree of parallelism due to virtual storage constraints, and
possibly decreasing the degree down to one, meaning no parallelism.
|
|
602
RUNSTATS INDEX
LIST
listdef-name
correlation-stats-spec
,
( index-name
(
ALL
correlation-stats-spec
)
PART integer
TABLESPACE
tablespace-name
correlation-stats-spec
database-name.
SHRLEVEL REFERENCE
REPORT NO
UPDATE ALL
SHRLEVEL CHANGE
REPORT YES
UPDATE
SORTDEVT device-type
ACCESSPATH
SPACE
NONE
(1)
HISTORY NONE
FORCEROLLUP NO
HISTORY
FORCEROLLUP YES
SORTNUM
integer
ALL
ACCESSPATH
SPACE
Notes:
1
You can change the default HISTORY value by modifying the STATISTICS HISTORY subsystem
parameter. By default, this value is NONE.
correlation-stats-spec:
|
FREQVAL NUMCOLS 1
COUNT 10
MOST
MOST
KEYCARD
FREQVAL NUMCOLS
integer
COUNT
integer
BOTH
LEAST
NUMCOLS 1
NUMQUANTILES 100
HISTOGRAM
NUMQUANTILES 100
NUMCOLS integer
NUMQUANTILES
integer
603
|
|
|
NUMCOLS integer
Indicates the number of columns in the index for which RUNSTATS is to
604
MOST
Indicates that the utility is to collect the most frequently occurring values
for the specified set of key columns when FREQVAL NUMCOLS COUNT
MOST keywords are specified.
|
|
|
|
LEAST
Indicates that the utility is to collect the least frequently occurring values
for the specified set of key columns when FREQVAL NUMCOLS COUNT
LEAST keywords are specified.
|
|
|
|
BOTH
Indicates that the utility is to collect the most and the least frequently
occurring values for the specified set of key columns when FREQVAL
NUMCOLS COUNT BOTH keywords are specified.
|
|
|
|
|
HISTOGRAM
Indicates, when specified with the INDEX option, that histogram statistics are
to be gathered for the specified key columns. Histogram statistics can only be
collected on the prefix columns with the same order. Key columns for
histogram statistics with a mixed order are not allowed.
|
|
|
|
|
|
|
|
NUMQUANTILES integer
Indicates how many quantiles that the utility is to collect. The integer value
must be equal to or greater than one. The number of quantiles that you
specify should never exceed the total number of distinct values in the
specified key columns. The maximum number of quantiles is 100.
|
|
|
605
REFERENCE
Allows only read-only access by other programs.
CHANGE
Allows other programs to change the table space or index. With
SHRLEVEL CHANGE, RUNSTATS might collect statistics on uncommitted
data.
REPORT
Specifies whether RUNSTATS is to generate a set of messages that report the
collected statistics.
NO
Indicates that RUNSTATS is not to generate the set of messages.
YES
Indicates that the set of messages is to be sent as output to SYSPRINT. The
messages that RUNSTATS generates are dependent on the combination of
keywords in the utility control statement. However, these messages are not
dependent on the value of the UPDATE option. REPORT YES always
generates a report of space and access path statistics.
UPDATE
Indicates which collected statistics are to be inserted into the catalog tables.
ALL
Indicates that all collected statistics are to be updated in the catalog.
ACCESSPATH
Indicates that DB2 is to update the catalog with only those statistics that
are used for access path selection.
SPACE
Indicates that DB2 is to update the catalog with only space-related
statistics.
NONE
Indicates that no catalog tables are to be updated with the collected
statistics.
Executing RUNSTATS always invalidates the dynamic cache; however,
when you specify UPDATE NONE REPORT NO, RUNSTATS invalidates
statements in the dynamic statement cache without collecting statistics,
updating catalogs tables, or generating reports.
SORTDEVT
Specifies the device type that DFSORT uses to dynamically allocate the sort
work data sets that are required.
device-type
Specifies any disk device type that is acceptable for the DYNALLOC
parameter of the SORT or OPTIONS option of DFSORT.
|
|
|
If you omit SORTDEVT, a sort is required, and you have not provided the DD
statements that the SORT program requires for the temporary data sets,
SORTDEVT will default to SYSALLDA and the temporary data sets will be
dynamically allocated.
If you specify SORTDEVT and omit SORTNUM, no value is passed to
DFSORT; DFSORT uses its own default.
606
SORTNUM
Specifies the number of required sort work data sets that DFSORT is to
allocate.
integer is the number of temporary data sets that can range from 2 to 255.
|
|
|
|
|
You need at least two sort work data sets for each sort. The SORTNUM value
applies to each sort invocation in the utility. For example, if there are three
indexes, SORTKEYS is specified, there are no constraints limiting parallelism,
and SORTNUM is specified as 8, then a total of 24 sort work data sets will be
allocated for a job.
|
|
|
|
Each sort work data set consumes both above the line and below the line
virtual storage, so if you specify too high a value for SORTNUM, the utility
may decrease the degree of parallelism due to virtual storage constraints, and
possibly decreasing the degree down to one, meaning no parallelism.
HISTORY
Indicates which statistics are to be recorded in the catalog history tables. The
value that you specify for HISTORY does not depend on the value that you
specify for UPDATE.
The default is the value of the STATISTICS HISTORY subsystem parameter on
the DSNTIPO installation panel. By default, this parameter value is NONE.
ALL
Indicates that all collected statistics are to be updated in the catalog history
tables.
ACCESSPATH
Indicates that DB2 is to update the catalog history tables with only those
statistics that are used for access path selection.
SPACE
Indicates that DB2 is to update the catalog history tables with only
space-related statistics.
NONE
Indicates that no catalog history tables are to be updated with the collected
statistics.
FORCEROLLUP
Specifies whether aggregation or rollup of statistics is to occur even if statistics
have not been gathered on some partitions. This option enables the optimizer
to select the best access path.
YES
Indicates that forced aggregation or rollup processing is to be done, even
though some partitions might not contain data.
NO
Indicates that aggregation or rollup is to be done only if data is available
for all partitions.
If the value for STATISTICS ROLLUP on panel DSNTIPO is NO and data is
not available for all partitions, DB2 issues message DSNU623I.
607
Related reference
Chapter 15, LISTDEF, on page 185
608
Data set
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
RNPRIN01
No1
STPRIN01
Yes1, 2, 4
No2, 3
No3
|
|
|
|
Description
Required?
Note:
1. Required when collecting distribution statistics for column groups.
2. Required when collecting statistics on at least one data-partitioned secondary index.
3. If the DYNALLOC parm of the SORT program is not turned on, you need to allocate the
data set. Otherwise, DFSORT dynamically allocates the temporary data set.
4. Required when the COLGROUP with FREQVAL options are specified.
5. It is recommended that you use dynamic allocation by specifying SORTDEVT in the
utility statement because dynamic allocation reduces the maintenance required of the
utility job JCL.
The following objects are named in the utility control statement and do not require
DD statements in the JCL:
Table space or index
Object that is to be scanned.
The SORTWK01 data set is used when collecting distribution statistics. To calculate
the approximate size (in bytes) of the SORTWK01 data set, use the following
formula:
(longest_record_length + prefix) sum from 1 to N (#colgroupsn #rows - n)
The variables in the preceding formula have the following values:
N
#colgroupsn
Number of column groups that are specified for the nth table
#rows
609
|
|
|
The ST02WKnn data sets are used when collecting frequency statistics on at least
one COLGROUP. To calculate the approximate size (in bytes) of the ST02WKnn
data set, use the following formula:
DB2 utilities use DFSORT to perform sorts. Sort work data sets cannot span
volumes. Smaller volumes require more sort work data sets to sort the same
amount of data; therefore, large volume sizes can reduce the number of needed
sort work data sets. When you allocate sort work data sets on disk, the
recommended amount of space to allow provides at least 1.2 times the amount of
data that is to be sorted.
|
|
|
|
|
|
Claims
The following table shows which claim classes RUNSTATS claims and drains and
any restrictive state that the utility sets on the target object.
Table 105. Claim classes of RUNSTATS operations
RUNSTATS
TABLESPACE
SHRLEVEL
REFERENCE
RUNSTATS
TABLESPACE
SHRLEVEL
CHANGE
RUNSTATS
INDEX
SHRLEVEL
REFERENCE
RUNSTATS
INDEX
SHRLEVEL
CHANGE
Table space or
partition
DW/UTRO
CR/UTRW1
None
None
Index or
partition
None
None
DW/UTRO
CR/UTRW
Target
Legend:
v DW - Drain the write claim class - concurrent access for SQL readers.
v CR - Claim the read claim class.
v UTRO - Utility restrictive state - read-only access allowed.
v UTRW - Utility restrictive state - read-write access allowed.
v None - Object is not affected by this utility.
Note:
1. If the target object is a segmented table space, SHRLEVEL CHANGE does not allow you
to concurrently execute an SQL searched DELETE without the WHERE clause.
610
Compatibility
The following table shows which utilities can run concurrently with RUNSTATS on
the same target object. The target object can be a table space, an index space, or a
partition of a table space or index space. If compatibility depends on particular
options of a utility, that information is also shown in the table.
Table 106. Compatibility of RUNSTATS with other utilities
|
|
Utility
RUNSTATS
TABLESPACE
SHRLEVEL
REFERENCE
RUNSTATS
TABLESPACE
SHRLEVEL
CHANGE
RUNSTATS
INDEX
SHRLEVEL
REFERENCE
RUNSTATS
INDEX
SHRLEVEL
CHANGE
Yes
Yes
Yes
Yes
No
No
No
No
CHECK INDEX
Yes
Yes
Yes
Yes
CHECK LOB
Yes
Yes
Yes
Yes
COPY INDEXSPACE
Yes
Yes
Yes
Yes
COPY TABLESPACE
Yes
Yes
Yes
Yes
DIAGNOSE
Yes
Yes
Yes
Yes
LOAD
No
No
No
No
No
Yes
No
Yes
MERGECOPY
Yes
Yes
Yes
Yes
MODIFY RECOVERY
Yes
Yes
Yes
Yes
QUIESCE
Yes
Yes
Yes
Yes
REBUILD INDEX
Yes
Yes
No
No
No
No
Yes
Yes
RECOVER INDEX
Yes
Yes
No
No
No
No
No
No
No
No
Yes
Yes
No
No
No
No
REORG INDEX
Yes
Yes
No
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
No
Yes
No
No
Yes
Yes
REPORT
Yes
Yes
Yes
Yes
RUNSTATS
Yes
Yes
Yes
Yes
611
Utility
RUNSTATS
TABLESPACE
SHRLEVEL
REFERENCE
RUNSTATS
TABLESPACE
SHRLEVEL
CHANGE
RUNSTATS
INDEX
SHRLEVEL
REFERENCE
RUNSTATS
INDEX
SHRLEVEL
CHANGE
STOSPACE
Yes
Yes
Yes
Yes
UNLOAD
Yes
Yes
Yes
Yes
|
|
You should recollect frequency statistics when either of the following situations is
true:
v The distribution of the data changes
v The values over which the data is distributed change
Determining when to gather statistics and what statistics to gather depends on a
number of factors. The preceding information is only a guideline. You should
determine your own statistic collection strategy.
One common situation in which old statistics can affect query performance is when
a table has columns that contain data or ranges that are constantly changing (for
example, dates and timestamps). These types of columns can result in old values in
the HIGH2KEY and LOW2KEY columns in the catalog. You should periodically
collect column statistics on these changing columns so that the values in
HIGH2KEY and LOW2KEY accurately reflect the true range of data, and range
predicates can obtain accurate filter factors.
612
DSNU610I
DSNU610I
DSNU610I
DSNU610I
DSNU610I
#
#
#
#
#
DSNUSUTB
DSNUSUIX
DSNUSUIP
DSNUSUCO
DSNUSUFL
DSNU610I
DSNU610I
DSNU610I
DSNU610I
DSNU010I
#
#
#
#
DSNUSUIX
DSNUSUIP
DSNUSUCO
DSNUSUFL
DSNUGBAC
Figure 98. Example RUNSTATS output from a job on a catalog table space
613
You can improve the performance of RUNSTATS on table spaces that are defined
with the LARGE option by specifying the SAMPLE option, which reduces the
number of rows that are scanned for statistics.
Consider running several RUNSTATS jobs concurrently against different partitions
of a partitioned table space or index rather than running a single RUNSTATS job
on the entire table space or index. The sum of the processor time for the
concurrent jobs is roughly equivalent to the processor time for running the single
RUNSTATS job. However, the total elapsed time for the concurrent jobs can be
significantly less than when you run RUNSTATS on an entire table space or index.
Run RUNSTATS on only the columns or column groups that might be used as
search conditions in a WHERE clause of queries. Use the COLGROUP option to
identify the column groups. Collecting additional statistics on groups of columns
that are used as predicates improves the accuracy of the filter factor estimate and
leads to improved query performance. Collecting statistics on all columns of a table
is costly and might not be necessary.
In some cases, you can avoid running RUNSTATS by specifying the STATISTICS
keyword in LOAD, REBUILD INDEX, or REORG utility statements. When you
specify STATISTICS in one of these utility statements, DB2 updates the catalog
with table space or index space statistics for the objects on which the utility is run.
However, you cannot collect column group statistics with the STATISTICS
keyword. You can collect column group statistics only by running the RUNSTATS
utility. If you restart a LOAD or REBUILD INDEX job that uses the STATISTICS
keyword, DB2 does not collect inline statistics. For these cases, you need to run the
RUNSTATS utility after the restarted utility job completes.
Related concepts
Restart of REORG TABLESPACE on page 517
614
Related reference
Data sets that RUNSTATS uses on page 608
615
RUNSTATS sets the following columns to -1 for table spaces that are defined as
LARGE:
v CARD in SYSTABLES
v CARD in SYSINDEXPART
v FAROFFPOS in SYSINDEXPART
v NEAROFFPOS in SYSINDEXPART
v FIRSTKEYCARD in SYSINDEXES
v FULLKEYCARD in SYSINDEXES
Keyword
UPDATE option
HISTORY option
TABLESPACE
UPDATE ALL
HISTORY ALL 4
SYSTABLESPACE
SYSTABLEPART1
SYSTABLEPART_HIST1
SYSTABLES1
SYSTABLES_HIST1
SYSTABSTATS1,2
SYSTABSTATS_HIST1,2
SYSLOBSTATS3
SYSLOBSTATS_HIST3
TABLESPACE
UPDATE ALL
HISTORY ACCESSPATH
SYSTABLESPACE
SYSTABLES1
SYSTABLES_HIST1
SYSTABSTATS1,2
SYSTABSTATS_HIST1,2
TABLESPACE
UPDATE ALL
HISTORY SPACE
SYSTABLEPART1
SYSTABLEPART_HIST1
SYSLOBSTATS3
SYSLOBSTATS_HIST3
TABLESPACE
UPDATE ACCESSPATH2
HISTORY ALL 4
SYSTABLESPACE
SYSTABLES
SYSTABLES_HIST
SYSTABSTATS2
SYSTABSTATS_HIST2
TABLESPACE
UPDATE ACCESSPATH2
HISTORY ACCESSPATH
SYSTABLESPACE
SYSTABLES
SYSTABLES_HIST
SYSTABSTATS2
SYSTABSTATS_HIST2
TABLESPACE
UPDATE ACCESSPATH2
HISTORY SPACE
none
TABLESPACE
UPDATE SPACE
TABLESPACE
UPDATE SPACE2
616
HISTORY ALL
HISTORY ACCESSPATH
SYSTABLEPART
SYSTABLEPART_HIST
SYSLOBSTATS3
SYSLOBSTATS_HIST3
SYSTABLES
SYSTABLES_HIST
none
Keyword
UPDATE option
HISTORY option
TABLESPACE
UPDATE SPACE2
HISTORY SPACE
SYSTABLEPART
SYSTABLEPART_HIST
SYSLOBSTATS3
SYSLOBSTATS_HIST3
SYSTABLES SYSTABLES_HIST
TABLE
UPDATE ALL
HISTORY ALL 4
SYSCOLUMNS
SYSCOLSTATS2
TABLE
UPDATE ALL
HISTORY ACCESSPATH
SYSCOLUMNS
SYSCOLSTATS2
TABLE
UPDATE ALL
HISTORY SPACE
none
SYSCOLUMNS
SYSCOLSTATS2
TABLE
UPDATE ACCESSPATH
HISTORY ALL
TABLE
UPDATE ACCESSPATH
HISTORY ACCESSPATH
SYSCOLUMNS
SYSCOLSTATS2
TABLE
UPDATE ACCESSPATH
HISTORY SPACE
none
SYSCOLUMNS
SYSCOLUMNS_HIST
SYSCOLDIST
SYSCOLDIST_HIST
SYSCOLDISTSTATS2
SYSCOLSTATS2
SYSINDEXES
SYSINDEXES _HIST
SYSINDEXPART
SYSINDEXPART_HIST
SYSINDEXSTATS2
INDEX
UPDATE ALL
HISTORY ALL
INDEX
UPDATE ALL
HISTORY ACCESSPATH
SYSCOLUMNS
SYSCOLUMNS_HIST
SYSCOLDIST
SYSCOLDIST_HIST
SYSCOLDISTSTATS2
SYSCOLSTATS2
SYSINDEXPART
SYSINDEXPART_HIST
SYSINDEXSTATS2
INDEX
UPDATE ALL
HISTORY SPACE
SYSINDEXES
SYSINDEXES_HIST
INDEX
UPDATE ACCESSPATH
HISTORY ALL 4
SYSCOLUMNS
SYSCOLUMNS_HIST
SYSCOLDIST
SYSCOLDIST_HIST
SYSCOLDISTSTATS2
SYSCOLSTATS
SYSINDEXES
SYSINDEXES _HIST
SYSINDEXSTATS2
617
Keyword
UPDATE option
HISTORY option
INDEX
UPDATE ACCESSPATH
HISTORY ACCESSPATH
SYSCOLUMNS
SYSCOLUMNS_HIST
SYSCOLDIST
SYSCOLDIST_HIST
SYSCOLDISTSTATS2
SYSCOLSTATS
SYSINDEXES
SYSINDEXES _HIST
SYSINDEXSTATS2
INDEX
UPDATE ACCESSPATH
HISTORY SPACE
SYSINDEXES
SYSINDEXES_HIST
INDEX
UPDATE SPACE
HISTORY ALL 4
SYSINDEXPART
SYSINDEXPART_HIST
SYSINDEXES5
SYSINDEXES_HIST5
INDEX
UPDATE SPACE
HISTORY ACCESSPATH
none
INDEX
UPDATE SPACE
HISTORY SPACE
SYSINDEXPART
SYSINDEXES5
| INDEX6
|
|
|
|
|
|
|
|
|
|
|
UPDATE ALL
HISTORY ALL4
SYSKEYTARGETS
SYSKEYTARGETS_HIST
SYSKEYTARGETSTATS2
SYSKEYTGTDISTSTATS2
SYSINDEXPART
SYSINDEXPART_HIST
SYSINDEXSTATS2
SYSINDEXSTATS_HIST2
SYSINDEXES
SYSINDEXES_HIST
SYSKEYTGTDIST
SYSKEYTGTDIST_HIST
| INDEX6
|
|
|
|
|
|
|
|
|
|
UPDATE ALL
HISTORY ACCESSPATH
SYSKEYTARGETS
SYSKEYTARGETS_HIST
SYSKEYTARGETSTATS2
SYSKEYTGTDISTSTATS2
SYSINDEXPART
SYSINDEXSTATS2
SYSINDEXSTATS_HIST2
SYSINDEXES
SYSINDEXES_HIST
SYSKEYTGTDIST
SYSKEYTGTDIST_HIST
| INDEX6
|
|
|
|
|
|
|
|
UPDATE ALL
HISTORY SPACE
SYSKEYTARGETS
SYSKEYTARGETSTATS2
SYSKEYTGTDISTSTATS2
SYSINDEXPART
SYSINDEXPART_HIST
SYSINDEXSTATS2
SYSINDEXES
SYSINDEXES_HIST
SYSKEYTGTDIST
618
Keyword
UPDATE option
HISTORY option
INDEX6
UPDATE ACCESSPATH
HISTORY ALL4
SYSKEYTARGETS
SYSKEYTARGETS_HIST
SYSKEYTARGETSTATS2
SYSKEYTGTDISTSTATS2
SYSINDEXPART
SYSINDEXSTATS2
SYSINDEXSTATS_HIST2
SYSINDEXES
SYSINDEXES_HIST
SYSKEYTGTDIST
SYSKEYTGTDIST_HIST
| INDEX6
|
|
|
|
|
|
|
|
|
|
UPDATE ACCESSPATH
HISTORY ACCESSPATH
SYSKEYTARGETS
SYSKEYTARGETS_HIST
SYSKEYTARGETSTATS2
SYSKEYTGTDISTSTATS2
SYSINDEXPART
SYSINDEXSTATS2
SYSINDEXSTATS_HIST2
SYSINDEXES
SYSINDEXES_HIST
SYSKEYTGTDIST
SYSKEYTGTDIST_HIST
| INDEX6
|
|
|
|
|
|
|
|
UPDATE ACCESSPATH
HISTORY SPACE
SYSKEYTARGETS
SYSKEYTARGETSTATS2
SYSKEYTGTDISTSTATS2
SYSINDEXPART
SYSINDEXPART_HIST
SYSINDEXSTATS2
SYSINDEXES
SYSINDEXES_HIST
SYSKEYTGTDIST
| INDEX6
|
|
|
|
|
UPDATE SPACE
HISTORY ALL4
SYSKEYTARGETS_HIST
SYSINDEXPART
SYSINDEXSTATS_HIST2
SYSINDEXES
SYSINDEXES_HIST
SYSKEYTGTDIST_HIST
| INDEX6
|
|
UPDATE SPACE
HISTORY ACCESSPATH
SYSINDEXPART
SYSINDEXES
SYSINDEXES_HIST
INDEX6
UPDATE SPACE
HISTORY SPACE
SYSINDEXPART
SYSINDEXPART_HIST
SYSINDEXES
SYSINDEXES_HIST
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
619
UPDATE option
HISTORY option
Note:
1. Not applicable if the specified table space is a LOB table space.
2. Only updated for partitioned objects. When you run RUNSTATS against single partitions of an object, RUNSTATS
uses the partition-level statistics to update the aggregate statistics for the entire object. These partition-level
statistics are contained in the following catalog tables:
v SYSCOLSTATS
v SYSCOLDISTSTATS
v SYSTABSTATS
v SYSINDEXSTATS
3. Applicable only when the specified table space is a LOB table space.
4. When HISTORY NONE is specified, none of the catalog history tables are updated.
5. Only the SPACEF and STATSTIME columns are updated.
Column description
CARDF
NPAGES
NPAGESF
PCTROWCOMP
Use
The following table lists the columns in SYSTABSTATS that DB2 uses to select
access paths. These columns are updated by RUNSTATS with the UPDATE
ACCESSPATH or UPDATE ALL options.
620
Table 109. SYSTABSTATS catalog columns that DB2 uses to select access paths
SYSTABSTATS
column name
Column description
CARDF
NPAGES
Use
The following table lists the columns in SYSCOLUMNS that DB2 uses to select
access paths. These columns are updated by RUNSTATS with the UPDATE
ACCESSPATH or UPDATE ALL options.
Table 110. SYSCOLUMNS catalog columns that DB2 uses to select access paths
SYSCOLUMNS
column name
Column description
Use
COLCARDF
HIGH2KEY
LOW2KEY
The following table lists the columns in SYSCOLDIST that DB2 uses to select
access paths. These columns are updated by RUNSTATS with the UPDATE
ACCESSPATH or UPDATE ALL options.
Table 111. SYSTCOLDIST catalog columns that DB2 uses to select access paths
SYSCOLDIST
column name
Column description
Use
CARDF
COLGROUPCOLNO
COLVALUE
FREQUENCYF
HIGHVALUE
621
Table 111. SYSTCOLDIST catalog columns that DB2 uses to select access paths (continued)
SYSCOLDIST
column name
Column description
LOWVALUE
NUMCOLUMNS
Use
The following table lists the columns in SYSTABLESPACE that DB2 uses to select
access paths. These columns are updated by RUNSTATS with the UPDATE
ACCESSPATH or UPDATE ALL options.
Table 112. SYSTABLESPACE catalog columns that DB2 uses to select access paths
SYSTABLESPACE
Column name
NACTIVE or
NACTIVEF
Column description
Use
The following table lists the columns in SYSINDEXES that DB2 uses to select
access paths. These columns are updated by RUNSTATS with the UPDATE
ACCESSPATH or UPDATE ALL options.
Table 113. SYSINDEXES catalog columns that DB2 uses to select access paths
SYSINDEXES
column name
Column description
Use
CLUSTERRATIOF
CLUSTERING
DATAREPEATFACTORF
FIRSTKEYCARDF
FULLKEYCARDF
NLEAF
NLEVELS
The following table lists the columns in SYSKEYTARGETS that DB2 uses to select
access paths. These columns are updated by RUNSTATS with the UPDATE
ACCESSPATH or UPDATE ALL options.
622
Table 114. SYSKEYTARGETS catalog columns that DB2 uses to select access paths
|
|
SYSKEYTARGETS
column name
|
|
|
|
|
CARDF
HIGH2KEY
|
|
LOW2KEY
Column description
Use
The following table lists the columns in SYSKEYTGTDIST that DB2 uses to select
access paths. These columns are updated by RUNSTATS with the UPDATE
ACCESSPATH or UPDATE ALL options.
|
Table 115. SYSKEYTGTDIST catalog columns that DB2 uses to select access paths
|
|
SYSKEYTGTDIST
column name
Column description
KEYSEQ
|
|
|
KEYVALUE
|
|
|
|
CARDF
|
|
|
|
|
|
FREQUENCYF
|
|
LOWVALUE
|
|
|
HIGHVALUE
Use
Related information
Statistics used for access path selection (DB2 Performance Monitoring and Tuning
Guide)
DB2 catalog tables (DB2 SQL Reference)
623
The following table lists the columns in SYSTABLESPACE that are updated by
RUNSTATS with the UPDATE SPACE or UPDATE ALL options
Table 116. SYSTABLESPACE catalog columns that are updated by RUNSTATS with the
UPDATE SPACE or UPDATE ALL options.
SYSTABLESPACE
column name
Column description
AVGROWLEN
Use
G
The following table lists the columns in SYSTABLES that are updated by
RUNSTATS with the UPDATE SPACE or UPDATE ALL options.
Table 117. SYSTABLES catalog columns that are updated by RUNSTATS with the UPDATE
SPACE or UPDATE ALL options
SYSTABLES column
name
Column description
AVGROWLEN
Use
G
The following table lists the columns in SYSTABLES_HIST that are updated by
RUNSTATS with the UPDATE SPACE or UPDATE ALL options.
Table 118. SYSTABLES_HIST catalog columns that are updated by RUNSTATS with the
UPDATE SPACE or UPDATE ALL options
SYSTABLES_HIST
column name
Column description
AVGROWLEN
Use
G
The following table lists the columns in SYSTABLEPART that are updated by
RUNSTATS with the UPDATE SPACE or UPDATE ALL options.
Table 119. SYSTABLEPART catalog columns that are updated by RUNSTATS with the
UPDATE SPACE or UPDATE ALL options
SYSTABLEPART
column name
Column description
AVGROWLEN
CARDF
DSNUM
EXTENTS
NEARINDREF
624
Use
Table 119. SYSTABLEPART catalog columns that are updated by RUNSTATS with the
UPDATE SPACE or UPDATE ALL options (continued)
SYSTABLEPART
column name
FARINDREF
Column description
Use
625
Table 119. SYSTABLEPART catalog columns that are updated by RUNSTATS with the
UPDATE SPACE or UPDATE ALL options (continued)
SYSTABLEPART
column name
PERCDROP
Column description
Use
SPACEF
PQTY
(user-managed)
SQTY
(user-managed)
SECQTYI
(user-managed)
The following table lists the columns in SYSTABLEPART_HIST that are updated by
RUNSTATS with the UPDATE SPACE or UPDATE ALL options.
Table 120. SYSTABLEPART_HIST that are updated by RUNSTATS with the UPDATE SPACE
or UPDATE ALL options
SYSTABLEPART_HIST
column name
AVGROWLEN
Column description
Use
The following table lists the columns in SYSINDEXES that are updated by
RUNSTATS with the UPDATE SPACE or UPDATE ALL options.
Table 121. SYSINDEXES catalog columns that are updated by RUNSTATS with the UPDATE
SPACE or UPDATE ALL options
SYSINDEXES
column name
AVGKEYLEN
Column description
Average length of keys within the index. The value is
-1 if statistics have not been gathered.
Use
G
The following table lists the columns in SYSINDEXES_HIST that are updated by
RUNSTATS with the UPDATE SPACE or UPDATE ALL options.
626
Table 122. SYSINDEXES_HIST catalog columns that are updated by RUNSTATS with the
UPDATE SPACE or UPDATE ALL options
SYSINDEXES_HIST
column name
AVGKEYLEN
Column description
Use
The following table lists the columns in SYSINDEXPART that are updated by
RUNSTATS with the UPDATE SPACE or UPDATE ALL options.
Table 123. SYSINDEXPART catalog columns that are updated by RUNSTATS with the
UPDATE SPACE or UPDATE ALL options
SYSINDEXPART
column name
Column description
Use
AVGKEYLEN
CARDF
DSNUM
EXTENTS
FAROFFPOSF
LEAFFAR
627
Table 123. SYSINDEXPART catalog columns that are updated by RUNSTATS with the
UPDATE SPACE or UPDATE ALL options (continued)
SYSINDEXPART
column name
Column description
NEAROFFPOSF
Use
S
628
PSEUDO_DEL_
ENTRIES
SPACE
SPACEF
PQTY
(user-managed)
Table 123. SYSINDEXPART catalog columns that are updated by RUNSTATS with the
UPDATE SPACE or UPDATE ALL options (continued)
SYSINDEXPART
column name
Column description
Use
SQTY
(user-managed)
SECQTYI
(user-managed)
The following table lists the columns in SYSINDEXPART_HIST that are updated by
RUNSTATS with the UPDATE SPACE or UPDATE ALL options.
Table 124. SYSINDEXPART_HIST catalog columns that are updated by RUNSTATS with the
UPDATE SPACE or UPDATE ALL options
SYSINDEXPART_HIST
column name
AVGKEYLEN
Column description
Use
The following table lists the columns in SYSLOBSTATS that are updated by
RUNSTATS with the UPDATE SPACE or UPDATE ALL options.
Table 125. SYSLOBSTATS catalog columns that are updated by RUNSTATS with the
UPDATE SPACE or UPDATE ALL options
SYSLOBSTATS
column name
Column description
AVGSIZE
FREESPACE
ORGRATIO
Use
629
630
631
most frequently occurring values on the column set NP1 and NP2 (the first two
key columns of the index). The utility is to report the collected statistics and route
the statistics to SYSPRINT.
RUNSTATS INDEX (SYSADM.IXNPI)
KEYCARD
FREQVAL NUMCOLS 1 COUNT 5
FREQVAL NUMCOLS 2 COUNT 10
REPORT YES
632
633
634
Output
The output from STOSPACE consists of updated values in the columns and tables
in the following list. In each case, an amount of space is given in kilobytes (KB). If
the value is too large to fit in the SPACE column, the SPACEF column is updated.
v SPACE in SYSIBM.SYSINDEXES shows the amount of space that is allocated to
indexes. If the index is not defined using STOGROUP, or if STOSPACE has not
been executed, the value is zero.
v SPACE in SYSIBM.SYSTABLESPACE shows the amount of space that is allocated
to table spaces. If the table space is not defined using STOGROUP, or if
STOSPACE has not been executed, the value is zero.
v SPACE in SYSIBM.SYSINDEXPART shows the amount of space that is allocated
to index partitions. If the partition is not defined using STOGROUP, or if
STOSPACE has not been executed, the value is zero.
v SPACE in SYSIBM.SYSTABLEPART shows the amount of space that is allocated
to table partitions. If the partition is not defined using STOGROUP, or if
STOSPACE has not been executed, the value is zero.
v SPACE in SYSIBM.SYSSTOGROUP shows the amount of space that is allocated
to storage groups.
v STATSTIME in SYSIBM.SYSSTOGROUP shows the timestamp for the time at
which STOSPACE was last executed.
Authorization required
To execute this utility, you must use a privilege set that includes one of the
following authorities:
v STOSPACE privilege
v SYSCTRL or SYSADM authority
635
Syntax diagram
,
STOSPACE STOGROUP(
stogroup-name
Option descriptions
STOGROUP
Identifies the storage groups that are to be processed.
(stogroup-name, ...)
Specifies the name of a storage group. You can use a list of from one to 255
storage group names. Separate items in the list by commas, and enclose
them in parentheses.
*
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
The following object is named in the utility control statement and does not require
a DD statement in the JCL:
Storage group
Object that is to be reported.
636
Column name
Column description
SYSTABLESPACE
SPACEF
SYSTABLEPART
SPACEF
SYSINDEXES
SPACEF
SYSINDEXPART
SPACEF
SYSSTOGROUP
SPACEF
SYSSTOGROUP
STATSTIME
637
STOSPACE does not accumulate information for more than one storage group. If a
partitioned table space or index space has partitions in more than one storage
group, the information in the catalog about that space comes from only the group
for which STOSPACE was run.
When you run the STOSPACE utility, the SPACEF column of the catalog represents
the high-allocated RBA of the VSAM linear data set. Use the value in the SPACEF
column to project space requirements for table spaces, table space partitions, index
spaces, and index space partitions over time. Use the output from the Access
Method Services LISTCAT command to determine which table spaces and index
spaces have allocated secondary extents. When you find these, increase the
primary quantity value for the data set, and run the REORG utility.
v For information about space utilization in the DSN8S91E table space in the
DSN8D91A database:
1. Run the STOSPACE utility
2. Execute the following SQL statement: PSPI
EXEC SQL
SELECT SPACE
FROM SYSIBM.SYSTABLESPACE
WHERE NAME = 'DSN8S91E
AND DBNAME = 'DSN8D91A'
ENDEXEC
PSPI
Alternatively, you can use TSO to look at data set and pack descriptions.
v To update SYSIBM.SYSSTOGROUP for storage group DSN8G910, as well as
SYSIBM.SYSTABLESPACE and SYSIBM.SYSINDEXES, for every table space and
index that belongs to DSN8G910, use the following utility control statement:
STOSPACE STOGROUP DSN8G910
638
Related concepts
Restart of an online utility on page 36
639
640
Output
The TEMPLATE control statement generates a dynamic allocation template with an
assigned name for later reference.
Authorization required
No privileges are required to execute this control statement. When a TEMPLATE is
referenced by a specific utility, privileges are checked at that time.
641
Syntax diagram
TEMPLATE
template-name DSN
name-expression
common-options
disk-options
tape-options
int
RECFM
F
FB
V
VB
name-expression:
.
(1)
qualifier-expression
(parenthetical-expression)
Notes:
1
The entire name-expression represents one character string and cannot contain any blanks.
qualifier-expression:
character-expression
(2)
&variable
.
(1)
(start
)
,length
Notes:
1
If you use substring notation, the entire DSN operand must be enclosed in single quotation
marks. For example, the DSN operand 'P&PA(4,2).' uses substring notation, so it is enclosed in
single quotation marks.
common-options:
642
UNIT
SYSALLDA
UNIT
name
BUFNO 30
BUFNO
MODELDCB dsname
integer
DATACLAS
name
MGMTCLAS
name
STORCLAS name
RETPD integer
EXPDL date
,
VOLUMES ( volser
GDGLIMIT 99
VOLCNT
integer
GDGLIMIT
UNCNT integer
integer
DISP
NEW
OLD
SHR
MOD
DELETE
KEEP
CATLG
UNCATLG
DELETE
KEEP
CATLG
UNCATLG
LIMIT(n
CYL
GB
MB
,new_template)
disk-options:
SPACE CYL
PCTPRIME 100
SPACE
(primary,secondary)
CYL
TRK
MB
PCTPRIME
integer
MAXPRIME
integer
NBRSECND 10
NBRSECND
integer
DIR integer
DSNTYPE
LIBRARY
PDS
HFS
NULL
tape-options:
STACK NO
TRTCH NONE
STACK YES
TRTCH
COMP
NOCOMP
Option descriptions
TEMPLATE template-name
Defines a data set allocation template and assigns to the template a name,
643
Specifies the template for the z/OS data set name. You can specify the data set
name, name-expression, by using symbolic variables, non-variable alphanumeric,
or national characters, or any combination of these characters. The resulting
name must adhere to the z/OS data set naming rules, including those rules
about name length, valid characters, name structure and qualifier length. You
must specify a DSN expression that is unique for each data set allocated by the
utility and to each invocation of the utility.
|
|
|
|
Parentheses around the DSN name operand are optional. They are used in the
following DSN specification:
DSN(&DB..&TS..D&DATE.)
character-expression
Specifies the data set name or part of the data set name by using non-variable
alphanumeric or national characters.
parenthetical-expression
Specifies part of the data set name by using non-variable alphanumeric or
national characters that are enclosed in parentheses. For example, the
expressions Q1.Q2.Q3(member) and Q1.Q2.Q3(+1) use valid parenthetical
expressions. No variable substitution is performed within the parenthetical
expression.
|
|
|
|
|
|
&variable.
Specifies the data set name or part of the data set name by using symbolic
variables. See the following tables for a list of variables that can be used.
Each symbolic variable is substituted with its related value at execution time to
form a specific data set name. When used in a DSN expression, substitution
variables begin with an ampersand sign (&) and end with a period (.), as in
the following example:
DSN &DB..&TS..D&JDATE..COPY&ICTYPE.
Using numeric variables alone generates an invalid data set qualifier for all
numeric-type variables (all date or time-type variables, and others, such as
644
Description
&JOBNAME. or &JO.
&STEPNAME. or &ST.
&USERID. or &US.
&UTILID. or &UT.
&SSID. or &SS.
The following table contains a list of UTILITY variables and their descriptions.
Table 129. UTILITY variables
Variable
Description
&ICTYPE. or &IC.
645
Description
&UTILNAME. or &UN.
&SEQ. or &SQ.
&LOCREM. or &LR.
&PRIBAC. or &PB.
The following table contains a list of OBJECT variables and their descriptions.
Table 130. OBJECT variables
Variable
Description
&LIST. or &LI.
&DB.
Database name.
&TS.
&IS.
&SN.
&PART. or &PA.
Note:
1. When you specify the &TS., &IS., or &SN. variables in a template that is used by an
UNLOAD statement with BLOBF, CLOBF, or DBCLOBF, DB2 substitutes the name of the
table space that stores the LOB column value, not the base table space name. This
substitution enables DB2 to generate unique data set names for each LOB column with
partitioned table spaces.
2. Use the &PA. variable when processing LISTDEF lists with the PARTLEVEL keyword or
data-partitioned secondary indexes. Otherwise, DB2 could generate duplicate data set
names.
The following table contains a list of DATE and TIME variables. and their
descriptions.
646
Description
&DATE. or &DT.
YYYYDDD
&TIME. or &TI.
HHMMSS
&JDATE. or &JU.
YYYYDDD
&YEAR. or &YE.
&MONTH. or &MO.
MM
&DAY. or &DA.
DD
&JDAY. or &JD.
&HOUR. or &HO.
HH portion of &TIME.
&MINUTE. or &MI.
MM portion of &TIME.
&SECOND. or &SC.
SS portion of &TIME.
&UNIQ. or &UQ.
Note: All date and time values are set by using the STCK instruction, and they reflect the
date and time value in Greenwich Mean Time (GMT). With the exception of the &UNIQ. and
&UQ. variables, DATE and TIME values are captured in the UTILINIT phase of each utility
and remain constant until the utility terminates. &UNIQ. and &UQ. are assigned a unique
value for each allocation.
|
|
|
|
|
|
SUBSYS name
Specifies the MVS BATCHPIPES SUBSYSTEM name. The SUBSYS operand
must be a valid BATCHPIPES SUBSYSTEM name and must not exceed eight
characters in length. When SUBSYS is specified, LRECL and RECFM are
required. When SUBSYS is specified, TEMPLATE keywords that are not
compatible with SUBSYS (such as UNIT) are ignored.
|
|
|
|
|
|
LRECL int
Specifies the record length of the MVS BATCHPIPES SUBSYSTEM file. There is
no default value and this option is required when SUBSYS is specified.
|
|
|
|
RECFM
Specifies the record format of the MVS BATCHPIPES SUBSYSTEM file. The
valid values are F, FB, V, or VB. There is no default value and this option is
required when SUBSYS is specified.
UNIT
Specifies the device-number, device-type (generic), or group-name for the data
set. All other TEMPLATE keywords are validated based on the specified type
of unit (disk or tape).
The default value is SYSALLDA.
MODELDCB dsname
Specifies the name of the data set on which the template is based. DCB
information is read from this model data set.
647
BUFNO integer
Specifies the number of BSAM buffers. The specified value must be in the
range from 0 to 99.
The default value is 30.
DATACLAS name
Specifies the SMS data class. The name value must be a valid SMS data class
and must not exceed eight characters in length.
The data set is cataloged if DATACLAS is specified. If this option is omitted,
no DATACLAS is specified to SMS.
MGMTCLAS name
Specifies the SMS management class. The name value must be a valid SMS
management class and must not exceed eight characters in length.
The data set is cataloged if MGMTCLAS is specified. If this option is omitted,
no MGMTCLAS is specified to SMS.
STORCLAS name
Specifies the SMS storage class. The name value must be a valid SMS storage
class and must not exceed eight characters in length.
The data set is cataloged if STORCLAS is specified. If this option is omitted, no
STORCLAS is specified to SMS.
RETPD integer
Specifies the retention period in days for the data set. The integer value must
be in the range from 0 to 9999.
If DATACLAS, MGMTCLAS, or STORCLAS is specified, the class definition
might control the retention. RETPD cannot be specified with EXPDL.
|
|
EXPDL date
Specifies the expiration date for the data set, in the form YYYYDDD, where
YYYY is the four-digit year, and DDD is the three-digit Julian day. The date
value must be enclosed by single quotation marks.
If DATACLAS, MGMTCLAS, or STORCLAS is specified, the class definition
might control the retention. EXPDL cannot be specified with RETPD.
|
|
VOLUMES (vol1,vol2,...)
Specifies a list of volume serial numbers for this allocation. If the data set is
not cataloged the list is truncated, if necessary, when it is stored in
SYSIBM.SYSCOPY. The specified number of volumes cannot exceed the
specified or default value of VOLCNT.
The first volume must contain enough space for the primary space allocation.
If an individual volume serial-number contains leading zeros, it must be
enclosed in single quotation marks.
VOLCNT (integer)
Specifies the maximum number of volumes that an output data set might
require. The specified value must be between 0 and 255.
The default value for tape templates is 95. For disk templates, the utility does
not set a default value. Operating system defaults apply.
UNCNT integer
Specifies the number of devices that are to be allocated. The specified value
must in the range from 0 to 59.
648
If UNIT specifies a specific device number, the value of UNCNT must either be
1 or be omitted.
GDGLIMIT (integer)
Specifies the number of entries that are to be created in a GDG base if a GDG
DSN is specified and the base does not already exist. If a GDG base does not
already exist and you do not want to define one, specify a GDGLIMIT of zero
(0).
The default value is 99. The integer value must be in the range from 0 to 255.
DISP integer
Specifies the data set disposition by using three positional parameters: status,
normal-termination, and abnormal-termination. All three parameters must be
specified.
status
Standard z/OS values are allowed: NEW, OLD, SHR, MOD.
normal-termination
Standard z/OS values are allowed: DELETE, KEEP, CATLG, UNCATLG.
abnormal-termination
Standard z/OS values are allowed: DELETE, KEEP, CATLG, UNCATLG.
Default values for DISP vary, depending on the utility and the data set that is
being allocated. Defaults for restarted utilities also differ from default values
for new utility executions. Default values are shown in the following tables.
The following table shows the data dispositions for dynamically allocated data
sets for new utility executions.
Note: It is possible that output from utilities that use piped data would not be
dynamically allocated for new utility executions.
|
|
Table 132. Data dispositions for dynamically allocated data sets for new utility executions
ddname
CHECK
DATA
CHECK
INDEX or
CHECK LOB COPY
COPYTOCOPY
REORG
TABLESPACE
UNLOAD
SYSREC
Ignored
Ignored
Ignored
Ignored
Ignored
NEW
CATLG
CATLG
NEW
CATLG
CATLG
SYSDISC
Ignored
Ignored
Ignored
Ignored
Ignored
NEW
CATLG
CATLG
Ignored
SYSPUNCH
Ignored
Ignored
Ignored
Ignored
Ignored
NEW
CATLG
CATLG
NEW
CATLG
CATLG
SYSCOPY
Ignored
NEW
CATLG
CATLG
NEW
CATLG
CATLG
Ignored
Ignored
NEW
CATLG
CATLG
Ignored
SYSCOPY2
Ignored
NEW
CATLG
CATLG
NEW
CATLG
CATLG
Ignored
Ignored
NEW
CATLG
CATLG
Ignored
NEW
CATLG
CATLG
Ignored
NEW
CATLG
CATLG
NEW
CATLG
CATLG
Ignored
Ignored
NEW
CATLG
CATLG
Ignored
Ignored
NEW
CATLG
CATLG
Ignored
NEW
CATLG
CATLG
NEW
CATLG
CATLG
Ignored
Ignored
NEW
CATLG
CATLG
Ignored
NEW
DELETE
CATLG
Ignored
Ignored
NEW
DELETE
CATLG
Ignored
NEW
DELETE
CATLG
NEW
CATLG
CATLG
NEW
DELETE
CATLG
Ignored
MERGECOPY
REBUILD
INDEX
REORG
INDEX
OLD
KEEP
KEEP
Ignored
Ignored
Ignored
NEW
CATLG
CATLG
Ignored
Ignored
Ignored
Ignored
Ignored
NEW
CATLG
CATLG
Ignored
Ignored
Ignored
NEW
CATLG
CATLG
SYSRCPY1
Ignored
Ignored
SYSRCPY2
Ignored
SYSUT1
NEW
DELETE
CATLG
LOAD
649
Table 132. Data dispositions for dynamically allocated data sets for new utility executions (continued)
CHECK
DATA
ddname
CHECK
INDEX or
CHECK LOB COPY
COPYTOCOPY
LOAD
MERGECOPY
REBUILD
INDEX
REORG
INDEX
REORG
TABLESPACE
UNLOAD
SORTOUT
NEW
DELETE
CATLG
Ignored
Ignored
Ignored
NEW
DELETE
CATLG
Ignored
Ignored
NEW
DELETE
CATLG
NEW
DELETE
CATLG
Ignored
SYSMAP
Ignored
Ignored
Ignored
Ignored
NEW
CATLG
CATLG
Ignored
Ignored
Ignored
Ignored
Ignored
SYSERR
NEW
CATLG
CATLG
Ignored
Ignored
Ignored
NEW
CATLG
CATLG
Ignored
Ignored
Ignored
Ignored
Ignored
FILTERDDS
Ignored
Ignored
NEW
DELETE
DELETE
Ignored
Ignored
Ignored
Ignored
Ignored
Ignored
Ignored
The following table shows data dispositions for dynamically allocated data sets
on RESTART.
Table 133. Data dispositions for dynamically allocated data sets on RESTART
ddname
CHECK
DATA
CHECK
INDEX or
CHECK LOB
COPY
COPYTOCOPY
SYSREC
Ignored
Ignored
Ignored
Ignored
SYSDISC
Ignored
Ignored
Ignored
SYSPUNCH
Ignored
Ignored
SYSCOPY
Ignored
SYSCOPY2
REORG
TABLESPACE
MERGECOPY
REBUILD
INDEX
REORG
INDEX
OLD
KEEP
KEEP
Ignored
Ignored
Ignored
MOD
CATLG
CATLG
MOD CATLG
CATLG
Ignored
MOD
CATLG
CATLG
Ignored
Ignored
Ignored
MOD
CATLG
CATLG
Ignored
Ignored
Ignored
Ignored
Ignored
Ignored
Ignored
MOD
CATLG
CATLG
MOD CATLG
CATLG
Ignored
MOD
CATLG
CATLG
Ignored
MOD
CATLG
CATLG
MOD
CATLG
CATLG
Ignored
Ignored
MOD
CATLG
CATLG
Ignored
Ignored
Ignored
MOD
CATLG
CATLG
Ignored
MOD
CATLG
CATLG
MOD
CATLG
CATLG
Ignored
Ignored
MOD
CATLG
CATLG
Ignored
SYSRCPY1
Ignored
Ignored
MOD
CATLG
CATLG
Ignored
MOD
CATLG
CATLG
MOD
CATLG
CATLG
Ignored
Ignored
MOD
CATLG
CATLG
Ignored
SYSRCPY2
Ignored
Ignored
MOD
CATLG
CATLG
Ignored
MOD
CATLG
CATLG
MOD
CATLG
CATLG
Ignored
Ignored
MOD
CATLG
CATLG
Ignored
SYSUT1
MOD
DELETE
CATLG
MOD
DELETE
CATLG
Ignored
Ignored
MOD
DELETE
CATLG
Ignored
MOD
DELETE
CATLG
MOD
CATLG
CATLG
MOD
DELETE
CATLG
Ignored
SORTOUT
MOD
DELETE
CATLG
Ignored
Ignored
Ignored
MOD
DELETE
CATLG
Ignored
Ignored
MOD
DELETE
CATLG
MOD
DELETE
CATLG
Ignored
SYSMAP
Ignored
Ignored
Ignored
Ignored
MOD
CATLG
CATLG
Ignored
Ignored
Ignored
Ignored
Ignored
SYSERR
MOD
CATLG
CATLG
Ignored
Ignored
Ignored
MOD
CATLG
CATLG
Ignored
Ignored
Ignored
Ignored
Ignored
FILTERDDS
Ignored
Ignored
NEW
DELETE
DELETE
Ignored
Ignored
Ignored
Ignored
Ignored
Ignored
Ignored
LOAD
UNLOAD
LIMIT
Specifies template switching.
|
|
|
|
650
|
|
CYL
Cylinders
|
|
GB
|
|
MB
|
|
|
new_template
Specifies a character string that specifies the name of a TEMPLATE to use
if the size limit is exceeded.
|
|
|
|
|
|
v MERGECOPY
|
|
v LOAD
v REORG
|
|
Restriction:
v You cannot switch to a DD card.
|
|
|
|
|
|
|
v The template control statement that LIMIT references must exist in SYSIN or
SYSTEMPL and it cannot refer to itself.
v Switching can only be performed a single time per allocation. Multiple
switching cannot take place.
v The utility PREVIEW function ignores the LIMIT keyword, only the original
TEMPLATE control statement is previewed. The LIMIT keyword is ignored
for new templates.
Gigabytes
Megabytes
|
|
|
|
|
SPACE (primary,secondary)
Specifies the z/OS disk space allocation parameters in the range from 1 to
1677215. If you specify (primary,secondary) value, these values are used instead
of the DB2-calculated values. When specifying primary and secondary
quantities, you must either specify both values or omit both values.
Use the MAXPRIME option to set an upper limit on the primary quantity.
|
|
|
|
|
|
CYL
Specifies that allocation quantities, if present, are to be expressed in
cylinders and that allocation is to occur in cylinders. If SPACE CYL is
specified, without (primary, secondary), the DB2-calculated quantities are
allocated in cylinders by using 3390 quantities for byte conversion. If TRK
and MB are omitted, CYL is the default.
|
|
|
|
TRK
Specifies that allocation quantities, if present, are to be expressed in tracks
and that allocation is to occur in tracks. If SPACE TRK is specified, without
(primary,secondary), the DB2-calculated quantities are allocated in tracks by
using 3390 quantities for byte conversion.
MB
|
|
651
|
|
|
|
|
PCTPRIME integer
Specifies the percentage of the estimated required space that is to be obtained
as the primary quantity.
The default value is 100.
Use the MAXPRIME option to set the upper limit of this value for large
objects.
MAXPRIME integer
Specifies the maximum allowable primary space allocation, expressed in
cylinders (CYL). This value constrains the primary space value and the
PCTPRIME calculation, as well as the size of each secondary allocation.
NBRSECND integer
Specifies the division of secondary space allocations. After the primary space is
allocated, an amount of space equal to the estimated required space is divided
into the specified number of secondary allocations. The integer value must be
in the range from 1 to 10.
The default value is 10.
DIR integer
Specifies the number of 256-byte records that are to be allocated for the
directory of a new partitioned data set. You must specify this operand if you
are allocating a new partitioned data set.
If the template is being used in a UNLOAD statement with BLOBF, CLOBF, or
DBCLOBF and you specify a DSNTYPE of LIBRARY or PDS, but do not
specify DIR, DB2 calculates the number of 256-byte records to allocate by
dividing the estimated number of records by 20.
DSNTYPE
Specifies the type of data set to be allocated.
LIBRARY
Specifies that a partitioned data set extended (PDSE) is to be allocated.
PDS
Specifies that a partitioned data set (PDS) is to be allocated.
HFS
Specifies that a hierarchical file system (HFS) file is to be allocated.
NULL
Specifies a null file. Use this value for a template with UNLOAD CLOBF,
BLOBF, or DBCLOBF to unload a null LOB value. In this case, the unload
data set contains a null file name.
If you omit DSNTYPE, the type of data set is determined by other data set
attributes, the data class for the data set, or an installation default.
STACK
Specifies whether output data sets are to be stacked contiguously on the same
tape volumes.
652
NO
Specifies that output data sets are not to be stacked contiguously on tape.
YES
Specifies that similar output data sets are to be stacked as successive files
on one logical tape volume, where a logical tape volume can consist of a
multi-volume aggregate. Within one utility execution, output data sets are
stacked on a logical tape volume of the same usage type. For example,
local primary image copies are stacked separately from local backup image
copies.
Restriction: Do not use the STACK YES option for concurrent copies
(copies that are made by the COPY utility with the CONCURRENT
option).
To preserve parallel processing, parallel tasks are written to different tape
volumes. The specific volume to which the data set is written can vary,
depending on the number of output data sets that are being produced, the
number of parallel processes that are requested, and the number of tape
units that are available to the job step.
The data sets and utilities for which the STACK YES option are supported
are listed in the following table. Yes indicates that the specified utility
supports tape stacking for the specified data set. No indicates that the
specified utility does not support tape stacking for the specified data set.
Ignored indicates that the specified data set does not apply to the
specified utility.
Table 134. Supported data sets for tape stacking
ddname
CHECK
DATA
CHECK
INDEX or
CHECK
LOB
SYSREC
Ignored
Ignored
SYSDISC
Ignored
SYSPUNCH
Ignored
SYSCOPY
LOAD
MERGECOPY
REBUILD
INDEX
REORG
INDEX
REORG
TABLESPACE
UNLOAD
No
Ignored
Ignored
Ignored
Yes
Yes
Ignored
No
Ignored
Ignored
Ignored
Yes
Ignored
Ignored
Ignored
Ignored
Ignored
Ignored
Yes
Yes
Yes
Yes
No
Yes
Ignored
Ignored
Yes
Ignored
Ignored
Yes
Yes
No
Yes
Ignored
Ignored
Yes
Ignored
Ignored
Yes
Yes
No
Yes
Ignored
Ignored
Yes
Ignored
Ignored
Ignored
Yes
Yes
No
Yes
Ignored
Ignored
Yes
Ignored
SYSUT1
No
No
Ignored
Ignored
No
Ignored
No
No
No
Ignored
SORTOUT
No
Ignored
Ignored
Ignored
No
Ignored
Ignored
No
No
Ignored
SYSMAP
Ignored
Ignored
Ignored
Ignored
No
Ignored
Ignored
Ignored
Ignored
Ignored
SYSERR
No
Ignored
Ignored
Ignored
No
Ignored
Ignored
Ignored
Ignored
Ignored
FILTERDDS
Ignored
Ignored
No
Ignored
Ignored
Ignored
Ignored
Ignored
Ignored
Ignored
COPY
COPYTOCOPY
Ignored
Ignored
Ignored
Ignored
Ignored
Ignored
Ignored
Ignored
SYSCOPY2
Ignored
SYSRCPY1
Ignored
SYSRCPY2
TRTCH
Specifies the track recording technique for magnetic tape drives that have
improved data recording capability.
NONE
Specifies that the TRTCH specification is to be eliminated from dynamic
allocation.
COMP
Specifies that data is to be written in compacted format.
NOCOMP
Specifies that data is to be written in standard format.
Chapter 31. TEMPLATE
653
654
The required TEMPLATE statement might look something like the following
TEMPLATE statement:
TEMPLATE tmp1 DSN(DB2.&TS..D&JDATE..COPY&ICTYPE.&LOCREM.&PRIBAC.)
VOLUMES(vol1,vol2,vol3)
LISTDEF payroll INCLUDE TABLESPACE PAYROLL.*
INCLUDE INDEXSPACE PAYROLL.*IX
EXCLUDE TABLESPACE PAYROLL.TEMP*
EXCLUDE INDEXSPACE PAYROLL.TMPIX*
COPY LIST payroll COPYDDN(tmp1,tmp1) RECOVERYDDN(tmp1,tmp1)
v Use &DB. and &TS. to relate the data set to a database object.
v Use &PART. when executing PARTLEVEL lists. Preceed the variable with a static
character or a character variable to form a valid qualifier.
v Use &JO. and &ST. to eliminate conflicts with other jobs or job steps.
v Use &SS., &US., &UT., and &UN. if you have a need to know the subsystem,
member, user, utility ID, or name of the utility that produced the data set.
v Use &DATE. and &TIME. or the shorter substring variations to guarantee
uniqueness. Preceed the variable with a static character or a character variable to
form a valid qualifier.
655
v Use &IC., &LR., and &PB. to identify image copy data sets. For example, the
following template name would make a meaningful seven-character data set
qualifier:
COPY&IC.&LR.&PB.
Related reference
Syntax and options of the TEMPLATE control statement on page 641
656
CHECK DATA
CHECK INDEX
CHECK LOB
REBUILD INDEX
REORG INDEX
REORG TABLESPACE
Template switching
Template switching is most commonly used to direct small data sets to disk and
large data sets to tape, but it can also be used to switch to templates that differ in
DSNs or in HSN classes. The decision to switch is made based on the estimated
output data set size, which may differ from the actual final size of the output data
set. This difference is particularly true for incremental image copies that are
estimated at 10% of the space required for a full image copy.
657
658
naming convention. The subsequent COPY utility control statement specifies that
DB2 is to make a local primary copy of the first partition of table space
DSN8D81A.DSN8S81E. COPY is to write this image copy to a data set that is
dynamically allocated according to the SYSCOPY template. In this case, the
resulting data set name is DSN8D81A.DSN8S81E.P001
TEMPLATE SYSCOPY DSN '&DB..&TS..P&PA(3).'
COPY TABLESPACE DSN8D81A.DSN8S81E DSNUM 1 COPYDDN(SYSCOPY)
Notice that you can change the part variable in the DSN operand from P&PA(3). to
P&PA(3,3). The resulting data set name is the same, because the length value of 3
is implied in the first specification.
659
660
are specified by the DISP option. The GDGLIMIT option specifies that 50 entries
are to be created in a GDG base.
/*
//*************************************************
//* COMMENT: COPY GDG DATA SET TO TAPE
//*************************************************
//STEP1
EXEC DSNUPROC,UID='JULTU243.GDG',
//
UTPROC='',
//
SYSTEM='SSTR'
//SYSIN
DD *
OPTIONS PREVIEW
TEMPLATE COPYTEMP
UNIT TAPE
DSN 'JULTU243.GDG(+1)'
VOLUMES (99543)
GDGLIMIT(50)
DISP(NEW,CATLG,CATLG)
STACK YES
OPTIONS OFF
COPY TABLESPACE DBLT4301.TPLT4301
FULL YES
COPYDDN (COPYTEMP)
SHRLEVEL REFERENCE
/*
Figure 100. Example job that uses OPTIONS, TEMPLATE, and COPY statements to copy a
GDG data set to tape.
|
|
|
|
|
|
The following TEMPLATE control statement assumes that tables space SMALL.TS
occupies 10 cylinders and table space LARGE.TS occupies 100 cylinders. Both
COPY statements use the SMALLTP template which specifies a limit of 20
cylinders. Table space SMALL.TS is smaller than this limit so no switching is
performed. The output data set for table space SMALL.TS will be allocated on
UNIT=SYSALLDA. Table space LARGE.TS is larger than this limit so the template
661
is switched to the LARGETP template. The output data set for table space
LARGE.TS will be allocated on UNIT=TAPE.
|
|
|
|
|
|
662
Output
UNLOAD generates an unloaded table space or partition.
Authorization required
|
|
|
To execute this utility, you must use a privilege set that includes one of the
following authorities:
v Ownership of the tables
v SELECT privilege on the tables
v DBADM authority for the database. If the object on which the utility operates is
in an implicitly created database, DBADM authority on DSNDB04 or the
implicitly created database is sufficient.
v SYSADM authority
v SYSCTRL authority (catalog tables only)
If you use RACF access control with multilevel security and UNLOAD is to
process a table space that contains a table that has multilevel security with
row-level granularity, you must be identified to RACF and have an accessible valid
security label. Each row is unloaded only if your security label dominates the data
security label. If your security label does not dominate the data security label, the
row is not unloaded, but DB2 does not issue an error message.
663
Syntax diagram
UNLOAD
DATA
from-table-spec
from-table-spec
source-spec
from-table-spec
LIST listdef-name
unload-spec
CLONE
source-spec:
664
TABLESPACE
tablespace-name
database-name.
PART
integer
int1 :
int2
FROMCOPY
data-set-name
FROMVOLUME
CATALOG
vol-ser
(1)
FROMSEQNO
FROMCOPYDDN ddname
Notes:
1
The FROMSEQNO option is required if you are unloading an image copy from a tape data set
that is not cataloged.
unload-spec:
665
PUNCHDDN SYSPUNCH
UNLDDN SYSREC
PUNCHDDN
UNLDDN
ddname
template-name
ddname
template-name
EBCDIC
ASCII
UNICODE
,
NOSUBS
CCSID( integer
NOPAD
FLOAT S390
COLDEL ,
CHARDEL
DECPT
COLDEL coldel
CHARDEL chardel
DECPT
decpt
FLOAT IEEE
DELIMITED
MAXERR 1
MAXERR
SHRLEVEL
integer
CHANGE ISOLATION UR
REFERENCE
DECFLOAT_ROUNDMODE
ROUND_CEILING
ROUND_DOWN
ROUND_FLOOR
ROUND_HALF_DOWN
ROUND_HALF_EVEN
ROUND_HALF_UP
ROUND_UP
FROM-TABLE-spec:
Option descriptions
DATA
Identifies the data that is to be selected for unloading with table-name in the
from-table-spec. The DATA keyword is mutually exclusive with TABLESPACE,
PART, and LIST keywords.
When you specify the DATA keyword, or you omit either the TABLESPACE or
the LIST keyword, you must also specify at least one FROM TABLE clause.
TABLESPACE
Specifies the table space (and, optionally, the database to which it belongs)
from which the data is to be unloaded.
database-name
The name of the database to which the table space belongs. The name
cannot be DSNDB01 or DSNDB07.
The default value is DSNDB04.
666
tablespace-name
The name of the table space from which the data is to be unloaded. The
specified table space must not be a LOB or XML table space.
PART
Identifies a partition or a range of partitions from which the data is to be
unloaded. This keyword applies only if the specified table space is
partitioned. You cannot specify PART with LIST. The maximum is 4096.
integer
Designates a single partition. integer must identify an existing partition
number within the table space.
int1:int2
Designates a range of partitions from int1 to int2. int1 must be a
positive integer that is less than the highest partition number within
the table space. int2 must be an integer that is greater than int1 and
less than or equal to the highest partition number.
If no PART keyword is specified in an UNLOAD control statement, the
data from the entire table space is unloaded into a single unload data set.
FROMCOPY data-set-name
Indicates that data is to be unloaded from an image copy data set. When you
specify FROMCOPY, the UNLOAD utility processes only the specified image
copy data set. Alternatively, you can use the FROMCOPYDDN keyword where
multiple image copy data sets can be concatenated under a single DD name.
|
667
CATALOG
Indicates that the data set is cataloged. Use this option only for an image
copy that was created as a cataloged data set (which means that its volume
serial is not recorded in SYSIBM.SYSCOPY).
vol-ser
Identifies the data set by an alphanumeric volume serial identifier of its
first volume. Use this option only for an image copy that was created as a
non-cataloged data set. To specify a data set that is stored on multiple tape
volumes, identify the first vol-ser in the SYSCOPY record.
FROMSEQNO n
Identifies the image copy data set by its file sequence number. The
FROMSEQNO option is required if you are unloading an image copy
from a tape data set that is not cataloged.
n
FROMCOPYDDN ddname
Indicates that data is to be unloaded from one or more image copy data sets
that are associated with the specified ddname. Multiple image copy data sets
(primarily for the copy of pieces) can be concatenated under a single DD
name.
ddname
Identifies a DD name with which one or more image copy data sets are
associated.
LIST listdef-name
Identifies the name of a list of objects that are defined by a LISTDEF utility
control statement. The list can include table spaces, index spaces, databases, a
tables, an index, and partitions. The list cannot include index spaces, LOB table
spaces, and directory objects. You cannot use the LIST option to specify image
copy data sets.
When you specify the LIST option, the referenced LISTDEF identifies:
v The table spaces from which the data is to be unloaded. You can use the
pattern-matching feature of LISTDEF.
v The partitions (if a table space is partitioned) from which the data is to be
unloaded (defined by the INCLUDE, EXCLUDE, and PARTLEVEL keywords
in the LISTDEF statement).
The UNLOAD utility associates a single table space with one output data set,
except when partition-parallelism is activated. When you use the LIST option
with a LISTDEF that represents multiple table spaces, you must also define a
data set TEMPLATE that corresponds to all of the table spaces and specify the
template-name in the UNLDDN option.
If you want to generate the LOAD statements, you must define another
TEMPLATE for the PUNCHDDN data set that is similar to UNLDDN. DB2
then generates a LOAD statement for each table space. This utility will only
process clone data if the CLONE keyword is specified. The use of CLONED
YES on the LISTDEF statement is not sufficient.
PUNCHDDN
Specifies the DD name for a data set or a template name that defines one or
more data set names that are to receive the LOAD utility control statements
that the UNLOAD utility generates.
ddname
Specifies the DD name.
668
669
670
v For character strings that are converted from numeric, date, time, or
timestamp data, the default encoding scheme of the table is used. For more
information, see the CCSID option of the CREATE TABLE statement in
|
|
|
If you do specify EBCDIC, ASCI, or UNICODE, the CCSIDs specified for SBCS,
DBCS, and MIXED should be valid CCSIDs for the specified encoding scheme
or 0.
When a CCSID conversion is requested, CCSID character substitutions can
occur in the output string. Use the NOSUBS option to prevent possible
character substitutions during CCSID conversion.
NOSUBS
Specifies that CCSID code substitution is not to be performed during unload
processing.
When a string is converted from one CCSID to another (including EBCDIC,
ASCII, and Unicode), a substitution character is sometimes placed in the
output string. For example, this substitution occurs when a character (referred
to as a code point) that exists in the source CCSID does not exist in the target
CCSID. You can use the NOSUBS keyword to prevent the UNLOAD utility
from allowing this substitution.
If you specify the NOSUBS keyword and character substitution is attempted
while data is being unloaded, this action is treated as a conversion error. The
record with the error is not unloaded, and the process continues until the total
error count reaches the number that is specified by MAXERR.
|
|
NOPAD
Specifies that the variable-length columns in the unloaded records are to
occupy the actual data length without additional padding. As a result, the
unloaded or discarded records might have varying lengths. NOPAD is the
default for XML columns.
When you do not specify NOPAD:
v Default UNLOAD processing pads variable-length columns in the unloaded
records to their maximum length, and the unloaded records have the same
length for each table.
v The padded data fields are preceded by the length fields that indicate the
size of the actual data without the padding.
v When the output records are reloaded with the LOAD utility, padded data
fields are treated as varying-length data.
If you specify DELIMITED, the NOPAD option is the default for
variable-length columns. For fixed-length columns, the normal padding rules
apply.
Although LOAD processes records with variable-length columns that are
unloaded or discarded by using the NOPAD option, these records cannot be
processed by applications that process only fields in fixed positions. For
example, the LOAD statement that is generated for the EMP sample table
would look similar to the LOAD statement in Figure 72 on page 469.
DELIMITED
Specifies that the output data file is in a delimited format. When data is in a
delimited format, all fields in the output data set are character strings or
external numeric values. In addition, each column in a delimited file is
separated from the next column by a column delimiter character.
For each of the delimiter types that you can specify, you must ensure that the
delimiter character is specified in the code page of the target data. The
Chapter 32. UNLOAD
671
672
IEEE
Indicates that the binary floating-point data is written to the output records
in the IEEE format (also known as the binary floating point, or BFP).
MAXERR integer
Specifies the maximum number of records in error that are to be allowed; the
unloading process terminates when this value is reached.
integer
Specifies the number of records in error that are allowed. When the error
count reaches this number, the UNLOAD utility issues message DSNU1219
and terminates with return code 8.
The default value is 1, which indicates that UNLOAD stops when the first
error is encountered. If you specify 0 or any negative number, execution
continues regardless of the number of records that are in error.
If multiple table spaces are being processed, the number of records in error is
counted for each table space. If the LIST option is used, you can add OPTION
utility control statement (EVENT option with ITEMERROR) before the
UNLOAD statement to specify that the table space in error is to be skipped
and the subsequent table spaces are to be processed.
SHRLEVEL
Specifies whether other processes can access or update the table space or
partitions while the data is being unloaded.
UNLOAD ignores the SHRLEVEL specification when the source object is an
image copy data set.
The default value is SHRLEVEL CHANGE ISOLATION CS.
CHANGE
Specifies that rows can be read, inserted, updated, and deleted from the
table space or partition while the data is being unloaded.
ISOLATION
Specifies the isolation level with SHRLEVEL CHANGE.
CS
Indicates that the UNLOAD utility is to read rows in cursor
stability mode. With CS, the UNLOAD utility assumes
CURRENTDATA(NO).
UR
Indicates that uncommitted rows, if they exist, are to be unloaded.
The unload operation is performed with minimal interference from
the other DB2 operations that are applied to the objects from which
the data is being unloaded.
|
|
|
|
673
data is unloaded from multiple partitions, the drain lock is obtained for all
of the selected partitions in the UTILINIT phase.
|
|
|
DECFLOAT_ROUNDMODE
Specifies the rounding mode to be used when DECFLOATs are manipulated.
The following rounding modes are supported:
|
|
|
|
ROUND_CEILING
Round toward +infinity. The discarded digits are removed if they are all
zero or if the sign is negative. Otherwise, the result coefficient should be
incremented by 1 (rounded up).
|
|
ROUND_DOWN
Round toward 0 (truncation). The discarded digits are ignored.
|
|
|
|
ROUND_FLOOR
Round toward -infinity. The discarded digits are removed if they are all
zero or positive. Otherwise, the sign is negative and the result coefficient
should be incremented by 1 (rounded up).
|
|
|
|
ROUND_HALF_DOWN
Round to the nearest number. If equidistant, round down. If the discarded
digits are greater than 0.5, the result coefficient should be incremented by 1
(rounded up). The discarded digits are ignored if they are 0.5 or less.
|
|
|
|
|
|
|
|
ROUND_HALF_EVEN
Round to the nearest number. If equidistant, round so that the final digit is
even. If the discarded digits are greater than .05, the result coefficient
should be incremented by 1 (rounded up). The discarded digits are ignored
if they are less than 0.5. If the result coefficient is .05 and the rightmost
digit is even, the result coefficient is not altered. If the result coefficient is
.05 and the rightmost digit is odd, the result coefficient should be
incremented by 1 (rounded up).
|
|
|
|
ROUND_HALF_UP
Round to nearest. If equidistant, round up. If the discarded digits are
greater than or equal to 0.5, the result coefficient should be incremented by
1 (rounded up). Otherwise the discarded digits are ignored.
|
|
|
|
ROUND_UP
Round away from 0. If all of the discarded digits are 0, the result is
unchanged. Otherwise, the result coefficient should be incremented by 1
(rounded up).
|
|
|
|
|
|
|
|
|
CLONE
Indicates that UNLOAD is to unload data from only clone tables in the
specified table spaces. This utility will only process clone data if the CLONE
keyword is specified. The use of CLONED YES on the LISTDEF statement is
not sufficient. If you specify the name of the clone table in the FROM TABLE
clause, you do not need to specify the CLONE keyword.
FROM-TABLE-spec
More than one table or partition for each table space can be unloaded with a single
invocation of the UNLOAD utility. One FROM TABLE statement for each table that
is to be unloaded is required to identify:
674
You cannot specify FROM TABLE if the LIST option is already specified.
FROM-TABLE-spec
HEADER OBID
FROM
TABLE table-name
HEADER
NONE
CONST
SAMPLE
decimal
string
Xhex-string
LIMIT
integer
,
( field-specification
WHEN
(selection-condition)
675
field-specification:
POSITION(*)
field-name
POSITION(start)
CHAR
(length)
TRUNCATE
strip-spec
DBCLOBF
CLOBF
BLOBF
template-name
VARCHAR
(length)
strip-spec
DBCLOBF
CLOBF
BLOBF
template-name
GRAPHIC
EXTERNAL
(length)
strip-spec
VARGRAPHIC
TRUNCATE
(length)
SMALLINT
INTEGER
EXTERNAL
(length)
BIGINT
BINARY
(length)
VARBINARY
BINARY VARYING
strip-spec
PACKED
DECIMAL
ZONED
EXTERNAL
TRUNCATE
,0
(length
)
,scale
FLOAT
EXTERNAL
DOUBLE
REAL
DATE EXTERNAL
(length)
(length)
TIME
EXTERNAL
(length)
TIMESTAMP EXTERNAL
(length)
CONSTANT
string
Xhex-string
ROWID
BLOB
(length)
TRUNCATE
CLOB
(length)
TRUNCATE
DBCLOB
(length)
TRUNCATE
decfloat-spec
XML
676
strip spec:
BOTH
TRUNCATE
STRIP
TRAILING
LEADING
(1)
strip-char
Xstrip-char
Notes:
|
|
If you specify VARGRAPHIC, BINARY, or VARBINARY, you cannot specify strip-char. You can
specify only Xstrip-char.
decfloat spec:
(34)
DECFLOAT
(16)
EXTERNAL
(length)
selection condition:
predicate
(selection-condition)
AND
OR
predicate
(selection-condition)
predicate:
basic predicate
BETWEEN predicate
IN predicate
LIKE predicate
NULL predicate
basic predicate:
677
column-name
=
<>
>
<
>=
<=
constant
labeled-duration-expression
BETWEEN predicate:
column-name
BETWEEN
constant
labeled-duration-expression
NOT
AND
constant
labeled-duration-expression
IN predicate:
,
IN ( constant
column-name
NOT
LIKE predicate:
column-name
LIKE string-constant
NOT
ESCAPE
string-constant
NULL predicate:
column-name
IS
NULL
NOT
labeled-duration-expression:
678
CURRENT_DATE
CURRENT_TIMESTAMP
+
-
constant
YEAR
YEARS
MONTH
MONTHS
DAY
DAYS
HOUR
HOURS
MINUTE
MINUTES
SECOND
SECONDS
MICROSECOND
MICROSECONDS
679
NONE
Indicates that no record header field is to be created. HEADER NONE is
the default value for a delimited file.
If HEADER NONE is specified in a FROM TABLE clause, the
corresponding INTO TABLE clause in the generated LOAD statement does
not have a WHEN specification. Therefore, if rows from multiple tables are
unloaded and HEADER NONE is specified in one or more FROM TABLE
clauses, rows that are unloaded from those tables are not able to be
reloaded until you edit the generated LOAD statement. If you use the
generated statement directly with the LOAD utility, the results might be
unpredictable.
CONST
Specifies that a constant string is to be used as the record header. The
given string operand determines the length of the header field. The string
value must be enclosed by a pair of single quote characters.
For example, consider the following UNLOAD statement:
UNLOAD ...
FROM TABLE table-name HEADER CONST 'abc' ...
680
The sampling is applied for each individual table. If the rows from multiple
tables are unloaded with sampling enabled, the referential integrity between
the tables might be lost.
LIMIT integer
Specifies the maximum number of rows that are to be unloaded from a table. If
the number of unloaded rows reaches the specified limit, message DSNU1201
is issued for the table, and no more rows are unloaded from the table. The
process continues to unload qualified rows from the other tables.
When partition parallelism is activated, the LIMIT option is applied to each
partition instead of to the entire table.
integer
Indicates the maximum number of rows that are to be unloaded from a
table. If the specified number is less than or equal to zero, no row is
unloaded from the table.
Like the SAMPLE option, if multiple tables are unloaded with the LIMIT
option, the referential integrity between the tables might be lost.
field-name
Identifies a column name that must exist in the source table.
POSITION(start)
Specifies the field position in the output record. You can specify
the position parameter as follows:
*
An asterisk, indicating that the field starts at the first byte after the last
position of the previous field.
start
A positive integer that indicates the start column of the data field.
681
When you explicitly specify the output field positions by using start
parameters (or using the * format) of the POSITION option, you must consider
the following items as a part of the output field:
v For a field whose value can be null, a space for the NULL indicator byte
v For varying-length data, a space for the length field (either 2 bytes or 4
bytes)
Layout of output fields on page 708 illustrates the field layout in conjunction
with the POSITION option, NULL indicator byte, the length field for a
varying-length field, the length parameter, and the actual data length.
The POSITION option is useful when the output fields must be placed at
desired positions in the output records. The use of the POSITION parameters,
however, can restrict the size of the output data fields. Use care when explicitly
specifying start parameters for nullable and varying-length fields. The
TRUNCATE option might be required, if applicable, to fit a data item in a
shorter space in an output record.
If you omit the POSITION option for the first field, the field starts from
position 1 if HEADER NONE is specified. Otherwise, the field starts from the
next byte position past the record header field. If POSITION is omitted for a
subsequent field, the field is placed next to the last position of the previous
field without any gap.
If NOPAD is specified and POSITION parameters are given for certain fields,
the effect of the NOPAD option might be lost because the fields with start
parameters (other than the default *) always start at the fixed positions in the
output records.
The POSITION option is ignored for delimited output files.
CHAR
Indicates that the output field is a character type with fixed length. You can
use CHARACTER in place of CHAR. If the source table column can be null, a
NULL indicator byte is placed at the beginning of the output field for a
non-delimited output file.
If you specify the EBCDIC, ASCII, UNICODE, or CCSID options, the output
data that corresponds to the specified option, is encoded in the CCSID,
depending on the subtype of the source data (SBCS or MIXED). If the subtype
is BIT, no conversion is applied.
(length)
Specifies the size of the output data in bytes.
|
|
|
|
|
|
If the length parameter is omitted, the default is the maximum length that
is defined on the source table column or the length in bytes of the
expanded template name if BLOBF, CLOBF, or DBCLOBF follows the
CHAR keyword. When the length parameter is specified:
v If the length is less than the size of the table column, the data is
truncated to the length if the TRUNCATE keyword is present; otherwise,
a conversion error occurs.
|
|
|
|
|
|
|
|
682
|
|
|
BLOBF
Specifies that the output field is to contain the name of the file to which
the BLOB or XML is to be unloaded without CCSID conversion.
|
|
|
CLOBF
Specifies that the output field is to contain the name of the file to which
the CLOB or XML is to be unloaded with any required CCSID conversion.
|
|
|
|
DBCLOBF
Specifies that the output field is to contain the name of the file to which
the DBCLOBF or XML is to be unloaded with any required CCSID
conversion.
TRUNCATE
Indicates that a character string (encoded for output) is to be truncated
from the right, if the data does not fit in the available space for the field in
the output record. Truncation occurs at the character boundary. See
Specifying TRUNCATE and STRIP options for output data on page 713
for the truncation rules that are used in the UNLOAD utility. Without
TRUNCATE, an error occurs when the output field size is too small for the
data.
VARCHAR
Specifies that the output field type is character of varying length. A 2-byte
binary field indicating the length of data in bytes is prepended to the data
field. If the table column can be null, a NULL indicator byte is placed before
this length field for a non-delimited output file.
If you specify the EBCDIC, ASCII, UNICODE, or CCSID options, the output
data is encoded in the CCSID corresponding to the specified option, depending
on the subtype of the source data (SBCS or MIXED). If the subtype is BIT, no
conversion is applied.
(length)
Specifies the maximum length of the actual data field in bytes. If you also
specify NOPAD, it indicates the maximum allowable space for the data in
the output records; otherwise, the space of the specified length is reserved
for the data.
|
|
|
|
|
|
|
|
|
BLOBF
Specifies that the output field is to contain the name of the file to which
the BLOB or XML is to be unloaded without CCSID conversion.
BINARYXML Specifies that the XML document is to be unloaded using file
reference variables in binary XML format. This option is only supported
when unloading an XML column.
|
|
|
CLOBF
Specifies that the output field is to contain the name of the file to which
the CLOB or XML is to be unloaded with any required CCSID conversion.
|
|
|
|
DBCLOBF
Specifies that the output field is to contain the name of the file to which
the DBCLOBF or XML is to be unloaded with any required CCSID
conversion.
Chapter 32. UNLOAD
683
STRIP
Specifies that UNLOAD is to remove binary zeroes (the default) or the
specified string from the beginning, the end, or both ends of the data.
UNLOAD adjusts the VARCHAR length field (for the output field) to the
length of the stripped data.
|
|
|
|
The STRIP option is applicable if the subtype of the source data is BIT. In
this case, no CCSID conversion is performed on the specified strip
character (even if it is given in the form strip-char).
The effect of the STRIP option is the same as the SQL STRIP scalar
function.
BOTH
Indicates that UNLOAD is to remove occurrences of blank or the
specified strip character from the beginning and end of the data. The
default is BOTH.
TRAILING
Indicates that UNLOAD is to remove occurrences of blank or the
specified strip character from the end of the data.
LEADING
Indicates that UNLOAD is to remove occurrences of blank or the
specified strip character from the beginning of the data.
strip-char
Specifies a single-byte character that is to be stripped. Specify this
character value in EBCDIC. Depending on the output encoding
scheme, UNLOAD applies SBCS CCSID conversion to the strip-char
value before it is used in the strip operation. If you want to specify a
strip-char value in an encoding scheme other than EBCDIC, use the
hexadecimal form. UNLOAD does not perform CCSID conversion if
the hexadecimal form is used.
Xstrip-char
Specifies a single-byte character that is to be stripped. It can be
specified in the hexadecimal form, Xhex-string, where hex-string is two
hexadecimal characters that represent a single SBCS character. If the
strip-char operand is omitted, the default is the blank character, which
is coded as follows:
v X40, for the EBCDIC-encoded output case
v X20 for the ASCII-encoded output case
v X20 the Unicode-encoded output case
The strip operation is applied after the character code conversion, if
the output character encoding scheme is different from the one that is
defined on the source data. Therefore, if a strip character is specified in
the hexadecimal format, you must specify the character in the encoding
scheme that is used for output.
TRUNCATE
Indicates that a character string (encoded for output) is to be truncated
from the right, if the data does not fit in the available space for the field in
the output records. Truncation occurs at a character boundary. See
Specifying TRUNCATE and STRIP options for output data on page 713
for the truncation rules that are used in the UNLOAD utility. Without
TRUNCATE, an error occurs when the output field size is too small for the
data.
684
GRAPHIC
Specifies that the output field is of the fixed-length graphic type. If the table
column can be null, a NULL indicator byte is placed before the actual data
field for any non-delimited output file.
If the output is in EBCDIC, the shift-in and shift-out characters are not
included at the beginning and at the end of the data.
(length)
Specifies the number of DBCS characters (the size of the output data in
bytes is twice the given length). If the given length is larger than the source
data length, the output field is padded with the default pad character.
TRUNCATE
Indicates that a graphic character string (encoded for output) is to be
truncated from the right, if the data does not fit in the available space for
the field in the output records. Truncation occurs at a character (DBCS)
boundary. Without TRUNCATE, an error occurs when the output field size
is too small for the data.
GRAPHIC EXTERNAL
Specifies that the data is to be written in the output records as a fixed-length
field of the graphic type with the external format; that is, the shift-out (SO)
character is placed at the starting position, and the shift-in (SI) character is
placed at the ending position. The byte count of the output field is always an
even number.
GRAPHIC EXTERNAL is supported only in the EBCDIC output mode (by
default or when the EBCDIC keyword is specified).
If the start parameter of the POSITION option is used to specify the output
column position, it points to the (inserted) shift-out character at the beginning
of the field. The shift-in character is placed at the next byte position past the
last double-byte character of the data.
(length)
Specifies a number of DBCS characters, excluding the shift characters (as in
the graphic type column definition that is used in a CREATE TABLE
statement) nor the NULL indicator byte if the source column can be null. If
the length parameter is omitted, the default output field size is the length
that is defined on the corresponding table column, plus two bytes
(shift-out and shift-in characters).
If the specified length is larger than the size of the data, the field is padded
on the right with the default DBCS padding character.
TRUNCATE
Indicates that a graphic character string is to be truncated from the right
by the DBCS characters, if the data does not fit in the available space for
the field in the output records. Without TRUNCATE, an error occurs when
the output field size is too small for the data. An error can also occur with
the TRUNCATE option if the available space is less than 4 bytes (4 bytes is
the minimum size for a GRAPHIC EXTERNAL field; shift-out character,
one DBCS, and shift-in character); or fewer than 5 bytes if the field is can
be null (the 4 bytes plus the NULL indicator byte).
VARGRAPHIC
Specifies that the output field is to be of the varying-length graphic type. A
2-byte binary length field is prepended to the actual data field. If the table
column can be null, a NULL indicator byte is placed before this length field for
any non-delimited output file.
Chapter 32. UNLOAD
685
(length)
Specifies the maximum length of the actual data field in the number of
DBCS characters. If you also specify NOPAD, it indicates the maximum
allowable space for the data in the output records; otherwise, the space of
the specified length is reserved for the data.
If the length parameter is omitted, the default is the smaller of 127 and the
maximum defined length of the source table column.
STRIP
Indicates that UNLOAD is to remove binary zeroes (the default) or the
specified string from the unloaded data. UNLOAD adjusts the
VARGRAPHIC length field (for the output field) to the length of the
stripped data (the number of DBCS characters).
|
|
|
|
The effect of the STRIP option is the same as the SQL STRIP scalar
function.
BOTH
Indicates that UNLOAD is to remove occurrences of blank or the
specified strip character from the beginning and end of the data. The
default is BOTH.
TRAILING
Indicates that UNLOAD is to remove occurrences of blank or the
specified strip character from the end of the data.
LEADING
Indicates that UNLOAD is to remove occurrences of blank or the
specified strip character from the beginning of the data.
Xstrip-char
Specifies a DBCS character that is to be stripped in the hexadecimal
format, Xhhhh, where hhhh is four hexadecimal characters that
represent a DBCS character. If this operand is omitted, the default is a
DBCS blank in the output encoding scheme (for example, X4040 for
the EBCDIC-encoded output or X8140 for CCSID 301).
The strip operation is applied after the character code conversion, if
the output character encoding scheme is different from the one that is
defined on the source data. Therefore, if you specify a strip character, it
must be in the encoding scheme that is used for the output.
TRUNCATE
Indicates that a graphic character string (encoded for output) is to be
truncated from the right, if the data does not fit in the available space for
the field in the output records. Truncation occurs at a DBCS character
boundary. Without TRUNCATE, an error occurs when the output field size
is too small for the data.
SMALLINT
Specifies that the output field is a 2-byte binary integer (a negative number is
in twos complement notation). To use the external format, specify INTEGER
EXTERNAL.
If the source data type is INTEGER, DECIMAL, FLOAT, BIGINT, or
DECFLOAT (either 4-byte or 8-byte format), an error occurs when the data is
greater than 32 767 or less than -32 768.
|
|
|
A SMALLINT output field requires 2 bytes, and the length option is not
available.
686
INTEGER
Specifies that the output field is a 4-byte binary integer (a negative number is
in twos complement notation).
|
|
|
|
|
|
|
(length)
Indicates the size of the output data in bytes, including a space for the sign
character. When the length is given and the character notation does not fit
in the space, an error occurs. The default is 20 characters (including a
space for the sign).
If the value is negative, a minus sign precedes the numeric digits. If the output
field size is larger than the length of the data, the output data is left justified
and blanks are padded on the right.
|
|
|
|
If the source data type is DECIMAL, FLOAT (either 4-byte or 8-byte format), or
DECFLOAT (either 8-byte or 16-byte format), an error occurs when the original
data is greater than 9 223 372 036 854 775 807 or less than
-9 223 372 036 854 775 808.
|
|
|
|
BIGINT
Specifies that the output field is an 8-byte binary integer (a negative number is
in twos complement notation). To use the external format, specify INTEGER
EXTERNAL.
|
|
|
|
|
|
|
|
|
BINARY(length)
Indicates that the output field is a binary string type with a fixed length. If the
source table column can be null, a NULL indicator byte is placed at the
beginning of the output field for a nondelimited output file. No data
conversion is applied to the field. The default for Xstrip-char is hexadecimal
zero (X00).
|
|
|
|
|
TRUNCATE
Indicates that the output binary string (encoded for output) is to be
truncated from the right, if the data does not fit in the available space for
the field in the output records. Without TRUNCATE, an error occurs when
the output field size is too small for the data.
|
|
|
|
|
|
|
|
VARBINARY
Indicates that the output field is a binary string type with varying length. A
2-byte binary field indicating the length of data in bytes is prepended to the
data field. If the table column can be null, a NULL indicator byte is placed
before the length field for a non-delimited output file. No data conversion is
applied to the field. The default for Xstrip-char is hexadecimal zero (X00).
STRIP
Specifies that UNLOAD is to remove binary zeroes (the default) or the
Chapter 32. UNLOAD
687
|
|
|
specified string from the beginning, the end, or both ends of the data.
UNLOAD adjusts the VARBINARY length field (for the output field) to the
length of the stripped data.
|
|
|
|
BOTH
Indicates that UNLOAD is to remove occurrences of binary zeroes or
the specified strip character from the beginning and end of the data.
The default is BOTH.
|
|
|
TRAILING
Indicates that UNLOAD is to remove occurrences of binary zeroes or
the specified strip character from the end of the data.
|
|
|
LEADING
Indicates that UNLOAD is to remove occurrences of binary zeroes or
the specified strip character from the beginning of the data.
|
|
|
|
Xstrip-char
Specifies a single-byte character that is to be stripped. It can be
specified only in the hexadecimal form, Xhex-string, where hex-string
is two hexadecimal characters that represent a single SBCS character.
|
|
|
|
|
TRUNCATE
Indicates that a binary string (encoded for output) is to be truncated from
the right, if the data does not fit in the available space for the field in the
output records. Without TRUNCATE, an error occurs when the output
field size is too small for the data.
DECIMAL
Specifies that the output data is a number that is represented by the indicated
decimal format (either PACKED, ZONED, or EXTERNAL). If you specify the
keyword DECIMAL by itself, packed-decimal format is assumed.
PACKED
Specifies that the output data is a number that is represented by the
packed-decimal format. You can use DEC or DEC PACKED as an
abbreviated form of the keyword.
The packed-decimal representation of a number is of the form ddd...ds,
where d is a decimal digit that is represented by 4 bits, and s is a 4-bit sign
character (hexadecimal A, C, E, or F for a positive number, and
hexadecimal B or D for a negative number).
length
Specifies the number of digits (not including the sign digit) that are to
be placed in the output field. The length must be between 1 and 31. If
the length is odd, the size of the output data field is (length+1) / 2
bytes; if even, (length / 2)+1 byte.
If the source data type is DECIMAL and the length parameter is
omitted, the default length is determined by the column attribute
defined on the table. Otherwise, the default length is 31 digits (16
bytes).
scale
Specifies the number of digits to the right of the decimal point. (Note
that, in this case, a decimal point is not included in the output field.)
The number must be an integer that is greater than or equal to zero
and less than or equal to the length.
688
689
690
(length)
Specifies the size of the data field in bytes in the output record. A DATE
EXTERNAL field requires a space of at least 10 characters. If the space is
not available, an error occurs. If the specified length is larger than the size
of the data, blanks are padded on the right.
TIME EXTERNAL
Specifies that the output field is for a character string representation of a time.
The output format of time depends on the DB2 installation.
(length)
Specifies the size of the data field in bytes in the output record. A TIME
EXTERNAL field requires a space of at least eight characters. If the space is
not available, a conversion error occurs. If the specified length is larger than
the size of the data, blanks are padded on the right.
TIMESTAMP EXTERNAL
Specifies that the output field is for a character string representation of a
timestamp.
(length)
Specifies the size of the data field in bytes in the output record. A
TIMESTAMP EXTERNAL field requires a space of at least 19 characters. If
the space is not available, an error occurs. The length parameter, if
specified, determines the output format of the TIMESTAMP. If the specified
length is larger than the size of the data, the field is padded on the right
with the default padding character.
CONSTANT
Specifies that the output records are to have an extra field containing a
constant value. The field name that is associated with the CONSTANT
keyword must not coincide with a table column name (the field name is for
clarification purposes only). A CONSTANT field always has a fixed length that
is equal to the length of the given string.
string
Specifies the character string that is to be inserted in the output records at
the specified or default position. A string is the required operand of the
CONSTANT option. If the given string is in the form string, it is assumed
to be an EBCDIC SBCS string. However, the output string for a
CONSTANT field is in the specified or default encoding scheme. (That is, if
the encoding scheme used for output is not EBCDIC, the SBCS CCSID
conversion is applied to the given string before it is placed in output
records.)
Xhex-string
Specifies the character string in hexadecimal form, Xhex-string, that is to
be inserted in the output records at the specified or default position. If you
want to specify a CONSTANT string value in an encoding scheme other
than SBCS EBCDIC, use the hexadecimal form. No CCSID conversion is
performed if the hexadecimal form is used.
For a CONSTANT field, no other field selection list options should be
specified.
If a CONSTANT field is inserted, it will not be included in the generated
LOAD statement (the LOAD statement is generated so that the CONSTANT
field is skipped).
691
692
TRUNCATE
Indicates that a CLOB string (encoded for output) is to be truncated from
the right, if the data does not fit in the available space for the field in the
output record. For CLOB data, truncation occurs at a character boundary.
See Specifying TRUNCATE and STRIP options for output data on page
713 for the truncation rules that are used in the UNLOAD utility. Without
TRUNCATE, an error occurs when the output field size is too small for the
data.
DBCLOB
Indicates that the column is to be unloaded as a double-byte character large
object (DBCLOB).
If you specify the DBCLOB field type, a 4-byte binary length field is placed in
the output record prior to the actual data field. If the source table column can
be null, a NULL indicator byte is placed before the length field.
If you specify the EBCDIC, ASCII, UNICODE, or CCSID options, the output
data is encoded in the CCSID corresponding to the specified option; DBCS
CCSID is used.
(length)
Specifies the maximum length of the actual data field in the number of
DBCS characters. If you specify NOPAD, it indicates the maximum
allowable space for the data in the output records; otherwise, the space of
the specified length is reserved for the data.
The default is the maximum length that is defined on the source table
column.
TRUNCATE
Indicates that a DBCS string (encoded for output) is to be truncated from
the right, if the data does not fit in the available space for the field in the
output record. For a DBCLOB data, truncation occurs at a character (DBCS)
boundary. See Specifying TRUNCATE and STRIP options for output data
on page 713 for the truncation rules that are used in the UNLOAD utility.
Without TRUNCATE, an error occurs when the output field size is too
small for the data.
|
|
|
|
|
|
|
DECFLOAT (length)
Specifies either a 128-bit decimal floating-point number or a 64-bit decimal
floating-point number. The value of the length must be either 16 or 34. If the
length is 16, the number is in 64 bit decimal floating-point number format. If
the length is 34, the number is in 128 bit decimal floating-point format. The
default length is determined by the column attribute defined on the table.
Otherwise, the default length is 34 (16 bytes).
|
|
|
DECFLOAT EXTERNAL
Specifies a string of characters that represent a number. The format is an SQL
numeric constant.
|
|
|
|
|
|
|
|
|
(length)
Specifies the total field length in bytes. This length includes the first sign
character, the decimal point, the E character, the second sign character, and
the exponent if in the string. If the number of characters in the result is
less than the specified or the default length, the result is padded to the
right with blanks. The character representation of a value must fit in the
given or default field size.
The default output field size is 23 if the source data type is the
DECFLOAT(16). Otherwise, the default is 42.
Chapter 32. UNLOAD
693
XML
Specifies that an XML column is being unloaded directly to the output record.
|
|
WHEN
Indicates which records in the table space are to be unloaded. If no WHEN
clause is specified for a table in the table space, all of the records are unloaded.
The option following WHEN describes the conditions for unloading records
from a table.
Data in the table can be in EBCDIC, ASCII, or Unicode. If the target table is in
Unicode and the character constants are specified in the utility control
statement as EBCDIC, the UNLOAD utility converts these constants to
Unicode. To use a constant when the target table is ASCII, specify the
hexadecimal form of the constant (instead of the character string form) in the
condition for the WHEN clause.
selection condition
Specifies a condition that is true, false, or unknown about a given row. When
the condition is true, the row qualifies for UNLOAD. When the condition is
false or unknown, the row does not qualify.
The result of a selection condition is derived by application of the specified
logical operators (AND and OR) to the result of each specified predicate. If
logical operators are not specified, the result of the selection condition is the
result of the specified predicate.
Selection conditions within parentheses are evaluated first. If the order of
evaluation is not specified by parentheses, AND is applied before OR.
If the control statement is in the same encoding scheme as the input data, you
can code character constants in the control statement. Otherwise, if the control
statement is not in the same encoding scheme as the input data, you must code
the condition with hexadecimal constants. For example, if the table space is in
EBCDIC and the control statement is in UTF-8, use (1:1) = X31 in the
condition rather than (1:1) = 1.
Restriction: UNLOAD cannot filter rows that contain encrypted data.
predicate
Specifies a condition that is true, false, or unknown about a row.
A DECFLOAT column or DECFLOAT constant cannot be specified in the
predicate.
|
|
basic predicate
Specifies the comparison of a column with a constant. If the value of the
column is null, the result of the predicate is unknown. Otherwise, the
result of the predicate is true or false.
column = constant
The column is equal to the constant or labeled duration expression.
column < > constant
The column is not equal to the constant or labeled duration
expression.
column > constant
The column is greater than the constant or labeled duration
expression.
694
Equivalent predicate
None
For example, the following predicate is true for any row when salary is
greater than or equal 10000 and less than or equal to 20000:
SALARY BETWEEN 10000 AND 20000
IN predicate
Specifies that a value is to be compared with a set of values. In the IN
predicate, the second operand is a set of one or more values that are
specified by constants. Each of the predicates two forms (IN and NOT IN)
has an equivalent search condition, as shown in the following table.
Table 136. IN predicates and their equivalent search conditions
Predicate
For example, the following predicate is true for any row whose employee
is in department D11, B01, or C01:
WORKDEPT IN ('D11', 'B01', 'C01')
695
LIKE predicate
Specifies the qualification of strings that have a certain pattern.
Within the pattern, a percent sign or underscore can have a special
meaning, or it can represent the literal occurrence of a percent sign or
underscore. To have its literal meaning, it must be preceded by an escape
character. If it is not preceded by an escape character, it has its special
meaning. The underscore character (_) represents a single, arbitrary
character. The percent sign (%) represents a string of zero or more arbitrary
characters.
The ESCAPE clause designates a single character. That character, and only
that character, can be used multiple times within the pattern as an escape
character. When the ESCAPE clause is omitted, no character serves as an
escape character, so that percent signs and underscores in the pattern
always have their special meanings.
The following rules apply to the use of the ESCAPE clause:
v The ESCAPE clause cannot be used if x is mixed data.
v If x is a character string, the data type of the string constant must be
character string. If x is a graphic string, the data type of the string
constant must be graphic string. In both cases, the length of the string
constant must be 1.
v The pattern must not contain the escape character except when followed
by the escape character, % or _. For example, if + is the escape
character, any occurrence of + other than ++, +_, or +% in the
pattern is an error.
When the pattern does not include escape characters, a simple description
of its meaning is:
v The underscore sign (_) represents a single arbitrary character.
v The percent sign (%) represents a string of zero or more arbitrary
characters.
v Any other character represents a single occurrence of itself.
Let x denote the column that is to be tested and y the pattern in the string
constant. The following rules apply to predicates of the form x LIKE y....
If NOT is specified, the result is reversed.
v When x and y are both neither empty nor null, the result of the
predicate is true if x matches the pattern in y and false if x does not
match the pattern in y.
v When x or y is null, the result of the predicate is unknown.
v When y is empty and x is not empty, the result of the predicate is false.
v When x is empty and y is not empty, the result of the predicate is false
unless y consists only of one or more percent signs.
v When x and y are both empty, the result of the predicate is true.
The pattern string and the string that is to be tested must be of the same
type. That is, both x and y must be character strings, or both x and y must
be graphic strings. When x and y are graphic strings, a character is a DBCS
character. When x and y are character strings and x is not mixed data, a
character is an SBCS character and y is interpreted as SBCS data regardless
of its subtype.
Strings and patterns
696
697
calendar page. Adding months to a date, then, is like turning the pages of
a calendar, starting with the page on which the date appears.) The result
must fall between the dates January 1, 0001 and December 31, 9999
inclusive. If a duration of years is added or subtracted, only the year
portion of the date is affected. The month is unchanged, as is the day,
unless the result would be February 29 of a non-leap-year. In this situation,
the day portion of the result is set to 28.
Similarly, if a duration of months is added or subtracted, only months and,
if necessary, years are affected. The day portion of the date is unchanged
unless the result would be invalid (September 31, for example). In this case
the day is set to the last day of the month.
Adding or subtracting a duration of days affects the day portion of the
date, and potentially the month and year.
Date durations, whether positive or negative, can also be added to and
subtracted from dates. As with labeled durations, the result is a valid date.
When a positive date duration is added to a date, or a negative date
duration is subtracted from a date, the date is incremented by the specified
number of years, months, and days.
When a positive date duration is subtracted from a date, or a negative date
duration is added to a date, the date is decremented by the specified
number of days, months, and years.
Adding a month to a date gives the same day one month later, unless that
day does not exist in the later month. In that case, the day in the result is
set to the last day of the later month. For example, January 28 plus one
month gives February 28; one month added to January 29, 30, or 31 results
in either February 28 or, for a leap year, February 29. If one or more
months is added to a given date and then the same number of months is
subtracted from the result, the final date is not necessarily the same as the
original date.
The order in which labeled date durations are added to and subtracted
from dates can affect the results. When you add labeled date durations to a
date, specify them in the order of YEARS + MONTHS + DAYS. When you
subtract labeled date durations from a date, specify them in the order of
DAYS - MONTHS - YEARS. For example, to add one year and one day to
a date, specify the following code:
CURRENT DATE + 1 YEAR + 1 DAY
To subtract one year, one month, and one day from a date, specify the
following code:
CURRENT DATE - 1 DAY - 1 MONTH - 1 YEAR
698
Related reference
CREATE TABLE (DB2 SQL Reference)
|
|
|
|
|
If the table into which you are loading data has an index with these characteristics,
LOAD fails:
v The index was created on a VARBINARY column or a column with a distinct
type that is based on a VARBINARY data type.
v The index column has the DESC attribute.
|
|
To fix the problem, drop the index, or alter the column data type to BINARY, and
then rebuild the index.
Description
Required?
SYSIN
Yes
SYSPRINT
Yes
SYSPUNCH
Note:
1. Required if you request that UNLOAD generate LOAD statements by specifying
PUNCHDDN in the utility control statement.
The following object is named in the utility control statement and does not require
a DD statement in the JCL:
Table space
Table space that is to be unloaded. (If you want to unload only one
partition of a table space, you must specify the PART option in the control
statement.)
Chapter 32. UNLOAD
699
UNLOAD
UNLOAD PART
DW/UTRO
DW/UTRO
CR/UTRW
CR/UTRW
Image copy*
CR/UTRW
CR/UTRW
Legend:
v DW: Drain the write claim class, concurrent access for SQL readers
v UTRO: Utility restrictive state, read-only access allowed
v CR: Claim read, concurrent access for SQL writers and readers
v UTRW: Utility restrictive state; read-write access allowed
Note: * If the target object is an image copy, the UNLOAD utility applies CR/UTRW to the
corresponding table space or physical partitions to prevent the table space from being
dropped while data is being unloaded from the image copy, even though the UNLOAD
utility does not access the data in the table space.
Compatibility
The compatibility of the UNLOAD utility and the other utilities on the same target
objects are shown in the following table. If the SHRLEVEL REFERENCE option is
specified, only SQL read operations are allowed on the same target objects;
otherwise SQL INSERT, DELETE, and UPDATE are also allowed. If the target
object is an image copy, INSERT, DELETE, and UPDATE are always allowed on
the corresponding table space. In any case, DROP or ALTER cannot be applied to
the target object while the UNLOAD utility is running.
Table 139. Compatibility of UNLOAD with other utilities
UNLOAD
SHRLEVEL
REFERENCE
UNLOAD
SHRLEVEL
CHANGE
FROM IMAGE
COPY
CHECK DATA
DELETE NO
Yes
Yes
Yes
CHECK DATA
DELETE YES
No
No
Yes
CHECK INDEX
Yes
Yes
Yes
CHECK LOB
Yes
Yes
Yes
COPY INDEXSPACE
Yes
Yes
Yes
COPY TABLESPACE
Yes
Yes
Yes*
Action
700
Action
UNLOAD
SHRLEVEL
REFERENCE
UNLOAD
SHRLEVEL
CHANGE
FROM IMAGE
COPY
DIAGNOSE
Yes
Yes
Yes
LOAD SHRLEVEL
CHANGE
No
Yes
Yes
LOAD SHRLEVEL
NONE
No
No
Yes
MERGECOPY
Yes
Yes
No
Yes
No
Yes
Yes
QUIESCE
Yes
Yes
Yes
REBUILD INDEX
Yes
Yes
Yes
RECOVER (no
options)
No
No
Yes
RECOVER ERROR
RANGE
No
No
Yes
RECOVER TOCOPY
or TORBA
No
No
Yes
REORG INDEX
Yes
Yes
Yes
REORG
TABLESPACE
UNLOAD
CONTINUE or
PAUSE
No
No
Yes
REORG
TABLESPACE
UNLOAD ONLY or
EXTERNAL
Yes
Yes
Yes
REPAIR DUMP or
VERIFY
Yes
Yes
Yes
REPAIR LOCATE
INDEX PAGE
REPLACE
Yes
Yes
Yes
REPAIR LOCATE
KEY or RID DELETE
or REPLACE
No
No
Yes
REPAIR LOCATE
TABLESPACE PAGE
REPLACE
No
No
Yes
REPORT
Yes
Yes
Yes
RUNSTATS INDEX
Yes
Yes
Yes
RUNSTATS
TABLESPACE
Yes
Yes
Yes
STOSPACE
Yes
Yes
Yes
Note: If the same data set is used as the output from the COPY utility and as the input data
set of the UNLOAD utility, unexpected results can occur.
701
Unloading partitions
You can unload partitions in one of two ways.
If the source table space is partitioned, use one of the following mutually exclusive
methods to select the partitions to unload:
v Use the LIST keyword with a LISTDEF that contains PARTLEVEL specifications.
Partitions can be either included or excluded by the use of the INCLUDE and
the EXCLUDE features of LISTDEF.
v Specify the PART keyword to select a single partition or a range of partitions.
With either method, the unloaded data can be stored in a single data set for all
selected partitions or in one data set for each selected partition. If you want to
unload to a single output data set, specify a DD name to UNLDDN. If you want to
unload into multiple output data sets, specify a template name that is associated
with the partitions. You can process multiple partitions in parallel if the
TEMPLATE definition contains the partition as a variable, for example &PA.
You cannot specify multiple output data sets with the FROMCOPY or the
FROMCOPYDDN option.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Specify XML as the output field type. If the output is a non-delimited format, a
2-byte length will precede the value of the XML. For delimited output, no length
field is present. XML is the only acceptable field type when unloading the XML
directly to the output record. No data type conversion applies and you cannot
specify FROMCOPY.
|
|
|
|
|
|
|
|
|
v Use the template control statement to create the XML output file and filename. If
data sets are not created and the DSN type is not specified on the template,
UNLOAD will use PDS as the data set type. PDS has a limit of single volume.
The output file uses multiple volumes, so you must specify HFS as the DSN
type. See Data sets that UNLOAD uses on page 699.
702
703
UNLOAD accepts full image copies, incremental image copies, and a copy of
pieces as valid input sources.
The UNLOAD utility supports image copy data sets for a single table space. The
table space name must be specified in the TABLESPACE option. The specified table
space must exist when you run the UNLOAD utility. (That is, the table space
cannot have been dropped since the image copy was taken.)
Use the FROMCOPYDDN option to concatenate the copy of table space partitions
under a DD name to form a single input data set image. When you use the
FROMCOPYDDN option, concatenate the data sets in the order of the data set
number; the first data set must be concatenated first. If the data sets are
concatenated in the wrong order or if different generations of image copies are
concatenated, the results might be unpredictable. For example, if the most recent
image copy data sets and older image copies are intermixed, the results might be
unpredictable.
You can use the FROMCOPYDDN option to concatenate a full image copy and
incremental image copies for a table space, a partition, or a piece, but duplicate
rows are also unloaded in this situation. Instead, consider using MERGECOPY to
generate an updated full image copy as the input to the UNLOAD utility.
You can select specific rows and columns to unload just as you would for a table
space. However, you can unload only rows that contain LOB columns when the
LOB columns are not included in a field specification list. If you use an image
copy that does not contain the page set header page when unloading a ROWID
column, the unload fails.
If you use the FROMCOPY or the FROMCOPYDDN option, you can specify only
one output data set.
If an image copy is created by an inline copy operation (LOAD or REORG
TABLESPACE), the image copy can contain duplicate pages. If duplicate pages
exist, the UNLOAD utility issues a warning message, and all the qualified rows in
duplicate pages are unloaded into the output data set.
If you specify a dropped table on the FROM TABLE option, the UNLOAD utility
terminates with return code 4. If you do not specify a FROM TABLE option and if
an image copy contains rows from dropped tables, UNLOAD ignores these rows.
When you specify either a full or incremental copy of partitions of a segmented
table space that consists of multiple data sets in the FROMCOPY option, be careful
when applying a mass delete to a table in the table space before you create the
copy. If a mass delete of a table occurs, the utility unloads deleted rows if the
space map pages that indicate the mass delete are not included in the data set that
corresponds to the specified copy. Where possible, use the FROMCOPYDDN
option to concatenate the copy of table space partitions.
If an image copy contains a table to which ALTER ADD COLUMN was applied
after the image copy was taken, the UNLOAD utility sets the system or
user-specified default value for the added column when the data is unloaded from
such an image copy.
704
Related reference
Chapter 11, COPY, on page 113
705
INTEGER
(external)
BIGINT
DECIMAL
(external)
FLOAT
(external)
DOUBLE or
REAL
FLOAT/REAL
SMALLINT
Y1
Y1
Y1
INTEGER
Y2
Y1
Y1
Y1
Y2
Y2
Y2
N2
Y3
| BIGINT
DECIMAL
FLOAT, DOUBLE, or
REAL
| DECFLOAT
Y2
1, 2
1, 2
Y1, 2
Y2
1, 2
Y1, 2
Y1, 2
Note:
1. Subject to the CCSID conversion, if specified (EXTERNAL case).
2. Potential overflow (conversion error).
| 3. When converting from DECFLOAT(34) to DECFLOAT(16), you might encounter overflow, underflow, subnormal number, or
inexact. However, there will be no conversion error.
|
The following table shows the compatibility of converting character data types.
Table 141. Compatibility of converting character data types
Output data types
| Input data
| types
BLOB
BLOB
CHAR
VARCHAR
1, 2
1, 2
CLOB
GRAPHIC
EXTERGRAPHIC NAL
VARGRAPHIC
DBCLOB
BINARY
VARBINARY
CLOB
DBCLOB
Y1, 2
Y1, 2, 3
Y1, 2
Y1
CHAR
Y1
Y1
Y1, 4
Y1, 4
Y1
Y1, 3
Y1
Y1
1,2
VARCHAR
or
LONG
VARCHAR
GRAPHIC
VARGRAPHIC or
LONG VARGRAPHIC
| BINARY
| VARBINARY
N
N
1, 2
1, 2, 3
Note:
1. Subject to the CCSID conversion, if specified.
2. Results in an error if the field length is too small for the data unless you specify the TRUNCATE option. Note that a LOB has a
4-byte length field; any other varying-length type has a 2-byte length field.
3. Only in the EBCDIC output mode.
4. Not applicable to BIT subtype data.
The following table shows the compatibility of converting time data types.
706
DATE EXTERNAL
TIME EXTERNAL
TIMESTAMP EXTERNAL
DATE
Y1, 2
TIME
Y1
TIMESTAMP
1, 3
1, 3
Y1
Note:
1. Subject to the CCSID conversion, if specified.
2. Zeros in the time portion.
3. DATE or TIME portion of the timestamp.
Related reference
Syntax and options of the UNLOAD control statement on page 664
Related information
Data types (DB2 SQL Reference)
707
Related concepts
Specifying TRUNCATE and STRIP options for output data on page 713
Layout of output fields
Field specification errors on page 714
Related reference
Syntax and options of the UNLOAD control statement on page 664
Data field
Length
The following figure shows the layout of a fixed-length field that can be null. This
diagram shows that a null indicator byte is stored before the data field, which
begins at the specified position or at the next byte position past the end of the
previous data field.
Specified position, or the next byte position
past the end of the previous data field
Default position of the next field
Data field
Length
If you are running UNLOAD with the NOPAD option and need to determine the
layout of a varying-length field that cannot be null, see the layout diagram in the
following figure. The length field begins at the specified position or at the next
708
Data field
Length
Maximum
length
Figure 104. Layout of a varying-length field (NOT NULL) with the NOPAD option
For UNLOAD without the NOPAD option, the layout of a varying-length field that
cannot be null is depicted in the following figure.
Specified position, or the next byte position
past the end of the previous data field
Default position of the next field
Data field
Pad
Length
Maximum
length
Figure 105. Layout of a varying-length field (NOT NULL) without the NOPAD option
For UNLOAD with the NOPAD option, the layout of a varying-length field that
can be null is depicted in the following figure. The length field begins at the
specified position or at the next byte position past the end of the previous data
field.
709
Data field
Length
Maximum
length
Figure 106. Layout of a nullable varying-length field with the NOPAD option
For UNLOAD without the NOPAD option, the layout of a varying-length field that
can be null is depicted in the following figure. The length field begins at the
specified position or at the next byte position past the end of the previous data
field.
Specified position, or the next byte position
past the end of the previous data field
Default position of the next field
Data field
Pad
Length
Maximum
length
Figure 107. Layout of a nullable varying-length field without the NOPAD option
710
EBCDIC SBCS
EBCDIC
DBCS/MBCS
ASCII/Unicode
SBCS
ASCII/Unicode
MBCS
Character string
delimiter
X7F
X7F
X22
X22
Decimal point
character
X4B
X4B
X2E
X2E
Column
delimiter
X6B
X6B
X2C
X2C
711
In most EBCDIC code pages, the hex values in the previous table represent a
double quotation mark() for the character string delimiter, a period(.) for the
decimal point character, and a comma(,) for the column delimiter.
The following table lists by encoding scheme the maximum allowable hex values
for any delimiter character.
Table 144. Maximum delimiter values for different encoding schemes
Encoding scheme
EBCDIC SBCS
None
EBCDIC DBCS/MBCS
X3F
ASCII/Unicode SBCS
None
ASCII/Unicode MBCS
X7F
The following table identifies the acceptable data type forms for the delimited file
format that the LOAD and UNLOAD utilities use.
Table 145. Acceptable data type forms for delimited files
Acceptable form for loading a
delimited file
CHAR, VARCHAR
A delimited or non-delimited
character string
A delimited or non-delimited
character stream
FLOAT
BLOB, CLOB
A delimited or non-delimited
character string
DBCLOB
A delimited or non-delimited
character string
DATE
A delimited or non-delimited
character string that contains a date
value in EXTERNAL format
TIME
A delimited or non-delimited
character string that contains a time
value in EXTERNAL format
TIMESTAMP
A delimited or non-delimited
character string that contains a
timestamp value in EXTERNAL
format
Data type
712
Table 145. Acceptable data type forms for delimited files (continued)
Data type
XML
Related concepts
Loading delimited files on page 263
Related reference
Appendix G, Delimited file format, on page 1011
Source string
Specified
length
STRIP BOTH
'_ABC_DEF'
'_ABC_'
'ABC'
STRIP LEADING
'_ABC_DEF'
'_ABC_'
'ABC_'
STRIP TRAILING
'_ABC_DEF'
'_ABC_'
'_ABC'
713
The generated LOAD statement includes WHEN and INTO TABLE specifications
that identify the table where the rows are to be reloaded, unless the HEADER
NONE option was specified in the UNLOAD control statement. You need to edit
the generated LOAD statement if you intend to load the UNLOAD output data
into different tables than the original ones.
If multiple table spaces are to be unloaded and you want UNLOAD to generate
LOAD statements, you must specify a physically distinct data set for each table
space to PUNCHDDN by using a template that contains the table space as a
variable (&TS.).
If PUNCHDDN is not specified and the SYSPUNCH DD name does not exist, the
LOAD statement is not generated.
714
completed. For a table space or partitions that were being processed at termination,
UNLOAD resets the output data sets and processes those table space or partitions
again.
When the source is one or more image copy data sets (when FROMCOPY or
FROMCOPYDDN is specified), UNLOAD always starts processing from the
beginning.
Related concepts
Restart of an online utility on page 36
The output from this example might look similar to the following output:
000060@@STERN#
32250.00
000150@@ADAMSON#
25280.00
000200@@BROWN#
27740.00
000220@@LUTZ#
29840.00
200220@@JOHN#
29840.00
Chapter 32. UNLOAD
715
In this output:
v @@ before the last name represents the 2-byte binary field that contains the
length of the VARCHAR field LASTNAME (for example, X0005 for STERN).
v # represents the NULL indicator byte for the nullable SALARY field.
v Because the SALARY column is declared as DECIMAL (9,2) on the table, the
default output length of the SALARY field is 11 (9 digits + sign + decimal point),
not including the NULL indicator byte.
v LASTNAME is unloaded as a variable-length field because the NOPAD option is
specified.
716
EXEC DSNUPROC,UID='SMPLUNLD',UTPROC='',SYSTEM='DSN'
DD DSN=USERID.SMPLUNLD.SYSPUNCH,
DISP=(NEW,CATLG,CATLG),
UNIT=SYSDA,SPACE=(TRK,(1,1))
DD SYSOUT=*
DD *
UNLDDS
DSN &USERID..SMPLUNLD.&TS..P&PART.
UNIT SYSDA DISP (NEW,CATLG,CATLG) SPACE (2,1) CYL
UNLOAD TABLESPACE TDB1.TSP1
UNLDDN UNLDDS
FROM TABLE TCRT.TTBL
Figure 109. Example of unloading data in parallel from a partitioned table space
Assume that the user ID is USERID. This UNLOAD job creates the following three
data sets to store the unloaded data:
v USERID.SMPLUNLD.TSP1.P00001 ... contains rows from partition 1.
v USERID.SMPLUNLD.TSP1.P00002 ... contains rows from partition 2.
v USERID.SMPLUNLD.TSP1.P00003 ... contains rows from partition 3.
717
//SAMPJOB
//STEP1
//SYSPUNCH
//
//
//SYSPRINT
//SYSIN
LISTDEF
JOB ...
EXEC DSNUPROC,UID='SMPLUNLD',UTPROC='',SYSTEM='DSN'
DD DSN=USERID.SMPLUNLD.SYSPUNCH,
DISP=(NEW,CATLG,CATLG),
UNIT=SYSDA,SPACE=(TRK,(1,1))
DD SYSOUT=*
DD *
UNLDLIST
INCLUDE TABLESPACE TDB1.TSP1 PARTLEVEL(1)
INCLUDE TABLESPACE TDB1.TSP1 PARTLEVEL(3)
TEMPLATE UNLDDS
DSN &USERID..SMPLUNLD.&TS..P&PART.
UNIT SYSDA DISP (NEW,CATLG,CATLG) SPACE (2,1) CYL
UNLOAD LIST UNLDLIST
-- LIST name
UNLDDN UNLDDS
-- TEMPLATE name
Figure 110. Example of using a LISTDEF utility statement to specify partitions to unload
Assume that the user ID is USERID. This UNLOAD job creates the following two
data sets to store the unloaded data:
v USERID.SMPLUNLD.TSP1.P00001 ... contains rows from partition 1.
v USERID.SMPLUNLD.TSP1.P00003 ... contains rows from partition 3.
JOB ...
EXEC DSNUPROC,UID='SMPLUNLD',UTPROC='',SYSTEM='DSN'
DD SYSOUT=*
DD *
UNLDLIST
INCLUDE TABLESPACE TDB1.TSP*
TEMPLATE UNLDDS
DSN &USERID..SMPLUNLD.&TS.
UNIT SYSDA DISP (NEW,CATLG,CATLG) SPACE (2,1) CYL
TEMPLATE PUNCHDS DSN &USERID..SMPLPUNC.&TS.
UNIT SYSDA DISP (NEW,CATLG,CATLG) SPACE (1,1) CYL
UNLOAD LIST UNLDLIST
PUNCHDDN PUNCHDS
-- TEMPLATE name
UNLDDN
UNLDDS
-- TEMPLATE name
Assume that the user ID is USERID. This UNLOAD job creates the following two
data sets to store the unloaded data:
v USERID.SMPLUNLD.TSP1 ... contains rows from table space TDB1.TSP1.
v USERID.SMPLUNLD.TSP2 ... contains rows from table space TDB1.TSP2.
718
719
|
|
|
|
720
721
722
EXEC PARM='ABC,...,XYZ'
723
To
1.
2.
3.
specify the parameter across multiple lines, perform the following actions:
Enclose it in parentheses.
End the first line with a subparameter, followed by a comma.
Continue the subparameters on the next line, beginning before column 17.
EXEC PARM=(ABC,...LMN,
OPQ,...,XYZ)
724
Environment
Execute the DSNJCNVB utility as a batch job only when DB2 is not running.
Your DB2 subsystem must be in new-function mode to convert the BSDS.
Authorization required
The authorization ID of the DSNJCNVB job must have the requisite RACF
authorization.
Prerequisite actions
If you have migrated to a new version of DB2, you need to create a larger BSDS
before converting it. For a new installation, you do not need to create a larger
BSDS. DB2 provides a larger BSDS definition in installation job DSNTIJIN;
however, if you want to convert the BSDS, you must still run DSNJCNVB.
725
Running DSNJCNVB
Use the following EXEC statement to execute this utility:
//EXEC
PGM=DSNJCNVB
EXEC PGM=DSNJCNVB
DD DISP=SHR,DSN=DSNC810.SDSNEXIT
DD DISP=SHR,DSN=DSNC810.SDSNLOAD
DD DISP=OLD,DSN=DSNC810.BSDS01
DD DISP=OLD,DSN=DSNC810.BSDS02
DD SYSOUT=*
DSNJCNVB output
The following example shows sample DSNJCNVB output:
CONVERSION OF BSDS DATA SET - COPY 1, DSN=DSNC810.BSDS01
SYSTEM TIMESTAMP
- DATE=2003.199 LTIME= 9:40:58.74
UTILITY TIMESTAMP - DATE=2003.216 LTIME=14:26:02.21
PREVIOUS HIKEY
- 04000053
NEW HIKEY
- 040002F0
RECORDS ADDED
- 669
DSNJ260I DSNJCNVB BSDS CONVERSION FOR DDNAME=SYSUT1 COMPLETED SUCCESSFULLY
DSNJ200I DSNJCNVB CONVERT BSDS UTILITY PROCESSING COMPLETED SUCCESSFULLY
Related information
Add a second BSDS (DB2 Installation Guide)
726
Environment
Run DSNJLOGF as a z/OS job.
DSNJLOGF output
The following sample shows the DSNJLOGF output for the first data set in the
previous sample control statement shown above.
Copyright IBM Corp. 1983, 2009
727
728
STEP1
Environment
Execute the change log inventory utility only as a batch job when DB2 is not
running. Changing a BSDS for a data-sharing member by using DSNJU003 might
cause a log read request from another data-sharing member to fail. The failure
occurs only if the second member tries to access the changed BSDS before the first
member is started.
Authorization required
The authorization ID of the DSNJU003 job must have the requisite RACF
authorization.
729
Running DSNJU003
Execute the utility with the following statement, which can be included only in a
batch job:
//EXEC
PGM=DSNJU003
NEWLOG DSNAME=data-set-name
STARTIME=startime,ENDTIME=endtime
,COPY1
,COPY2
,STARTRBA=startrba,ENDRBA=endrba
,CATALOG=NO
,COPY1VOL=vol-id
,COPY2VOL=vol-id
,STARTRBA=startrba,ENDRBA=endrba,UNIT=unit-id
STRTLRSN=startlrsn,ENDLRSN=endlrsn
DELETE statement
730
,CATALOG=YES
DELETE
DSNAME=data-set-name
,COPY1VOL=vol-id
,COPY2VOL=vol-id
CCSIDS
CRESTART statement
CRESTART
CREATE
CANCEL
create-spec
create-spec:
,STARTRBA=startrba
,ENDRBA=endrba
,ENDLRSN=endlrsn
,SYSPITR=log-truncation-point
,ENDTIME=log-truncation-timestamp
,SYSPITRT=log-truncation-timestamp
,FORWARD=YES
,CHKPTRBA=chkptrba
,BACKOUT=YES
,FORWARD=NO
,CSRONLY
,BACKOUT=NO
NEWCAT statement
NEWCAT VSAMCAT=catalog-name
DDF statement
|
|
|
DDF
ip-spec
lu-spec
no-spec
ip-spec:
731
,
LOCATION=locname
PORT=port
RESPORT=resport
SECPORT=secport
,
ALIAS= alias-name
:
:
:
alias-port
alias-secport
alias-port-:alias-secport
IPNAME=ipname
,
IPV4=IPV4-address
,GRPIPV4=group-ipv4-addr
IPV6=IPV6-address
,GRPIPV6=group-ipv6-addr
lu-spec:
,
LOCATION=locname
LUNAME=luname
PASSWORD=password
GENERIC=gluname
PORT=port
RESPORT=resport
,
ALIAS= alias-name
:alias-port
no-spec:
NOPASSWD
NGENERIC
NOALIAS
NOIPV4 , NGRPIPV4
NOIPV6 , NGRPIPV6
NGRPIPV4
NGRPIPV6
NOIPNAME
NOLUNAME
732
CHECKPT statement
CHECKPT STARTRBA=startrba
,ENDRBA=endrba ,TIME=time
,ENDLRSN=endlrsn
,CANCEL
HIGHRBA statement
HIGHRBA
STARTRBA=startrba
,TIME=time
,OFFLRBA=offlrba
OFFLRBA=offlrba
Option descriptions
NEWLOG
Declares one of the following data sets:
v A VSAM data set that is available for use as an active log data set.
Use only the keywords DSNAME=, COPY1, and COPY2.
v An active log data set that is replacing one that encountered an I/O error.
Use only the keywords DSNAME=, COPY1, COPY2, STARTRBA=, and
ENDRBA=.
v An archive log data set volume.
Use only the keywords DSNAME=,COPY1VOL=, COPY2VOL=,
STARTRBA=, ENDRBA=, UNIT=, CATALOG=, STRTLRSN=, and
ENDLRSN=.
If you create an archive log data set and add it to the BSDS with this utility,
you can specify a name that DB2 might also generate. DB2 generates archive
log data set names of the form DSNCAT.ARCHLOGx.Annnnnnn where:
DSNCAT and ARCHLOG are parts of the data set prefix that you
specified on installation panels DSNTIPA2 and DSNTIPH.
x is 1 for the first copy of the logs, and 2 is for the second copy.
Annnnnnn represents the series of low-level qualifiers that DB2 generates
for archive log data set names, beginning with A0000001, and
incrementing to A0000002, A0000003, and so forth.
For data sharing, the naming convention is DSNCAT.ARCHLOG1 or
DSNCAT.DSN1.ARCLG1.
If you do specify a name by using the same naming convention as DB2, you
receive a dynamic allocation error when DB2 generates that name. The error
message, DSNJ103I, is issued once. DB2 then increments the low-level
qualifier to generate the next data set name in the series and offloads to it
the next time DB2 archives. (The active log that previously was not
offloaded is offloaded to this data set.)
The newly defined active logs cannot specify a start and end LRSN. When
DB2 starts, it reads the new active log data sets with an RBA range to
determine the LRSN range, and updates the start and end LRSN in the
BSDS for the new log data sets. The start and end LRSN for new active logs
Chapter 36. DSNJU003 (change log inventory)
733
that contain active log data are read at DB2 start-up time from the new
active log data sets that are specified in the change log inventory NEWLOG
statements. For new archive logs that are defined with change log inventory,
the user must specify the start and end RBAs. For data sharing, the user
must also specify the start and end LRSNs. DB2 startup does not attempt to
find these values from the new archive log data sets.
DSNAME= data-set-name
Specifies a log data set.
data-set-name can be up to 44 characters long.
COPY1
Makes the data set an active log copy-1 data set.
COPY2
Makes the data set an active log copy-2 data set.
STARTRBA= startrba
Identifies a hexadecimal number of up to 12 characters. If you use fewer than
12 characters, leading zeros are added. startrba must end with 000; otherwise
DB2 returns a DSNJ4381 error message. You can obtain the RBA from messages
or by printing the log map.
On the NEWLOG statement, startrba gives the log RBA of the beginning of the
replacement active log data set or the archive log data set volume that is
specified by DSNAME.
On the CRESTART statement, startrba is the earliest RBA of the log that is to
be used during restart. If you omit STARTRBA, DB2 determines the beginning
of the log range.
On the CHECKPT statement, startrba indicates the start checkpoint log record.
STARTRBA is required when STARTIME is specified.
On the HIGHRBA statement, startrba denotes the log RBA of the
highest-written log record in the active log data sets.
ENDRBA= endrba
endrba is a hexadecimal number of up to 12 characters. If you use fewer than
12 characters, leading zeros are added. endrba must end with 000 or DB2
returns a DSNJ4381 error message.
On the NEWLOG statement, endrba gives the log RBA (relative byte address
within the log) of the end of the replacement active log data set or the archive
log data set volume that is specified by DSNAME.
On the CRESTART statement, endrba is the last RBA of the log that is to be
used during restart, and it is also the starting RBA of the next active log that is
written after restart. Any log information in the bootstrap data set, the active
logs, and the archive logs with an RBA that is greater than endrba is discarded.
If you omit ENDRBA, DB2 determines the end of the log range.
The value of ENDRBA must be a multiple of 4096. (The hexadecimal value
must end in 000.) Also, the value must be greater than or equal to the value of
STARTRBA. If STARTRBA and ENDRBA are equal, the next restart is a cold
start; that is, no log records are processed during restart. The specified RBA
becomes the beginning RBA of the new log.
On the CHECKPT statement, endrba indicates the end checkpoint log record
that corresponds to the start checkpoint log record.
734
COPY1VOL= vol-id
vol-id is the volume serial of the copy-1 archive log data set that is specified
after DSNAME.
COPY2VOL=vol-id
vol-id is the volume serial of the copy-2 archive log data set that is specified
after DSNAME.
UNIT=unit-id
unit-id is the device type of the archive log data set that is named after
DSNAME.
CATALOG
Indicates whether the archive log data set is to be cataloged.
NO
Indicates that the archive log data set is not to be cataloged. All subsequent
allocations of the data set are made using the unit and volume information
that is specified on the statement.
YES
Indicates that the archive log data set is to be cataloged. All subsequent
allocations of the data set are made using the catalog.
DB2 requires that all archive log data sets on disk be cataloged. Select
CATALOG=YES if the archive log data set is on disk.
STRTLRSN= startlrsn
On the NEWLOG statement, startlrsn identifies the LRSN in the log record
header of the first complete log record on the new archive data set. startlrsn is
a hexadecimal number of up to 12 characters. If you use fewer than 12
characters, leading zeros are added. In a data sharing environment, run the
print log map utility to find an archive log data set and start and end RBAs
and LRSNs.
ENDLRSN=endlrsn
endlrsn is a hexadecimal number of up to 12 characters. If you use fewer than
12 characters, leading zeros are added. In a data sharing environment, run the
print log map utility to find an archive log data set and start and end RBAs
and LRSNs.
For the NEWLOG and CHECKPT statements, the ENDLRSN option is valid
only in a data sharing environment. For the CRESTART statement, the
ENDLRSN option is valid in both data sharing and non-data sharing
environments. This option cannot be specified with STARTRBA or ENDRBA.
On the NEWLOG statement, endlrsn is the LRSN in the log record header of
the last log record on the new archive data set.
On the CRESTART statement, in a data sharing environment, endlrsn is an
LRSN value that is to be used as the log truncation point. A valid log
truncation point is any LRSN value for which there exists a log record with an
LRSN that is greater than or equal to the specified LRSN value. Any log
information in the bootstrap data set, the active logs, and the archive logs with
an LRSN greater than endlrsn is discarded. If you omit ENDLRSN, DB2
determines the end of the log range.
In a non-data sharing environment, endlrsn is the RBA value that matches the
start of the last log record that is to be used during restart. Any log
information in the bootstrap data set, the active logs, and the archive logs with
an RBA that is greater than endlrsn is discarded. If the endlrsn RBA value does
735
not match the start of a log record, DB2 restart fails. If you omit ENDLRSN,
DB2 determines the end of the log range.
On the CHECKPT statement, endlrsn is the LRSN of the end checkpoint log
record.
STARTIME=startime
Enables you to record the start time of the RBA in the BSDS. This field is
optional.
startime specifies the start time in the following timestamp format:
yyyydddhhmmsst
In this
yyyy
ddd
hh
mm
ss
t
format:
Indicates
Indicates
Indicates
Indicates
Indicates
Indicates
|
|
|
736
|
|
|
|
you must use the SYSPITR option of DSNJU003. This option enables you to
create a conditional restart control record to truncate the logs for system
point-in-time recovery. You can also specify a value of FFFFFFFFFFFF to cause
a point-in-time recovery to occur without log truncation.
|
|
|
|
|
|
|
|
|
|
|
You cannot specify any other option with CREATE, SYSPITR. You can run this
option of the utility only after new-function mode is enabled.
|
|
|
|
|
|
|
ENDTIME= log-truncation-timestamp
Specifies an end time value that is to be used as the log truncation point. A
valid truncation point is any GMT timestamp for which there exists a log
record with a timestamp that is greater than or equal to the specified
timestamp value. Any log information in the bootstrap data set, the active logs,
and the archive logs with a timestamp greater than the ENDTIME is discarded.
If you do not specify ENDTIME, DB2 determines the end of the log range.
|
|
You cannot specify any other option with CREATE, ENDTIME. You can run
this option of the utility only after new-function mode is enabled.
|
|
|
|
|
|
SYSPITRT= log-truncation-timestamp
Specifies the timestamp value that represents the point-in-time log truncation
point for system recovery. Before you run the RESTORE SYSTEM utility to
recover system data, you must use the SYSPITR or SYSPITRT option of
DSNJU003. The options enable you to create a conditional restart control record
to truncate the logs for system point-in-time recovery.
|
|
|
|
|
|
|
|
|
|
You cannot specify any other option with CREATE, SYSPITRT. You can run this
option of the utility only after new-function mode is enabled.
|
|
Note: The startime keyword specifies the start time in the yyyydddhhmmsst
timestamp format. See the STARTIME option for details about the timestamp.
|
|
|
CANCEL
On the CRESTART statement, deactivates the currently active conditional
restart control record. The record remains in the BSDS as historical information.
|
|
|
On the CHECKPT statement, deletes the checkpoint queue entry that contains
a starting RBA that matches the parameter that is specified by the STARTRBA
keyword.
737
|
|
|
|
|
|
CHKPTRBA= chkptrba
Identifies the log RBA of the start of the checkpoint record that is to be used
during restart.
|
|
|
If you use STARTRBA or ENDRBA, and you do not use CHKPTRBA, the
DSNJU003 utility selects the RBA of an appropriate checkpoint record. If you
do use CHKPTRBA, you override the value that is selected by the utility.
|
|
chkptrba must be in the range that is determined by startrba and endrba or their
default values.
|
|
If possible, do not use CHKPTRBA; let the utility determine the RBA of the
checkpoint record.
|
|
|
|
|
|
|
|
|
YES
Allows forward-log recovery.
|
|
If you specify a cold start (by using the same value for STARTRBA and
ENDRBA), no recovery processing is performed.
|
|
NO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
YES
Allows backward-log recovery.
|
|
If you specify a cold start (by using the same value for STARTRBA and
ENDRBA), no recovery processing is performed.
|
|
738
|
|
NO
Terminates backward-log recovery before log records are processed.
|
|
|
|
|
|
CSRONLY
Performs only the first and second phases of restart processing (log
initialization and current-status rebuild). After these phases, the system status
is displayed, and restart terminates. Some parts of the log initialization are not
performed, including any updating of the log and display of STARTRBA and
ENDRBA information.
|
|
|
|
When DB2 is restarted with this option in effect, the conditional restart control
record is not deactivated. To prevent the control record from remaining active,
use the DSNJU003 utility again with CRESTART CANCEL, or with CRESTART
CREATE to create a new active control record.
|
|
NEWCAT
Changes the VSAM catalog name in the BSDS.
|
|
VSAMCAT= catalog-name
Changes the VSAM catalog name entry in the BSDS.
|
|
|
|
|
|
|
|
|
DDF
Updates the LOCATION, LUNAME, and other DDF related information values
in the BSDS. If you use this statement to insert new values into the BSDS, you
must include at least the LOCATION and LUNAME in the DDF statement. To
update an existing set of values, you need to include only those values that
you want to change. The DDF record cannot be deleted from the BSDS after it
has been added; it can only be modified.
|
|
LOCATION= location-name
Changes the LOCATION value in the BSDS.
|
|
|
|
|
|
|
|
If DB2 is part of a data sharing group, all the members of the DB2 data sharing
group must have the same value for PORT.
|
|
|
|
|
|
RESPORT
Identifies the TCP/IP port number that is used by DDF to accept incoming
DRDA two-phase commit resynchronization requests. This value must be a
decimal number between 0 and 65535, including 65535; zero indicates that
DDFs TCP/IP support is to be deactivated. If RESPORT is non-zero, RESPORT
must not be the same as the value that is supplied on PORT.
|
|
|
For data sharing DB2 systems, RESPORT must be uniquely assigned to each
DB2 member, so that no two DB2 members use the same TCP/IP port for
two-phase commit resynchronization.
|
|
|
|
|
SECPORT
Identifies the TCP/IP port number that is used by DDF to accept inbound
secure DRDA connection requests. This value must be a decimal number
between 0 and 65535, including 65535; zero indicates that DDFs secure
connection support for TCP/IP is deactivated.
Chapter 36. DSNJU003 (change log inventory)
739
|
|
:alias-port specifies a TCP/IP port number for the alias that can be used by
DDF to accept distributed requests. This value must be a decimal number
between 1 and 65535, including 65535, and must be different than the values
for the PORT and RESPORT options. Specify a value for alias-port when you
want to identify a subset of data sharing members to which a distributed
request can go.
:alias-secport specifies a secure TCP/IP port number for the alias that can be
used by DDF to accept secure distributed requests using SSL. This value must
be a decimal number between 1 and 65535, including 65535, and must be
different than the values for the SECPORT, PORT, and RESPORT options.
Specify a value for alias-secport when you want to identify a subset of data
sharing members to which a secure distributed request can go. When you
specify a value for alias-secport, the :alias-port value is optional.
|
|
|
|
|
|
|
You can add or replace aliases by respecifying the ALIAS option. The new list
of names replaces the existing list.
IPNAME= ipname
Changed the IPNAME values in the BSDS.
|
|
|
|
|
|
|
|
|
ipname specifies the IPNAME value. The value can be up to 8-bytes in length
and must be an alphanumeric character beginning with an alphabetic character.
When you specify this option, the DDF will activate only its TCP/IP
communications support, regardless of whether or not there is a value for
LUNAME. Only inbound and outbound DRDA protocol communications over
TCP/IP is allowed and there is no attempt to activate SNA/APPC
communications support.
|
|
|
|
|
|
|
|
|
|
The value specified must be either unique to this DB2 subsystem with an
enterprise, or if the DB2 subsystem is configured to be a member of a data
sharing group, unique to the data sharing group for which this DB2 subsystem
is a member. All members of a data sharing group must be defined with the
same IPNAME value if all the members are to activate only their TCP/IP
communications support. If some members of a data sharing group activate
their SNA/APPC (as well as TCP/IP communications support), then the
IPNAME value chosen for the TCP/IP only members must match the
GENERIC value specified for the members which activate their SNA/APPC as
well as their TCP/IP communications support.
|
|
|
|
|
|
|
|
|
The value given to IPNAME will be used by DB2 as the network-id portion of
a unit-of-work identifier. A unit-of-work identifier has traditionally been made
up of a network-id, a LU name, a 6-byte unique identifier created from a
timestamp, and a 2-byte current commit count value. When running with an
IPNAME value, the LU name portion of the unit-of-work identifier will be
created from a 4-byte character representation of the hexadecimal notation of
the value specified for the TCP/IP resync port (RESPORT). This support for
activating only TCP/IP communications will occur only if the DB2 is running
in V9 New Function Mode.
|
|
740
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IPV6= ipv6-address
Identifies and associates a constant IPv6 IP address with DDF to accept
incoming connection requests to this specific subsystem only. This address
must be entered in colon hexadecimal form. If an IP address is not specified,
DB2 will automatically determine the IP address from TCP/IP.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GRPIPV4
Identifies and associates a constant IPv4 IP address with the data sharing
group for which this DDF is a member. The IP address is used to accept
incoming connection requests that can be serviced by any member of the data
sharing group. This address must be entered in dotted decimal form. An
associated IPv4 subsystem/member address must also be specified in order to
identify the IP address associated with this specific member of the group. If an
IP address is not specified, DB2 will automatically determine the IP address
from TCP/IP.
It is strongly recommended that you refer to a sysplex distributor owned
distributing dynamic virtual IP address (DVIPA).
GRPIPV6
Identifies and associates a constant IPv6 IP address with the data sharing
group for which this DDF is a member. The IP address is used to accept
incoming connection requests that can be serviced by any member of the data
sharing group. This address must be entered in colon hexadecimal form. An
associated IPv6 subsystem/member address must also be specified in order to
identify the IP address associated to this specific member of the group. If an IP
address is not specified, DB2 will automatically determine the IP address from
TCP/IP.
It is strongly recommended that you refer to a sysplex distributor owned
distributing dynamic virtual IP address (DVIPA).
LUNAME= luname
Changes the LUNAME value in the BSDS.
luname specifies the LUNAME value. The LUNAME in the BSDS must always
contain the value that identifies your local DB2 subsystem to the VTAM
network.
PASSWORD=
The DDF password follows VTAM convention, but DB2 restricts it to one to
Chapter 36. DSNJU003 (change log inventory)
741
eight alphanumeric characters. The first character must be either a capital letter
or an alphabetic extender. The remaining characters can consist of
alphanumeric characters and alphabetic extenders.
password
Optionally assigns a password to the distributed data facility
communication record that establishes communications for a distributed
data environment. See VTAM for MVS/ESA Resource Definition Reference for
a description of the PRTCT=password option on the APPL definition
statement that is used to define DB2 to VTAM.
GENERIC= gluname
Replaces the value of the DB2 GENERIC LUNAME subsystem parameter in
the BSDS.
gluname specifies the GENERIC LUNAME value.
NOPASSWD
Removes the archive password protection for all archives that are created after
this operation. It also removes a previously existing password from the DDF
record. No other keyword can be used with NOPASSWD.
NGENERIC
Changes the DB2 GENERIC LUNAME to binary zeros in the BSDS, indicating
that no VTAM generic LU name support is requested.
NOALIAS
Indicates that no alias names exist for the specified location. Any alias names
that were specified in a previous DSNJU003 utility job are removed.
|
|
|
|
NOIPV4
Removes the constant IPv4 address from the BSDS. The NGRPIPV4 keyword
must also be specified to ensure that the associated group address, if any, is
also removed.
|
|
|
|
NOIPV6
Removes the constant IPv6 address from the BSDS. The NGRPIPV6 keyword
must also be specified to ensure that the associated group address, if any, is
also removed.
|
|
NGRPIPV4
Removes the constant data sharing group IPv4 address from the BSDS.
|
|
NGRPIPV6
Removes the constant data sharing group IPv6 address from the BSDS.
|
|
|
NOIPNAME
Removes the IPNAME value from the DDF record. No other keyword can be
used with NOIPNAME.
|
|
|
NOLUNAME
Removes the LUNAME value from the DDF record. No other keyword can be
used with NOLUNAME.
CHECKPT
Allows updating of the checkpoint queue with the start checkpoint and end
checkpoint log records.
Attention: This statement can override DB2s efforts to maintain data in a
consistent state. Do not use the statement without understanding the
conditional restart and checkpoint processing processes.
742
TIME= time
On the CHECKPT statement, specifies the time that the start checkpoint
record was written.
On the HIGHRBA statement, TIME specifies when the log record with the
highest RBA was written to the log.
time specifies the time value. For timestamp format, see the STARTIME option
description.
HIGHRBA
Updates the highest-written log RBA in either the active or archive log data
sets.
Attention: This statement can override DB2s efforts to maintain data in a
consistent state. Do not use the statement without understanding the
conditional restart process.
OFFLRBA= offlrba
Specifies the highest-offloaded RBA in the archive log.
offlrba is a hexadecimal number of up to 12 characters. If you use fewer than 12
characters, leading zeros are added. The value must end with hexadecimal
XFFF.
Related information
Performing conditional restart (DB2 Administration Guide)
Phase 3: Forward log recovery (DB2 Administration Guide)
Member-specific access (DB2 Data Sharing: Planning and Administration)
To copy the contents of an old active log data set to the new one, you can also give
the RBA range and the starting and ending timestamp on the NEWLOG statement.
To archive to disk when the size of your active logs has increased, you might find
it necessary to increase the size of your archive data set primary and secondary
space quantities in DSNZPARM.
743
Deleting: To delete information about an active log data set from the BSDS, you
might specify the following statements:
DELETE DSNAME=DSNC910.LOGCOPY1.DS01
DELETE DSNAME=DSNC910.LOGCOPY2.DS01
Recording: To record information about an existing active log data set in the BSDS,
you might specify the following statement:
NEWLOG DSNAME=DSNC910.LOGCOPY2.DS05,COPY2,STARTIME=19910212205198,
ENDTIME=19910412205200,STARTRBA=43F8000,ENDRBA=65F3FFF
You can insert a record of that information into the BSDS for any of these reasons:
v The data set has been deleted and is needed again.
v You are copying the contents of one active log data set to another data set (copy
1 to copy 2).
v You are recovering the BSDS from a backup copy.
Enlarging: When DB2 is inactive (down), use one of the following procedures.
If you can use the Access Method Services REPRO command, follow these steps:
1. Stop DB2. This step is required because DB2 allocates all active log data sets
when it is active.
2. Use the Access Method Services ALTER command with the NEWNAME option
to rename your active log data sets.
3. Use the Access Method Services DEFINE command to define larger active log
data sets. Refer to installation job DSNTIJIN to see the definitions that create
the original active log data sets.
By reusing the old data set names, you dont need to run the change log
inventory utility to establish new names in the BSDSs. The old data set names
and the correct RBA ranges are already in the BSDSs.
4. Use the Access Method Services REPRO command to copy the old (renamed)
data sets into their respective new data sets.
5. Start DB2.
If you cannot use the Access Method Services REPRO command, follow this
procedure:
1. Ensure that all active log data sets except the current active log data sets have
been archived. Active log data sets that have been archived are marked
REUSABLE in print log map utility (DSNJU004) output.
2. Stop DB2.
3. Rename or delete the reusable active logs. Allocate new, larger active log data
sets with the same names as the old active log data sets.
4. Run the DSNJLOGF utility to preformat the new log data sets.
5. Run the change log inventory utility (DSNJU003) with the DELETE statement
to delete all active logs except the current active logs from the BSDS.
6. Run the change log inventory utility with the NEWLOG statement to add to
the BSDS the active logs that you just deleted. So that the logs are added as
empty, do not specify an RBA range.
7. Start DB2.
8. Issue the ARCHIVE LOG command to cause DB2 to truncate the current active
logs and switch to one of the new sets of active logs.
9. Repeat steps 2 through 7 to enlarge the active logs that were just archived.
744
Although all log data sets do not need to be the same size, from an operational
standpoint using the same size is more consistent and efficient. If the log data sets
are not the same size, tracking your systems logs can be more difficult. Space can
be wasted if you are using dual data sets of different sizes because they fill only to
the size of the smallest, not using the remaining space on the larger one.
If you are archiving to disk and the size of your active logs has increased, you
might need to increase the size of your archive log data sets. However, because of
DFSMS disk management limits, you must specify less than 64 000 tracks for the
primary space quantity. See the PRIMARY QUANTITY and SECONDARY QTY
fields on installation panel DSNTIPA to modify the primary and secondary
allocation space quantities.
Deleting: To delete an entire archive log data set from one or more volumes, you
might specify the following statement:
DELETE DSNAME=DSNC910.ARCHLOG1.D89021.T2205197.A0000015,COPY1VOL=DSNV04
CRESTART CREATE,STARTRBA=28000,ENDRBA=58000,BACKOUT=NO
To specify a cold start, make the values of STARTRBA and ENDRBA equal with a
statement similar to the following statement:
CRESTART CREATE,STARTRBA=4A000,ENDRBA=4A000
In most cases when doing a cold start, you should make sure that the STARTRBA
and ENDRBA are set to an RBA value that is greater than the highest used RBA.
|
|
To truncate the DB2 logs via conditional restart by specifying a timestamp rather
than an RBA value, use a statement similar to the following statement:
CRESTART CREATE,ENDTIME=20051402030068
An existing conditional restart control record governs any START DB2 operation
until one of these events occurs:
v A restart operation completes.
v A CRESTART CANCEL statement is issued.
v A new conditional restart control record is created.
745
In this convention, n=1 for all primary log data sets, n=2 for all secondary log data
sets, and mm is the data set number within each series.
If a naming convention such as the default convention is used, pairs of data sets
with equal mm values are usually used together. For example,
DSNC120.LOGCOPY1.DS02 and DSNC120.LOGCOPY2.DS02 are used together.
However, after you run the change log inventory utility with the DELETE and
NEWLOG statements, the primary and secondary series can become
unsynchronized, even if the NEWLOG data set name that you specify is the same
as the old data set name. To avoid this situation, always do maintenance on both
data sets of a pair in the same change log inventory execution:
v Delete both data sets together.
v Define both data sets together with NEWLOG statements.
The data sets themselves do not require deletion and redefinition.
To ensure consistent results, execute the change log inventory utility on the same
z/OS system on which the DB2 online subsystem executes.
746
If misused, the change log inventory utility can compromise the viability and
integrity of the DB2 subsystem. Only highly skilled people, such as the DB2 system
administrator, should use this utility, and then only after careful consideration.
Before initiating a conditional restart or cold restart, you should consider making
backup copies of all disk volumes that contain any DB2 data sets. This enables a
possible fallback. The backup data sets must be generated when DB2 is not active.
After you run the change log inventory utility with the NEWCAT statement, the
utility generates output similar to the following output:
NEWCAT VSAMCAT=DBP1
DSNJ210I OLD VASAM CATALOG NAME=DSNC120, NEW CATALOG NAME=DBP1
DSNJ225I NEWCAT OPERATION COMPLETED SUCCESSFULLY
DSNJ200I DSNJU003 CHANGE LOG INVENTORY UTILITY
PROCESSING COMPLETED SUCCESSFULLY
747
Related tasks
Renaming DB2 system data sets
7. Start DB2.
8. Drop and re-create the work file database.
9. Optionally use the ALTER command for table spaces in DSNDB04 and user
databases.
748
The following control statement specifies that the DSNJU003 utility is to add the
data set DSNREPAL.A0001187 to the BSDS. The volume serial number for the data
set is DSNV04, as indicated by the COPY1VOL option. The device type is SYSDA,
and the data set is not to be cataloged. The RBA of the beginning of the archive log
data set volume is 3A190000, and the end RBA is 3A1F0FFF.
//STEP5 EXEC PGM=DSNJU003,COND=EVEN
//SYSUT1
DD DSN=DSNCAT.BSDS01,DISP=SHR
//SYSUT2
DD DSN=DSNCAT.BSDS02,DISP=SHR
//SYSPRINT DD SYSOUT=A
//SYSIN
DD *
NEWLOG DSNAME=DSNREPAL.A0001187,COPY1VOL=DSNV04,UNIT=SYSDA,
STARTRBA=3A190000,ENDRBA=3A1F0FFF,CATALOG=NO
/*
749
Note: The alias is an SQL identifier and should follow the rules of SQL identifiers.
The identifier can not include special characters when you are naming a location
alias.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
During the subsequent restart, the user will be asked to confirm the conditional
restart with the following:
750
The print log map (DSNJU004) utility lists the following information:
v Log data set name, log RBA association, and log LRSN for both copy 1 and copy
2 of all active and archive log data sets
v Active log data sets that are available for new log data
v Status of all conditional restart control records in the bootstrap data set
v Contents of the queue of checkpoint records in the bootstrap data set
v The communication record of the BSDS, if one exists
v Contents of the quiesce history record
v System and utility timestamps
v Contents of the checkpoint queue
v Archive log command history
v BACKUP SYSTEM utility history
v System CCSID information
v System-level backup information
In a data sharing environment, the DSNJU004 utility can list information from any
or all BSDSs of a data sharing group.
Environment
The DSNJU004 program runs as a batch job.
This utility can be executed either when DB2 is running and when it is not
running. However, to ensure consistent results from the utility job, the utility and
the DB2 online subsystem must both be executing under the control of the same
operating system.
Authorization required
The user ID of the DSNJU004 job must have requisite RACF authorization.
751
the group. Ensure that the BSDS name that you specify is not the BSDS of a
member that has been quiesced since before new members joined the group.
This statement is required if the control statement specifies either of these
options:
v MEMBER *
v MEMBER(member-name)
MnnBSDS
Names the BSDS data set of a group member whose information is to be listed.
You must specify one such DD statement for each member. The statements are
required if the control statement specifies MEMBER DDNAME. nn represents a
two-digit number. You must use consecutive two-digit numbers from 01 to the
total number of required members. If a break occurs in the sequence of
numbers, any number after the break is ignored.
EXEC
PGM=DSNJU004
Recommendations
v For dual BSDSs, execute the print log map utility twice, once for each BSDS, to
compare their contents.
v To ensure consistent results for this utility, execute the utility job on the same
z/OS system on which the DB2 online subsystem executes.
v Execute the print log map utility regularly, possibly daily, to keep a record of
recovery log data set usage.
v Use the print log map utility to document changes that are made by the change
log inventory utility.
MEMBER *
MEMBER
DDNAME
,
( member-name
Option descriptions
The following keywords can be used in an optional control statement on the SYSIN
data set:
MEMBER
Specifies which members BSDS information to print.
752
Prints the information from the BSDS of each member in the data sharing
group.
DDNAME
Prints information from only those BSDSs that are pointed to by the
MxxBSDS DD statements.
(member-name)
Prints information for only the named group members.
EXEC PGM=DSNJU004
DD DSN=DBD1.BSDS01,DISP=SHR
DD SYSOUT=*
DD *
MEMBER *
|
|
|
|
|
|
|
|
|
|
v The system date and time (SYSTEM TIMESTAMP), which is set at the time that
the subsystem stops.
v The date and time that the BSDS was last changed by the change log inventory
utility (listed as the UTILITY TIMESTAMP).
v The integrated catalog facility catalog name that is associated with the BSDS.
v The highest-written RBA. The value is updated each time the log buffers are
physically written to disk.
v The highest RBA that was offloaded.
v Log RBA ranges (STARTRBA and ENDRBA) and data set information for active
and archive log data sets. The last active log data set shown is the current active
log.
v Information about each active log data set. This information includes the starting
and ending RBAs within the data set, the date and time the data set was
created, and the data sets name (DSN), and status. You might see consecutive
active or archive log data sets with an end LRSN value that is the same as the
beginning LRSN value of the next data set.
v Information about each archive log data set. This information includes the
starting and ending RBAs within the data set, the date and time the data set was
created, and the data sets name (DSN), unit and volume of storage, and status.
You might see consecutive active or archive log data sets with an end LRSN
value that is the same as the beginning LRSN value of the next data set.
v Conditional restart control records. For a description of these records and the
format of this part of the output from the print log map utility, see DSNJU004
(print log map) output.
753
****************************************************************************************
*
*
* LOG MAP OF THE BSDS DATA SET BELONGING TO MEMBER 'NO NAME ' OF GROUP 'NO NAME '.
*
*
*
****************************************************************************************
DSNJCNVB CONVERSION PROGRAM HAS RUN
DDNAME=SYSUT1
LOG MAP OF BSDS DATA SET COPY 1, DSN=DSNC910.BSDS01
LTIME INDICATES LOCAL TIME, ALL OTHER TIMES ARE GMT.
DATA SHARING MODE IS OFF
SYSTEM TIMESTAMP
- DATE=2007.011 LTIME=18:58:19.11
UTILITY TIMESTAMP - DATE=2007.008 LTIME= 0:19:33.53
VSAM CATALOG NAME=DSNC910
HIGHEST RBA WRITTEN
0000384B7A15 2007.011 06:27:04.4
HIGHEST RBA OFFLOADED
000000000000
RBA WHEN CONVERTED TO V4 000000000000
THIS BSDS HAS MEMBER RECORDS FOR THE FOLLOWING MEMBERS:
HOST MEMBER NAME:
........
MEMBER ID:
0
GROUP NAME:
........
BSDS COPY 1 DATA SET NAME: ............................................
BSDS COPY 2 DATA SET NAME: ............................................
ENFM START RBA/LRSN:
000000000000
**** DISTRIBUTED DATA FACILITY ****
COMMUNICATION RECORD
04:44:04 JANUARY 12, 2007
LOCATION=STLEC1 IPNAME=(NULL) PORT=446 SPORT=NULL RPORT=5001
ALIAS=(NULL)
IPV4=NULL IPV6=NULL
GRPIPV4=NULL GRPIPV6=NULL
LUNAME=SYEC1DB2 PASSWORD=DB2PW1 GENERICLU=(NULL)
ACTIVE LOG COPY 1 DATA SETS
START RBA/TIME
END RBA/TIME
-------------------- -------------------000036C18000
0000375EFFFF
2007.008 21:51:30.7 2007.008 22:07:30.7
0000375F0000
000037FC7FFF
2007.008 22:07:30.7 2007.008 22:13:15.5
000037FC8000
00003899FFFF
2007.008 22:13:15.5 ........ ..........
NO ARCHIVE DATA SETS DEFINED FOR THIS COPY
ACTIVE LOG COPY 2 DATA SETS
START RBA/TIME
END RBA/TIME
-------------------- -------------------000036C18000
0000375EFFFF
2007.008 21:51:30.7 2007.008 22:07:30.7
0000375F0000
000037FC7FFF
2007.008 22:07:30.7 2007.008 22:13:15.5
754
DATE
LTIME
-------- ----2005.263 17:36
PASSWORD=(NULL)
2005.263 17:36
PASSWORD=(NULL)
2005.263 17:36
PASSWORD=(NULL)
DATE
LTIME
-------- ----2005.263 17:36
PASSWORD=(NULL)
2005.263 17:36
PASSWORD=(NULL)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000037FC8000
00003899FFFF
2005.263 17:36 DSN=DSNC910.LOGCOPY2.DS02
2007.008 22:13:15.5 ........ .......... PASSWORD=(NULL) STATUS=REUSABLE
ARCHIVE LOG COPY 2 DATA SETS
NO ARCHIVE DATA SETS DEFINED FOR THIS COPY
DSNJ401I DSNRJPCR RESTART CONTROL RECORD NOT FOUND
CHECKPOINT QUEUE
04:44:05 JANUARY 12, 2007
TIME OF CHECKPOINT
02:58:33 JANUARY 12, 2007
BEGIN CHECKPOINT RBA
0000384B8090
END CHECKPOINT RBA
0000384BA4C0
END CHECKPOINT STCK
BFFDF5B0AE7C
TIME OF CHECKPOINT
06:26:54 JANUARY 11, 2007
BEGIN CHECKPOINT RBA
0000384B3F31
END CHECKPOINT RBA
0000384B7A15
END CHECKPOINT STCK
BFFCE26E2478
SHUTDOWN CHECKPOINT
TIME OF CHECKPOINT
04:06:56 JANUARY 11, 2007
BEGIN CHECKPOINT RBA
0000384AB000
END CHECKPOINT RBA
0000384AD7BE
END CHECKPOINT STCK
BFFCC31B6815
TIME OF CHECKPOINT
20:07:35 JANUARY 10, 2007
BEGIN CHECKPOINT RBA
000038484198
END CHECKPOINT RBA
00003848761A
END CHECKPOINT STCK
BFFC57F6EC70
TIME OF CHECKPOINT
20:06:49 JANUARY 10, 2007
BEGIN CHECKPOINT RBA
000038449F2E
END CHECKPOINT RBA
00003844D3C0
END CHECKPOINT STCK
BFFC57CB6CFD
TIME OF CHECKPOINT
19:54:11 JANUARY 10, 2007
BEGIN CHECKPOINT RBA
0000384098E4
END CHECKPOINT RBA
00003840C0B8
END CHECKPOINT STCK
BFFC54F80848
. . .
BEGIN CHECKPOINT RBA
000035CBA4FD
END CHECKPOINT RBA
000035CBE608
END CHECKPOINT STCK
BF2025C5621E
TIME OF CHECKPOINT
16:51:36 JULY 19, 2006
BEGIN CHECKPOINT RBA
000035C3FDAF
END CHECKPOINT RBA
000035C43EC4
END CHECKPOINT STCK
BF2025C50CEA
TIME OF CHECKPOINT
16:51:36 JULY 19, 2006
BEGIN CHECKPOINT RBA
000035C0D767
END CHECKPOINT RBA
000035C11760
END CHECKPOINT STCK
BF2025C4E1F8
TIME OF CHECKPOINT
16:51:36 JULY 19, 2006
BEGIN CHECKPOINT RBA
000035BE8240
END CHECKPOINT RBA
000035BEC302
END CHECKPOINT STCK
BF2025C4C7D5
TIME OF CHECKPOINT
16:51:35 JULY 19, 2006
BEGIN CHECKPOINT RBA
000035BB82AB
END CHECKPOINT RBA
000035BCBB6A
END CHECKPOINT STCK
BF2025C4B137
TIME OF CHECKPOINT
16:48:56 JULY 19, 2006
BEGIN CHECKPOINT RBA
000035B5EA64
END CHECKPOINT RBA
000035B61BC4
END CHECKPOINT STCK
BF20252C3DE4
DSNJ401I DSNJU104 ARCHIVE LOG COMMAND HISTORY RECORD NOT FOUND
DSNJ401I DSNUPBHR BACKUP SYSTEM UTILITY HISTORY RECORD NOT FOUND
SYSTEM CCSIDS
04:44:05 JANUARY 12, 2007
SYSTEM CCSIDS
-------------------ASCII SBCS
= 1252
ASCII MIXED = 65534
ASCII DBCS
= 65534
EBCDIC SBCS = 37
EBCDIC MBCS = 65534
Chapter 37. DSNJU004 (print log map)
755
|
EBCDIC DBCS =
UNICODE SBCS =
|
UNICODE MBCS =
|
UNICODE DBCS =
|
| DSNJ200I DSNJU004
|
| ...
65534
367
1208
1200
PRINT LOG UTILITY PROCESSING COMPLETED SUCCESSFULLY
Figure 116. Sample print log map utility output for a non-dating-sharing subsystem
The sample print log map utility output in the following figure is for a member of
a data sharing group.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*****************************************************************************************
*
*
* LOG MAP OF THE BSDS DATA SET BELONGING TO MEMBER 'V91A
' OF GROUP 'DSNCAT '.
*
*
*
*****************************************************************************************
DSNJCNVB CONVERSION PROGRAM HAS RUN
DDNAME=SYSUT1
LOG MAP OF BSDS DATA SET COPY 1, DSN=DSNC910.BSDS01
LTIME INDICATES LOCAL TIME, ALL OTHER TIMES ARE GMT.
DATA SHARING MODE IS ON
SYSTEM TIMESTAMP
- DATE=2006.299 LTIME= 8:58:20.49
UTILITY TIMESTAMP - DATE=2007.012 LTIME=10:00:20.82
VSAM CATALOG NAME=DSNC910
HIGHEST RBA WRITTEN
00002B7458B4 2006.299 15:58:04.9
HIGHEST RBA OFFLOADED
000000000000
RBA WHEN CONVERTED TO V4 00000CF0F0A6
MAX RBA FOR TORBA
00000CF0F0A6
MIN RBA FOR TORBA
000000000000
STCK TO LRSN DELTA
000000000000
THIS BSDS HAS MEMBER RECORDS FOR THE FOLLOWING MEMBERS:
HOST MEMBER NAME:
V91A
MEMBER ID:
1
GROUP NAME:
DSNCAT
BSDS COPY 1 DATA SET NAME: DSNC910.BSDS01
BSDS COPY 2 DATA SET NAME: DSNC910.BSDS02
ENFM START RBA/LRSN:
000000000000
MEMBER NAME:
V91B
MEMBER ID:
2
GROUP NAME:
DSNCAT
BSDS COPY 1 DATA SET NAME: DSNC918.BSDS01
BSDS COPY 2 DATA SET NAME: DSNC918.BSDS02
**** DISTRIBUTED DATA FACILITY ****
COMMUNICATION RECORD
18:05:25 JANUARY 12, 2007
LOCATION=STLEC1 IPNAME=(NULL) PORT=446 SPORT=NULL RPORT=5001
ALIAS=(NULL)
IPV4=NULL IPV6=NULL
GRPIPV4=NULL GRPIPV6=NULL
LUNAME=SYEC1DB2 PASSWORD=DB2PW1 GENERICLU=SYEC1GLU
ACTIVE LOG COPY 1 DATA
START RBA/LRSN/TIME
-------------------000029DB8000
BF215D6C20F3
2006.201 16:05:55.0
00002A790000
BF215E3D8600
2006.201 16:09:34.6
00002B168000
756
SETS
END RBA/LRSN/TIME
-------------------00002A78FFFF
BF215E3D8600
2006.201 16:09:34.6
00002B167FFF
BF2168CB4F59
2006.201 16:56:47.6
00002BB3FFFF
DATE
LTIME
-------- ----2005.263 17:36
PASSWORD=(NULL)
17:36 DSN=DSNC910.LOGCOPY1.DS03
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BF2168CB4F59
............
PASSWORD=(NULL) STATUS=REUSABLE
2006.201 16:56:47.6 ........ ..........
ARCHIVE LOG COPY 1 DATA SETS
NO ARCHIVE DATA SETS DEFINED FOR THIS COPY
ACTIVE LOG COPY 2 DATA SETS
START RBA/LRSN/TIME
END RBA/LRSN/TIME
DATE
LTIME
-------------------- -------------------- -------- ----000029DB8000
00002A78FFFF
2005.263 17:36
BF215D6C20F3
BF215E3D8600
PASSWORD=(NULL)
2006.201 16:05:55.0 2006.201 16:09:34.6
00002A790000
00002B167FFF
2005.263 17:36
BF215E3D8600
BF2168CB4F59
PASSWORD=(NULL)
2006.201 16:09:34.6 2006.201 16:56:47.6
00002B168000
00002BB3FFFF
2005.263 17:36
BF2168CB4F59
............
PASSWORD=(NULL)
2006.201 16:56:47.6 ........ ..........
ARCHIVE LOG COPY 2 DATA SETS
NO ARCHIVE DATA SETS DEFINED FOR THIS COPY
DSNJ401I DSNRJPCR RESTART CONTROL RECORD NOT FOUND
CHECKPOINT QUEUE
18:05:25 JANUARY 12, 2007
TIME OF CHECKPOINT
15:57:53 OCTOBER 26, 2006
BEGIN CHECKPOINT RBA
00002B742232
END CHECKPOINT RBA
00002B7458B4
END CHECKPOINT LRSN
BF9C9272E481
SHUTDOWN CHECKPOINT
TIME OF CHECKPOINT
15:38:07 OCTOBER 26, 2006
BEGIN CHECKPOINT RBA
00002B73BEDE
END CHECKPOINT RBA
00002B73E458
END CHECKPOINT LRSN
BF9C8DFC9AE2
END CHECKPOINT LRSN
BF9C8DFC9AE2
TIME OF CHECKPOINT
14:45:29 OCTOBER 26, 2006
BEGIN CHECKPOINT RBA
00002B72F57E
END CHECKPOINT RBA
00002B731ABA
END CHECKPOINT LRSN
BF9C8238F7F6
TIME OF CHECKPOINT
13:52:34 OCTOBER 26, 2006
BEGIN CHECKPOINT RBA
00002B722C78
END CHECKPOINT RBA
00002B725152
END CHECKPOINT LRSN
BF9C7664E895
TIME OF CHECKPOINT
12:59:07 OCTOBER 26, 2006
BEGIN CHECKPOINT RBA
00002B716C2B
END CHECKPOINT RBA
00002B719402
END CHECKPOINT LRSN
BF9C6A7355D2
TIME OF CHECKPOINT
12:05:55 OCTOBER 26, 2006
BEGIN CHECKPOINT RBA
00002B708488
END CHECKPOINT RBA
00002B70A9B8
END CHECKPOINT LRSN
BF9C5E8E6C30
TIME OF CHECKPOINT
11:13:16 OCTOBER 26, 2006
BEGIN CHECKPOINT RBA
00002B6FBB22
END CHECKPOINT RBA
00002B6FE0A6
END CHECKPOINT LRSN
BF9C52CA437D
TIME OF CHECKPOINT
10:20:21 OCTOBER 26, 2006
BEGIN CHECKPOINT RBA
00002B6EF344
END CHECKPOINT RBA
00002B6F180A
END CHECKPOINT LRSN
BF9C46F69881
TIME OF CHECKPOINT
09:26:54 OCTOBER 26, 2006
BEGIN CHECKPOINT RBA
00002B6E3344
END CHECKPOINT RBA
00002B6E5ABA
END CHECKPOINT LRSN
BF9C3B03EEA6
TIME OF CHECKPOINT
08:34:36 OCTOBER 26, 2006
BEGIN CHECKPOINT RBA
00002B6D6662
END CHECKPOINT RBA
00002B6D8DC0
END CHECKPOINT LRSN
BF9C2F539652
TIME OF CHECKPOINT
07:40:44 OCTOBER 26, 2006
757
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
00002B6CA000
00002B6CC55A
BF9C23487986
. . .
TIME OF CHECKPOINT
23:40:10 JULY 19, 2006
BEGIN CHECKPOINT RBA
000029CB7E8B
END CHECKPOINT RBA
000029CBA65C
END CHECKPOINT LRSN
BF208117E71F
DSNJ401I DSNJU104 ARCHIVE LOG COMMAND HISTORY RECORD NOT FOUND
DSNJ401I DSNUPBHR BACKUP SYSTEM UTILITY HISTORY RECORD NOT FOUND
SYSTEM CCSIDS
18:05:25 JANUARY 12, 2007
SYSTEM CCSIDS
-------------------ASCII SBCS
= 1252
ASCII MIXED = 65534
ASCII DBCS
= 65534
EBCDIC SBCS = 37
EBCDIC MBCS = 65534
EBCDIC DBCS = 65534
UNICODE SBCS = 367
UNICODE MBCS = 1208
UNICODE DBCS = 1200
...
Figure 117. Sample print log map utility output for a member of a data sharing group
758
Utility timestamp
The date and time that the contents of the BSDS were altered by the
change log inventory utility (DSNJU003).
The following timestamps are included in the active and archive log data sets
portion of the reports:
Active log date
The date on which the active log data set was originally allocated on the
DB2 subsystem.
Active log time
The time at which the active log data set was originally allocated on the
DB2 subsystem.
Archive log date
The date of creation (not allocation) of the archive log data set.
Archive log time
The time of creation (not allocation) of the archive log data set.
The following timestamps are included in the conditional restart control record
portion of the report that is shown in Figure 121 on page 762:
Conditional restart control record
The current time and date. This data is reported for information only and
is not kept in the BSDS.
CRCR created
The time and date of creation of the CRCR by the CRESTART option in the
change log inventory utility.
Begin restart
The time and date that the conditional restart was attempted.
End restart
The time and date that the conditional restart ended.
STARTRBA (timestamp)
The time at which the control interval was written.
ENDRBA (timestamp)
The time at which the last control interval was written.
Time of checkpoint
The time and date that are associated with the checkpoint record that was
used during the conditional restart process.
The following timestamps are included in the checkpoint queue and the DDF
communication record sections of the report that is shown in Figure 120 on page
761:
Checkpoint queue
The current time and date. This data is reported for information only and
is not kept in the BSDS.
Time of checkpoint
The time and date that the checkpoint was taken.
DDF communication record (heading)
The current time and date. This data is reported for information only, and
is not kept in the BSDS.
759
Meaning
NEW
The data set has been defined but never used by DB2, or the log is truncated at a point
before the data set was created. In either case, the data set starting and ending RBA values
are reset to zero.
REUSABLE
Either the data set is new and has no records, or the data set has been offloaded. In the print
log map output, the start RBA value for the last REUSABLE data set is equal to the start
RBA value of the last archive log data set.
NOT REUSABLE
The data set contains records that have not been offloaded.
STOPPED
The offload processor encountered an error while reading a record, and that record could
not be obtained from the other copy of the active log. Alternatively, an error occurred during
truncation of the data set following a write I/O error.
TRUNCATED
The status value for each active log data set is displayed in the print log map
utility output. The sample print log map output in the following figure shows how
the status is displayed.
ACTIVE LOG COPY 1 DATA
START RBA/TIME
-------------------00000316C000
2003.346 16:20:49.6
0000031AC000
2003.346 16:21:23.7
0000031B2000
2003.346 16:21:23.8
SETS
END RBA/TIME
-------------------0000031ABFFF
2003.346 16:21:23.7
0000031B1FFF
2003.346 16:21:23.8
000003535FFF
........ ..........
DATE
LTIME
-------- ----2001.045 14:39
PASSWORD=(NULL)
2001.045 14:39
PASSWORD=(NULL)
2001.045 14:39
PASSWORD=(NULL)
Figure 118. Portion of print log map utility output that shows active log data set status
760
WAIT
---YES
TIME
----999
Figure 119. Portion of print log map utility output that shows archive log command history
The values in the TIME column of the ARCHIVE LOG COMMAND HISTORY
section of the report in the previous figure represent the time that the ARCHIVE
LOG command was issued. This time value is saved in the BSDS and is converted
to printable format at the time that the print log map utility is run. Therefore this
value, when printed, can differ from other time values that were recorded
concurrently. Some time values are converted to printable format when they are
recorded, and then they are saved in the BSDS. These printed values remain the
same when the printed report is run.
2003
2003
2003
2003
761
DATA/LOG COMPLETE
DATE
LTIME
LOCATION NAME
-------------------- ---------------2006/10/15 18:34:11 STLEC1
2006/10/15
13:05:56
STLEC1
2006/10/15
11:23:49
STLEC1
|
|
|
762
Environment
Run the DSN1CHKR program as a z/OS job.
Do not run DSN1CHKR on a table space while it is active under DB2. While
DSN1CHKR runs, do not run other database operations for the database and table
space that are to be checked. Use the STOP DATABASE command for the database
and table space that are to be checked.
Authorization required
This utility does not require authorization. However, if RACF protects any of the
data sets, the authorization ID must also have the necessary RACF authority.
763
DSN1CHKR cannot use full image copies that are created with DFSMSdss
concurrent copy. The DFSMSdss data set does not copy to a VSAM data set
because of incompatible formats.
Recommendation: First copy the stopped table space to a temporary data set by
using DSN1COPY. Use the DB2 naming convention for the copied data set. Run
DSN1CHKR on the copy, which frees the actual table space for restart to DB2.
When you run DSN1COPY, use the CHECK option to examine the table space for
page integrity errors. Although DSN1CHKR does check for these errors, running
DSN1COPY with CHECK prevents an unnecessary invocation of DSN1CHKR.
DSN1CHKR output
One intended use of this utility is to aid in determining and correcting system
problems. When diagnosing DB2, you might need to refer to licensed
documentation to interpret output from this utility.
Related information
DB2 Diagnosis Guide and Reference
764
,
PARM=
DUMP
FORMAT
,
HASH( hexadecimal-constant
,
MAP=
ANCHOR( id,integer
,
RID( integer,hexadecimal-constant
,
HASH( hexadecimal-constant,integer
,
PAGE( integer,hexadecimal-constant
Option descriptions
The following parameters are optional. Specify parameters on the EXEC statement
in any order after the required JCL parameter PARM=. If you specify more than
one parameter, separate them with commas but no blanks. If you do not specify
any parameters, DSN1CHKR scans all table space pages for broken links and for
records that are not part of any link or chain, and prints the appropriate diagnostic
messages.
DUMP
Specifies that printed table space pages, if any, are to be in dump format. If
you specify DUMP, you cannot specify the FORMAT parameter.
FORMAT
Specifies that printed table space pages, if any, are to be formatted on output.
If you specify FORMAT, you cannot specify the DUMP parameter.
HASH(hexadecimal-constant, ...)
Specifies a hash value for a hexadecimal database identifier (DBID) in table
space DBD01. DSN1CHKR returns hash values for each DBID in page form
and in anchor point offset form.
hexadecimal-constant is the hash value for a DBID. The maximum number of
DBIDs is 10.
MAP=
Identifies a record whose pointer is to be followed. DSN1CHKR prints each
record as it follows the pointer. Use this parameter only after you have
determined which chain is broken. You can determine if a chain is broken by
running DSN1CHKR without any parameters, or with only FORMAT or
DUMP.
The options for this parameter help DSN1CHKR locate the record whose
pointer it follows. Each option must point to the beginning of the 6-byte prefix
Chapter 38. DSN1CHKR
765
area of a valid record or to the beginning of the hash anchor. If the value that
you specify does not point to one of these, DSN1CHKR issues an error
message and continues with the next pair of values.
ANCHOR(id,integer)
Specifies the anchor point that DSN1CHKR is to map.
id identifies the starting page and anchor point in the form ppppppaa, where
pppppp is the page number, and aa is the anchor point number.
integer determines which pointer to follow while mapping. 0 specifies the
forward pointer; 4 specifies the backward pointer.
The maximum number of pairs is five.
RID(integer, hexadecimal-constant, ...)
Identifies the record or hash anchor from which DSN1CHKR is to start
mapping.
integer is the page and record, in the form pppppprr, where pppppp is the
page number, and rr is the record number. These values are in hexadecimal
format.
hexadecimal-constant specifies the hexadecimal displacement from the
beginning of the record to the pointer in the record from which mapping
starts.
The maximum number of pairs is five.
HASH(hexadecimal-constant, integer, ...)
Specifies the value that DSN1CHKR is to hash and map for table space
DBD01.
hexadecimal constant is the database identifier in table space DBD01.
integer determines which pointer to follow while mapping. 0 specifies the
forward pointer; 4 specifies the backward pointer.
The maximum number of pairs is five.
PAGE(integer, hexadecimal-constant, ...)
integer specifies the page number on which the record or hash anchor is to
be located.
hexadecimal-constant specifies the offset to the pointer from the beginning of
the page.
When you use the PAGE option, DSN1CHKR follows the forward pointer
while mapping. If a forward pointer does not exist, DSN1CHKR stops
mapping after the first record.
The maximum number of pairs is five.
766
767
//SYSTSPRT DD SYSOUT=A
//SYSPRINT DD SYSOUT=A
//SYSTSIN DD *
DSN SYSTEM(DSN)
-START DB(DSNDB06) SPACENAM(SYSDBASE)
END
/*//STEP5
EXEC PGM=DSN1CHKR,PARM='MAP=RID(00000201,06,00000B01,06)',
//
COND=(4,LT)
//********************************************************************
//*
CHECK LINKS OF SYSDBASE
*
//********************************************************************
//STEPLIB DD DSN=prefix.SDSNLOAD,DISP=SHR
//SYSPRINT DD SYSOUT=A
//SYSUT1
DD DSN=TESTCAT.DSNDBC.TEMPDB.TMPDBASE.I0001.A001,DISP=SHR
/*
Figure 124. Sample JCL for running DSN1CHKR on a temporary data set
768
Figure 125. Sample JCL for running DSN1CHKR on a stopped table space.
769
770
Environment
Run DSN1COMP as a z/OS job.
You can run DSN1COMP even when the DB2 subsystem is not operational. Before
you use DSN1COMP when the DB2 subsystem is operational, issue the DB2 STOP
DATABASE command. Issuing the STOP DATABASE command ensures that DB2
has not allocated the DB2 data sets.
Do not run DSN1COMP on table spaces in DSNDB01, DSNDB06, or DSNDB07.
Authorization required
DSN1COMP does not require authorization. However, if any of the data sets is
RACF-protected, the authorization ID of the job must have RACF authority.
771
If you are running the online REORG utility with FASTSWITCH behavior,
verify the data set name before running the DSN1COMP utility. The
fifth-level qualifier in the data set name alternates between I0001 and
J0001 when using FASTSWITCH. If the table space has cloning, the
fifth-level qualifier can be n0002. You cannot specify FASTSWITCH YES if
the table space has cloning; however, a FASTSWITCH YES REORG might
have been done before the clone was created so you might still have a
mixture of I and J data sets. Specify the correct fifth-level qualifier in the
data set name to successfully execute the DSN1COMP utility. To determine
the correct fifth-level qualifier, query the IPREFIX column of
SYSIBM.SYSTABLEPART for each data partition or the IPREFIX column of
SYSIBM.SYSINDEXPART for each index partition. If the object is not
partitioned, use zero as the value for the PARTITION column in your
query.
|
Recommendation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Before using DSN1COMP, be sure that you know the page size and data set size
(DSSIZE) for the table space. Use the following query on the DB2 catalog to get the
information you need, in this example for table DEPT:
SELECT T.CREATOR,T.NAME,S.NAME AS TABLESPACE,S.PARTITIONS,S.PGSIZE,
CASE S.DSSIZE
WHEN 0 THEN
CASE WHEN S.TYPE = 'G' THEN 4194304
WHEN S.TYPE = 'O' THEN 4194304
WHEN S.TYPE = 'P' THEN 4194304
WHEN S.TYPE = 'R' THEN 4194304
ELSE
CASE WHEN S.PARTITIONS > 254 THEN
CASE WHEN S.PGSIZE = 4 THEN 4194304
WHEN S.PGSIZE = 8 THEN 8388608
WHEN S.PGSIZE = 16 THEN 16777216
WHEN S.PGSIZE = 32 THEN 33554432
ELSE NULL
END
WHEN S.PARTITIONS > 64 THEN 4194304
WHEN S.PARTITIONS > 32 THEN 1048576
WHEN S.PARTITIONS > 16 THEN 2097152
WHEN S.PARTITIONS > 0 THEN 4194304
ELSE 2097152
END
END
ELSE S.DSSIZE
END
AS DSSIZE
FROM SYSIBM.SYSTABLES T,
SYSIBM.SYSTABLESPACE S
WHERE
T.NAME = 'DEPT' AND
T.TSNAME = S.NAME;
Related information
Contents of the log (DB2 Administration Guide)
772
DSN1COMP
32K
PAGESIZE (
4K
8K
16K
32K
DSSIZE (
LARGE
integer
NUMPARTS(integer)
FREEPAGE(integer)
PCTFREE(integer)
FULLCOPY
REORG
ROWLIMIT(integer)
MAXROWS(integer)
|
|
|
DSN1COMP
LEAFLIM(integer)
Option descriptions
To run DSN1COMP, specify one or more of the following parameters on the EXEC
statement to run DSN1COMP. If you specify more than one parameter, separate
each parameter by a comma. You can specify parameters in any order.
32K
Specifies that the input data set, SYSUT1, has a 32-KB page size. If you specify
this option and the SYSUT1 data set does not have a 32-KB page size,
DSN1COMP might produce unpredictable results.
The recommended option for performance is PAGESIZE(32K).
PAGESIZE
Specifies the page size of the input data set that is defined by SYSUT1.
Available page size values are 4K, 8K, 16K, or 32K. If you specify an incorrect
page size, DSN1COMP might produce unpredictable results.
If you omit PAGESIZE, DSN1COMP tries to determine the page size from the
input data set. DB2 issues an error message if DSN1COMP cannot determine
the input page size. This might happen if the header page is not in the input
data set, or if the page size field in the header page contains an invalid page
size.
DSSIZE(integer G)
Specifies the data set size, in gigabytes, for the input data set. If you omit
DSSIZE, DB2 assumes that the input data set size is 2 GB.
integer must match the DSSIZE value that was specified when the table space
was defined.
If you omit DSSIZE and the data set is not the assumed default size, the results
from DSN1COMP are unpredictable.
773
LARGE
Specifies that the input data set is a table space that was defined with the
LARGE option. If you specify LARGE, DB2 assumes that the data set has a
4-GB boundary.
The recommended method of specifying a table space defined with LARGE is
DSSIZE(4G).
If you omit the LARGE or DSSIZE(4G) option when it is needed, or if you
specify LARGE for a table space that was not defined with the LARGE option,
the results from DSN1COMP are unpredictable.
NUMPARTS(integer)
Specifies the number of partitions that are associated with the input data set.
Valid specifications range from 1 to 4096. If you omit NUMPARTS or specify it
as 0, DSN1COMP assumes that your input file is not partitioned. If you specify
a number greater than 64, DSN1COMP assumes that the data set is for a
partitioned table space that was defined with the LARGE option, even if the
LARGE keyword is not specified.
DSN1COMP cannot always validate the NUMPARTS parameter. If you specify
it incorrectly, DSN1COMP might produce unpredictable results.
DSN1COMP terminates and issues message DSN1946I when it encounters an
image copy that contains multiple partitions; a compression report is issued for
the first partition.
FREEPAGE(integer)
Specifies how often to leave a page of free space when calculating the
percentage of saved pages. You must specify an integer in the range 0 to 255. If
you specify 0, no pages are included as free space when DSN1COMP reports
the percentage of pages saved. Otherwise, one free page is included after every
n pages, where n is the specified integer.
The default value is 0.
Specify the same value that you specify for the FREEPAGE option of the SQL
statement CREATE TABLESPACE or ALTER TABLESPACE.
PCTFREE(integer)
Indicates what percentage of each page to leave as free space when calculating
the percentage of pages saved. You must specify an integer in the range 0 to
99. When calculating the savings, DSN1COMP allows for at least n percent of
free space for each page, where n is the specified integer.
The default value is 5.
Specify the same value that you specify for the PCTFREE option of the SQL
statement CREATE TABLESPACE or ALTER TABLESPACE.
FULLCOPY
Specifies that a DB2 full image copy (not a DFSMSdss concurrent copy) of your
data is to be used as input. Omitting this parameter when the input is a full
image copy can cause error messages or unpredictable results. If this data is
partitioned, also specify the NUMPARTS parameter to identify the number of
partitions.
REORG
Provides an estimate of compression savings that are comparable to the
savings that the REORG utility would achieve. If this keyword is not specified,
the results are similar to the compression savings that the LOAD utility would
achieve.
774
ROWLIMIT(integer)
Specifies the maximum number of rows to evaluate in order to provide the
compression estimate. This option prevents DSN1COMP from examining every
row in the input data set. Valid specifications range from 1 to 99000000.
Use this option to limit the elapsed time and processor time that DSN1COMP
requires. An analysis of the first 5 to 10 MB of a table space provides a fairly
representative sample of the table space for estimating compression savings.
Therefore, specify a ROWLIMIT value that restricts DSN1COMP to the first 5
to 10 MB of the table space. For example, if the row length of the table space is
200 bytes, specifying ROWLIMIT(50000) causes DSN1COMP to analyze
approximately 10 MB of the table space.
MAXROWS(integer)
Specifies the maximum number of rows that DSN1COMP is to consider when
calculating the percentage of pages saved. You must specify an integer in the
range 1 to 255.
The default value is 255.
Specify the same value that you specify for the MAXROWS option of the SQL
statement CREATE TABLESPACE or ALTER TABLESPACE.
|
|
|
|
|
LEAFLIM(integer)
Specifies how many index leaf pages should be evaluated to determine the
compression estimate. This option prevents DSN1COMP from processing all
index leaf pages in the input data set. Valid specifications range from 1 to
99000000.
|
|
If the LEAFLIM parameter is not specified, the entire index will be scanned
and all leaf pages will be examined.
|
|
In a compressed index, only leaf pages are compressed. All other page types
remain uncompressed.
775
+-------------------------------------------+
| DBNAME | TSNAME | PARTITION | IPREFIX |
+-------------------------------------------+
1_| DBMC0731 | TPMC0731 |
1 | J
|
2_| DBMC0731 | TPMC0731 |
2 | J
|
3_| DBMC0731 | TPMC0731 |
3 | J
|
4_| DBMC0731 | TPMC0731 |
4 | J
|
5_| DBMC0731 | TPMC0731 |
5 | J
|
+-------------------------------------------+
Figure 126. Result from query on the SYSTABLEPART catalog table to determine the value
in the IPREFIX column
The preceding output provides the current instance qualifier (J), which can be used
to code the data set name in the DSN1COMP JCL as follows.
//STEP1
//SYSUT1
//SYSPRINT
//SYSUDUMP
EXEC PGM=DSN1COMP
DD DSN=vcatname.DSNDBC.DBMC0731.J0001.A001,DISP=SHR
DD AYAOUT=*
DD AYAOUT=*
|
|
|
|
|
776
STEP1
, SEQ
COMPRESSION REPORT
KB WITHOUT COMPRESSION
KB WITH COMPRESSION
PERCENT OF THE BYTES WOULD BE SAVED
566,764 TIMES
182,026 TIMES
10,300 TIMES
1,129 TIMES
528,139 TIMES
777
//SYSPRINT DD SYSOUT=A
//SYSABEND DD SYSOUT=A
//SYSUT1
DD DSN=DSNCAT.DSNDBC.DB254A.TS254A.I0001.A001,DISP=SHR
778
PGM=DSN1COMP,
PARM='LARGE,PCTFREE(30),FREEPAGE(30),NUMPARTS(
254),REORG,ROWLIMIT(1000)'
DSN='USER.TESTLIB',DISP=SHR
DSN='DB2A.SDSNLOAD',DISP=SHR
SYSOUT=A
SYSOUT=A
SYSOUT=A
DSN=DSNCAT.DSNDBD.DBJT0201.TPJT0201.I0001.A254,DISP=SHR
SYSOUT=A
Figure 129. Example DSN1COMP statement with the LARGE, PCTFREE, FREEPAGE,
NUMPARTS, REORG, and ROWLIMIT options.
DSN1COMP output
The output of the DSN1COMP utility lists a variety of information.
Message DSN1941
If you receive this message, use a data set with more rows as input, or specify a
larger ROWLIMIT.
COMPRESSION REPORT
KB WITHOUT COMPRESSION
KB WITH COMPRESSION
PERCENT OF THE BYTES WOULD BE SAVED
ROWS SCANNED TO BUILD DICTIONARY
ROWS SCANNED TO PROVIDE COMPRESSION ESTIMATE
DICTIONARY ENTRIES
BYTES FOR AVERAGE UNCOMPRESSED ROW LENGTH
BYTES FOR AVERAGE COMPRESSED ROW LENGTH
DICTIONARY PAGES REQUIRED
PAGES REQUIRED WITHOUT COMPRESSION
PAGES REQUIRED WITH COMPRESSION
PERCENT OF THE DB2 DATA PAGES WOULD BE SAVED
779
, VSAM
780
38
PAGES PROCESSED
Output
One intended use of this utility is to aid in determining and correcting system
problems. When diagnosing DB2, you might need to refer to licensed
documentation to interpret output from this utility.
Environment
Execute DSN1COPY as a z/OS job when the DB2 subsystem is either active or not
active.
If you execute DSN1COPY when DB2 is active, use the following procedure:
1. Start the table space as read-only by using START DATABASE.
2. Run the QUIESCE utility with the WRITE (YES) option to externalize all data
pages and index pages.
3. Run DSN1COPY with DISP=SHR on the data definition (DD) statement.
4. Start the table space as read-write by using START DATABASE to return to
normal operations.
Authorization required
DSN1COPY does not require authorization. However, if any of the data sets is
RACF-protected, the authorization ID of the job must have RACF authority.
Copyright IBM Corp. 1983, 2009
781
Restrictions
DSN1COPY does not alter data set structure. For example, DSN1COPY does not
copy a partitioned or segmented table space into a simple table space. The output
data set is a page-for-page copy of the input data set. If the intended use of
DSN1COPY is to move or restore data, ensure that definitions for the source and
target table spaces, tables, and indexes are identical. Otherwise, unpredictable
results can occur.
DSN1COPY cannot copy DB2 recovery log data sets. The format of a DB2 log page
is different from that of a table or index page. If you try to use DSN1COPY to
recover log data sets, DSN1COPY will abnormally terminate.
|
|
|
|
|
|
|
For a compressed table space, DSN1COPY does not reset the dictionary version for
an inline image copy, or for an incremental image copy that was created with the
SYSTEMPAGES=YES COPY utility option. To reset the dictionary version for an
inline image copy, use the inline image copy as input to DSN1COPY with a VSAM
intermediate data set as output. This intermediate data set can then be used as
input to DSN1COPY RESET to copy the intermediate data set to the real target
data set.
|
|
|
|
For Partition-by-growth table spaces, DSN1COPY can only be used if the number
of active partitions of the source and the target table space are the same, otherwise
you should use the UNLOAD utility to unload the data from the source table
space and the LOAD utility to reload the data into the target table space.
|
|
All the target data sets must exist. You can use Access Method Services to define
them.
|
|
|
|
|
DSN1COPY will issue an error and terminate if it can be clearly verified that the
LOB option is specified, but the data set is not a LOB data set, or that the LOB
option is omitted for a data set that is a LOB data set. To avoid problems, always
specify the LOB option if the input data set SYSUT1 is a LOB table space, and
make sure that the LOB option is not specified for non LOB table spaces.
DSN1COPY cannot copy a source object of 4 GB or greater in size when it is full
unless the target object is EA-enabled. For example, the source is full when it is not
the last piece of a multi-piece non-partitioned object with a DSSIZE of 4 GB or
greater. To avoid VSAM errors and limit each piece to 2 GB so that the target
object has more pieces than the original source:
v Define the target data set as EA-enabled and DSN1COPY can be used, one piece
at a time, to copy the data from the source that is not EA-enabled to the target.
v If it is not possible to define the target data set as EA-enabled:
1. Take a full image copy of the entire source object by running the COPY
utility and specifying DSNUM ALL.
2. Create the target object by specifying DSSIZE 2GB for table spaces and
PIECESIZE 2GB for indexes. See Copying tables from one subsystem to
another on page 797 for more information.
3. Define the partition number data sets (2 GB each) with the IDCAMS
command. Define enough pieces to hold the entire source.
4. Run the DSN1COPY utility with the image copy as the source (SYSUT1), the
target object as SYSUT2, and specify DSSIZE 2G.
|
|
|
|
|
|
|
782
|
|
|
|
The DSN1COPY utility control statement, with its multiple options, defines the
function that the utility job performs.
|
|
|
|
DSN1COPY
CHECK
|
|
|
|
32K
PAGESIZE(
4K
8K
16K
32K
FULLCOPY
INCRCOPY
SEGMENT
INLCOPY
LARGE
LOB
DSSIZE ( integer G )
PIECESIZ(integer
K
M
G
NUMPARTS(integer)
(1)
EBCDIC
PRINT
(hexadecimal-constant,hexadecimal-constant)
|
|
ASCII
UNICODE
VALUE(
string
hexadecimal-constant
OBIDXLAT
RESET
|
|
Notes:
|
|
|
||
EBCDIC is not necessarily the default if the first page of the input data set is a header page. If
the first page is a header page, DSN1COPY uses the format information in the header page as the
default format.
Option descriptions
|
|
|
To run DSN1COPY, specify one or more of the following parameters on the EXEC
statement. If you specify more than one parameter, separate each parameter by a
comma. You can specify parameters in any order.
|
|
|
|
|
|
|
|
|
|
CHECK
Checks each page from the SYSUT1 data set for validity. The validity checking
operates on one page at a time and does not include any cross-page checking.
If an error is found, a message is issued describing the type of error, and a
dump of the page is sent to the SYSPRINT data set. If an unexpected page
number is encountered, validity checking continues to the end and a report
will be printed of all unexpected page numbers. If you do not receive any
messages, no errors were found. If more than one error exists in a given page,
the check identifies only the first of the errors. However, the entire page is
dumped. DSN1COPY does not check system pages for validity.
783
32K
|
|
|
|
Specifies that the SYSUT1 data set has a 32-KB page size. If you specify this
option and the SYSUT1 data set does not have a 32-KB page size, DSN1COPY
might produce unpredictable results.
The recommended option for performance is PAGESIZE(32K).
PAGESIZE
Specifies the page size of the input data set that is defined by SYSUT1.
Available page size values are 4K, 8K, 16K, or 32K. If you specify an incorrect
page size, DSN1COPY might produce unpredictable results.
|
|
|
|
If you do not specify the page size, DSN1COPY tries to determine the page
size from the input data set if the first page of the input data set is a header
page. DB2 issues an error message if DSN1COPY cannot determine the input
page size. This might happen if the header page is not in the input data set, or
if the page size field in the header page contains an invalid page size.
|
|
|
|
|
FULLCOPY
Specifies that a DB2 full image copy (not a DFSMSdss concurrent copy) of your
data is to be used as input. If this data is partitioned, specify NUMPARTS to
identify the total number of partitions. If you specify FULLCOPY without
NUMPARTS, DSN1COPY dtermines the NUMPARTS value from the header
page if possible; otherwise, DSN1COPY assumes that your input file is not
partitioned.
|
|
|
|
|
|
|
|
|
Specify FULLCOPY when using a full image copy as input. Omitting the
parameter can cause error messages or unpredictable results.
|
|
784
|
|
|
|
INLCOPY
Specifies that the input data is an inline copy data set. The INLCOPY
parameter requires SYSUT2 (output data set) to be either a VSAM data set or a
DUMMY data set.
You cannot specify the INLCOPY option with the LOB parameter.
|
|
|
|
|
DSSIZE(integer G)
Specifies the data set size, in gigabytes. This value has to match with the
DSSIZE of the source table space. If you omit the DSSIZE keyword or the
LARGE keyword, DSN1COPY assumes the appropriate default input data set
size that is listed in the following table.
Object
LOB
|
|
|
|
|
|
|
|
|
|
|
integer must match the DSSIZE value that was specified when the table space
was defined.
|
|
If you omit DSSIZE and the data set is not the assumed default size, the results
from DSN1COPY are unpredictable.
|
|
|
|
|
|
DSN1COPY attempts to determine if the input data set is a LOB data set. If it
can be clearly verified that the LOB option is specified, but the data set is not a
LOB data set, or that the LOB option is omitted for a data set that is a LOB
data set, DSN1COPY issues an error message and terminates. Otherwise, if the
LOB option isnt specified or omitted correctly the results of DSN1COPY are
unpredictable.
Chapter 40. DSN1COPY
785
Because the CHECK and RESET options and the copy function run
independently of the PRINT range, these options apply to the entire input file,
regardless of whether a range of pages is being printed.
You can indicate the format of the row data in the PRINT output by specifying
EBCDIC, ASCII, or UNICODE.
EBCDIC
Indicates that the row data in the PRINT output is to be displayed in
EBCDIC. The default value is EBCDIC if the first page of the input data
set is not a header page.
If the first page is a header page, DSN1COPY uses the format information
in the header page as the default format. However, if you specify EBCDIC,
ASCII, or UNICODE, that format overrides the format information in the
header page. The unformatted header page dump is always displayed in
EBCDIC, because most of the fields are in EBCDIC.
ASCII
Indicates that the row data in the PRINT output is to be displayed in
ASCII. Specify ASCII when printing table spaces that contain ASCII data.
UNICODE
Indicates that the row data in the PRINT output is to be displayed in
Unicode. Specify UNICODE when printing table spaces that contain
Unicode data.
PIECESIZ(integer)
Specifies the maximum piece size (data set size) for nonpartitioned indexes.
The value that you specify must match the value that was specified when the
786
nonpartitioning index was created or altered. The defaults for PIECESIZ are 2G
(2 GB) for indexes that are backed by non-large table spaces and 4G (4 GB) for
indexes that are backed by table spaces that were defined with the LARGE
option. This option is required if the piece size is not one of the default values.
If PIECESIZ is omitted and the index is backed by a table space that was
defined with the LARGE option, the LARGE option is required for
DSN1COPY.
The subsequent keyword K, M, or G indicates the unit of the value that is
specified in integer.
K
If you want to search for the equivalent hexadecimal character string, your JCL
should look similar to the following JCL:
//STEP1 EXEC PGM=DSN1COPY,PARM='VALUE(''F1F2F3F4F5'')'
|
|
|
|
|
OBIDXLAT
Specifies that OBID translation must be done before the DB2 data set is copied.
This parameter requires additional input from the SYSXLAT file by using the
DD statements. DSN1COPY can translate only up to 10000 record OBIDs. If
you specify OBIDXLAT, CHECK processing is performed, regardless of
whether you specify the CHECK option.
787
RESET
Causes the log RBAs in each index page or data page and the high-formatted
page number in the header page to be reset to 0. If you specify this option,
CHECK processing is performed, regardless of whether you specify the
CHECK option.
Use RESET when the output file is used to build a DB2 table space that is to
be processed on a DB2 subsystem with a different recovery log than the source
subsystem. Failure to specify RESET in such a case can result in an abend
during subsequent update activity. The abend reason code of 00C200C1
indicates that the specified RBA value is outside the valid range of the
recovery log. A condition code of 0 indicates successful completion.
For a compressed table space, DSN1COPY does not reset the dictionary version
for an inline image copy, or for an incremental image copy that was created
with the SYSTEMPAGES=YES COPY utility option.
|
|
|
If you do not specify RESET when copying a table space from one DB2 system
to another, a down-level ID check might result in abend reason code 00C2010D
when the table space is accessed.
Related information
Recovering from a down-level page set problem (DB2 Administration Guide)
Recommendations
Printing with DSN1PRNT instead of DSN1COPY
If you require only a printed hexadecimal dump of a data set, use
DSN1PRNT rather than DSN1COPY.
Copying a table space with DSN1COPY with row formats
When you use a DSN1COPY of a table space to populate another table
space, the row formats of the two table spaces must match. If the row
formats do not match, the results are unpredictable and could cause
integrity problems.
To determine the source table space and target table space row format, run
the following query against your DB2 catalog:
|
|
If the FORMAT column has a value of R, then the table space or partition
is in RRF (reordered row format). If the FORMAT column has a blank
value, then the table space or partition is in BRF (basic row format).
Determining page size and DSSIZE
788
Before using DSN1COPY, ensure that you know the page size and data set
size (DSSIZE) for the page set. Use the following query on the DB2 catalog
to get the information you need in this example for table DEPT:
SELECT T.CREATOR,T.NAME,S.NAME AS TABLESPACE,S.PARTITIONS,S.PGSIZE,
CASE S.DSSIZE
WHEN 0 THEN
CASE WHEN S.TYPE = 'G' THEN 4194304
WHEN S.TYPE = 'O' THEN 4194304
WHEN S.TYPE = 'P' THEN 4194304
WHEN S.TYPE = 'R' THEN 4194304
ELSE
CASE WHEN S.PARTITIONS > 254 THEN
CASE WHEN S.PGSIZE = 4 THEN 4194304
WHEN S.PGSIZE = 8 THEN 8388608
WHEN S.PGSIZE = 16 THEN 16777216
WHEN S.PGSIZE = 32 THEN 33554432
ELSE NULL
END
WHEN S.PARTITIONS > 64 THEN 4194304
WHEN S.PARTITIONS > 32 THEN 1048576
WHEN S.PARTITIONS > 16 THEN 2097152
WHEN S.PARTITIONS > 0 THEN 4194304
ELSE 2097152
END
END
ELSE S.DSSIZE
END
AS DSSIZE
FROM SYSIBM.SYSTABLES T,
SYSIBM.SYSTABLESPACE S
WHERE
T.NAME = 'DEPT' AND
T.TSNAME = S.NAME;
Figure 132. Example catalog query that returns the page set size and data set size for the
page set.
789
If running the online REORG utility with the FASTSWITCH option, verify
the data set name before running the DSN1COPY utility. The fifth-level
qualifier in the data set name alternates between I0001 and J0001 when
using FASTSWITCH. If the table space has cloning or ever had cloning, the
fifth-level qualifier can be I0002 or J0002. You cannot specify FASTSWITCH
YES if the table space has cloning; however, a FASTSWITCH YES REORG
might have been done before the clone was created so you might still have
a mixture of I and J data sets. Specify the correct fifth-level qualifier in
the data set name to successfully execute the DSN1COPY utility. To
determine the correct fifth-level qualifier, query the IPREFIX column of
SYSIBM.SYSTABLEPART for each data partition or the IPREFIX column of
SYSIBM.SYSINDEXPART for each index partition. If the object is not
partitioned, use zero as the value for the PARTITION column in your
query.
|
|
|
|
|
|
790
|
|
instance number 1 data sets. This process can be used to determine the
instance number even if there is no active cloning.
SYSUT2
Defines the output data set. This data set can be a sequential data set, a
VSAM data set, or a DUMMY data set.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
791
index fan set OBID, in addition to the DBID and ISOBID. Sample data in a
SYSXLAT file follows (with an indication of how each record translates
shown in parentheses):
260,280
2,10
3,55
6,56
7,57
(source
(source
(source
(source
(source
To obtain the names, DBIDs, PSIDs, ISOBIDs, and OBIDs, run the
DSNTEP2 sample application on both the source and target systems. The
following SQL statements yield the preceding information.
The example for indexes yields output that is similar to the preceding
example, but with an additional column of data.
For table spaces use the following statements:
SELECT DBID, PSID FROM SYSIBM.SYSTABLESPACE
WHERE NAME='tablespace_name'
AND DBNAME='database_name';
SELECT NAME, OBID FROM SYSIBM.SYSTABLES
WHERE TSNAME='tablespace_name'
AND CREATOR='creator_name';
792
SYSUT2: DB2-VSAM
Parameters: FULLCOPY, NUMPARTS(nn)
v Perform RBA RESET on a DB2 data set:
SYSUT1: DB2-VSAM or DSN1COPY sequential data set
SYSUT2: DB2-VSAM
Parameter: RESET
2. If DB2 has not stopped the object, issue the following command to stop the
object:
-STOP DATABASE (database_name) SPACENAME(space_name)
DB2 allows input of only one DSN1COPY data set. DB2 does not permit the input
of concatenated data sets. For a table space that consists of multiple data sets,
ensure that you specify the correct data set. For example, if you specify the
CHECK option to validate pages of a partitioned table spaces second partition,
code the second data set of the table space for SYSUT1.
v Method 1:
1. Use DSN1COPY to copy your existing data set to a sequential data set.
Specify this target data set as SYSUT1 in step 3.
2. If you defined your existing data set without the REUSE parameter, delete
and redefine the data set. Specify your existing data set as SYSUT2 in step 3.
Chapter 40. DSN1COPY
793
794
To protect against invalidating the OBIDs, specify the OBIDXLAT parameter for
DSN1COPY. The OBIDXLAT parameter translates OBID, DBID, PSID, or ISOBID
before DSN1COPY copies the data.
Using the FULLCOPY parameter ensures that the data that is contained in your
image copies is consistent. DSN1COPY accepts an index image copy as input when
you specify the FULLCOPY option. If you want to use inline image copies as input
to DSN1COPY, you must produce those image copies by using the REORG utility
or LOAD utility.
|
|
795
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
the name of the data sets for that partition. Code the NUMPARTS(nn) parameter,
where nn is the number of partitions in the entire table space.
If SYSUT1 is an image copy of a single data set of a multiple data set linear
table space, ensure that the SYSUT2 DD statement refers to the actual (not the
first) output data set of the table space. Do not specify NUMPARTS because this
parameter is only for partitioned table spaces.
If SYSUT1 is an image copy of an entire multiple data set linear table space,
ensure that the SYSUT2 DD statement refers to the first data set of the table
space. DSN1COPY allocates all target data sets. However, you must have
previously defined the target data sets by using Access Method Services. If the
source data sets are less than the target data sets it is recommended to either
delete all rows from the target table space or to do a LOAD REPLACE with DD
DUMMY on the target table space first, before running DSN1COPY.
If SYSUT1 is an image copy of a single data set of a multiple data set LOB
table space, ensure that the SYSUT2 DD statement refers to the actual (not the
first) data set of the tablespace. Do not specify NUMPARTS because this
parameter is only for partitioned table spaces.
If SYSUT1 is an image copy of an entire multiple data set LOB table space,
ensure that the SYSUT2 DD statement refers to the first data set of the
tablespace. DSN1COPY allocates all target data sets. However, you must have
previously defined the target data sets by using Access Method Services.
796
copies. These actions ensure data integrity. You are responsible for providing the
correct sequence of image copies. DB2 cannot help ensure the proper sequence.
|
|
|
|
|
You can use the DSN1COPY utility to restore a partition or an entire table space
for a partition-by-growth table space. The total number of partitions in a
DSN1COPY might not be consistent with the number of partitions defined on the
current table space. To avoid residual data , delete data in the excess partitions
from the table space before you apply the DSN1COPY utility.
If you use DSN1COPY for point-in-time recovery, the table space is not recoverable
with the RECOVER utility. Because DSN1COPY executed outside of DB2s control,
DB2 is not aware that you recovered to a point in time. Use DSN1COPY to recover
the affected table space after point-in-time recovery. Then perform the following
steps:
1. Remove old image copies by using MODIFY AGE.
2. Create one or more full image copies by using SHRLEVEL REFERENCE.
797
|
|
|
The following statements specify that DSN1COPY is to copy data into all pieces of
a segmented table space by using a full image copy of another segmented table
space as input.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3. Run DSN1COPY.
//DSN1COPY EXEC PGM=DSN1COPY,
// PARM='FULLCOPY'
//SYSUDUMP DD SYSOUT=A
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD DISP=SHR,DSN=PROD.IMAGE.COPY.DSNUMALL
//SYSUT2 DD DISP=OLD,DSN=DSNCAT.DSNDBD.TESTDB.TS01.I0001.A001
Related tasks
Updating version information when moving objects to another subsystem on
page 557
|
|
|
798
//SYSPRINT DD SYSOUT=A
//SYSUT1
DD DSN=DSNCAT.DSNDBC.DSNDB01.SYSUTILX.I0001.A001,DISP=OLD
//SYSUT2
DD DSN=TAPE.DS,UNIT=TAPE,DISP=(NEW,KEEP),VOL=SER=UTLBAK
//EXECUTE EXEC
//STEPLIB DD
//SYSPRINT DD
//SYSUT1
DD
//
//SYSUT2
DD
//
//SYSXLAT DD
260,280
2,10
3,55
6,56
7,57
/*
PGM=DSN1COPY,PARM='OBIDXLAT'
DSN=PDS CONTAINING DSN1COPY
SYSOUT=A
DSN=DSNC910.DSNDBC.DSN8D91P.DSN8S91C.I0001.A001,
DISP=OLD
DSN=DSNC910.DSNDBC.DSN8D91P.DSN8S91C.I0001.A001,
DISP=OLD
*
799
EXEC PGM=DSN1COPY,
PARM='NUMPARTS(1600),RESET,FULLCOPY'
DD SYSOUT=A
DD SYSOUT=A
DD DISP=SHR,DSN=PROD.IMAGE.COPY.PART1501
DD DISP=OLD,DSN=DSNCAT.DSNDBD.TESTDB.TS01.I0001.B501
EXEC PGM=DSN1COPY,
PARM='NUMPARTS(1600),RESET,FULLCOPY'
DD SYSOUT=A
DD SYSOUT=A
DD DISP=SHR,DSN=PROD.IMAGE.COPY.PART1502
DD DISP=OLD,DSN=DSNCAT.DSNDBD.TESTDB.TS01.J0001.B502
EXEC PGM=DSN1COPY,
PARM='NUMPARTS(16),RESET,FULLCOPY'
DD SYSOUT=A
DD SYSOUT=A
DD DISP=SHR,DSN=PROD.IMAGE.COPY.DSNUMALL
DD DISP=OLD,DSN=DSNCAT.DSNDBD.TESTDB.TS01.I0001.A001
|
|
//******************************************************************
//* COMMENT: RUN DSN1COPY FOR THE TABLESPACE Part 1
//******************************************************************
//STEP1 EXEC PGM=DSN1COPY,
// PARM='SEGMENT,RESET'
//SYSUDUMP DD SYSOUT=A
//SYSPRINT DD SYSOUT=A
//SYSOUT DD SYSOUT=A
//SYSABEND DD SYSOUT=A
//SYSUT1 DD DSN=DSNCAT.DSNDBD.DBKQBG01.TPKQBG01.I0001.A001,DISP=SHR
//SYSUT2 DD DSN=JUKQU2BG.DSN1COPY.D1P1,DISP=(NEW,CATLG,CATLG),
// VOL=SER=SCR03,UNIT=SYSDA,SPACE=(TRK,(55,1))
/*
//******************************************************************
800
801
802
DSN1LOGP can print the log records for both base and clone table objects.
DSN1LOGP cannot read logs that have been compressed by DFSMS. (This
compression requires extended format data sets.)
Environment
DSN1LOGP runs as a batch z/OS job.
DSN1LOGP runs on archive data sets, but not active data sets, when DB2 is
running.
Authorization required
DSN1LOGP does not require authorization. However, if any of the data sets is
RACF-protected, the authorization ID of the job must have RACF authority.
803
SYSSUMRY
DSN1LOGP writes the formatted output of a summary report to the
SYSSUMRY file. The LRECL is 131.
DSN1LOGP identifies the recovery log by DD statements that are described in the
stand-alone log services.
804
|
|
If you use GROUP or MxxBSDSs to locate the log data sets, you must use
LRSNSTART to define the selection range.
Related information
Reading log records with OPEN, GET, and CLOSE (DB2 Administration Guide)
RBAEND (
FFFFFFFFFFFF )
DATAONLY (NO)
RBASTART(hex-constant)
RBAEND ( hex-constant
LRSNEND ( FFFFFFFFFFFF )
DATAONLY (YES)
LRSNSTART(hex-constant)
LRSNEND (
hex-constant
SYSCOPY (NO)
SYSCOPY (YES)
DBID(hex-constant)
OBID(hex-constant)
RID(hex-constant)
PAGE(hex-constant)
URID(hex-constant)
LUWID(luwid)
TYPE ( hex-constant )
SUBTYPE ( hex-constant )
value/offset statement
SUMMARY (NO)
SUMMARY (
YES
ONLY
CHECK(DATA)
FILTER
value/offset statement:
805
VALUE/OFFSET
VALUE(hex-constant) OFFSET(hex-constant)
Option descriptions
To execute DSN1LOGP, construct a batch job. The utility name, DSN1LOGP, should
appear on the EXEC statement.
Specify keywords in up to 50 control statements in the SYSIN file. Each control
statement can have up to 72 characters. To specify no keywords, either use a
SYSIN file with no keywords following it, or omit the SYSIN file from the job JCL.
If you specify more than one keyword, separate them by commas. You can specify
the keywords in any order. You can include blanks between keywords, and also
between the keywords and the corresponding values.
RBASTART(hex-constant)
Specifies the hexadecimal log RBA from which to begin reading. If the value
does not match the beginning RBA of one of the log records, DSN1LOGP
begins reading at the beginning RBA of the next record. For any given job,
specify this keyword only once. Alternative spellings: STARTRBA, ST.
hex-constant is a hexadecimal value consisting of 1 to 12 characters (6 bytes);
leading zeros are not required.
The default value is 0.
DB2 issues a warning if the value is not within the range of log records that is
covered by the input log record information.
|
|
RBAEND(hex-constant)
Specifies the last valid hexadecimal log RBA to extract. If the specified RBA is
in the middle of a log record, DSN1LOGP continues reading the log in an
attempt to return a complete log record.
To read to the last valid RBA in the log, specify RBAEND(FFFFFFFFFFFF). For
any given job, specify this keyword only once. Alternative spellings: ENDRBA,
EN.
hex-constant is a hexadecimal value consisting of 1 to 12 characters (6 bytes);
leading zeros are not required.
The default value is FFFFFFFFFFFF.
DB2 issues a warning if the value is not within the range of log records that is
covered by the input log record information.
|
|
806
DB2 issues a warning if the value is not within the range of log records that is
covered by the input log record information.
LRSNEND(hex-constant)
Specifies the LRSN value of the last log record that is to be scanned. When
LRSNSTART is specified, the default is XFFFFFFFFFFFF. Otherwise, it is the
end of the data set. Alternative spelling: ENDLRSN.
For any given job, specify this keyword only once.
|
|
DB2 issues a warning if the value is not within the range of log records that is
covered by the input log record information.
DATAONLY
Limits the log records in the detail report to those that represent data changes
(insert, page repair, update space map, and so on).
The default value is DATAONLY(NO).
(YES)
Extracts log records for data changes only. For example, DATAONLY(YES),
together with a DBID and OBID, reads only the log records that modified
data for that DBID and OBID.
(NO)
Extracts all record types.
SYSCOPY
Limits the detail report to SYSCOPY log records.
The default value is SYSCOPY(NO).
(YES)
Includes only SYSCOPY log records in the detail report.
(NO)
Does not limit records to SYSCOPY records only.
DBID(hex-constant)
Specifies a hexadecimal database identifier (DBID). DSN1LOGP extracts only
the records that are associated with that DBID. For any given job, specify this
keyword only once.
hex-constant is a hexadecimal value consisting of one to four characters.
Leading zeros are not required.
The DBID is displayed in many DB2 messages. You can also find the DBID in
the DB2 catalog for a specific object (for example, in the column named DBID
of the SYSIBM.SYSTABLESPACE catalog table).
When you select a DBID from a catalog table, the value is displayed in decimal
format. Use the SQL HEX function in a SELECT statement to convert a DBID
to hexadecimal format. The following SQL statements show this use of the
HEX function:
SELECT NAME, DBNAME, HEX(DBID), HEX(PSID)
FROM SYSIBM.SYSTABLESPACE
WHERE NAME ='table space name'
SELECT NAME, DBNAME, HEX(DBID), HEX(ISOBID)
FROM SYSIBM.SYSINDEXES
WHERE NAME ='index name'
807
OBID(hex-constant)
Specifies a hexadecimal database object identifier, either a data page set
identifier (PSID) or an index page set identifier (ISOBID). DSN1LOGP extracts
only the records that are associated with that identifier.
hex-constant is a hexadecimal value consisting of one to four characters.
Leading zeros are not required.
Whenever DB2 makes a change to data, the log record that describes the
change identifies the database by DBID and the table space by page set ID
(PSID). You can find the PSID column in the SYSIBM.SYSTABLESPACE catalog
table.
You can also find a column named OBID in the SYSIBM.SYSTABLESPACE
catalog table. That column actually contains the OBID of a file descriptor; dont
confuse this with the PSID, which is the information that you must include
when you execute DSN1LOGP.
Whenever DB2 makes a change to an index, the log record that describes the
change identifies the database (by DBID) and the index space (by index space
OBID or ISOBID). You can find the ISOBID for an index space in the column
named ISOBID in the SYSIBM.SYSINDEXES catalog table.
You can also find a column named OBID in the SYSIBM.SYSINDEXES catalog
table. This column actually contains the identifier of a fan set descriptor; dont
confuse this with the ISOBID, which is the information that you must include
when you execute DSN1LOGP.
When you select either the PSID or the ISOBID from a catalog table, the value
is displayed in decimal format. Use the SQL HEX function in your select
statement to convert them to hexadecimal.
For any given DSN1LOGP job, use this keyword only once. If you specify
OBID, you must also specify DBID.
PAGE(hex-constant)
Specifies a hexadecimal page number. When data or an index is changed, a
recovery log record is written to the log, identifying the object identifier and
the page number of the changed data page or index page. Specifying a page
number limits the search to a single page; otherwise, all pages for a given
combination of DBID and OBID are extracted. The log output also contains
page set control log records for the specified DBID and OBID, and system
event log records, unless DATAONLY(YES) is also specified.
hex-constant is a hexadecimal value consisting of a maximum of eight
characters.
You can specify a maximum of 100 PAGE keywords in any given DSN1LOGP
job. You must also specify the DBID and OBID keywords that correspond to
those pages.
The PAGE and RID keywords are mutually exclusive.
RID(hex-constant)
Specifies a record identifier, which is a hexadecimal value consisting of 10
characters, with the first eight characters representing the page number and the
last two characters representing the page ID map entry number. The option
limits the log records that are extracted to those that are associated with that
particular record. The log records that are extracted include not only those that
are directly associated with the RID, such as insert and delete, but also the
808
control records that are associated with the DBID and OBID specifications,
such as page set open, page set close, set write, reset write, page set write, data
set open, and data set close.
You can specify a maximum of 40 RID keywords in any given DSN1LOGP job.
You must also specify the DBID and OBID keywords that correspond to the
specified records.
The PAGE and RID keywords are mutually exclusive.
URID(hex-constant)
Specifies a hexadecimal unit of recovery identifier (URID). Changes to data
and indexes occur in the context of a DB2 unit of recovery, which is identified
on the log by a BEGIN UR record. In the summary DSN1LOGP report, the
URID is listed in the STARTRBA field in message DSN1162I. In the detail
DSN1LOGP report, look for the subtype of BEGIN UR; the URID is listed in
the URID field. Using the log RBA of that record as the URID value limits the
extraction of information from the DB2 log to that unit of recovery.
hex-constant is a hexadecimal value consisting of 1 to 12 characters (6 bytes).
Leading zeros are not required.
You can specify a maximum of 10 URID keywords in any given DSN1LOGP
job.
LUWID(luwid)
Specifies up to 10 LUWIDs that DSN1LOGP is to include information about in
the summary report.
luwid consists of three parts: an LU network name, an LUW instance number,
and a commit sequence number. If you supply the first two parts, the
summary report includes an entry for each commit that is performed in the
logical unit of work (within the search range). If you supply all three parts, the
summary report includes an entry for only that LUWID.
The LU network name consists of a one- to eight-character network ID, a
period, and a one- to eight-character network LU name. The LUW instance
number consists of a period, followed by 12 hexadecimal characters. The last
element of the LUWID is the commit sequence number of 4 hexadecimal
characters, preceded by a period.
TYPE(hex-constant)
Limits the log records that are extracted to records of a specified type. The
TYPE and SUBTYPE options are mutually exclusive.
hex-constant indicates the type, as follows:
Constant
Description
2
10
20
UR control record
100
Checkpoint record
200
UR-UNDO record
400
UR-REDO record
800
809
1000 to 8000
Assigned by the resource manager
SUBTYPE(hex-constant)
Restricts formatting to a particular subtype of unit of recovery undo and redo
log records (types 200 and 400). The TYPE and SUBTYPE options are mutually
exclusive.
hex-constant indicates the subtype, as follows:
Constant
Description
10
11
12
Undo/redo log record for modified page or redo log record for
formatted page
14
Savepoint
15
Other DB2 component log records that are written for RMID 14
17
19
1A
1B
1C
1D
1E
65
81
82
The VALUE and OFFSET options must be used together. You can specify a
maximum of 10 VALUE-OFFSET pairs. The SUBTYPE parameter is required
when using the VALUE and OFFSET options.
810
VALUE(hex-constant)
Specifies a value that must appear in a log record that is to be extracted.
hex-constant is a hexadecimal value consisting of a maximum of 64
characters and must be an even number of characters.
The SUBTYPE keyword must be specified before the VALUE option.
OFFSET(hex-constant)
Specifies an offset from the log record header at which the value that is
specified in the VALUE option must appear.
hex-constant is a hexadecimal value consisting of a maximum of eight
characters.
The SUBTYPE keyword must be specified before specifying the OFFSET
option.
SUMMARY
Summarizes all recovery information within the RBASTART and RBAEND
specifications. You can use summary information to determine what work is
incomplete when DB2 starts. You cannot limit the output of the summary
report with any of the other options, except by using the FILTER option with a
URID or LUWID specification.
The default value is SUMMARY(NO).
(YES)
Generates both a detail and summary report.
(NO)
Generates only a detail report.
(ONLY)
Generates only a summary report.
FILTER
Restricts the summary report to include messages for only the specified URIDs
and LUWIDs. Specify this option only once.
The SUMMARY keyword must be specified before FILTER.
CHECK(DATA)
Specifies that DSN1LOGP is to check the specified range of data pages for
page regression. Any page regression errors are displayed in the detail and
summary reports.
Related concepts
DSN1LOGP output on page 816
Related reference
Sample DSN1LOGP control statements on page 813
|
|
|
You can determine the PSID for base and clone objects by querying the
SYSIBM.SYSTABLESPACE catalog table.
|
|
|
811
2. Determine the instance number of the clone or base object. You can determine
the instance number in two ways:
v Look at the TYPE column in the DISPLAY DATABASE command output. The
output indicates the base and clone objects with a B or a C character
respectively along with the data set instance number.
v Look at the DB2 catalog. The SYSIBM.SYSTABLESPACE catalog table
INSTANCE column indicates the current instance number of the base table.
3. Determine whether to alter the PSID value or leave the PSID value the same.
For example, if the PSID value of the base or clone is 0009X and the instance
number is 1, specify a PSID value of 0009X to DSN1LOGP. If the PSID of the
base or clone is 0009X and the instance number is 2, specify a PSID value of
8009X to DSN1LOGP.
|
|
|
|
|
|
|
|
|
|
|
|
When reading archive log data sets on tape (or copies of active log data sets on
tape), add one or more of the following Job Entry Subsystem (JES) statements:
For the JES3 environment:
JES3 environment JCL
Description
//*MAIN SETUP=JOB
Alert the z/OS operator to mount the initial volumes before the job
executes.
//*MAIN HOLD=YES
Place the job in HOLD status until the operator is ready to release the job.
TYPRUN=HOLD
Perform the same function as //*MAIN HOLD=YES. The system places
the JCL on the JOB statement.
For the JES2 environment:
JES2 environment JCL
Description
/*SETUP
Alert the z/OS operator to prepare to mount a specified list of tapes.
812
/*HOLD
Place the job in HOLD status until the operator has located the tapes and
is ready to release the job.
TYPRUN=HOLD
Perform the same function as /*HOLD. The system places the JCL on the
JOB statement.
Alternatively, submit the job to a z/OS initiator that your operations center has
established for exclusive use by jobs that require tape mounts. Specify the initiator
class by using the CLASS parameter on the JOB statement, in both JES2 and JES3
environments.
For additional information on these options, refer to z/OS MVS JCL Users Guide
or z/OS MVS JCL Reference.
You can think of the DB2 recovery log as a large sequential file. When recovery log
records are written, they are written to the end of the log. A log RBA is the address
of a byte on the log. Because the recovery log is larger than a single data set, the
recovery log is physically stored on many data sets. DB2 records the RBA ranges
and their corresponding data sets in the BSDS. To determine which data set
contains a specific RBA, read the information about the DSNJU004 utility. During
normal DB2 operation, messages are issued that include information about log
RBAs.
813
814
815
//M01BSDS DD DSN=DSNDB0G.DB1G.BSDS01,DISP=SHR
//SYSIN DD *
DATAONLY (YES)
LRSNSTART (A7951A001AD5) LRSNEND (A7951A003B6A)
DBID (112) OBID(1D)
/*
Related reference
Chapter 37, DSNJU004 (print log map), on page 751
Related information
Resetting the log RBA (DB2 Administration Guide)
DSN1LOGP output
One intended use of this utility is to aid in determining and correcting system
problems. When diagnosing DB2, you might need to refer to licensed
documentation to interpret output from this utility.
|
|
The first section lists all completed units of recovery (URs) and checkpoints within
the range of the log that is scanned. Events are listed chronologically, with URs
listed according to when they were completed and checkpoints listed according to
when the end of the checkpoint was processed. The page sets that are changed by
each completed UR are listed. If a log record that is associated with a UR is
unavailable, the attribute INFO=PARTIAL is displayed for the UR. Otherwise, the
UR is marked INFO=COMPLETE. A log record that is associated with a UR is
unavailable if the range of the scanned log is not large enough to contain all
records for a given UR.
The DISP attribute can be one of the following values: COMMITTED, ABORTED,
INFLIGHT, IN-COMMIT, IN-ABORT, POSTPONED ABORT, or INDOUBT. The
DISP attributes COMMITTED and ABORTED are used in the first section; the
remaining attributes are used in the second section.
816
The list in the second section shows the work that is required of DB2 at restart as
it is recorded in the log that you specified. If the log is available, the checkpoint
that is to be used is identified, as is each outstanding UR, together with the page
sets it changed. Each page set with pending writes is also identified, as is the
earliest log record that is required to complete those writes. If a log record that is
associated with a UR is unavailable, the attribute INFO=PARTIAL is displayed,
and the identification of modified page sets is incomplete for that UR.
DSN1212I DSN1LGRD FIRST LOG LRSN ENCOUNTERED AA526968220D
================================================================================
DSN1150I SUMMARY OF COMPLETED EVENTS
DSN1151I DSN1LPRT MEMBER=V91B UR CONNID=V91B CORRID=021.OPNLGR00 AUTHID=SYSOPR PLAN=SYSTEM
START DATE=94.347 TIME=11:15:22 DISP=COMMITTED INFO=COMPLETE
STARTRBA=00000000E570 ENDRBA=00000000EB64 STARTLRSN=AA52696B1269 ENDLRSN=AA526999D14D NID=*
LUWID=USIBMSY.SYEC1B.AA52696825CE.0001 COORDINATOR=*
PARTICIPANTS=*
DATA MODIFIED:
DATABASE=0001=DSNDB01 PAGE SET=00CF=SYSLGRNX
DATABASE=0001=DSNDB01 PAGE SET=0087=DSNLLX01
DATABASE=0001=DSNDB01 PAGE SET=0086=DSNLLX02
DSN1151I DSN1LPRT MEMBER=V91B UR CONNID=V91B CORRID=021.OPNLGR00 AUTHID=SYSOPR PLAN=SYSTEM
START DATE=94.347 TIME=11:16:14 DISP=COMMITTED INFO=COMPLETE
STARTRBA=00000000ECFC ENDRBA=00000000F20A STARTLRSN=AA52699C97A9 ENDLRSN=AA52699CADC5 NID=*
LUWID=USIBMSY.SYEC1B.AA52699C9508.0001 COORDINATOR=*
PARTICIPANTS=*
DATA MODIFIED:
DATABASE=0001=DSNDB01 PAGE SET=00CF=SYSLGRNX
DATABASE=0001=DSNDB01 PAGE SET=0087=DSNLLX01
DATABASE=0001=DSNDB01 PAGE SET=0086=DSNLLX02
....
DSN1213I DSN1LGRD LAST LOG LRSN ENCOUNTERED AA527C9B8392
DSN1214I NUMBER OF LOG RECORDS READ 0000000000004991
================================================================================
DSN1157I RESTART SUMMARY
DSN1153I DSN1LSIT CHECKPOINT MEMBER=V91B
STARTRBA=000000068CD3 ENDRBA=00000006CAED STARTLRSN=AA527AA809DF ENDLRSN=AA527AA829F4
DATE=94.347 TIME=12:32:29
DSN1162I DSN1LPRT MEMBER=V91C UR CONNID=BATCH CORRID=S5529927 AUTHID=ADMF001 PLAN=PLNFW543
START DATE=94.347 TIME=12:41:04 DISP=INFLIGHT
INFO=COMPLETE
STARTRBA=000000016000 STARTLRSN=AA527C9278DF NID=*
LUWID=USIBMSY.SYEC1C.AA527C22E283.0001 COORDINATOR=*
PARTICIPANTS=*
DATA MODIFIED:
DATABASE=0113=DBFW5401 PAGE SET=0002=TPFW5401
DATABASE=0113=DBFW5401 PAGE SET=0005=IPFW5401
DSN1162I DSN1LPRT MEMBER=V91A UR CONNID=BATCH CORRID=S5529925 AUTHID=ADMF001 PLAN=PLNFW541
START DATE=94.347 TIME=12:41:04 DISP=INFLIGHT INFO=COMPLETE
STARTRBA=000001F9A3C1 STARTLRSN=AA527C92E419 NID=*
LUWID=USIBMSY.SYEC1DB2.AA527C1D674B.0001 COORDINATOR=*
PARTICIPANTS=*
DATA MODIFIED:
DATABASE=0113=DBFW5401 PAGE SET=0002=TPFW5401
...
DSN1160I DATABASE WRITES PENDING:
DATABASE=0001=DSNDB01
PAGE SET=0046=DSNLUX02 START=000000068CD3
DATABASE=0001=DSNDB01
PAGE SET=0044=DSNLUX01 START=000000068CD3
...
DATABASE=0006=DSNDB06
PAGE SET=0076=DSNUCX01 START=000000068CD3
DATABASE=0006=DSNDB06
PAGE SET=0072=DSNUCH01 START=000000068CD3
...
817
0040C4C2
00000000
00000000
F8000000
C6E6F0F0
00000000
00000000
0000C4E2
F1F1C9C3
00000000
00000000
D5C3F4F1
C6E6F0F0 F0F10001
00000000 00000000
00000000 00000000
F040
000000010A82 MEMBER(M02
) URID(000000010A82) LRSN(AB6253747801)
TYPE(UR CONTROL) SUBTYPE(BEGIN UR)
*LRH* 009000A0 00200001 03800000 00010A82 00000000 00000126 00000000
53747801 0002
0000 00010000 0000D000 00000000 00000700 0000D4F0 F0F0F1F0 F2F54040
0020 E5E3F0F0 F340AB62 537477FC B803C4E2 D5E3C5D7 F340C2C1 E3C3C840
0040 E3C3C840 40400000 00000000 0000001A 0001E4E2 C9C2D4E2 E840E2E8
0060 4040AB62 5362554A 0001
0000AB62
4040D7C6
4040C2C1
C5C3F1C4
000000010B12 MEMBER(M02
) URID(000000010A82) LRSN(AB6253747807)
TYPE( UNDO ) SUBTYPE(SAVEPOINT)
*LRH* 002F0090 22000014 0E800000 00010A82 00000001 0A820126 00000001 0A82AB62
53747807 0002
0000 00E7D9E4 C9000000 02
000000010B42 MEMBER(M02
) URID(000000010A82) LRSN(AB625374780E) DBID(0113) OBID(0008)
PAGE(00000003)
TYPE( UNDO REDO ) SUBTYPE(TYPE 2 INDEX UPDATE) CLR(NO) PROCNAME(DSNKDLE )
*LRH* 0053002F 06000019 0E800000 00010A82 00000001 0B120126 00000001 0B12AB62
5374780E 0002
*LG** 84011300 08000003 63000000 00000000 0000
0000 001B3000 00B40001 00000201 000A0000 02C5C5F0 F6C1C1D4 F3F1C1
000000010B94 MEMBER(M02
) URID(000000010A82) LRSN(AB6253747CEF) DBID(0113) OBID(0008)
PAGE(00000003)
TYPE( UNDO REDO ) SUBTYPE(TYPE 2 INDEX UPDATE) CLR(NO) PROCNAME(DSNKINSL)
*LRH* 00530053 06000019 0E800000 00010A82 00000001 0B420126 00000001 0B42AB62
53747CEF 0002
*LG** 04011300 08000003 64000000 00000000 0000
0000 001B1000 00B30001 00000201 000A2000 00C5C5F0 F6C1C1D7 D7D3F4
......
00000001138E MEMBER(M02
) URID(0000000110A0) LRSN(AB62537B4931)
TYPE(UR CONTROL) SUBTYPE(BEGIN COMMIT1)
*LRH* 005C0053 00200002 03800000 000110A0 00000001 133B0126 00000001 133BAB62
537B4931 0002
0000 00020000 00004000 00000000 00000700 0000F0F2 F14BD6D7 D5D3C7D9 F0F04040
0020 40404040 40400000 00000000 00000000 00000000 0000
0000000113EA MEMBER(M02
) URID(0000000110A0) LRSN(AB62537B4940)
TYPE(UR CONTROL) SUBTYPE(PHASE 1 TO 2)
818
819
v LR WRITTEN shows the number of written log records that represented changes
to tables that were defined for data capture and were available to the
DB2CDCEX routine. Recursive SQL changes from DB2CDCEX and changes from
other attachments that are not associated with DB2CDCEX are not included. If
you receive a value of 2147483647, an overflow occurred and the count is not
valid.
v LR RETRIEVED is the number of captured RBAs that were retrieved by
DB2CDCEX. If you receive a value of 2147483647, an overflow occurred and the
count is not valid.
v LR NOT RETRIEVED is the difference between the number of written log
records (LR WRITTEN) and the number of retrieved log records (LR
RETRIEVED). The following example output shows that four log records were
written, and none were retrieved.
DATA PROPAGATION INFORMATION:
START RBA=000004A107F4
END RBA=000004A10A5C
LR WRITTEN=0000000000000004 LR RETRIEVED=0000000000000000
DATABASE=0112=DBCS1701
PAGESET=0002=TSCS1701
Figure 138. Sample data propagation information from the summary report
Page number
Current LRSN or RBA
Member name
Previous level
Previous update
v Date
v Time
A summary report contains the total number of page regressions that the utility
found as well as the following information for each table space in which it found
page regression errors:
v Database name
v Table space name
v DBID
v OBID
If no page regression errors are found, DSN1LOGP outputs a single message that
no page regression errors were found.
The sample output in the following figure shows detail and summary reports
when page regression errors are found.
820
Figure 139. Sample DSN1LOGP detail and summary reports for page regression errors.
821
822
Output
One intended use of this utility is to aid in determining and correcting system
problems. When diagnosing DB2, you might need to refer to licensed
documentation to interpret output from this utility.
Environment
Run DSN1PRNT as a z/OS job.
You can run DSN1PRNT even when the DB2 subsystem is not operational. If you
choose to use DSN1PRNT when the DB2 subsystem is operational, ensure that the
DB2 data sets that are to be printed are not currently allocated to DB2.
To make sure that a data set is not currently allocated to DB2, issue the DB2 STOP
DATABASE command, specifying the table spaces and indexes that you want to
print.
823
Authorization required
No special authorization is required. However, if any of the data sets is RACF
protected, the authorization ID of the job must have RACF authority.
If you run the online REORG utility with FASTSWITCH behavior, verify
the data set name before running the DSN1PRNT utility. The fifth-level
qualifier in the data set name alternates between I0001 and J0001 when
using FASTSWITCH. If the table space has cloning, the fifth-level qualifier
can be I0002 or J0002. Specify the correct fifth-level qualifier in the data set
name to successfully execute the DSN1PRNT utility. To determine the
correct fifth-level qualifier, query the IPREFIX column of
SYSIBM.SYSTABLEPART for each data partition or the IPREFIX column of
SYSIBM.SYSINDEXPART for each index partition. If the object is not
partitioned, use zero as the value for the PARTITION column in your
query.
Related information
DB2 Diagnosis Guide and Reference
|
|
|
|
|
|
|
|
|
|
|
824
32K
PAGESIZE (
4K
8K
16K
32K
FULLCOPY
INCRCOPY
INLCOPY
LARGE
LOB
DSSIZE ( integer
G )
PIECESIZ(integer
K
M
G
NUMPARTS(integer)
(1)
PRINT EBCDIC
(1)
EBCDIC
PRINT
(hexadecimal-constant,hexadecimal-constant)
ASCII
UNICODE
VALUE(
string
hexadecimal-constant
FORMAT
EXPAND
NODATA
NODATPGS
Notes:
1
EBCDIC is not necessarily the default if the first page of the input data set is a header page. If
the first page is a header page, DSN1PRNT uses the format information in the header page as the
default format.
Option descriptions
To run DSN1PRNT, specify one or more of the following parameters on the EXEC
statement.
Important: If you specify more than one parameter:
v Separate them by commas (no blanks).
v Specify them in any order.
32K
Specifies that the SYSUT1 data set has a 32-KB page size. If you specify this
option and the SYSUT1 data set does not have a 32-KB page size, DSN1COPY
might produce unpredictable results.
The recommended option for performance is PAGESIZE(32K).
825
PAGESIZE
Specifies the page size of the input data set that is defined by SYSUT1.
Available page size values are 4K, 8K, 16K, or 32K. If you specify an incorrect
page size, DSN1PRNT might produce unpredictable results.
If you do not specify the page size, DSN1PRNT tries to determine the page
size from the input data set if the first page of the input data set is a header
page. DB2 issues an error message if DSN1PRNT cannot determine the input
page size. This might happen if the header page is not in the input data set, or
if the page size field in the header page contains an invalid page size.
FULLCOPY
Specifies that a DB2 full image copy (not a DFSMSdss concurrent copy) of your
data is to be used as input. If this data is partitioned, you also need to specify
the NUMPARTS parameter to identify the number and length of the partitions.
If you specify FULLCOPY without including a NUMPARTS specification,
DSN1PRNT assumes that the input file is not partitioned.
The FULLCOPY parameter must be specified when you use an image copy as
input to DSN1PRNT. Omitting the parameter can cause error messages or
unpredictable results.
INCRCOPY
Specifies that an incremental image copy of the data is to be used as input. If
the data is partitioned, also specify NUMPARTS to identify the number and
length of the partitions. If you specify INCRCOPY without NUMPARTS,
DSN1PRNT assumes that the input file is not partitioned.
The INCRCOPY parameter must be specified when you use an incremental
image copy as input to DSN1PRNT. Omitting the parameter can cause error
messages or unpredictable results.
INLCOPY
Specifies that the input data is to be an inline copy data set.
When you use DSN1PRNT to print a page or a page range from an inline copy
that is produced by LOAD or REORG, DSN1PRNT prints all instances of the
pages. The last instance of the printed page or pages is the last one that is
created by the utility.
LARGE
Specifies that the input data set is a table space that was defined with the
LARGE option, or an index on such a table space. If you specify LARGE, DB2
assumes that the data set has a 4-GB boundary. The recommended method of
specifying a table space that was defined with the LARGE option is
DSSIZE(4G).
If you omit the LARGE or DSSIZE(4G) option when it is needed, or if you
specify LARGE for a table space that was not defined with the LARGE option,
the results from DSN1PRNT are unpredictable.
If you specify LARGE, you cannot specify LOB or DSSIZE.
LOB
Specifies that the SYSUT1 data set is a LOB table space. You cannot specify the
INLCOPY option with the LOB parameter.
DB2 attempts to determine if the input data set is a LOB data set. If you
specify the LOB option but the data set is not a LOB data set, or if you omit
the LOB option but the data set is a LOB data set, DB2 issues an error message
and DSN1PRNT terminates.
826
LOB
integer must match the DSSIZE value that was specified when the table space
was defined.
If you omit DSSIZE and the data set is not the assumed default size, the results
from DSN1PRNT are unpredictable.
If you specify DSSIZE, you cannot specify LARGE.
PIECESIZ(integer)
Specifies the maximum piece size (data set size) for nonpartitioned indexes.
The value that you specify must match the value that is specified when the
secondary index was created or altered.
The defaults for PIECESIZ are 2G (2 GB) for indexes that are backed by
non-large table spaces and 4G (4 GB) for indexes that are backed by table
spaces that were defined with the LARGE option. This option is required if a
print range is specified and the piece size is not one of the default values. If
PIECESIZ is omitted and the index is backed by a table space that was defined
with the LARGE option, the LARGE keyword is required for DSN1PRNT.
The subsequent keyword K, M, or G, indicates the units of the value that is
specified in integer.
K
827
v
v
v
v
v
32 MB
64 MB
128 MB
256 KB or 256 MB
512 KB or 512 MB
NUMPARTS(integer)
Specifies the number of partitions that are associated with the input data set.
Valid specifications range from 1 to 4096. If you omit NUMPARTS or specify it
as 0, DSN1COMP assumes that your input file is not partitioned. If you specify
a number greater than 64, DSN1COMP assumes that the data set is for a
partitioned table space that was defined with the LARGE option, even if the
LARGE keyword is not specified.
DSN1COMP cannot always validate the NUMPARTS parameter. If you specify
it incorrectly, DSN1COMP might produce unpredictable results.
DSN1COMP terminates and issues message DSN1946I when it encounters an
image copy that contains multiple partitions; a compression report is issued for
the first partition.
PRINT(hexadecimal-constant,hexadecimal-constant)
Causes the SYSUT1 data set to be printed in hexadecimal format on the
SYSPRINT data set. This option is the default for DSN1PRNT.
You can specify the PRINT parameter with or without page range
specifications. If you do not specify a range, all pages of the SYSUT1 are
printed. If you want to limit the range of pages that are printed, you can do so
by indicating the beginning and ending page numbers with the PRINT
parameter or, if you want to print a single page, by indicating only the
beginning page. In either case, your range specifications must be from one to
eight hexadecimal characters in length.
The following example shows how to code the PRINT parameter if you want
to begin printing at page X2F0 and to stop at page X35C:
PRINT(2F0,35C)
Note that the actual size of a 4-GB DB2 data set that is full is 4G - 256 x 4KB.
This size also applies to data sets that are created with a DFSMS data class that
has extended addressability. When calculating the print range of pages in a
non-first data set of a multiple data set linear table space or index with 4G
DSSIZE or PIECESIZ, use the actual data set size.
The relationship between the page size and the number of pages in a 4-GB
data set is shown in the following table.
Table 150. Relationship between page size and the number of pages in a 4-GB data set
Page size
Number of pages
4 KB
XFFF00
8 KB
X7FF80
16 KB
X3FFC0
32 KB
X1FFE0
For example, if PAGESIZE is 4 KB, the page number of the first page of the
third data set is 2*FFF00 = 1FFE00.
To print only the header page for a nonpartitioned table space, specify
PRINT(0).
828
You can indicate the format of the row data in the PRINT output by specifying
EBCDIC, ASCII, or UNICODE. The part of the output that is affected by these
options is in bold in the following figure.
RECORD: XOFFSET='0014'X PGSFLAGS='00'X PGSLTH=65 PGSLTH='0041'X PGSOBD='0003'X PGSBID='01'X
C5C5F0F6 C1404040 40404040 F1F34040 40C1E2D6 F1F3F5E7 40404040 40404040
EE06A
13
ASO135X
C1C6F3F1 C587C6F0 01800000 14199002 01174522 00000080 000000
AF31E.F0...................
RECORD: XOFFSET='0055'X PGSFLAGS='00'X PGSLTH=65 PGSLTH='0041'X PGSOBD='0003'X PGSBID='02'X
C5C5F0F6 C1404040 40404040 F1F34040 40C1E2D6 F1F3F5E7 40404040 40404040
EE06A
13
ASO135X
C1C6F5F2 D487C5F0 09800000 78199002 01174522 00000080 000000
AF52M.E0...................
Figure 140. The part of the DSN1PRNT FORMAT output that is affected by the EBCDIC, ASCII, and UNICODE
options
EBCDIC
Indicates that the row data in the PRINT output is to be displayed in
EBCDIC.
The default value is EBCDIC if the first page of the input data set is not a
header page.
If the first page is a header page, DSN1PRNT uses the format information
in the header page as the default format. However, if you specify EBCDIC,
ASCII, or UNICODE, that format overrides the format information in the
header page. The unformatted header page dump is always displayed in
EBCDIC, because most of the fields are in EBCDIC.
ASCII
Indicates that the row data in the PRINT output is to be displayed in
ASCII. Specify ASCII when printing table spaces that contain ASCII data.
UNICODE
Indicates that the row data in the PRINT output is to be displayed in
Unicode. Specify UNICODE when printing table spaces that contain
Unicode data.
VALUE
Causes each page of the input data set SYSUT1 to be scanned for the character
string that you specify in parentheses following the VALUE parameter. Each
page that contains that character string is then printed in SYSPRINT. You can
specify the VALUE parameter in conjunction with any of the other DSN1PRNT
parameters.
(string)
Can consist of from 1 to 20 alphanumeric EBCDIC characters. For
non-EBCDIC characters, use hexadecimal characters.
(hexadecimal-constant)
Consists of from 2 to 40 hexadecimal characters. You must specify two
apostrophe characters before and after the hexadecimal character string.
If, for example, you want to search your input file for the string 12345, your
JCL should look like the following JCL:
//STEP1 EXEC PGM=DSN1PRNT,PARM='VALUE(12345)'
829
FORMAT
Causes the printed output to be formatted. Page control fields are identified,
and individual records are printed. Empty fields are not displayed.
EXPAND
Specifies that the data is compressed and causes DSN1PRNT to expand it
before formatting. This option is intended to be used only under the
direction of your IBM Support Center.
NODATA
Suppresses printing of table row data. The row headers are formatted and
printed. Specify NODATA to reduce the volume of the output when the
contents of the rows are not important.
|
|
|
NODATPGS
Suppresses all data pages of a table space. Specify NODATPGS to format
and print only non-data pages to reduce the volume of the output when
only certain page types are of interest (for example, LOB space map
pages). Alternatively, you can specify NODHDR.
DSN1PRNT cannot format a leaf or nonleaf page for an index page set that
contains keys with altered columns. When it encounters this situation,
DSN1PRNT generates the following message:
*KEY WITH ALTERED COLUMN HAS BEEN DETECTED-UNABLE TO FORMAT PAGE*
|
|
Related concepts
Using VERIFY with REPLACE and DELETE operations on page 557
830
Figure 141. Example SQL query that returns the page size and data set size for the page
set.
Related reference
Data sets that REORG INDEX uses on page 433
831
//PRINT2 EXEC
//
//SYSUDUMP DD
//SYSPRINT DD
//SYSUT1
DD
PGM=DSN1PRNT,
PARM=(PRINT(F0000,F000F),FORMAT,PIECESIZ(64M))
SYSOUT=A
SYSOUT=A
DISP=OLD,DSN=DSNCAT.DSNDBD.MMRDB.NPI1.I0001.A061
EXEC PGM=DSN1PRNT,
PARM='PRINT(1),FORMAT,INLCOPY'
DD DSN=DB2A.SDSNLOAD,DISP=SHR
DD SYSOUT=A
DD SYSOUT=A
DD DSN=HUHYU205.L1.STEP1.DD2,DISP=SHR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The printout includes page numbers. Use these page numbers to setup another
DSN1PRNT job using the appropriate page numbers.
2. Run DSN1PRNT on partition 8 specifying your PRINT range
//
EXEC PGM=DSN1PRNT,
//
PARM='PRINT(xx000000,xx000020),FORMAT,NUMPARTS(8)'
//SYSUT1
DD DSN=DSNT6USR.DSNDBC.V9DS306.XV9D0000.I0001.A008,DISP=SHR
832
To ensure that you do not take action on an IFCID 4 or IFCID 5 start or stop trace
record, it is good practice to add
|
|
to your control statement, where hhhh is the hex representation of the IFCID that
you are trying to trigger on.
P4,00
DR,04,X'hhhh'
Output
One intended use of this utility is to aid in determining and correcting system
problems. When diagnosing DB2, you might need to refer to licensed
documentation to interpret output from this utility.
Environment
Run DSN1SDMP as a z/OS job, and execute it with the DSN TSO command
processor. To execute DSN1SDMP, the DB2 subsystem must be running.
The z/OS job completes only under one of the following conditions:
v The TRACE and any additional selection criteria that are started by DSN1SDMP
meet the criteria specified in the FOR parameter.
v The TRACE that is started by DSN1SDMP is stopped by using the STOP TRACE
command.
v The job is canceled by the operator.
If you must stop DSN1SDMP, use the STOP TRACE command.
Authorization required
To execute this utility, the privilege set of the process must include one of the
following privileges or authorities:
v TRACE system privilege
v SYSOPR authority
v SYSADM authority
v MONITOR1 or MONITOR2 privileges (if you are using user-defined data sets)
The user who executes DSN1SDMP must have EXECUTE authority on the plan
that is specified in the trace-parameters of the START TRACE keyword.
833
The DB2 subsystem name must be filled in by the user. The DSN RUN
command must specify a plan for which the user has execute authority.
DSN1SDMP dump does not execute the specified plan; the plan is used
only to connect to DB2.
When no plan name is specified on the DSN RUN command, the default
plan name is the program name. When DSN1SDMP is executed without a
plan, DSN generates an error if no DSN1SDMP plan exists for which the
user has execute authority.
Related information
DB2 Diagnosis Guide and Reference
Trace data record format (DB2 Performance Monitoring and Tuning Guide)
834
SELECT function,offset,data-specification
(X00E60100)
ACTION
(action
)
(abend-code)
(1)
(STTRACE
second-trace-spec
(X00E60100)
,action
(abend-code)
AFTER (1)
FOR
(1)
AFTER (integer)
FOR
(integer)
Notes:
1
The options in the second-trace-spec do not have to be specified immediately following the
STTRACE option. However, they can be specified only if the STTRACE option is also specified.
second-trace-spec:
(X00E60100)
ACTION2( action
FILTER(
)
ACE
EB
COMMAND
command
(abend-code)
AFTER2 (1)
FOR2
(1)
AFTER2 (integer)
FOR2
(integer)
SELECT2 function,offset,data-specification
Option descriptions
START TRACE (trace-parameters)
Indicates the start of a DSN1SDMP job. START TRACE is a required keyword
and must be the first keyword that is specified in the SDMPIN input stream.
The trace parameters that you use are those that are described in DB2
Command Reference, except that you cannot use the subsystem recognition
character.
If the START TRACE command in the SDMPIN input stream is not valid, or if
the user is not properly authorized, the IFI (instrumentation facility interface)
Chapter 43. DSN1SDMP
835
returns an error code and START TRACE does not take effect. DSN1SDMP
writes the error message to the SDMPPRNT data set.
Trace Destination: If DB2 trace data is to be written to the SDMPTRAC data set,
the trace destination must be an IFI online performance (OP) buffer. OP buffer
destinations are specified in the DEST keyword of START TRACE. Eight OP buffer
destinations exist, OP1 to OP8. The OPX trace destination assigns the next
available OP buffer. Any record destined for the exclusive internal trace table (RES)
is not eligible to be evaluated. For example, if you start IFCID(0) DEST(RES), this
will not execute DSN1SDMP logic and cannot be acted upon.
|
|
|
The DB2 output text from the START TRACE command is written to SDMPPRNT.
START TRACE and its associated keywords must be specified first. Specify the
remaining selective dump keywords in any order following the START TRACE
command.
SELECT function,offset,data-specification
Specifies selection criteria in addition to those that are specified on the START
TRACE command. SELECT expands the data that is available for selection in a
trace record and allows more specific selection of data in the trace record than
using START TRACE alone. You can specify a maximum of eight SELECT
criteria.
The selection criteria use the concept of the current-record pointer. DB2
initializes the current-record pointer to zero, that is, at the beginning of the
trace record. For this instance of the DSN1SDMP trace, the trace record begins
with the self-defining section. The current-record pointer can be modified by
Px and LN functions, which are described in the list of functions below.
You can specify the selection criteria with the following parameters:
function
Specifies the type of search that is to be performed on the trace record. The
specified value must be two characters. The possible values are:
DR
Specifies a direct comparison of data from the specified offset. The
offset is always calculated from the current-record pointer.
GE
Specifies a comparison of data that is greater than or equal to the value
of the specified offset. The offset is always calculated from the
current-record pointer. The test succeeds if the data from the specified
offset is greater than or equal to data-specification, which you can
specify on the SELECT option.
LE Specifies a comparison of data that is less than or equal to the value of
the specified offset. The offset is always calculated from the
current-record pointer. The test succeeds if the data from the specified
offset is less than or equal to data-specification, which you specify on the
SELECT option.
P1, P2, or P4
Selects the 1-, 2-, or 4-byte field that is located offset bytes past the start
of the record. The function then moves the current-record pointer that
number of bytes into the record. P1, P2, and P4 always start from the
beginning of the record (plus the offset that you specify).
836
Data sections
Product
section
Figure 142. Format of the DB2 trace record at data specification comparison time
837
ABENDTER
ABEND and terminate the agent.
An abend reason code can also be specified on this parameter. The codes
must be in the range X00E60100 to X00E60199. The default value is
X00E60100.
STTRACE
Specifies that a second trace is to be started when a trace record passes the
selection criteria.
If you do not specify action or STTRACE, the record is written and no action is
performed.
AFTER(integer)
Specifies that the ACTION is to be performed after the trace point is reached
integer times.
integer must be between 1 and 32767.
The default value is AFTER(1).
FOR(integer)
Specifies the number of times that the ACTION is to take place when the
specified trace point is reached. After integer times, the trace is stopped, and
DSN1SDMP terminates.
integer must be between 1 and 32767 and includes the first action. If no
SELECT criteria are specified, use an integer greater than 1; the START TRACE
command automatically causes the action to take place one time.
The default value is FOR(1).
ACTION2
Specifies the action to perform when a trace record passes the selection criteria
of the START TRACE, SELECT, and SELECT2 keywords.
Attention: The ACTION2 keyword, like the ACTION keyword, should be
used with extreme caution, because you might damage existing data. Not all
abends are recoverable, even if the ABENDRET parameter is specified. Some
abends might force the DB2 subsystem to terminate, particularly those that
occur during end-of-task or end-of-memory processing due to the agent having
experienced a previous abend.
action(abend-code)
Specifies a particular action to perform. Possible values for action are:
ABENDRET
ABEND and retry the agent.
ABENDTER
ABEND and terminate the agent.
An abend reason code can also be specified on this parameter. The codes
must be in the range X00E60100-00E60199. If no abend code is specified,
X00E60100 is used.
If you do not specify action, the record is written and no action is performed.
FILTER
Specifies that DSN1SDMP is to filter the output of the second trace based on
either an ACE or an EB.
838
(ACE)
Specifies that DSN1SDMP is to include trace records only for the agent
control element (ACE) that is associated with the agent when the first
action is triggered and the second trace is started.
(EB)
Specifies that DSN1SDMP is to include trace records only for the execution
block (EB) that is associated with the agent when the first action is
triggered and the second trace is started.
COMMAND
Indicates that the specified command is to be issued when a trace record
passes the selection criteria for the first trace and a second trace is started. You
can start a second trace by specifying the STTRACE option.
command
Specifies a specific command to be issued.
FOR2(integer)
Specifies the number of times that the ACTION2 is to take place when the
specified second trace point is reached. After integer times, the second trace is
stopped, and DSN1SDMP terminates.
integer must be between 1 and 32767 and includes the first action. If no
SELECT2 criteria are specified, use an integer greater than 1; the STTRACE
option automatically causes the action to take place one time.
The default value is FOR2(1).
AFTER2(integer)
Specifies that the ACTION2 is to be performed after the second trace point is
reached integer times.
integer must be between 1 and 32767.
The default value is AFTER2(1).
SELECT2 function,offset,data-specification
Specifies selection criteria for the second trace. This option functions like the
SELECT option, except that it pertains to the second trace only. You can start a
second trace by specifying the STTRACE option.
Related information
Trace field descriptions (DB2 Performance Monitoring and Tuning Guide)
Assigning buffers
The OPX trace destination assigns the next available OP buffer. You must specify
the OPX destination for all traces that are being recorded to an OPn buffer, thereby
avoiding the possibility of starting a trace to a buffer that has already been
assigned.
If a trace is started to an OPn buffer that has already been assigned, DSN1SDMP
waits indefinitely until the trace is manually stopped. The default for
MONITOR-type traces is the OPX destination (the next available OP buffer). Other
trace types must be explicitly directed to OP destinations via the DEST keyword of
the START TRACE command. DSN1SDMP interrogates the IFCAOPN field after
the START TRACE COMMAND call to determine if the trace was started to an OP
buffer.
839
Trace Destination: If DB2 trace data is to be written to the SDMPTRAC data set,
the trace destination must be an IFI online performance (OP) buffer. OP buffer
destinations are specified in the DEST keyword of START TRACE. Eight OP buffer
destinations exist, OP1 to OP8. The OPX trace destination assigns the next
available OP buffer. Any record destined for the exclusive internal trace table (RES)
is not eligible to be evaluated. For example, if you start IFCID(0) DEST(RES), this
will not execute DSN1SDMP logic and cannot be acted upon.
|
|
|
Trace records are written to the SDMPTRAC data set when the trace destination is
an OP buffer. The instrumentation facilities component (IFC) writes trace records to
the buffer and posts DSN1SDMP to read the buffer when it fills to half of the
buffer size.
You can specify the buffer size on the BUFSIZE keyword of the START TRACE
command. All returned records are written to SDMPTRAC.
If the number of generated trace records requires a larger buffer size than was
specified, you can lose some trace records. If this happens, error message
DSN2724I is issued.
840
If the console operator terminates the original trace by using the STOP TRACE
command, the subsequent STOP TRACE command that is issued by DSN1SDMP
fails.
If the console operator enters a MODIFY TRACE command and processing of this
command completes before the STOP TRACE command is issued by DSN1SDMP,
the modified trace is also terminated.
841
The SELECT option indicates additional criteria for data in the trace record. In this
example, the P4,00 positions the current record pointer to the product section. The
GE, 04,X0005 insures that the IFCID being traced is either an IFCID 53 or 58 and
is not an IFCID4 which is automatically generated via the START TRACE
command. The P4,08 positions the current record pointer to data section 1 of the
IFCID 53 or 58. A direct comparison is then made at decimal offset 74 for SQL code
XFFFFFC78.
|
|
|
|
|
|
|
When a trace record passes the selection criteria of the START TRACE command
and SELECT keywords, DSN1SDMP is to perform the action that is specified by
the ACTION keyword. In this example, the job is to abend and retry with reason
code 00E60188. This action is to take place only once, as indicated by the FOR
option. FOR(1) is the default, and is therefore not required to be explicitly
specified.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//SDMPIN
DD *
START TRACE=A CLASS(32) IFCID(53,58) DEST(OPX)
FOR(1)
AFTER(1)
ACTION(ABENDRET(00E60188))
SELECT
* Position to the prodcut section
P4,00
* Insure QWHSIID = 58 or 53 (not IFCID 4)
GE,04,X'0005'
* Position to the data section 1
P4,08
* Compare SQLCODE in QW0058SQ or QW0053SQ
DR,74,X'FFFFFC78'
/*
Figure 144. Example job that abends and terminates agent on -904 SQL code
842
//*
ABEND AND RETRY AN AGENT WHEN EVENT ID X'0025'
//*
(AGENT ALLOCATION) IS RECORDED BY RMID 20 (SERVICE
//*
CONTROLLER).
//*
//SDMPIN
DD *
* ENSURE ONLY THE TRACE HEADER IS APPENDED WITH THE STANDARD HEADER
* VIA THE TDATA KEYWORD ON START TRACE
START TRACE=P CLASS(3,8) RMID(20) DEST(OPX) TDATA(TRA)
* ABEND AND RETRY THE AGENT WITH THE DEFAULT ABEND CODE (00E60100)
ACTION(ABENDRET)
* SPECIFY THE SELECT CRITERIA FOR RMID.EID
SELECT
* OFFSET TO THE STANDARD HEADER
P4,00
* ADD LENGTH OF STANDARD HEADER TO GET TO TRACE HEADER
LN,00
* LOOK FOR EID 37 AT OFFSET 4 IN THE TRACE HEADER
DR,04,X'0025'
/*
Figure 145. Example job that abends and retries on RMID 20
843
//SDMPIN
DD *
START TRACE=P CLASS(3) RMID(22) DEST(SMF) TDATA(COR,TRA)
AFTER(1)
FOR(1)
SELECT
* POSITION TO HEADERS (QWHS IS ALWAYS FIRST)
P4,00
* CHECK QWHS 01, FOR RMID 16, IFCID 58
DR,02,X'0116003A'
* POSITION TO SECOND SECTION (1ST DATA SECTION)
P4,08
* COMPARE SQLCODE FOR 811
DR,74,X'FFFFFCD5'
ACTION(ABENDRET(00E60188))
/*
Figure 146. Example job that generates a dump on SQL code -811 RMID16 IFCID
Related information
-STOP TRACE (DB2) (DB2 Command Reference)
844
Part 4. Appendixes
845
846
Limit
External-java-routine-name
1305 bytes
|
|
|
|
|
|
|
|
|
128 bytes
Name of an alias, auxiliary table, collection, clone table,
constraint, correlation, cursor (except for DECLARE
CURSOR WITH RETURN or the EXEC SQL utility),
distinct type (both parts of two-part name), function (both
parts of two-part name), host identifier, index, JARs,
parameter, procedure, role, schema, sequence, specific,
statement, storage group, savepoint, SQL condition, SQL
label, SQL parameter, SQL variable, synonym, table,
trigger, view, XML attribute name, XML element name
8 bytes
|
|
Name of a column
30 bytes
30 bytes
8 bytes
Name of a location
16 bytes
8 bytes
Name of package
|
|
Table 152 shows the minimum and maximum limits for numeric values.
Table 152. Numeric limits
Item
Limit
-32768
32767
-2147483648
2147483647
847
Limit
-9223372036854775808
9223372036854775807
About -7.2x1075
About 7.2x1075
About 5.4x10-79
About -5.4x10-79
About -7.2x1075
About 7.2x1075
About 5.4x10-79
About -5.4x10-79
1 - 1031
1031 - 1
31
1
-9.999999999999999x10384
9.999999999999999x10384
1.000000000000000x10-383
-1.000000000000000x10-383
-9.999999999999999999999999999999999x106144.
9.999999999999999999999999999999999x106144.
1.000000000000000000000000000000000x10-6143
-1.000000000000000000000000000000000x10-6143
| Note:
| 1. These are the limits for normal numbers in DECFLOAT. DECFLOAT also contains special values such as NaN
and Infinity that are also valid. DECFLOAT also supports subnormal numbers that are outside of the documented
|
range.
|
Limit
255 bytes
848
255 bytes
4046 bytes for 4 KB pages
8128 bytes for 8 KB pages
16320 bytes for 16 KB pages
32704 bytes for 32 KB pages
|
|
Item
Limit
32704 bytes
1000 bytes
998 bytes
128 levels
Note:
1. The maximum length can be achieved only if the column is the only column in the table. Otherwise, the
maximum length depends on the amount of space remaining on a page.
The following table shows the minimum and maximum limits for datetime values.
Table 154. Datetime limits
Item
Limit
0001-01-01
9999-12-31
00.00.00
24.00.00
0001-01-01-00.00.00.000000
9999-12-31-24.00.00.000000
849
Limit
225
32767
133
64
64
224
850
Limit
32767 bytes
Limited by storage
|
|
|
|
|
4000 bytes
|
|
|
32600 bytes
16000 bytes
3800 bytes
16 nesting levels
2048 bytes
|
|
|
32 bytes
|
|
50 nesting levels
|
|
Note:
1. If the scrollable cursor is read-only, the maximum number is 749 less the number of columns in the ORDER BY
that are not in the select list. If the scrollable cursor is not read-only, the maximum number is 747.
Limit
Limited by the EDM pool size, buffer pool size, and the
amount of storage that is used by each DB2 or
application agent
Appendix A. Limits in DB2 for z/OS
851
Limit
64 GB
248 bytes
4 GB -1 byte
4 GB -1 byte
93
10000
65271
10000
10000
255 for all table spaces except catalog and directory tables
spaces, which have a maximum of 127
2 GB
64 GB
500
11767
852
Description
ADMIN_COMMAND_DB2
ADMIN_COMMAND_DSN
ADMIN_COMMAND_UNIX
ADMIN_DS_BROWSE
ADMIN_DS_DELETE
ADMIN_DS_LIST
853
Description
ADMIN_DS_RENAME
ADMIN_DS_SEARCH
ADMIN_DS_WRIT
ADMIN_INFO_HOST
ADMIN_INFO_SSID
ADMIN_JOB_CANCEL
ADMIN_JOB_FETCH
ADMIN_JOB_QUERY
ADMIN_JOB_SUBMIT
854
Description
ADMIN_TASK_ADD
ADMIN_TASK_REMOVE
ADMIN_UTL_SCHEDULE
ADMIN_UTL_SORT
DSNACCOR
DSNACCOX
DSNACICS
DSNAEXP
DSNAHVPM
DSNAIMS
DSNAIMS2
DSNLEUSR
DSNTBIND
DSNTPSMP
DSNUTILS
855
Description
DSNUTILU
| DSNWSPM
| DSNWZP
|
| GET_CONFIG
|
|
|
|
|
|
|
|
|
| GET_MESSAGE
|
|
| GET_SYSTEM_INFO
|
|
|
|
|
|
|
|
| SQLJ.ALTER_JAVA_PATH
|
|
|
| SQLJ.DB2_INSTALL_JAR
|
| SQLJ.DB2_REMOVE_JAR
|
| SQLJ.DB2_REPLACE_JAR
|
| SQLJ.DB2_UPDATEJARINFO
|
|
| SQLJ.INSTALL_JAR
|
| SQLJ.REMOVE_JAR
|
856
v operating system
v product information
v PTF level of each DB2 module
v the SMP/E APPLY status of the requested SYSMOD
v WLM classification rules that apply to the DB2 workload for
subsystem types DB2 and DDF
Description
|
|
SQLJ.REPLACE_JAR
|
|
WLM_REFRESH
|
|
|
WLM_SET_CLIENT_INFO
|
|
|
|
|
|
Deprecated: XDBDECOMPXML
|
|
|
XSR_ADDSCHEMADOC
|
|
|
|
XSR_COMPLETE
|
|
|
|
XSR_REGISTER
|
|
XSR_REMOVE
Description
|
|
|
|
|
|
DXXMQINSERT
| DXXMQSHRED
|
|
|
|
|
857
Description
| DXXMQINSERTCLOB
|
|
|
|
|
|
|
| DXXMQSHREDCLOB
|
|
|
|
|
|
|
|
| DXXMQINSERTALL
|
|
|
|
|
|
|
| DXXMQSHREDALL
|
|
|
|
|
|
|
|
| DXXMQSHREDALLCLOB
|
|
|
|
|
|
|
|
858
Description
|
|
|
|
|
|
DXXMQINSERTALLCLOB
|
|
| DXXMQGEN
|
|
|
| DXXMQRETRIEVE
|
|
|
|
|
| DXXMQGENCLOB
|
|
|
|
|
| DXXMQRETRIEVECLOB
|
|
|
|
|
|
v constructs XML documents from data that is stored in the DB2 tables that
are specified in a document access definition (DAD) file
v sends the XML documents to an MQ message queue
v constructs XML documents from data that is stored in the DB2 tables that
are specified in an enabled XML collection
v sends the XML documents to an MQ message queue
v constructs XML documents from data that is stored in the DB2 tables that
are specified in a document access definition (DAD) file
v sends the XML documents to an MQ message queue
v constructs XML documents from data that is stored in the DB2 tables that
are specified in an enabled XML collection
v sends the XML documents to an MQ message queue
859
Related reference
DSNACCOX stored procedure on page 895
Related information
Creating DB2-supplied routines (DB2 Installation Guide)
Stored procedures for administration (DB2 Administration Guide)
DSNACICS (DB2 Application Programming and SQL Guide)
The DB2 EXPLAIN stored procedure (DB2 Application Programming and SQL
Guide)
DSNAIMS (DB2 Application Programming and SQL Guide)
DSNAIMS2 (DB2 Administration Guide)
DSNLEUSR (DB2 Administration Guide)
Enabling stored procedures for Java program preparation (DB2 Installation
Guide)
Creating an external SQL procedure by using DSNTPSMP (DB2 Application
Programming and SQL Guide)
GET_CONFIG (DB2 Administration Guide)
GET_MESSAGE (DB2 Administration Guide)
GET_SYSTEM_INFO (DB2 Administration Guide)
SQLJ.ALTER_JAVA_PATH (DB2 Application Programming Guide and Reference
for Java)
SQLJ.DB2_INSTALL_JAR (DB2 Application Programming Guide and Reference
for Java)
Defining Java routines and JAR files to DB2 (DB2 Application Programming
Guide and Reference for Java)
SQLJ.DB2_REPLACE_JAR (DB2 Application Programming Guide and Reference
for Java)
SQLJ.INSTALL_JAR (DB2 Application Programming Guide and Reference for
Java)
SQLJ.REMOVE_JAR (DB2 Application Programming Guide and Reference for
Java)
SQLJ.REPLACE_JAR (DB2 Application Programming Guide and Reference for
Java)
WLM_REFRESH (DB2 Application Programming and SQL Guide)
XDBDECOMPXML (DB2 Application Programming and SQL Guide)
XSR_ADDSCHEMADOC (DB2 Application Programming and SQL Guide)
XSR_COMPLETE (DB2 Application Programming and SQL Guide)
XSR_REGISTER (DB2 Application Programming and SQL Guide)
XSR_REMOVE (DB2 Application Programming and SQL Guide)
Source code for activating DB2-supplied stored procedures
860
DD name
CHECK
DATA
CHECK
INDEX or
CHECK
LOB
COPY
COPYTOCOPY
SYSREC
ignored
ignored
ignored
ignored
SYSDISC
ignored
ignored
ignored
SYSPUNCH
ignored
ignored
ignored
REORG
TABLESPACE
MERGECOPY
REBUILD
INDEX
REORG
INDEX
OLD KEEP
KEEP
ignored
ignored
ignored
NEW
CATLG
CATLG
NEW CATLG
CATLG
ignored
NEW
CATLG
CATLG
ignored
ignored
ignored
NEW
CATLG
CATLG
ignored
ignored
ignored
ignored
ignored
ignored
NEW
CATLG
CATLG
NEW CATLG
CATLG
LOAD
UNLOAD
861
Table 159. Data dispositions for dynamically allocated data sets (continued)
DD name
CHECK
DATA
CHECK
INDEX or
CHECK
LOB
SYSCOPY
ignored
ignored
NEW
CATLG
CATLG
ignored
SYSCOPY2
ignored
ignored
NEW
CATLG
CATLG
SYSRCPY1
ignored
ignored
SYSRCPY2
ignored
SYSUT1
REORG
TABLESPACE
LOAD
MERGECOPY
REBUILD
INDEX
REORG
INDEX
NEW
CATLG
CATLG
NEW
CATLG
CATLG
ignored
ignored
NEW
CATLG
CATLG
ignored
NEW
CATLG
CATLG
NEW
CATLG
CATLG
NEW
CATLG
CATLG
ignored
ignored
NEW
CATLG
CATLG
ignored
NEW
CATLG
CATLG
NEW
CATLG
CATLG
NEW
CATLG
CATLG
NEW
CATLG
CATLG
ignored
ignored
NEW
CATLG
CATLG
ignored
ignored
NEW
CATLG
CATLG
NEW
CATLG
CATLG
NEW
CATLG
CATLG
NEW
CATLG
CATLG
ignored
ignored
NEW
CATLG
CATLG
ignored
NEW
DELETE
CATLG
NEW
DELETE
CATLG
ignored
ignored
NEW
DELETE
CATLG
ignored
NEW
DELETE
CATLG
NEW
CATLG
CATLG
NEW
DELETE
CATLG
ignored
SORTOUT
NEW
DELETE
CATLG
ignored
ignored
ignored
NEW
DELETE
CATLG
ignored
ignored
ignored
NEW
DELETE
CATLG
ignored
SYSMAP
ignored
ignored
ignored
ignored
NEW
CATLG
CATLG
ignored
ignored
ignored
ignored
ignored
SYSERR
NEW
CATLG
CATLG
ignored
ignored
ignored
NEW
CATLG
CATLG
ignored
ignored
ignored
ignored
ignored
FILTER
ignored
ignored
NEW
DELETE
CATLG
ignored
ignored
ignored
ignored
ignored
ignored
ignored
COPY
COPYTOCOPY
UNLOAD
If the DSNUTILS stored procedure restarts a current utility, refer to Table 160 for
information about the default data dispositions that are specified for
dynamically-allocated data sets on RESTART. This table lists the DD name that is
used to identify the data set and the default dispositions for the data set by utility.
Table 160. Data dispositions for dynamically allocated data sets on RESTART
DD name
CHECK
DATA
CHECK
INDEX or
CHECK
LOB
COPY
COPYTOCOPY
SYSREC
ignored
ignored
ignored
ignored
SYSDISC
ignored
ignored
ignored
SYSPUNCH
ignored
ignored
SYSCOPY
ignored
SYSCOPY2
REORG
TABLESPACE
MERGECOPY
REBUILD
INDEX
REORG
INDEX
OLD
KEEP
KEEP
ignored
ignored
ignored
MOD
CATLG
CATLG
MOD CATLG
CATLG
ignored
MOD
CATLG
CATLG
ignored
ignored
ignored
MOD
CATLG
CATLG
ignored
ignored
ignored
ignored
ignored
ignored
ignored
MOD
CATLG
CATLG
MOD CATLG
CATLG
ignored
MOD
CATLG
CATLG
ignored
MOD
CATLG
CATLG
MOD
CATLG
CATLG
ignored
ignored
MOD
CATLG
CATLG
ignored
ignored
ignored
MOD
CATLG
CATLG
MOD
CATLG
CATLG
MOD
CATLG
CATLG
MOD
CATLG
CATLG
ignored
ignored
MOD
CATLG
CATLG
ignored
SYSRCPY1
ignored
ignored
MOD
CATLG
CATLG
MOD
CATLG
CATLG
MOD
CATLG
CATLG
MOD
CATLG
CATLG
ignored
ignored
MOD
CATLG
CATLG
ignored
SYSRCPY2
ignored
ignored
MOD
CATLG
CATLG
MOD
CATLG
CATLG
MOD
CATLG
CATLG
MOD
CATLG
CATLG
ignored
ignored
MOD
CATLG
CATLG
ignored
862
LOAD
UNLOAD
Table 160. Data dispositions for dynamically allocated data sets on RESTART (continued)
CHECK
DATA
CHECK
INDEX or
CHECK
LOB
COPY
COPYTOCOPY
SYSUT1
MOD
DELETE
CATLG
MOD
DELETE
CATLG
ignored
ignored
SORTOUT
MOD
DELETE
CATLG
ignored
ignored
SYSMAP
ignored
ignored
SYSERR
MOD
CATLG
CATLG
FILTER
ignored
DD name
MERGECOPY
REBUILD
INDEX
REORG
INDEX
REORG
TABLESPACE
MOD
DELETE
CATLG
ignored
MOD
DELETE
CATLG
MOD
CATLG
CATLG
MOD
DELETE
CATLG
ignored
ignored
MOD
DELETE
CATLG
ignored
ignored
ignored
MOD
DELETE
CATLG
ignored
ignored
ignored
MOD
CATLG
CATLG
ignored
ignored
ignored
ignored
ignored
ignored
ignored
ignored
MOD
CATLG
CATLG
ignored
ignored
ignored
ignored
ignored
ignored
MOD
DELETE
CATLG
ignored
ignored
ignored
ignored
ignored
ignored
ignored
LOAD
UNLOAD
CALL DSNUTILS (
utility-id,restart,utstmt,retcode , utility-name
863
CURRENT
Restarts the utility at the last commit point.
PHASE
Restarts the utility at the beginning of the currently stopped phase. Use the
DISPLAY UTILITY to determine the currently stopped phase.
PREVIEW
Executes in PREVIEW mode the utility control statements that follow.
While in PREVIEW mode, DB2 parses all utility control statements for
syntax errors, but normal utility execution does not take place. If the
syntax is valid, DB2 expands all LISTDEF lists and TEMPLATE data set
name expressions that appear in SYSIN and prints the results to the
SYSPRINT data set. DB2 evaluates and expands all LISTDEF definitions
into an actual list of table spaces or index spaces. DB2 also evaluates
TEMPLATE data set name expressions into actual data set names through
variable substitution. DB2 also expands lists from the SYSLISTD DD and
TEMPLATE data set name expressions from the SYSTEMPL DD that is
referenced by a utility invocation.
Absence of the PREVIEW keyword turns off preview processing with one
exception. The absence of this keyword does not override the PREVIEW
JCL parameter which, if specified, remains in effect for the entire job step.
This option is identical to the PREVIEW JCL parameter.
utstmt
Specifies the utility control statements.
This is an input parameter of type VARCHAR(32704) in EBCDIC.
retcode
Specifies the utility highest return code.
This is an output parameter of type INTEGER.
utility-name
Specifies the utility that you want to invoke.
This is an input parameter of type VARCHAR(20) in EBCDIC.
Because DSNUTILS allows only a single utility here, dynamic support of data
set allocation is limited. Specify only a single utility that requires data set
allocation in the utstmt parameter.
Select the utility name from the following list:
ANY1
CHECK DATA
CHECK INDEX
CHECK LOB
COPY
COPYTOCOPY
DIAGNOSE
LOAD
MERGECOPY
MODIFY RECOVERY
1. Use ANY to indicate that TEMPLATE dynamic allocation is to be used. This value suppresses the dynamic allocation that is
normally performed by DSNUTILS.
864
MODIFY STATISTICS
QUIESCE
REBUILD INDEX
RECOVER
REORG INDEX
REORG LOB
REORG TABLESPACE
REPAIR
REPORT RECOVERY
REPORT TABLESPACESET
RUNSTATS INDEX
RUNSTATS TABLESPACE
STOSPACE
UNLOAD
Recommendation: Invoke DSNUTILS with a utility-name of ANY and omit all
of the xxxdsn, xxxdevt, and xxxspace parameters. Use TEMPLATE statements
to allocate the data sets.
recdsn
Specifies the cataloged data set name that is required by LOAD for input, or
by REORG TABLESPACE as the unload data set. recdsn is required for LOAD.
It is also required for REORG TABLESPACE unless you also specified
NOSYSREC or SHRLEVEL CHANGE. If you specify recdsn, the data set is
allocated to the SYSREC DD name.
This is an input parameter of type VARCHAR(54) in EBCDIC.
If you specified the INDDN parameter for LOAD, the specified ddname value
must be SYSREC.
If you specify the UNLDDN parameter for REORG TABLESPACE, the
specified ddname value must be SYSREC.
recdevt
Specifies a unit address, a generic device type, or a user-assigned group name
for a device on which the recdsn data set resides.
This is an input parameter of type CHAR(8) in EBCDIC.
recspace
Specifies the number of cylinders to use as the primary space allocation for the
recdsn data set. The secondary space allocation is 10% of the primary space
allocation.
This is an input parameter of type SMALLINT.
discdsn
Specifies the cataloged data set name that is used by LOAD as a discard data
set to hold records not loaded, and by REORG TABLESPACE as a discard data
set to hold records that are not reloaded. If you specify discdsn, the data set is
allocated to the SYSDISC DD name.
This is an input parameter of type VARCHAR(54) in EBCDIC.
If you specify the DISCARDDN parameter for LOAD or REORG
TABLESPACE, the specified ddname value must be SYSDISC.
865
discdevt
Specifies a unit address, a generic device type, or a user-assigned group name
for a device on which the discdsn data set resides.
This is an input parameter of type CHAR(8) in EBCDIC.
discspace
Specifies the number of cylinders to use as the primary space allocation for the
discdsn data set. The secondary space allocation is 10% of the primary space
allocation.
This is an input parameter of type SMALLINT.
pnchdsn
Specifies the cataloged data set name that REORG TABLESPACE UNLOAD
EXTERNAL or REORG TABLESPACE DISCARD uses to hold the generated
LOAD utility control statements. If you specify a value for pnchdsn, the data set
is allocated to the SYSPUNCH DD name.
This is an input parameter of type VARCHAR(54) in EBCDIC.
If you specify the PUNCHDDN parameter for REORG TABLESPACE, the
specified ddname value must be SYSPUNCH.
pnchdevt
Specifies a unit address, a generic device type, or a user-assigned group name
for a device on which the pnchdsn data set resides.
This is an input parameter of type CHAR(8) in EBCDIC.
pnchspace
Specifies the number of cylinders to use as the primary space allocation for the
pnchdsn data set. The secondary space allocation is 10% of the primary space
allocation.
This is an input parameter of type SMALLINT.
copydsn1
Specifies the name of the required target (output) data set, which is needed
when you specify the COPY, COPYTOCOPY, or MERGECOPY utilities. It is
optional for LOAD and REORG TABLESPACE. If you specify copydsn1, the
data set is allocated to the SYSCOPY DD name.
This is an input parameter of type VARCHAR(54) in EBCDIC.
If you specify the COPYDDN parameter for COPY, COPYTOCOPY,
MERGECOPY, LOAD, or REORG TABLESPACE, the specified ddname1 value
must be SYSCOPY.
copydevt1
Specifies a unit address, a generic device type, or a user-assigned group name
for a device on which the copydsn1 data set resides.
This is an input parameter of type CHAR(8) in EBCDIC.
copyspace1
Specifies the number of cylinders to use as the primary space allocation for the
copydsn1 data set. The secondary space allocation is 10% of the primary space
allocation.
This is an input parameter of type SMALLINT.
copydsn2
Specifies the name of the cataloged data set that is used as a target (output)
data set for the backup copy. It is optional for COPY, COPYTOCOPY,
866
867
rcpyspace2
Specifies the number of cylinders to use as the primary space allocation for the
rcpydsn2 data set. The secondary space allocation is 10% of the primary space
allocation
This is an input parameter of type SMALLINT.
workdsn1
Specifies the name of the cataloged data set that is required as a work data set
for sort input and output. It is required for CHECK DATA, CHECK INDEX
and REORG INDEX. It is also required for LOAD and REORG TABLESPACE
unless you also specify the SORTKEYS keyword. It is optional for REBUILD
INDEX. If you specify workdsn1, the data set is allocated to the SYSUT1 DD
name.
This is an input parameter of type VARCHAR(54) in EBCDIC.
If you specify the WORKDDN parameter for CHECK DATA, CHECK INDEX,
LOAD, REORG INDEX, REORG TABLESPACE, or REBUILD INDEX, the
specified ddname value must be SYSUT1.
workdevt1
Specifies a unit address, a generic device type, or a user-assigned group name
for a device on which the workdsn1 data set resides.
This is an input parameter of type CHAR(8) in EBCDIC.
workspace1
Specifies the number of cylinders to use as the primary space allocation for the
workdsn1 data set. The secondary space allocation is 10% of the primary space
allocation.
This is an input parameter of type SMALLINT.
workdsn2
Specifies the name of the cataloged data set that is required as a work data set
for sort input and output. It is required for CHECK DATA. It is also required if
you use REORG INDEX to reorganize non-unique type 1 indexes. It is required
for LOAD or REORG TABLESPACE unless you also specify the SORTKEYS
keyword. If you specify workdsn2, the data set is allocated to the SORTOUT
DD name.
This is an input parameter of type VARCHAR(54) in EBCDIC.
If you specify the WORKDDN parameter for CHECK DATA, LOAD, REORG
INDEX, or REORG TABLESPACE, the specified ddname value must be
SORTOUT.
workdevt2
Specifies a unit address, a generic device type, or a user-assigned group name
for a device on which the workdsn2 data set resides.
This is an input parameter of type CHAR(8) in EBCDIC.
workspace2
Specifies the number of cylinders to use as the primary space allocation for the
workdsn2 data set. The secondary space allocation is 10% of the primary space
allocation.
This is an input parameter of type SMALLINT.
mapdsn
Specifies the name of the cataloged data set that is required as a work data set
868
869
|
|
|
|
When restarting a utility with DSNUTILS, use the TEMPLATE utility and specify
the utility name ANY to dynamically allocate datasets. When TEMPLATE is used,
the utility will attempt to close and deallocate the dataset. However, under some
circumstances, the utility is unable to deallocate the dataset.
|
|
|
|
|
When a utility is unable to deallocate the dataset, we recommend that you use the
TERM UTIL command to terminate the failing utility, then issue one of the
following commands.
v VARY, such as VARY WLM,APPLENV=xxx,REFRESH
v WLM_REFRESH
|
|
|
|
|
|
However, if you plan to use the RESTART UTILITY when there is a failure, the
TERM UTIL will terminate the utility and the WLM REFRESH may cause datasets
needed for restart to be deleted. To ensure that you can restart, specify DISP of
NEW,CATLG,CATLG on your template, and do not terminate the utility when you
do the WLM REFRESH. You will need to clean up the allocated datasets manually
after the utility is finished running.
870
DSNUTILS output
DB2 creates the result set according to the DECLARE statement that is shown
under Example of declaring a cursor to select from SYSPRINT.
Output from a successful execution of the DSNTEJ6U sample job or an equivalent
job lists the specified parameters followed by the messages that are generated by
the DB2 DIAGNOSE DISPLAY MEPL utility.
If DSNUTILB abends, the abend codes are returned as DSNUTILS return codes.
871
The BIND PACKAGE statement for the DSNUTILU stored procedure determines
the character set of the resulting utility SYSPRINT output that is placed in the
SYSIBM.SYSPRINT table. If ENCODING(EBCDIC) is specified, the SYSPRINT
contents are in EBCDIC. If ENCODING(UNICODE) is specified, the SYSPRINT
contents are in Unicode. The default install job, DSNTIJSG, is shipped with
ENCODING(EBCDIC).
872
873
//*
//*************************************************************
//DSNWLM
PROC RGN=0K,APPLENV=WLMENV1,DB2SSN=DSN
//IEFPROC EXEC PGM=DSNX9WLM,REGION=&RGN,TIME=NOLIMIT,
//
PARM='&DB2SSN,1,&APPLENV'
//STEPLIB DD DISP=SHR,DSN=CEE.V!R!M!.SCEERUN
//
DD DISP=SHR,DSN=DSN!!0.SDSNLOAD
//UTPRINT DD SYSOUT=*
//RNPRIN01 DD SYSOUT=*//DSSPRINT DD SYSOUT=*
//SYSIN
DD UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//SYSPRINT DD UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
|
|
|
|
|
When a utility is unable to deallocate the dataset, we recommend that you use the
TERM UTIL command to terminate the failing utility, then issue one of the
following commands.
|
|
|
|
|
|
However, if you plan to use the RESTART UTILITY when there is a failure, the
TERM UTIL will terminate the utility and the WLM REFRESH may cause datasets
needed for restart to be deleted. To ensure that you can restart, specify DISP of
NEW,CATLG,CATLG on your template, and do not terminate the utility when you
do the WLM REFRESH. You will need to clean up the allocated datasets manually
after the utility is finished running.
DSNUTILU output
DB2 creates the result set according to the DECLARE statement shown on Example
of declaring a cursor to select from SYSPRINT
Output from a successful execution of the DSNTEJ6R sample job or an equivalent
job lists the specified parameters, followed by the messages that are generated by
the DB2 DIAGNOSE DISPLAY MEPL utility.
|
|
|
|
|
|
PSPI
874
|
|
|
|
|
v Recommends when you should reorganize, image copy, or update statistics for
table spaces or index spaces
v Indicates when a data set has exceeded a specified threshold for the number of
extents that it occupies.
v Indicates whether objects are in a restricted state
DSNACCOR uses data from the SYSIBM.SYSTABLESPACESTATS and
SYSIBM.SYSSYSINDEXSPACESTATS real-time statistics tables to make its
recommendations. DSNACCOR provides its recommendations in a result set.
DSNACCOR uses the set of criteria that are shown in DSNACCOR formulas for
recommending actions on page 884 to evaluate table spaces and index spaces. By
default, DSNACCOR evaluates all table spaces and index spaces in the subsystem
that have entries in the real-time statistics tables. However, you can override this
default through input parameters.
Important information about DSNACCOR recommendations:
v DSNACCOR makes recommendations based on general formulas that require
input from the user about the maintenance policies for a subsystem. These
recommendations might not be accurate for every installation.
v If the real-time statistics tables contain information for only a small percentage
of your DB2 subsystem, the recommendations that DSNACCOR makes might
not be accurate for the entire subsystem.
v Before you perform any action that DSNACCOR recommends, ensure that the
object for which DSNACCOR makes the recommendation is available, and that
the recommended action can be performed on that object. For example, before
you can perform an image copy on an index, the index must have the COPY
YES attribute.
Environment
DSNACCOR must run in a WLM-established stored procedure address space.
You should bind the package for DSNACCOR with isolation UR to avoid lock
contention. You can find the installation steps for DSNACCOR in job DSNTIJSG.
Authorization required
To execute the CALL DSNACCOR statement, the owner of the package or plan
that contains the CALL statement must have one or more of the following
privileges on each package that the stored procedure uses:
v
v
v
v
The owner of the package or plan that contains the CALL statement must also
have:
v SELECT authority on the real-time statistics tables
v Select authority on catalog tables
v The DISPLAY system privilege
875
Syntax diagram
The following syntax diagram shows the CALL statement for invoking
DSNACCOR. Because the linkage convention for DSNACCOR is GENERAL WITH
NULLS, if you pass parameters in host variables, you need to include a null
indicator with every host variable. Null indicators for input host variables must be
initialized before you execute the CALL statement.
CALL DSNACCOR (
CatlgSchema
NULL
CRUpdatedPagesPct
NULL
ICRChangesPct
NULL
RRTDisorgLOBPct
NULL
RRIAppendInsertPct
NULL
RRINumLevelsLimit
NULL
SRIInsDelUpdPct
NULL
QueryType
NULL
ObjectType
NULL
LocalSchema
NULL
ChkLvl
NULL
CRChangesPct
NULL
CRIndexSize
NULL
,
SRTInsDelUpdPct
NULL
Restricted
NULL
,
SRTInsDelUpdAbs
NULL
RRILeafLimit
NULL
SRTMassDelLimit
NULL
ExtentLimit
NULL
RRIInsertDeletePct
NULL
RRIMassDelLimit
NULL
SRIMassDelLimit
NULL
ICRUpdatedPagesPct
NULL
RRTUnclustInsPct
NULL
RRTIndRefLimit
NULL
StatsSchema
NULL
CRDaySncLastCopy
NULL
RRIPseudoDeletePct
NULL
SRIInsDelUpdAbs
NULL
ICType
NULL
Criteria
NULL
RRTInsDelUpdPct
NULL
RRTMassDelLimit
NULL
Option descriptions
In the following option descriptions, the default value for an input parameter is
the value that DSNACCOR uses if you specify a null value.
QueryType
Specifies the types of actions that DSNACCOR recommends. This field
contains one or more of the following values. Each value is enclosed in single
quotation marks and separated from other values by a space.
ALL
876
RESTRICT
Indicates which objects are in a restricted state.
QueryType is an input parameter of type VARCHAR(40). The default is ALL.
ObjectType
Specifies the types of objects for which DSNACCOR recommends actions:
ALL
TS
IX
Incremental image copy. This value is valid for table spaces only.
For objects that are listed in the recommendations result set, check the
SYSTABLESPACE or SYSINDEXES catalog tables to ensure that those
objects have not been deleted. If value 16 is not also chosen, exclude
rows for the deleted objects from the recommendations result set.
DSNACCOR excludes objects from the recommendations result set if
those objects are not in the SYSTABLESPACE or SYSINDEXES catalog
tables.
|
|
|
For index spaces that are listed in the recommendations result set,
check the SYSTABLES, SYSTABLESPACE, and SYSINDEXES catalog
tables to determine the name of the table space that is associated with
each index space.
Appendix B. DB2-supplied stored procedures
877
Choosing this value causes DSNACCOR to also check for rows in the
recommendations result set for objects that have been deleted but have
entries in the real-time statistics tables (value 1). This means that if
value 16 is not also chosen, rows for deleted objects are excluded from
the recommendations result set.
4
16
For objects that are listed in the recommendations result set, check the
SYSTABLESPACE or SYSINDEXES catalog tables to ensure that those
objects have not been deleted (value 1). In result set rows for deleted
objects, specify the word ORPHANED in the OBJECTSTATUS column.
32
64
878
v The total number of distinct updated pages, divided by the total number of
preformatted pages (expressed as a percentage) is greater than
CRUpdatedPagesPct.
v The number of active pages in the index space or partition is greater than
CRIndexSize. See items 2 and 3 in Figure 149 on page 885.
CRUpdatedPagesPct is an input parameter of type INTEGER. The default is 20.
CRChangesPct
Specifies a criterion for recommending a full image copy on a table space or
index space. If the following condition is true for a table space, DSNACCOR
recommends an image copy:
The total number of insert, update, and delete operations since the last
image copy, divided by the total number of rows or LOBs in a table space
or partition (expressed as a percentage) is greater than CRChangesPct.
See item 3 in Figure 148 on page 884. If both of the following conditions are
true for an index table space, DSNACCOR recommends an image copy:
v The total number of insert and delete operations since the last image copy,
divided by the total number of entries in the index space or partition
(expressed as a percentage) is greater than CRChangesPct.
v The number of active pages in the index space or partition is greater than
CRIndexSize.
See items 2 and 4 in Figure 149 on page 885. CRChangesPct is an input
parameter of type INTEGER. The default is 10.
CRDaySncLastCopy
Specifies a criterion for recommending a full image copy on a table space or
index space. If the number of days since the last image copy is greater than
this value, DSNACCOR recommends an image copy. (See item 1 in Figure 148
on page 884 and item 1 in Figure 149 on page 885.) CRDaySncLastCopy is an
input parameter of type INTEGER. The default is 7.
ICRUpdatedPagesPct
Specifies a criterion for recommending an incremental image copy on a table
space. If the following condition is true, DSNACCOR recommends an
incremental image copy:
The number of distinct pages that were updated since the last image copy,
divided by the total number of active pages in the table space or partition
(expressed as a percentage) is greater than CRUpdatedPagesPct.
(See item 1 in Figure 150 on page 885.) ICRUpdatedPagesPct is an input
parameter of type INTEGER. The default is 1.
ICRChangesPct
Specifies a criterion for recommending an incremental image copy on a table
space. If the following condition is true, DSNACCOR recommends an
incremental image copy:
The ratio of the number of insert, update, or delete operations since the last
image copy, to the total number of rows or LOBs in a table space or
partition (expressed as a percentage) is greater than ICRChangesPct.
(See item 2 in Figure 150 on page 885.) ICRChangesPct is an input parameter of
type INTEGER. The default is 1.
CRIndexSize
Specifies, when combined with CRUpdatedPagesPct or CRChangesPct, a criterion
879
for recommending a full image copy on an index space. (See items 2, 3, and 4
in Figure 149 on page 885.) CRIndexSize is an input parameter of type
INTEGER. The default is 50.
RRTInsDelUpdPct
Specifies a criterion for recommending that the REORG utility is to be run on a
table space. If the following condition is true, DSNACCOR recommends
running REORG:
The sum of insert, update, and delete operations since the last REORG,
divided by the total number of rows or LOBs in the table space or partition
(expressed as a percentage) is greater than RRTInsDelUpdPct
(See item 1 in Figure 151 on page 885.) RRTInsDelUpdPct is an input parameter
of type INTEGER. The default is 20.
RRTUnclustInsPct
Specifies a criterion for recommending that the REORG utility is to be run on a
table space. If the following condition is true, DSNACCOR recommends
running REORG:
The number of unclustered insert operations, divided by the total number
of rows or LOBs in the table space or partition (expressed as a percentage)
is greater than RRTUnclustInsPct.
(See item 2 in Figure 151 on page 885.) RRTUnclustInsPct is an input parameter
of type INTEGER. The default is 10.
RRTDisorgLOBPct
Specifies a criterion for recommending that the REORG utility is to be run on a
table space. If the following condition is true, DSNACCOR recommends
running REORG:
The number of imperfectly chunked LOBs, divided by the total number of
rows or LOBs in the table space or partition (expressed as a percentage) is
greater than RRTDisorgLOBPct.
(See item 3 in Figure 151 on page 885.) RRTDisorgLOBPct is an input parameter
of type INTEGER. The default is 10.
RRTMassDelLimit
Specifies a criterion for recommending that the REORG utility is to be run on a
table space. If one of the following values is greater than RRTMassDelLimit,
DSNACCOR recommends running REORG:
v The number of mass deletes from a segmented or LOB table space since the
last REORG or LOAD REPLACE
v The number of dropped tables from a nonsegmented table space since the
last REORG or LOAD REPLACE
(See item 5 in Figure 151 on page 885.) RRTMassDelLimit is an input parameter
of type INTEGER. The default is 0.
RRTIndRefLimit
Specifies a criterion for recommending that the REORG utility is to be run on a
table space. If the following value is greater than RRTIndRefLimit, DSNACCOR
recommends running REORG:
The total number of overflow records that were created since the last
REORG or LOAD REPLACE, divided by the total number of rows or LOBs
in the table space or partition (expressed as a percentage)
(See item 4 in Figure 151 on page 885.) RRTIndRefLimit is an input parameter of
type INTEGER. The default is 10.
880
RRIInsertDeletePct
Specifies a criterion for recommending that the REORG utility is to be run on
an index space. If the following value is greater than RRIInsertDeletePct,
DSNACCOR recommends running REORG:
The sum of the number of index entries that were inserted and deleted
since the last REORG, divided by the total number of index entries in the
index space or partition (expressed as a percentage)
(See item 1 in Figure 152 on page 886.) This is an input parameter of type
INTEGER. The default is 20.
RRIAppendInsertPct
Specifies a criterion for recommending that the REORG utility is to be run on
an index space. If the following value is greater than RRIAppendInsertPct,
DSNACCOR recommends running REORG:
The number of index entries that were inserted since the last REORG,
REBUILD INDEX, or LOAD REPLACE with a key value greater than the
maximum key value in the index space or partition, divided by the number
of index entries in the index space or partition (expressed as a percentage)
(See item 2 in Figure 152 on page 886.) RRIInsertDeletePct is an input parameter
of type INTEGER. The default is 10.
RRIPseudoDeletePct
Specifies a criterion for recommending that the REORG utility is to be run on
an index space. If the following value is greater than RRIPseudoDeletePct,
DSNACCOR recommends running REORG:
The number of index entries that were pseudo-deleted since the last
REORG, REBUILD INDEX, or LOAD REPLACE, divided by the number of
index entries in the index space or partition (expressed as a percentage)
(See item 3 in Figure 152 on page 886.) RRIPseudoDeletePct is an input
parameter of type INTEGER. The default is 10.
RRIMassDelLimit
Specifies a criterion for recommending that the REORG utility is to be run on
an index space. If the number of mass deletes from an index space or partition
since the last REORG, REBUILD, or LOAD REPLACE is greater than this
value, DSNACCOR recommends running REORG.
(See item 4 in Figure 152 on page 886.) RRIMassDelLimit is an input parameter
of type INTEGER. The default is 0.
RRILeafLimit
Specifies a criterion for recommending that the REORG utility is to be run on
an index space. If the following value is greater than RRILeafLimit,
DSNACCOR recommends running REORG:
The number of index page splits that occurred since the last REORG,
REBUILD INDEX, or LOAD REPLACE that resulted in a large separation
between the parts of the original page, divided by the total number of
active pages in the index space or partition (expressed as a percentage)
(See item 5 in Figure 152 on page 886.) RRILeafLimit is an input parameter of
type INTEGER. The default is 10.
RRINumLevelsLimit
Specifies a criterion for recommending that the REORG utility is to be run on
an index space. If the following value is greater than RRINumLevelsLimit,
DSNACCOR recommends running REORG:
881
The number of levels in the index tree that were added or removed since
the last REORG, REBUILD INDEX, or LOAD REPLACE
(See item 6 in Figure 152 on page 886.) RRINumLevelsLimit is an input
parameter of type INTEGER. The default is 0.
SRTInsDelUpdPct
Specifies, when combined with SRTInsDelUpdAbs, a criterion for
recommending that the RUNSTATS utility is to be run on a table space. If both
of the following conditions are true, DSNACCOR recommends running
RUNSTATS:
v The number of insert, update, or delete operations since the last RUNSTATS
on a table space or partition, divided by the total number of rows or LOBs
in table space or partition (expressed as a percentage) is greater than
SRTInsDelUpdPct.
v The sum of the number of inserted and deleted index entries since the last
RUNSTATS on an index space or partition is greater than SRTInsDelUpdAbs.
(See items 1 and 2 in Figure 153 on page 886.) SRTInsDelUpdPct is an input
parameter of type INTEGER. The default is 20.
SRTInsDelUpdAbs
Specifies, when combined with SRTInsDelUpdPct, a criterion for recommending
that the RUNSTATS utility is to be run on a table space. If both of the
following conditions are true, DSNACCOR recommends running RUNSTATS:
v The number of insert, update, and delete operations since the last
RUNSTATS on a table space or partition, divided by the total number of
rows or LOBs in table space or partition (expressed as a percentage) is
greater than SRTInsDelUpdPct.
v The sum of the number of inserted and deleted index entries since the last
RUNSTATS on an index space or partition is greater than SRTInsDelUpdAbs.
(See items 1 and 2 in Figure 153 on page 886.) SRTInsDelUpdAbs is an input
parameter of type INTEGER. The default is 0.
SRTMassDelLimit
Specifies a criterion for recommending that the RUNSTATS utility is to be run
on a table space. If the following condition is true, DSNACCOR recommends
running RUNSTATS:
v The number of mass deletes from a table space or partition since the last
REORG or LOAD REPLACE is greater than SRTMassDelLimit.
(See item 3 in Figure 153 on page 886.) SRTMassDelLimit is an input parameter
of type INTEGER. The default is 0.
SRIInsDelPct
Specifies, when combined with SRIInsDelAbs, a criterion for recommending
that the RUNSTATS utility is to be run on an index space. If both of the
following conditions are true, DSNACCOR recommends running RUNSTATS:
v The number of inserted and deleted index entries since the last RUNSTATS
on an index space or partition, divided by the total number of index entries
in the index space or partition (expressed as a percentage) is greater than
SRIInsDelUpdPct.
v The sum of the number of inserted and deleted index entries since the last
RUNSTATS on an index space or partition is greater than SRIInsDelUpdAbs.
(See items 1 and 2 in Figure 154 on page 886.) SRIInsDelPct is an input
parameter of type INTEGER. The default is 20.
882
SRIInsDelAbs
Specifies, when combined with SRIInsDelPct, specifies a criterion for
recommending that the RUNSTATS utility is to be run on an index space. If the
following condition is true, DSNACCOR recommends running RUNSTATS:
v The number of inserted and deleted index entries since the last RUNSTATS
on an index space or partition, divided by the total number of index entries
in the index space or partition (expressed as a percentage) is greater than
SRIInsDelUpdPct.
v The sum of the number of inserted and deleted index entries since the last
RUNSTATS on an index space or partition is greater than SRIInsDelUpdAbs,
(See items 1 and 2 in Figure 154 on page 886.) SRIInsDelAbs is an input
parameter of type INTEGER. The default is 0.
SRIMassDelLimit
Specifies a criterion for recommending that the RUNSTATS utility is to be run
on an index space. If the number of mass deletes from an index space or
partition since the last REORG, REBUILD INDEX, or LOAD REPLACE is
greater than this value, DSNACCOR recommends running RUNSTATS.
(See item 3 in Figure 154 on page 886.) SRIMassDelLimit is an input parameter
of type INTEGER. The default is 0.
|
|
|
|
|
|
|
|
|
ExtentLimit
Specifies a criterion for recommending that the REORG utility is to be run on a
table space or index space. Also specifies that DSNACCOR is to warn the user
that the table space or index space has used too many extents. DSNACCOR
recommends running REORG, and altering data set allocations if the following
condition is true:
v The number of physical extents in the index space, table space, or partition
is greater than ExtentLimit.
(See Figure 155 on page 886.) ExtentLimit is an input parameter of type
INTEGER. The default is 50.
LastStatement
When DSNACCOR returns a severe error (return code 12), this field contains
the SQL statement that was executing when the error occurred. LastStatement is
an output parameter of type VARCHAR(8012).
ReturnCode
The return code from DSNACCOR execution. Possible values are:
0
12
14
883
16
Figure 148. DSNACCOR formula for recommending a full image copy on a table space
884
The figure below shows the formula that DSNACCOR uses to recommend a full
image copy on an index space.
Figure 149. DSNACCOR formula for recommending a full image copy on an index space
The figure below shows the formula that DSNACCOR uses to recommend an
incremental image copy on a table space.
Figure 150. DSNACCOR formula for recommending an incremental image copy on a table space
The figure below shows the formula that DSNACCOR uses to recommend a
REORG on a table space. If the table space is a LOB table space, and CHCKLVL=1,
the formula does not include EXTENTS>ExtentLimit.
The figure below shows the formula that DSNACCOR uses to recommend a
REORG on an index space.
885
1
2
3
4
5
6
7
The figure below shows the formula that DSNACCOR uses to recommend
RUNSTATS on a table space.
The figure below shows the formula that DSNACCOR uses to recommend
RUNSTATS on an index space.
The figure below shows the formula that DSNACCOR uses to that too many index
space or table space extents have been used.
EXTENTS>ExtentLimit
Figure 155. DSNACCOR formula for warning that too many data set extents for a table space or index space are used
886
To create the exception table, execute a CREATE TABLE statement similar to the
following one. You can include other columns in the exception table, but you must
include at least the columns that are shown.
CREATE TABLE DSNACC.EXCEPT_TBL
(DBNAME CHAR(8) NOT NULL,
NAME CHAR(8) NOT NULL,
QUERYTYPE CHAR(40))
CCSID EBCDIC;
Example
The following COBOL example that shows variable declarations and an SQL CALL
for obtaining recommendations for objects in databases DSN8D91A and
DSN8D91L. This example also outlines the steps that you need to perform to
retrieve the two result sets that DSNACCOR returns.
WORKING-STORAGE SECTION.
.
.
.
***********************
* DSNACCOR PARAMETERS *
***********************
Appendix B. DB2-supplied stored procedures
887
01
01
01
01
01
49
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
QUERYTYPE.
49
QUERYTYPE-LN
PICTURE S9(4) COMP VALUE 40.
49
QUERYTYPE-DTA
PICTURE X(40) VALUE 'ALL'.
OBJECTTYPE.
49
OBJECTTYPE-LN
PICTURE S9(4) COMP VALUE 3.
49
OBJECTTYPE-DTA
PICTURE X(3) VALUE 'ALL'.
ICTYPE.
49
ICTYPE-LN
PICTURE S9(4) COMP VALUE 1.
49
ICTYPE-DTA
PICTURE X(1) VALUE 'B'.
STATSSCHEMA.
49
STATSSCHEMA-LN
PICTURE S9(4) COMP VALUE 128.
49
STATSSCHEMA-DTA
PICTURE X(128) VALUE 'SYSIBM'.
CATLGSCHEMA.
CATLGSCHEMA-LN
PICTURE S9(4) COMP VALUE 128.
49
CATLGSCHEMA-DTA
PICTURE X(128) VALUE 'SYSIBM'.
LOCALSCHEMA.
49
LOCALSCHEMA-LN
PICTURE S9(4) COMP VALUE 128.
49
LOCALSCHEMA-DTA
PICTURE X(128) VALUE 'DSNACC'.
CHKLVL
PICTURE S9(9) COMP VALUE +3.
CRITERIA.
49
CRITERIA-LN
PICTURE S9(4) COMP VALUE 4096.
49
CRITERIA-DTA
PICTURE X(4096) VALUE SPACES.
RESTRICTED.
49
RESTRICTED-LN
PICTURE S9(4) COMP VALUE 80.
49
RESTRICTED-DTA
PICTURE X(80) VALUE SPACES.
CRUPDATEDPAGESPCT
PICTURE S9(9) COMP VALUE +0.
CRCHANGESPCT
PICTURE S9(9) COMP VALUE +0.
CRDAYSNCLASTCOPY
PICTURE S9(9) COMP VALUE +0.
ICRUPDATEDPAGESPCT
PICTURE S9(9) COMP VALUE +0.
ICRCHANGESPCT
PICTURE S9(9) COMP VALUE +0.
CRINDEXSIZE
PICTURE S9(9) COMP VALUE +0.
RRTINSDELUPDPCT
PICTURE S9(9) COMP VALUE +0.
RRTUNCLUSTINSPCT
PICTURE S9(9) COMP VALUE +0.
RRTDISORGLOBPCT
PICTURE S9(9) COMP VALUE +0.
RRTMASSDELLIMIT
PICTURE S9(9) COMP VALUE +0.
RRTINDREFLIMIT
PICTURE S9(9) COMP VALUE +0.
RRIINSERTDELETEPCT
PICTURE S9(9) COMP VALUE +0.
RRIAPPENDINSERTPCT
PICTURE S9(9) COMP VALUE +0.
RRIPSEUDODELETEPCT
PICTURE S9(9) COMP VALUE +0.
RRIMASSDELLIMIT
PICTURE S9(9) COMP VALUE +0.
RRILEAFLIMIT
PICTURE S9(9) COMP VALUE +0.
RRINUMLEVELSLIMIT
PICTURE S9(9) COMP VALUE +0.
SRTINSDELUPDPCT
PICTURE S9(9) COMP VALUE +0.
SRTINSDELUPDABS
PICTURE S9(9) COMP VALUE +0.
SRTMASSDELLIMIT
PICTURE S9(9) COMP VALUE +0.
SRIINSDELUPDPCT
PICTURE S9(9) COMP VALUE +0.
SRIINSDELUPDABS
PICTURE S9(9) COMP VALUE +0.
SRIMASSDELLIMIT
PICTURE S9(9) COMP VALUE +0.
EXTENTLIMIT
PICTURE S9(9) COMP VALUE +0.
LASTSTATEMENT.
49
LASTSTATEMENT-LN
PICTURE S9(4) COMP VALUE 8012.
49
LASTSTATEMENT-DTA
PICTURE X(8012) VALUE SPACES.
RETURNCODE
PICTURE S9(9) COMP VALUE +0.
ERRORMSG.
49
ERRORMSG-LN
PICTURE S9(4) COMP VALUE 1331.
49
ERRORMSG-DTA
PICTURE X(1331) VALUE SPACES.
IFCARETCODE
PICTURE S9(9) COMP VALUE +0.
IFCARESCODE
PICTURE S9(9) COMP VALUE +0.
EXCESSBYTES
PICTURE S9(9) COMP VALUE +0.
*****************************************
* INDICATOR VARIABLES.
*
* INITIALIZE ALL NON-ESSENTIAL INPUT
*
* VARIABLES TO -1, TO INDICATE THAT THE *
* INPUT VALUE IS NULL.
*
*****************************************
01 QUERYTYPE-IND
PICTURE S9(4) COMP-4 VALUE +0.
01 OBJECTTYPE-IND
PICTURE S9(4) COMP-4 VALUE +0.
888
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
ICTYPE-IND
STATSSCHEMA-IND
CATLGSCHEMA-IND
LOCALSCHEMA-IND
CHKLVL-IND
CRITERIA-IND
RESTRICTED-IND
CRUPDATEDPAGESPCT-IND
CRCHANGESPCT-IND
CRDAYSNCLASTCOPY-IND
ICRUPDATEDPAGESPCT-IND
ICRCHANGESPCT-IND
CRINDEXSIZE-IND
RRTINSDELUPDPCT-IND
RRTUNCLUSTINSPCT-IND
RRTDISORGLOBPCT-IND
RRTMASSDELLIMIT-IND
RRTINDREFLIMIT-IND
RRIINSERTDELETEPCT-IND
RRIAPPENDINSERTPCT-IND
RRIPSEUDODELETEPCT-IND
RRIMASSDELLIMIT-IND
RRILEAFLIMIT-IND
RRINUMLEVELSLIMIT-IND
SRTINSDELUPDPCT-IND
SRTINSDELUPDABS-IND
SRTMASSDELLIMIT-IND
SRIINSDELUPDPCT-IND
SRIINSDELUPDABS-IND
SRIMASSDELLIMIT-IND
EXTENTLIMIT-IND
LASTSTATEMENT-IND
RETURNCODE-IND
ERRORMSG-IND
IFCARETCODE-IND
IFCARESCODE-IND
EXCESSBYTES-IND
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
+0.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
+0.
+0.
+0.
+0.
+0.
+0.
PROCEDURE DIVISION.
.
.
.
*********************************************************
* SET VALUES FOR DSNACCOR INPUT PARAMETERS:
*
* - USE THE CHKLVL PARAMETER TO CAUSE DSNACCOR TO CHECK *
*
FOR ORPHANED OBJECTS AND INDEX SPACES WITHOUT
*
*
TABLE SPACES, BUT INCLUDE THOSE OBJECTS IN THE
*
*
RECOMMENDATIONS RESULT SET (CHKLVL=1+2+16=19)
*
* - USE THE CRITERIA PARAMETER TO CAUSE DSNACCOR TO
*
*
MAKE RECOMMENDATIONS ONLY FOR OBJECTS IN DATABASES *
*
DSN8D91A AND DSN8D91L.
*
* - FOR THE FOLLOWING PARAMETERS, SET THESE VALUES,
*
*
WHICH ARE LOWER THAN THE DEFAULTS:
*
*
CRUPDATEDPAGESPCT
4
*
*
CRCHANGESPCT
2
*
*
RRTINSDELUPDPCT
2
*
*
RRTUNCLUSTINSPCT
5
*
*
RRTDISORGLOBPCT
5
*
*
RRIAPPENDINSERTPCT 5
*
*
SRTINSDELUPDPCT
5
*
*
SRIINSDELUPDPCT
5
*
*
EXTENTLIMIT
3
*
*********************************************************
MOVE 19 TO CHKLVL.
MOVE SPACES TO CRITERIA-DTA.
MOVE 'DBNAME = ''DSN8D91A'' OR DBNAME = ''DSN8D91L'''
TO CRITERIA-DTA.
MOVE 46 TO CRITERIA-LN.
MOVE 4 TO CRUPDATEDPAGESPCT.
Appendix B. DB2-supplied stored procedures
889
MOVE 2 TO CRCHANGESPCT.
MOVE 2 TO RRTINSDELUPDPCT.
MOVE 5 TO RRTUNCLUSTINSPCT.
MOVE 5 TO RRTDISORGLOBPCT.
MOVE 5 TO RRIAPPENDINSERTPCT.
MOVE 5 TO SRTINSDELUPDPCT.
MOVE 5 TO SRIINSDELUPDPCT.
MOVE 3 TO EXTENTLIMIT.
********************************
* INITIALIZE OUTPUT PARAMETERS *
********************************
MOVE SPACES TO LASTSTATEMENT-DTA.
MOVE 1 TO LASTSTATEMENT-LN.
MOVE 0 TO RETURNCODE-O2.
MOVE SPACES TO ERRORMSG-DTA.
MOVE 1 TO ERRORMSG-LN.
MOVE 0 TO IFCARETCODE.
MOVE 0 TO IFCARESCODE.
MOVE 0 TO EXCESSBYTES.
*******************************************************
* SET THE INDICATOR VARIABLES TO 0 FOR NON-NULL INPUT *
* PARAMETERS (PARAMETERS FOR WHICH YOU DO NOT WANT
*
* DSNACCOR TO USE DEFAULT VALUES) AND FOR OUTPUT
*
* PARAMETERS.
*
*******************************************************
MOVE 0 TO CHKLVL-IND.
MOVE 0 TO CRITERIA-IND.
MOVE 0 TO CRUPDATEDPAGESPCT-IND.
MOVE 0 TO CRCHANGESPCT-IND.
MOVE 0 TO RRTINSDELUPDPCT-IND.
MOVE 0 TO RRTUNCLUSTINSPCT-IND.
MOVE 0 TO RRTDISORGLOBPCT-IND.
MOVE 0 TO RRIAPPENDINSERTPCT-IND.
MOVE 0 TO SRTINSDELUPDPCT-IND.
MOVE 0 TO SRIINSDELUPDPCT-IND.
MOVE 0 TO EXTENTLIMIT-IND.
MOVE 0 TO LASTSTATEMENT-IND.
MOVE 0 TO RETURNCODE-IND.
MOVE 0 TO ERRORMSG-IND.
MOVE 0 TO IFCARETCODE-IND.
MOVE 0 TO IFCARESCODE-IND.
MOVE 0 TO EXCESSBYTES-IND.
.
.
.
*****************
* CALL DSNACCOR *
*****************
EXEC SQL
CALL SYSPROC.DSNACCOR
(:QUERYTYPE
:QUERYTYPE-IND,
:OBJECTTYPE
:OBJECTTYPE-IND,
:ICTYPE
:ICTYPE-IND,
:STATSSCHEMA
:STATSSCHEMA-IND,
:CATLGSCHEMA
:CATLGSCHEMA-IND,
:LOCALSCHEMA
:LOCALSCHEMA-IND,
:CHKLVL
:CHKLVL-IND,
:CRITERIA
:CRITERIA-IND,
:RESTRICTED
:RESTRICTED-IND,
:CRUPDATEDPAGESPCT
:CRUPDATEDPAGESPCT-IND,
:CRCHANGESPCT
:CRCHANGESPCT-IND,
:CRDAYSNCLASTCOPY
:CRDAYSNCLASTCOPY-IND,
:ICRUPDATEDPAGESPCT :ICRUPDATEDPAGESPCT-IND,
:ICRCHANGESPCT
:ICRCHANGESPCT-IND,
:CRINDEXSIZE
:CRINDEXSIZE-IND,
:RRTINSDELUPDPCT
:RRTINSDELUPDPCT-IND,
:RRTUNCLUSTINSPCT
:RRTUNCLUSTINSPCT-IND,
:RRTDISORGLOBPCT
:RRTDISORGLOBPCT-IND,
:RRTMASSDELLIMIT
:RRTMASSDELLIMIT-IND,
890
:RRTINDREFLIMIT
:RRTINDREFLIMIT-IND,
:RRIINSERTDELETEPCT :RRIINSERTDELETEPCT-IND,
:RRIAPPENDINSERTPCT :RRIAPPENDINSERTPCT-IND,
:RRIPSEUDODELETEPCT :RRIPSEUDODELETEPCT-IND,
:RRIMASSDELLIMIT
:RRIMASSDELLIMIT-IND,
:RRILEAFLIMIT
:RRILEAFLIMIT-IND,
:RRINUMLEVELSLIMIT
:RRINUMLEVELSLIMIT-IND,
:SRTINSDELUPDPCT
:SRTINSDELUPDPCT-IND,
:SRTINSDELUPDABS
:SRTINSDELUPDABS-IND,
:SRTMASSDELLIMIT
:SRTMASSDELLIMIT-IND,
:SRIINSDELUPDPCT
:SRIINSDELUPDPCT-IND,
:SRIINSDELUPDABS
:SRIINSDELUPDABS-IND,
:SRIMASSDELLIMIT
:SRIMASSDELLIMIT-IND,
:EXTENTLIMIT
:EXTENTLIMIT-IND,
:LASTSTATEMENT
:LASTSTATEMENT-IND,
:RETURNCODE
:RETURNCODE-IND,
:ERRORMSG
:ERRORMSG-IND,
:IFCARETCODE
:IFCARETCODE-IND,
:IFCARESCODE
:IFCARESCODE-IND,
:EXCESSBYTES
:EXCESSBYTES-IND)
END-EXEC.
*************************************************************
* ASSUME THAT THE SQL CALL RETURNED +466, WHICH MEANS THAT *
* RESULT SETS WERE RETURNED. RETRIEVE RESULT SETS.
*
*************************************************************
* LINK EACH RESULT SET TO A LOCATOR VARIABLE
EXEC SQL ASSOCIATE LOCATORS (:LOC1, :LOC2)
WITH PROCEDURE SYSPROC.DSNACCOR
END-EXEC.
* LINK A CURSOR TO EACH RESULT SET
EXEC SQL ALLOCATE C1 CURSOR FOR RESULT SET :LOC1
END-EXEC.
EXEC SQL ALLOCATE C2 CURSOR FOR RESULT SET :LOC2
END-EXEC.
* PERFORM FETCHES USING C1 TO RETRIEVE ALL ROWS FROM FIRST RESULT SET
* PERFORM FETCHES USING C2 TO RETRIEVE ALL ROWS FROM SECOND RESULT SET
Output
If DSNACCOR executes successfully, in addition to the output parameters
described in Option descriptions on page 876, DSNACCOR returns two result
sets.
The first result set contains the results from IFI COMMAND calls that DSNACCOR
makes. The following table shows the format of the first result set.
Table 161. Result set row for first DSNACCOR result set
Column name
Data type
Contents
RS_SEQUENCE
INTEGER
RS_DATA
CHAR(80)
The second result set contains DSNACCORs recommendations. This result set
contains one or more rows for a table space or index space. A nonpartitioned table
space or nonpartitioning index space can have at most one row in the result set. A
partitioned table space or partitioning index space can have at most one row for
each partition. A table space, index space, or partition has a row in the result set if
both of the following conditions are true:
Appendix B. DB2-supplied stored procedures
891
v If the Criteria input parameter contains a search condition, the search condition
is true for the table space, index space, or partition.
v DSNACCOR recommends at least one action for the table space, index space, or
partition.
The following table shows the columns of a result set row.
Table 162. Result set row for second DSNACCOR result set
Column name
Data type
Description
DBNAME
CHAR(8)
NAME
CHAR(8)
PARTITION
INTEGER
OBJECTTYPE
CHAR(2)
OBJECTSTATUS
CHAR(36)
IMAGECOPY
CHAR(3)
COPY recommendation:
v If OBJECTTYPE is TS: FUL (full image copy), INC
(incremental image copy), or NO
v If OBJECTTYPE is IX: YES or NO
RUNSTATS
CHAR(3)
EXTENTS
CHAR(3)
Indicates whether the data sets for the object have exceeded
ExtentLimit: YES or NO.
REORG
CHAR(3)
INEXCEPTTABLE
CHAR(40)
ASSOCIATEDTS
892
CHAR(8)
Table 162. Result set row for second DSNACCOR result set (continued)
Column name
Data type
Description
COPYLASTTIME
TIMESTAMP
LOADRLASTTIME
TIMESTAMP
REBUILDLASTTIME
TIMESTAMP
CRUPDPGSPCT
INTEGER
CRCPYCHGPCT
INTEGER
CRDAYSCELSTCPY
INTEGER
CRINDEXSIZE
INTEGER
REORGLASTTIME
TIMESTAMP
RRTINSDELUPDPCT
INTEGER
RRTUNCINSPCT
INTEGER
RRTDISORGLOBPCT
INTEGER
RRTMASSDELETE
INTEGER
RRTINDREF
INTEGER
893
Table 162. Result set row for second DSNACCOR result set (continued)
Column name
Data type
Description
RRIINSDELPCT
INTEGER
RRIAPPINSPCT
INTEGER
RRIPSDDELPCT
INTEGER
RRIMASSDELETE
INTEGER
RRILEAF
INTEGER
RRINUMLEVELS
INTEGER
STATSLASTTIME
TIMESTAMP
SRTINSDELUPDPCT
INTEGER
SRTINSDELUPDABS
INTEGER
SRTMASSDELETE
INTEGER
SRIINSDELPCT
INTEGER
SRIINSDELABS
INTEGER
894
Table 162. Result set row for second DSNACCOR result set (continued)
Column name
Data type
Description
SRIMASSDELETE
INTEGER
TOTALEXTENTS
SMALLINT
PSPI
Related reference
CREATE DATABASE (DB2 SQL Reference)
CREATE TABLESPACE (DB2 SQL Reference)
|
|
|
v Indicates when a data set has exceeded a specified threshold for the number of
extents that it occupies.
v Indicates whether objects are in a restricted state
|
|
|
DSNACCOX uses data from catalog tables, including real-time statistics tables, to
make its recommendations. DSNACCOX provides its recommendations in a result
set.
DSNACCOX uses the set of criteria that are shown in DSNACCOX formulas for
recommending actions on page 907 to evaluate table spaces and index spaces. By
default, DSNACCOX evaluates all table spaces and index spaces in the subsystem
that have entries in the real-time statistics tables. However, you can override this
default through input parameters.
Important information about DSNACCOX recommendations:
v DSNACCOX makes recommendations based on general formulas that require
input from the user about the maintenance policies for a subsystem. These
recommendations might not be accurate for every installation.
v If the real-time statistics tables contain information for only a small percentage
of your DB2 subsystem, the recommendations that DSNACCOX makes might
not be accurate for the entire subsystem.
Appendix B. DB2-supplied stored procedures
895
v Before you perform any action that DSNACCOX recommends, ensure that the
object for which DSNACCOX makes the recommendation is available, and that
the recommended action can be performed on that object. For example, REORG
might be recommended for an object, but the object might be stopped.
|
|
|
|
Environment
DSNACCOX must run in a WLM-established stored procedure address space.
You should bind the package for DSNACCOX with isolation UR to avoid lock
contention. You can find the installation steps for DSNACCOX in job DSNTIJSG.
Authorization required
To execute the CALL DSNACCOX statement, the owner of the package or plan
that contains the CALL statement must have one or more of the following
privileges on each package that the stored procedure uses:
v The EXECUTE privilege on the package for DSNACCOX
v Ownership of the package
v PACKADM authority for the package collection
v SYSADM authority
The owner of the package or plan that contains the CALL statement must also
have:
v SELECT authority on catalog tables
v The DISPLAY system privilege
Syntax diagram
The following syntax diagram shows the CALL statement for invoking
DSNACCOX. Because the linkage convention for DSNACCOX is GENERAL WITH
NULLS, if you pass parameters in host variables, you need to include a null
indicator with every host variable. Null indicators for input host variables must be
initialized before you execute the CALL statement.
896
CALL DSNACCOX (
QueryType
NULL
LocalSchema
NULL
ChkLvl
NULL
CRUpdatedPagesAbs
NULL
ICRUpdatedPagesAbs
NULL
RRTInsertAbs
NULL
RRTDisorgLOBPct
NULL
-1
RRIInsertPct
NULL
-1
RRIAppendInsertPct
NULL
-1
RRINumLevelsLimit
NULL
-1
SRIInsDelUpdPct
NULL
-1
CRChangesPct
NULL
-1
,
ICType
NULL
Restricted
NULL
CRIndexSize
NULL
-1
RRTDeleteAbs
NULL
RRIDeletePct
NULL
-1
SRTInsDelUpdPct
NULL
-1
,
CatlgSchema
NULL
RRTInsertPct
NULL
-1
RRIDeleteAbs
NULL
RRILeafLimit
NULL
-1
SRTMassDelLimit
NULL
-1
ExtentLimit
NULL
-1
RRTIndRefLimit
NULL
-1
RRIMassDelLimit
NULL
-1
SRIMassDelLimit
NULL
-1
ICRUpdatedPagesPct
NULL
-1
RRTUnclustInsPct
NULL
-1
SRTInsDelUpdAbs
NULL
CRUpdatedPagesPct
NULL
-1
,
RRTMassDelLimit
NULL
-1
RRIPseudoDeletePct
NULL
-1
SRIInsDelAbs
NULL
CRDaySncLastCopy
NULL
-1
,
RRTDataSpaceRat
NULL
-1
ICRChangesPct
NULL
-1
RRIInsertAbs
NULL
-1
ObjectType
NULL
Criteria
NULL
RRTDeletePct
NULL
-1
Option descriptions
In the following option descriptions, the default value for an input parameter is
the value that DSNACCOX uses if you specify a null value.
QueryType
Specifies the types of actions that DSNACCOX recommends. This field
contains one or more of the following values. Each value is enclosed in single
quotation marks and separated from other values by a space.
ALL
897
REORG
Makes a recommendation on whether to perform REORG. Choosing
this value causes DSNACCOX to process the EXTENTS value also.
EXTENTS
Indicates when data sets have exceeded a user-specified extents limit.
RESTRICT
Indicates which objects are in a restricted state.
DSNACCOX recommends REORG on the table space when one of the
following conditions is true, and REORG (or ALL) is also specified for the
value of QUERYTYPE:
v The table space is in REORG-pending status.
v The table space is in advisory REORG-pending status as the result of an
ALTER TABLE statement.
DSNACCOX recommends REORG on the index when on the following
conditions is true and REORG (or ALL) is also specified for the value of
QUERYTYPE::
v The index is in REORG-pending status.
v The index is in advisory REORG-pending as the result of an ALTER TABLE
statement.
DSNACCOX recommends FULL COPY on the table space when on the
following conditions is true and COPY (or ALL) is also specified for the value
of QUERYTYPE::
v The table space is in COPY-pending status.
v The table space is in informational COPY-pending status.
DSNACCOX recommends FULL COPY on the index when on the following
conditions is true and COPY (or ALL) is also specified for the value of
QUERYTYPE: and SYSINDEX.COPY=Y:
v The index is in COPY-pending status.
v The index is in informational COPY-pending status.
QueryType is an input parameter of type VARCHAR(40). The default value is
ALL.
ObjectType
Specifies the types of objects for which DSNACCOX recommends actions:
ALL
TS
IX
Incremental image copy. This value is valid for table spaces only.
898
CatlgSchema
Specifies the qualifier for DB2 catalog table names. CatlgSchema is an input
parameter of type VARCHAR(128). The default value is SYSIBM.
|
|
|
LocalSchema
Specifies the qualifier for the names of local tables that DSNACCOX references.
LocalSchema is an input parameter of type VARCHAR(128). The default value is
DSNACC.
ChkLvl
Specifies the types of checking that DSNACCOX performs, and indicates
whether to include objects that fail those checks in the DSNACCOX
recommendations result set. This value is the sum of any combination of the
following values:
|
|
|
16
32
64
899
CRUpdatedPagesPct
Specifies, when combined with CRUpdatedPagesAbs, a criterion for
recommending a full image copy on a table space or index space. If both of the
following conditions are true for a table space, DSNACCOX recommends an
image copy:
v The total number of distinct updated pages, divided by the total number of
preformatted pages (expressed as a percentage) is greater than
CRUpdatedPagesPct.
v The total number of distinct updates pages is greater than
CRUpdatedPagesABS.
If all of the following conditions are true for an index space, DSNACCOX
recommends an image copy:
v The total number of distinct updated pages, divided by the total number of
preformatted pages (expressed as a percentage) is greater than
CRUpdatedPagesPct.
v The total number of distinct updates pages is greater than
CRUpdatedPagesABS.
v The number of active pages in the index space or partition is greater than
CRIndexSize.
CRUpdatedPagesPct is an input parameter of type DOUBLE. The default is 20.0.
A negative value turns off both this criteria and CRUpdatedPagesABS.
CRUpdatedPagesABS
Specifies, when combined with CRUpdatedPagesPct, a criterion for
recommending a full image copy on a table space or index space. If both of the
following conditions are true for a table space, DSNACCOX recommends an
image copy:
v The total number of distinct updated pages, divided by the total number of
preformatted pages (expressed as a percentage) is greater than
CRUpdatedPagesPct.
v The total number of distinct updated pages is greater than
CRUpdatedPagesAbs.
If all of the following conditions are true for an index space, DSNACCOX
recommends an image copy:
v The total number of distinct updated pages, divided by the total number of
preformatted pages (expressed as a percentage) is greater than
CRUpdatedPagesPct.
v The total number of distinct updates pages is greater than
CRUpdatedPagesAbs.
v The number of active pages in the index space or partition is greater than
CRIndexSize.
CRUpdatedPagesAbs is an input parameter of type INTEGER. The default value
is 0.
CRChangesPct
Specifies a criterion for recommending a full image copy on a table space or
index space. If the following condition is true for a table space, DSNACCOX
recommends an image copy:
The total number of insert, update, and delete operations since the last
image copy, divided by the total number of rows or LOBs in a table space
or partition (expressed as a percentage) is greater than CRChangesPct.
900
If both of the following conditions are true for an index table space,
DSNACCOX recommends an image copy:
v The total number of insert and delete operations since the last image copy,
divided by the total number of entries in the index space or partition
(expressed as a percentage) is greater than CRChangesPct.
v The number of active pages in the index space or partition is greater than
CRIndexSize.
CRChangesPct is an input parameter of type DOUBLE. The default is 10.0. A
negative value turns off this criterion.
CRDaySncLastCopy
Specifies a criterion for recommending a full image copy on a table space or
index space. If the number of days since the last image copy is greater than
this value, DSNACCOX recommends an image copy.
CRDaySncLastCopy is an input parameter of type INTEGER. The default is 7. A
negative value turns off this criterion.
ICRUpdatedPagesPct
Specifies a criterion for recommending an incremental image copy on a table
space. If both of the following conditions are true, DSNACCOX recommends
an incremental image copy:
v The number of distinct pages that were updated since the last image copy,
divided by the total number of active pages in the table space or partition
(expressed as a percentage) is greater than ICRUpdatedPagesPct..
v The number of distinct pages that were updated since last image copy is
greater than ICRUpdatedPagesAbs.
ICRUpdatedPagesPct is an input parameter of type DOUBLE. The default value
is 1.0. A negative value turns off this criterion and ICRUpdatedPagesAbs.
ICRChangesPct
Specifies a criterion for recommending an incremental image copy on a table
space. If the following condition is true, DSNACCOX recommends an
incremental image copy:
The ratio of the number of insert, update, or delete operations since the last
image copy, to the total number of rows or LOBs in a table space or
partition (expressed as a percentage) is greater than ICRChangesPct.
ICRChangesPct is an input parameter of type DOUBLE. The default is 1.0. A
negative value turns off this criterion.
CRIndexSize
Specifies the minimum index size before checking the ICRUpdatedPagesPct or
ICRChangesPctcriteria for recommending a full image copy on an index space.
CRIndexSize is an input parameter of type INTEGER. The default is 50. A
negative value turns of this criterion and ICRChangesPct.
RRTInsertPct
Specifies, when combined with RRTInsertAbs, a criterion for recommending
that the REORG utility is to be run on a table space. If both of the following
condition are true, DSNACCOX recommends running REORG:
v The sum of insert, update, and delete operations since the last REORG,
divided by the total number of rows or LOBs in the table space or partition
(expressed as a percentage) is greater than RRTInsertPct
v The sum of insert operations since the last REORG is greater than
RRTInsertAbs.
Appendix B. DB2-supplied stored procedures
901
902
903
904
905
v The number of mass deletes from a table space or partition since the last
REORG or LOAD REPLACE is greater than SRTMassDelLimit.
SRTMassDelLimit is an input parameter of type DOUBLE. The default is 0.0. A
negative value turns off this criterion.
SRIInsDelPct
Specifies, when combined with SRIInsDelAbs, a criterion for recommending
that the RUNSTATS utility is to be run on an index space. If both of the
following conditions are true, DSNACCOX recommends running RUNSTATS:
v The number of inserted and deleted index entries since the last RUNSTATS
on an index space or partition, divided by the total number of index entries
in the index space or partition (expressed as a percentage) is greater than
SRIInsDelUpdPct.
v The sum of the number of inserted and deleted index entries since the last
RUNSTATS on an index space or partition is greater than SRIInsDelUpdAbs.
SRIInsDelPct is an input parameter of type DOUBLE. The default is 20.0. A
negative value turns off this criterion.
SRIInsDelAbs
Specifies, when combined with SRIInsDelPct, specifies a criterion for
recommending that the RUNSTATS utility is to be run on an index space. If the
following condition is true, DSNACCOX recommends running RUNSTATS:
v The number of inserted and deleted index entries since the last RUNSTATS
on an index space or partition, divided by the total number of index entries
in the index space or partition (expressed as a percentage) is greater than
SRIInsDelUpdPct.
v The sum of the number of inserted and deleted index entries since the last
RUNSTATS on an index space or partition is greater than SRIInsDelUpdAbs,
SRIInsDelAbs is an input parameter of type INTEGER. The default is 0.
SRIMassDelLimit
Specifies a criterion for recommending that the RUNSTATS utility is to be run
on an index space. If the number of mass deletes from an index space or
partition since the last REORG, REBUILD INDEX, or LOAD REPLACE is
greater than this value, DSNACCOX recommends running RUNSTATS.
SRIMassDelLimit is an input parameter of type INTEGER. The default value is
0. A negative value turns off this criterion.
ExtentLimit
Specifies a criterion for recommending that the REORG utility is to be run on a
table space or index space. Also specifies that DSNACCOX is to warn the user
that the table space or index space has used too many extents. DSNACCOX
recommends running REORG, and altering data set allocations if the following
condition is true:
v The number of physical extents in the index space, table space, or partition
is greater than ExtentLimit.
|
|
|
|
|
|
|
|
|
LastStatement
When DSNACCOX returns a severe error (return code 12), this field contains
the SQL statement that was executing when the error occurred. LastStatement is
an output parameter of type VARCHAR(8012).
906
ReturnCode
The return code from DSNACCOX execution. Possible values are:
0
12
14
DSNACCOX terminated because the real time statistics table were not
yet migrated to the catalog.
15
16
907
Figure 157. DSNACCOX formula for recommending a full image copy on a table space
The figure below shows the formula that DSNACCOX uses to recommend a full
image copy on an index space.
Figure 158. DSNACCOX formula for recommending a full image copy on an index space
The figure below shows the formula that DSNACCOX uses to recommend an
incremental image copy on a table space.
Figure 159. DSNACCOX formula for recommending an incremental image copy on a table space
The figure below shows the formula that DSNACCOX uses to recommend a
REORG on a table space. If the table space is a LOB table space, and CHCKLVL=1,
the formula does not include EXTENTS>ExtentLimit.
908
The figure below shows the formula that DSNACCOX uses to recommend a
REORG on an index space.
The figure below shows the formula that DSNACCOX uses to recommend
RUNSTATS on a table space.
909
The figure below shows the formula that DSNACCOX uses to recommend
RUNSTATS on an index space.
910
Example
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The figure below is a COBOL example that shows variable declarations and an
SQL CALL for obtaining recommendations for objects in databases DSN8D91A and
DSN8D91L. This example also outlines the steps that you need to perform to
retrieve the two result sets that DSNACCOX returns. These result sets are
described in DSNACCOX output on page 915. See DB2 Application Programming
and SQL Guide for more information about how to retrieve result sets from a stored
procedure.
WORKING-STORAGE SECTION.
***********************
* DSNACCOX PARAMETERS *
***********************
01 QUERYTYPE.
49
QUERYTYPE-LN
PICTURE S9(4) COMP VALUE 40.
49
QUERYTYPE-DTA
PICTURE X(40) VALUE 'ALL'.
01 OBJECTTYPE.
49
OBJECTTYPE-LN
PICTURE S9(4) COMP VALUE 3.
49
OBJECTTYPE-DTA
PICTURE X(3) VALUE 'ALL'.
01 ICTYPE.
49
ICTYPE-LN
PICTURE S9(4) COMP VALUE 1.
49
ICTYPE-DTA
PICTURE X(1) VALUE 'B'.
01 STATSSCHEMA.
49
STATSSCHEMA-LN
PICTURE S9(4) COMP VALUE 128.
49
STATSSCHEMA-DTA
PICTURE X(128) VALUE 'SYSIBM'.
01 CATLGSCHEMA.
49
CATLGSCHEMA-LN
PICTURE S9(4) COMP VALUE 128.
49
CATLGSCHEMA-DTA
PICTURE X(128) VALUE 'SYSIBM'.
01 LOCALSCHEMA.
49
LOCALSCHEMA-LN
PICTURE S9(4) COMP VALUE 128.
49
LOCALSCHEMA-DTA
PICTURE X(128) VALUE 'DSNACC'.
01 CHKLVL
PICTURE S9(9) COMP VALUE +3.
01 CRITERIA.
49
CRITERIA-LN
PICTURE S9(4) COMP VALUE 4096.
49
CRITERIA-DTA
PICTURE X(4096) VALUE SPACES.
01 RESTRICTED.
49
RESTRICTED-LN
PICTURE S9(4) COMP VALUE 80.
49
RESTRICTED-DTA
PICTURE X(80) VALUE SPACES.
01 CRUPDATEDPAGESPCT
PICTURE S9(9) COMP VALUE +0.
01 CRUPDATEDPAGESABS
PICTURE S9(9) COMP VALUE +0.
01 CRCHANGESPCT
PICTURE S9(9) COMP VALUE +0.
01 CRDAYSNCLASTCOPY
PICTURE S9(9) COMP VALUE +0.
01 ICRUPDATEDPAGESPCT
PICTURE S9(9) COMP VALUE +0.
01 ICRCHANGESPCT
PICTURE S9(9) COMP VALUE +0.
01 CRINDEXSIZE
PICTURE S9(9) COMP VALUE +0.
01 RRTINSERTPCT
PICTURE S9(9) COMP VALUE +0.
01 RRTINSERTABS
PICTURE S9(9) COMP VALUE +0.
Appendix B. DB2-supplied stored procedures
911
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
RRTDELETEPCT
RRTDELETEABS
RRTUNCLUSTINSPCT
RRTDISORGLOBPCT
RRTDATASPACERAT
RRTMASSDELLIMIT
RRTINDREFLIMIT
RRIINSERTPCT
RRIINSERTABS
RRIDELETEPCT
RRIDELETEABS
RRIAPPENDINSERTPCT
RRIPSEUDODELETEPCT
RRIMASSDELLIMIT
RRILEAFLIMIT
RRINUMLEVELSLIMIT
SRTINSDELUPDPCT
SRTINSDELUPDABS
SRTMASSDELLIMIT
SRIINSDELPCT
SRIINSDELABS
SRIMASSDELLIMIT
EXTENTLIMIT
LASTSTATEMENT.
49
LASTSTATEMENT-LN
49
LASTSTATEMENT-DTA
RETURNCODE
ERRORMSG.
49
ERRORMSG-LN
49
ERRORMSG-DTA
IFCARETCODE
IFCARESCODE
EXCESSBYTES
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
*****************************************
* INDICATOR VARIABLES.
*
* INITIALIZE ALL NON-ESSENTIAL INPUT
*
* VARIABLES TO -1, TO INDICATE THAT THE *
* INPUT VALUE IS NULL.
*
*****************************************
01 QUERYTYPE-IND
PICTURE S9(4)
01 OBJECTTYPE-IND
PICTURE S9(4)
01 ICTYPE-IND
PICTURE S9(4)
01 STATSSCHEMA-IND
PICTURE S9(4)
01 CATLGSCHEMA-IND
PICTURE S9(4)
01 LOCALSCHEMA-IND
PICTURE S9(4)
01 CHKLVL-IND
PICTURE S9(4)
01 CRITERIA-IND
PICTURE S9(4)
01 RESTRICTED-IND
PICTURE S9(4)
01 CRUPDATEDPAGESPCT-IND
PICTURE S9(4)
01 CRUPDATEDPAGESABS-IND
PICTURE S9(4)
01 CRCHANGESPCT-IND
PICTURE S9(4)
01 CRDAYSNCLASTCOPY-IND
PICTURE S9(4)
01 ICRUPDATEDPAGESPCT-IND
PICTURE S9(4)
01 ICRCHANGESPCT-IND
PICTURE S9(4)
01 CRINDEXSIZE-IND
PICTURE S9(4)
01 RRTINSERTPCT-IND
PICTURE S9(4)
01 RRTINSERTABS-IND
PICTURE S9(4)
01 RRTDELETEPCT-IND
PICTURE S9(4)
01 RRTDELETEABS-IND
PICTURE S9(4)
01 RRTUNCLUSTINSPCT-IND
PICTURE S9(4)
01 RRTDISORGLOBPCT-IND
PICTURE S9(4)
01 RRTDATASPACERAT-IND
PICTURE S9(4)
01 RRTMASSDELLIMIT-IND
PICTURE S9(4)
01 RRTINDREFLIMIT-IND
PICTURE S9(4)
01 RRIINSERTPCT-IND
PICTURE S9(4)
01 RRIINSERTABS-IND
PICTURE S9(4)
01 RRIDELETEPCT-IND
PICTURE S9(4)
912
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
+0.
+0.
+0.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
RRIDELETEABS-IND
RRIAPPENDINSERTPCT-IND
RRIPSEUDODELETEPCT-IND
RRIMASSDELLIMIT-IND
RRILEAFLIMIT-IND
RRINUMLEVELSLIMIT-IND
SRTINSDELUPDPCT-IND
SRTINSDELUPDABS-IND
SRTMASSDELLIMIT-IND
SRIINSDELPCT-IND
SRIINSDELABS-IND
SRIMASSDELLIMIT-IND
EXTENTLIMIT-IND
LASTSTATEMENT-IND
RETURNCODE-IND
ERRORMSG-IND
IFCARETCODE-IND
IFCARESCODE-IND
EXCESSBYTES-IND
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
+0.
+0.
+0.
+0.
+0.
+0
PROCEDURE DIVISION.
*********************************************************
* SET VALUES FOR DSNACCOX INPUT PARAMETERS:
*
* - USE THE CHKLVL PARAMETER TO CAUSE DSNACCOX TO CHECK *
*
FOR RELATED TABLE SPACES WHEN PROCESSING INDEX
*
*
SPACES, AND DELETE RECOMMENDATION FOR INDEXSPACES
*
*
WHEN AN ACTION (SUCH AS REORG) ON THE TABLE SPACE
*
*
WILL ALSO CAUSE THE ACTION TO BE DONE ON THE INDEX *
*
SPACE. (CHKLVL=64)
*
* - USE THE CRITERIA PARAMETER TO CAUSE DSNACCOX TO
*
*
MAKE RECOMMENDATIONS ONLY FOR OBJECTS IN DATABASES *
*
DSN8D91A AND DSN8D91L.
*
* - FOR THE FOLLOWING PARAMETERS, SET THESE VALUES,
*
*
WHICH ARE LOWER THAN THE DEFAULTS:
*
*
CRUPDATEDPAGESPCT
4
*
*
CRCHANGESPCT
2
*
*
RRTINSDELUPDPCT
2
*
*
RRTUNCLUSTINSPCT
5
*
*
RRTDISORGLOBPCT
5
*
*
RRIAPPENDINSERTPCT 5
*
*
SRTINSDELUPDPCT
5
*
*
SRIINSDELPCT
5
*
*
EXTENTLIMIT
3
*
* - EXCLUDE CHECKING FOR THESE CRITERIA BY SET THE
*
*
FOLLOWING VALUES TO A NEGATIVE VALUE.
*
*
RRTMASSDELLIMIT
-1
*
*
RRIMASSDELLIMIT
-1
*
*********************************************************
MOVE 64 TO CHKLVL.
MOVE SPACES TO CRITERIA-DTA.
MOVE 'DBNAME = ''DSN8D91A'' OR DBNAME = ''DSN8D91L'''
TO CRITERIA-DTA.
MOVE 46 TO CRITERIA-LN.
MOVE 4 TO CRUPDATEDPAGESPCT.
MOVE 2 TO CRCHANGESPCT.
MOVE 2 TO RRTINSERTPCT.
MOVE 5 TO RRTUNCLUSTINSPCT.
MOVE 5 TO RRTDISORGLOBPCT.
MOVE 5 TO RRIAPPENDINSERTPCT.
MOVE 5 TO SRTINSDELUPDPCT.
MOVE 5 TO SRIINSDELPCT.
MOVE 3 TO EXTENTLIMIT.
MOVE -1 TO RRTMASSDELLIMIT.
MOVE -1 TO RRIMASSDELLIMIT.
********************************
* INITIALIZE OUTPUT PARAMETERS *
********************************
MOVE SPACES TO LASTSTATEMENT-DTA.
Appendix B. DB2-supplied stored procedures
913
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MOVE 1 TO LASTSTATEMENT-LN.
MOVE 0 TO RETURNCODE-O2.
MOVE SPACES TO ERRORMSG-DTA.
MOVE 1 TO ERRORMSG-LN.
MOVE 0 TO IFCARETCODE.
MOVE 0 TO IFCARESCODE.
MOVE 0 TO EXCESSBYTES.
*******************************************************
* SET THE INDICATOR VARIABLES TO 0 FOR NON-NULL INPUT *
* PARAMETERS (PARAMETERS FOR WHICH YOU DO NOT WANT
*
* DSNACCOX TO USE DEFAULT VALUES) AND FOR OUTPUT
*
* PARAMETERS.
*
*******************************************************
MOVE 0 TO CHKLVL-IND.
MOVE 0 TO CRITERIA-IND.
MOVE 0 TO CRUPDATEDPAGESPCT-IND.
MOVE 0 TO CRCHANGESPCT-IND.
MOVE 0 TO RRTINSERTPCT-IND.
MOVE 0 TO RRTUNCLUSTINSPCT-IND.
MOVE 0 TO RRTDISORGLOBPCT-IND.
MOVE 0 TO RRIAPPENDINSERTPCT-IND.
MOVE 0 TO SRTINSDELUPDPCT-IND.
MOVE 0 TO SRIINSDELPCT-IND.
MOVE 0 TO EXTENTLIMIT-IND.
MOVE 0 TO LASTSTATEMENT-IND.
MOVE 0 TO RETURNCODE-IND.
MOVE 0 TO ERRORMSG-IND.
MOVE 0 TO IFCARETCODE-IND.
MOVE 0 TO IFCARESCODE-IND.
MOVE 0 TO EXCESSBYTES-IND.
MOVE 0 TO RRTMASSDELLIMIT-IND.
MOVE 0 TO RRIMASSDELLIMIT-IND.
*****************
* CALL DSNACCOX *
*****************
EXEC SQL
CALL SYSPROC.DSNACCOX
(:QUERYTYPE
:OBJECTTYPE
:ICTYPE
:STATSSCHEMA
:CATLGSCHEMA
:LOCALSCHEMA
:CHKLVL
:CRITERIA
:RESTRICTED
:CRUPDATEDPAGESPCT
:CRUPDATEDPAGESABS
:CRCHANGESPCT
:CRDAYSNCLASTCOPY
:ICRUPDATEDPAGESPCT
:ICRCHANGESPCT
:CRINDEXSIZE
:RRTINSERTPCT
:RRTINSERTABS
:RRTDELETEPCT
:RRTDELETEABS
:RRTUNCLUSTINSPCT
:RRTDISORGLOBPCT
:RRTDATASPACERAT
:RRTMASSDELLIMIT
:RRTINDREFLIMIT
:RRIINSERTPCT
:RRIINSERTABS
:RRIDELETEPCT
:RRIDELETEABS
:RRIAPPENDINSERTPCT
914
:QUERYTYPE-IND,
:OBJECTTYPE-IND,
:ICTYPE-IND,
:STATSSCHEMA-IND,
:CATLGSCHEMA-IND,
:LOCALSCHEMA-IND,
:CHKLVL-IND,
:CRITERIA-IND,
:RESTRICTED-IND,
:CRUPDATEDPAGESPCT-IND,
:CRUPDATEDPAGESABS-IND,
:CRCHANGESPCT-IND,
:CRDAYSNCLASTCOPY-IND,
:ICRUPDATEDPAGESPCT-IND,
:ICRCHANGESPCT-IND,
:CRINDEXSIZE-IND,
:RRTINSERTPCT-IND,
:RRTINSERTABS-IND,
:RRTDELETEPCT-IND,
:RRTDELETEABS-IND,
:RRTUNCLUSTINSPCT-IND,
:RRTDISORGLOBPCT-IND,
:RRTDATASPACERAT-IND,
:RRTMASSDELLIMIT-IND,
:RRTINDREFLIMIT-IND,
:RRIINSERTPCT-IND,
:RRIINSERTABS-IND,
:RRIDELETEPCT-IND,
:RRIDELETEABS-IND,
:RRIAPPENDINSERTPCT-IND,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*************************************************************
* ASSUME THAT THE SQL CALL RETURNED +466, WHICH MEANS THAT *
* RESULT SETS WERE RETURNED. RETRIEVE RESULT SETS.
*
*************************************************************
* LINK EACH RESULT SET TO A LOCATOR VARIABLE
EXEC SQL ASSOCIATE LOCATORS (:LOC1, :LOC2)
WITH PROCEDURE SYSPROC.DSNACCOX
END-EXEC.
* LINK A CURSOR TO EACH RESULT SET
EXEC SQL ALLOCATE C1 CURSOR FOR RESULT SET :LOC1
END-EXEC.
EXEC SQL ALLOCATE C2 CURSOR FOR RESULT SET :LOC2
END-EXEC.
* PERFORM FETCHES USING C1 TO RETRIEVE ALL ROWS FROM FIRST RESULT SET
* PERFORM FETCHES USING C2 TO RETRIEVE ALL ROWS FROM SECOND RESULT SET
DSNACCOX output
|
|
|
|
|
The first result set contains the results from IFI COMMAND calls that DSNACCOX
makes. The following table shows the format of the first result set.
Table 163. Result set row for first DSNACCOX result set
Column name
Data type
Contents
RS_SEQUENCE
INTEGER
|
|
RS_DATA
CHAR(80)
|
|
|
|
|
|
|
|
|
|
The second result set contains DSNACCOXs recommendations. This result set
contains one or more rows for a table space or index space. A nonpartitioned table
space or nonpartitioning index space can have at most one row in the result set. A
partitioned table space or partitioning index space can have at most one row for
each partition. A table space, index space, or partition has a row in the result set if
both of the following conditions are true:
v If the Criteria input parameter contains a search condition, the search condition
is true for the table space, index space, or partition.
:RRIPSEUDODELETEPCT
:RRIMASSDELLIMIT
:RRILEAFLIMIT
:RRINUMLEVELSLIMIT
:SRTINSDELUPDPCT
:SRTINSDELUPDABS
:SRTMASSDELLIMIT
:SRIINSDELPCT
:SRIINSDELABS
:SRIMASSDELLIMIT
:EXTENTLIMIT
:LASTSTATEMENT
:RETURNCODE
:ERRORMSG
:IFCARETCODE
:IFCARESCODE
:EXCESSBYTES
END-EXEC.
:RRIPSEUDODELETEPCT-IND,
:RRIMASSDELLIMIT-IND,
:RRILEAFLIMIT-IND,
:RRINUMLEVELSLIMIT-IND,
:SRTINSDELUPDPCT-IND,
:SRTINSDELUPDABS-IND,
:SRTMASSDELLIMIT-IND,
:SRIINSDELPCT-IND,
:SRIINSDELABS-IND,
:SRIMASSDELLIMIT-IND,
:EXTENTLIMIT-IND,
:LASTSTATEMENT-IND,
:RETURNCODE-IND,
:ERRORMSG-IND,
:IFCARETCODE-IND,
:IFCARESCODE-IND,
:EXCESSBYTES-IND)
v DSNACCOX recommends at least one action for the table space, index space, or
partition.
915
| Table 164. Result set row for second DSNACCOX result set
| Column name
Data type
Description
| DBNAME
VARCHAR(24)
| NAME
VARCHARCHAR(128)
| PARTITION
INTEGER
| INSTANCE
|
INTEGER
| CLONE
CHAR(1)
| OBJECTTYPE
|
|
CHAR(2)
| INDEXSPACE
VARCHAR(24)
| CREATOR
VARCHAR(128)
CHAR(36)
OBJECTSTATUS
CHAR(4)
COPY recommendation:
v If OBJECTTYPE is TS: FULL (full image copy), INC
(incremental image copy), or NO
v If OBJECTTYPE is IX: YES or NO
RUNSTATS
CHAR(3)
EXTENTS
CHAR(3)
REORG
CHAR(3)
916
Table 164. Result set row for second DSNACCOX result set (continued)
Column name
Data type
Description
INEXCEPTTABLE
CHAR(40)
ASSOCIATEDTS
CHAR(8)
COPYLASTTIME
TIMESTAMP
LOADRLASTTIME
TIMESTAMP
REBUILDLASTTIME
TIMESTAMP
CRUPDPGSPCT
DOUBLE
CRUPDPGSABS
INTEGER
917
Table 164. Result set row for second DSNACCOX result set (continued)
Column name
Data type
Description
CRCPYCHGPCT
INTEGER
CRDAYSCELSTCPY
INTEGER
CRINDEXSIZE
INTEGER
REORGLASTTIME
TIMESTAMP
RRTINSERTSPCT
DOUBLE
RRTINSERTSABS
INTEGER
918
Table 164. Result set row for second DSNACCOX result set (continued)
Column name
Data type
Description
RRTDELETESPCT
DOUBLE
RRTDELETESABS
INTEGER
RRTUNCINSPCT
DOUBLE
RRTDISORGLOBPCT
DOUBLE
| RRTDATASPACERAT
|
|
DOUBLE
RRTMASSDELETE
INTEGER
919
Table 164. Result set row for second DSNACCOX result set (continued)
Column name
Data type
Description
RRTINDREF
INTEGER
RRIINSERTPCT
DOUBLE
RRIINSERTABS
INTEGER
RRIDELETEPCT
DOUBLE
RRIDELETABS
INTEGER
920
Table 164. Result set row for second DSNACCOX result set (continued)
Column name
Data type
Description
RRIAPPINSPCT
DOUBLE
RRIPSDDELPCT
INTEGER
RRIMASSDELETE
INTEGER
RRILEAF
INTEGER
RRINUMLEVELS
INTEGER
921
Table 164. Result set row for second DSNACCOX result set (continued)
Column name
Data type
Description
STATSLASTTIME
TIMESTAMP
SRTINSDELUPDPCT
DOUBLE
SRTINSDELUPDABS
INTEGER
SRTMASSDELETE
INTEGER
SRIINSDELPCT
DOUBLE
SRIINSDELABS
INTEGER
922
Table 164. Result set row for second DSNACCOX result set (continued)
Column name
Data type
Description
SRIMASSDELETE
INTEGER
TOTALEXTENTS
SMALLINT
PSPI
923
924
|
|
|
|
|
|
Status
Abbreviation
Object affected
Corrective action
Notes
Auxiliary
CHECKpending
ACHKP
Note:
1. A base table space in the ACHKP status is unavailable for processing by SQL.
925
| Auxiliary
| warning
|
|
|
|
|
|
|
| Auxiliary
| warning
|
|
|
|
|
|
|
Abbreviation
Object affected
Corrective action
Notes
AUXW
1,2,3
Note:
1. A base table space or LOB table space in the AUXW status is available for processing by SQL, even though it
contains invalid LOBs. However, an attempt to retrieve an invalid LOB results in a -904 SQL return code.
2. DB2 can access all rows of a base table space that are in the AUXW status. SQL can update the invalid LOB
column and delete base table rows, but the value of the LOB column cannot be retrieved. If DB2 attempts to
access an invalid LOB column, a -904 SQL code is returned. The AUXW status remains on the base table space
even when SQL deletes or updates the last invalid LOB column.
3. If CHECK DATA AUXERROR REPORT encounters only invalid LOB columns and no other LOB column errors,
the base table space is set to the auxiliary warning status.
926
CHECK-pending status
The CHECK-pending (CHKP) restrictive status indicates that an object might be in
an inconsistent state and must be checked.
The following utilities set the CHECK-pending status on a table space if referential
integrity constraints are encountered:
v LOAD with ENFORCE NO
v RECOVER to a point in time
v CHECK LOB
The CHECK-pending status can also affect a base table space or a LOB table space.
DB2 ignores informational referential integrity constraints and does not set
CHECK-pending status for them.
Refer to the following table for information about resetting the CHECK-pending
status. This table lists the status name, abbreviation, affected objects, and any
corrective actions.
Table 167. Resetting CHECK-pending status
Status
Abbreviation
Object affected
Corrective action
CHECKpending
CHKP
Notes
CHKP
CHECKpending
CHKP
Partitioning index,
nonpartitioning index,
index on the auxiliary
table
| 1. An index might be placed in the CHECK-pending status if you recovered an index to a specific RBA or LRSN
|
from a copy and applied the log records, but you did not recover the table space in the same list. The
|
CHECK-pending status can also be placed on an index if you specified the table space and the index, but the
|
RECOVER point in time was not a QUIESCE or COPY SHRLEVEL REFERENCE point.
COPY-pending status
The COPY-pending (COPY) restrictive status indicates that the affected object must
be copied.
927
DB2 ignores informational referential integrity constraints and does not set
CHECK-pending status for them.
Refer to the following table for information about resetting the COPY-pending
status. This table lists the status name, abbreviation, affected objects, and any
corrective actions.
Table 168. Resetting COPY-pending status
Status
Abbreviation
Object affected
Corrective action
COPYpending
COPY
Notes
The DBETE status identifies the objects that need special attention by the user.
|
|
|
|
|
|
|
|
Refer to the following table for information about resetting the DBET error status.
This table lists the status name, abbreviation, affected objects, and any corrective
actions.
Abbreviation
Object affected
Corrective action
| DBET error
|
|
|
|
DBETE
Notes
Abbreviation
928
Object affected
Corrective action
Object
Notes
Abbreviation
Object affected
Corrective action
Informational ICOPY
COPYpending
Informational ICOPY
COPYpending
Partitioning index,
nonpartitioning index,
index on the auxiliary
table
Notes
REBUILD-pending status
A REBUILD-pending restrictive status indicates that the affected index or index
partition is broken and must be rebuilt from the data.
REBUILD-pending (RBDP) status indicates that the physical or logical partition is
inaccessible and must be rebuilt. RBDP status is set on a data-partitioned
secondary index if you create the index after performing the following actions:
v Create a partitioned table space.
v Create a partitioning index.
v Insert a row into a table.
In this situation, the last partition of the table space is set to REORG-pending
(REORP) restrictive status.
REBUILD-pending star (RBDP*) status indicates that a logical partition of a
nonpartitioned secondary index is unavailable for read-write access and the entire
index is unavailable for read access.
Page set REBUILD-pending (PSRBD) status indicates that an entire nonpartitioned
secondary index or index on the auxiliary table is unavailable for read-write access.
Rebuilding an index and thereby resetting the REBUILD-pending status invalidates
the dynamic statement cache for the related table.
If you alter the data type of a column to a numeric data type, RECOVER INDEX
cannot complete. You must rebuild the index.
Refer to the following table for information about resetting a REBUILD-pending
status. This table lists the status name, abbreviation, affected objects, and any
corrective actions.
929
Abbreviation
Object affected
Corrective action
REBUILDpending
RBDP
REBUILDpending star
RBDP*
Logical partitions of
Run REBUILD INDEX PART or RECOVER
nonpartitioned secondary utility on the affected logical partitions.
indexes
Page set
REBUILDpending
PSRBD
Nonpartitioned
secondary index, index
on the auxiliary table
REBUILDpending
Notes
RECOVER-pending status
The RECOVER-pending (RECP) restrictive status indicates that a table space or
table space partition is broken and must be recovered.
Refer to the following table for information about resetting the RECOVER-pending
status. This table lists the status name, abbreviation, affected objects, and any
corrective actions.
Table 173. Resetting RECOVER-pending status
Status
Abbreviation
Object affected
Corrective action
RECOVERpending
RECP
Table space
RECOVERpending
RECP
RECOVERpending
RECP
RECOVERpending
RECP
Index space
930
Notes
Abbreviation
Object affected
Corrective action
RECOVERpending
RECP
Any
Notes
REFRESH-pending status
Whenever DB2 marks an object in refresh-pending (REFP) status, it also puts the
object in RECOVER-pending (RECP) or REBUILD-pending (RBDP or PSRBD).
If a user-defined table space is in refresh-pending (REFP) status, you can replace
the data by using LOAD REPLACE. At the successful completion of the RECOVER
and LOAD REPLACE jobs, both (REFP and RECP or REFP and RBDP or PSRBD)
statuses are reset.
REORG-pending status
The REORG-pending (REORP) restrictive status indicates that a table space
partition definition has changed and the affected partitions must be reorganized
before the data is accessible.
The REORG-pending (AREO*) advisory status indicates that a table space, index,
or partition needs to be reorganized for optimal performance.
Refer to the following table for information about resetting the REORG-pending
status. This table lists the status name, abbreviation, affected objects, and any
corrective actions.
Table 174. Resetting REORG-pending status
Status
Abbreviation
Object affected
Corrective action
REORGpending
REORP
Table space
Notes
931
Abbreviation
Object affected
Corrective action
REORGpending
REORP
Notes
Advisory
REORGpending
AREO*
Table space
v REORG TABLESPACE
v LOAD REPLACE
v REPAIR TABLESPACE
Advisory
REORGpending
AREO*
Index space
v REORG TABLESPACE
v LOAD REPLACE
v REORG INDEX
v REPAIR INDEX
Note:
1.
You can reset AREO* for a specific partition without being restricted by another AREO* for an adjacent partition.
When you run REPAIR VERSIONS, the utility resets the status and updates the version information in
SYSTABLEPART for table spaces and SYSINDEXES for indexes.
Restart-pending status
The restart-pending (RESTP) status is set on if an object has backout work pending
at the end of DB2 restart.
Refer to the following table for information about resetting the restart-pending
status. This table lists the status name, abbreviation, affected objects, and any
corrective actions.
Table 175. Resetting restart-pending status
Status
Abbreviation
Object affected
Corrective action
Notes
Restartpending
RESTP
1,2,3
Note:
1. Delay running REORG TABLESPACE SHRLEVEL CHANGE until all RESTP statuses are reset.
2. You cannot use LOAD REPLACE on an object that is in the RESTP status.
3. Utility activity against page sets or partitions with RESTP status is not allowed. Any attempt to access a page set
or partition with RESTP status terminates with return code 8.
Related information
Starting a table space or index space that has restrictions (DB2 Administration
Guide)
932
933
Table 176. Jobs that prepare DSNTIAUL, DSNTIAD, DSNTEP2, and DSNTEP4
Program name
DSNTIAUL
DSNTEJ2A
DSNTIAD
DSNTIJTM
DSNTEP2 (source)
DSNTEJ1P
DSNTEP2 (object)
DSNTEJ1L
DSNTEP4 (source)
DSNTEJ1P
DSNTEP4 (object)
DSNTEJ1L
Load module
Plan
DSNTIAUL
DSNTIAUL
DSNTIB91
SQL
number of rows per fetch
TOLWARN(NO|YES)
DSNTIAD
DSNTIAD
DSNTIA91
RC0
SQLTERM(termchar)
DSNTEP2
DSNTEP2
DSNTEP91
ALIGN(MID)
or ALIGN(LHS)
NOMIXED or MIXED
SQLTERM(termchar)
TOLWARN(NO|YES)
PREPWARN
DSNTEP4
DSNTEP4
DSNTP491
ALIGN(MID)
or ALIGN(LHS)
NOMIXED or MIXED
SQLTERM(termchar)
TOLWARN(NO|YES)
PREPWARN
Parameters
Related reference
RUN (DSN) (DB2 Command Reference)
DSNTIAUL
Use the DSNTIAUL program to unload data from DB2 tables into sequential data
sets.
This topic contains information that you need when you run DSNTIAUL,
including parameters, data sets, return codes, and invocation examples.
To retrieve data from a remote site by using the multi-row fetch capability for
enhanced performance, bind DSNTIAUL with the DBPROTOCOL(DRDA) option.
To run DSNTIAUL remotely when it is bound with the DBPROTOCOL(PRIVATE)
option, switch DSNTIAUL to single-row fetch mode by specifying 1 for the
number of rows per fetch parameter.
934
DSNTIAUL parameters:
SQL
Specify SQL to indicate that your input data set contains one or more complete
SQL statements, each of which ends with a semicolon. You can include any
SQL statement that can be executed dynamically in your input data set. In
addition, you can include the static SQL statements CONNECT, SET
CONNECTION, or RELEASE. DSNTIAUL uses the SELECT statements to
determine which tables to unload and dynamically executes all other
statements except CONNECT, SET CONNECTION, and RELEASE. DSNTIAUL
executes CONNECT, SET CONNECTION, and RELEASE statically to connect
to remote locations.
number of rows per fetch
Specify a number from 1 to 32767 to specify the number of rows per fetch that
DSNTIAUL retrieves. If you do not specify this number, DSNTIAUL retrieves
100 rows per fetch. This parameter can be specified with the SQL parameter.
Specify 1 to retrieve data from a remote site when DSNTIAUL is bound with
the DBPROTOCOL(PRIVATE) option.
TOLWARN
Specify NO (the default) or YES to indicate whether DSNTIAUL continues to
retrieve rows after receiving an SQL warning:
NO
YES
|
|
|
|
|
LOBFILE(prefix)
Specify LOBFILE to indicate that you want DSNTIAUL to dynamically allocate
data sets, each to receive the full content of a LOB cell. (A LOB cell is the
intersection of a row and a LOB column.) If you do not specify the LOBFILE
option, you can unload up to only 32 KB of data from a LOB column.
|
|
|
|
prefix
Specify a high-level qualifier for these dynamically allocated data sets. You
can specify up to 17 characters. The qualifier must conform with the rules
for TSO data set names.
|
|
|
DSNTIAUL uses a naming convention for these dynamically allocated data sets
of prefix.Qiiiiiii.Cjjjjjjj.Rkkkkkkk, where these qualifiers have the following
values:
|
|
prefix
The high-level qualifier that you specify in the LOBFILE option.
|
|
|
Qiiiiiii
The sequence number (starting from 0) of a query that returns one or more
LOB columns
|
|
|
Cjjjjjjj
The sequence number (starting from 0) of a column in a query that returns
one or more LOB columns
935
|
|
|
Rkkkkkkk
The sequence number (starting from 0) of a row of a result set that has one
or more LOB columns.
|
|
The generated LOAD statement contains LOB file reference variables that can
be used to load data from these dynamically allocated data sets.
If you do not specify the SQL parameter, your input data set must contain one or
more single-line statements (without a semicolon) that use the following syntax:
table or view name [WHERE conditions] [ORDER BY columns]
Each input statement must be a valid SQL SELECT statement with the clause
SELECT * FROM omitted and with no ending semicolon. DSNTIAUL generates a
SELECT statement for each input statement by appending your input line to
SELECT * FROM, then uses the result to determine which tables to unload. For this
input format, the text for each table specification can be a maximum of 72 bytes
and must not span multiple lines.
You can use the input statements to specify SELECT statements that join two or
more tables or select specific columns from a table. If you specify columns, you
need to modify the LOAD statement that DSNTIAUL generates.
936
|
|
|
|
|
|
Return code
Meaning
Successful completion.
|
|
|
|
|
|
|
|
|
|
12
937
938
RESUME CLOB(5K),
PRIMARY KEY (EMPNO))
IN DSN8D91L.DSN8S91B
CCSID EBCDIC;
The following call to DSNTIAUL unloads the sample LOB table. The parameters
for DSNTIAUL indicate the following options:
v The input data set (SYSIN) contains SQL.
v DSNTIAUL is to retrieve 2 rows per fetch.
v DSNTIAUL places the LOB data in data sets with a high-level qualifier of
DSN8UNLD.
//UNLOAD
EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//SYSTSIN
DD *
DSN SYSTEM(DSN)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIB91) PARMS('SQL,2,LOBFILE(DSN8UNLD)') LIB('DSN910.RUNLIB.LOAD')
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSREC00 DD DSN=DSN8UNLD.SYSREC00,
//
UNIT=SYSDA,SPACE=(800,(15,15)),DISP=(,CATLG),
//
VOL=SER=SCR03,RECFM=FB
//SYSPUNCH DD DSN=DSN8UNLD.SYSPUNCH,
//
UNIT=SYSDA,SPACE=(800,(15,15)),DISP=(,CATLG),
//
VOL=SER=SCR03,RECFM=FB
//SYSIN
DD *
SELECT * FROM DSN8910.EMP_PHOTO_RESUME;
Given that the sample LOB table has 4 rows of data, DSNTIAUL produces the
following output:
v Data for columns EMPNO and EMP_ROWID are placed in the data set that is
allocated according to the SYSREC00 DD statement. The data set name is
DSN8UNLD.SYSREC00
v A generated LOAD statement is placed in the data set that is allocated according
to the SYSPUNCH DD statement. The data set name is DSN8UNLD.SYSPUNCH
v The following data sets are dynamically created to store LOB data:
DSN8UNLD.Q0000000.C0000002.R0000000
DSN8UNLD.Q0000000.C0000002.R0000001
DSN8UNLD.Q0000000.C0000002.R0000002
DSN8UNLD.Q0000000.C0000002.R0000003
DSN8UNLD.Q0000000.C0000003.R0000000
DSN8UNLD.Q0000000.C0000003.R0000001
DSN8UNLD.Q0000000.C0000003.R0000002
DSN8UNLD.Q0000000.C0000003.R0000003
DSN8UNLD.Q0000000.C0000004.R0000000
DSN8UNLD.Q0000000.C0000004.R0000001
DSN8UNLD.Q0000000.C0000004.R0000002
DSN8UNLD.Q0000000.C0000004.R0000003
For example, DSN8UNLD.Q0000000.C0000004.R0000001 means that the data set
contains data that is unloaded from the second row (R0000001) and the fifth
column (C0000004) of the result set for the first query (Q0000000).
939
DSNTIAD
Use the DSNTIAD program to execute SQL statements other than SELECT
statements dynamically.
DSNTIAD parameters:
RC0
If you specify this parameter, DSNTIAD ends with return code 0, even if the
program encounters SQL errors. If you do not specify RC0, DSNTIAD ends
with a return code that reflects the severity of the errors that occur. Without
RC0, DSNTIAD terminates if more than 10 SQL errors occur during a single
execution.
SQLTERM(termchar)
Specify this parameter to indicate the character that you use to end each SQL
statement. You can use any special character except one of those listed in the
following table. SQLTERM(;) is the default.
Table 179. Invalid special characters for the SQL terminator
Name
Character
blank
Hexadecimal representation
X40
comma
X6B
X7F
left parenthesis
X4D
right parenthesis
X5D
X7D
underscore
X6D
Use a character other than a semicolon if you plan to execute a statement that
contains embedded semicolons.
example:
Suppose that you specify the parameter SQLTERM(#) to indicate that the
character # is the statement terminator. Then a CREATE TRIGGER statement
with embedded semicolons looks like this:
CREATE TRIGGER NEW_HIRE
AFTER INSERT ON EMP
FOR EACH ROW MODE DB2SQL
BEGIN ATOMIC
UPDATE COMPANY_STATS SET NBEMP = NBEMP + 1;
END#
940
Be careful to choose a character for the statement terminator that is not used
within the statement.
Meaning
12
DSNTIAD could not open a data set, the length of an SQL statement was
more than 32760 bytes, an SQL statement returned a severe error code
(-8nn or -9nn), or an error occurred in the SQL message formatting
routine.
941
|
|
|
|
|
|
|
DSNTEP2 and DSNTEP4 write their results to the data set that is defined by the
SYSPRINT DD statement. SYSPRINT data must have a logical record length of 133
bytes (LRECL=133). Otherwise, the program issues return code 12 with abend
U4038 and reason code 1. This abend occurs due to the PL/I file exception error
IBM0201S ONCODE=81. The following error message is issued:
|
|
Important: When you allocate a new data set with the SYSPRINT DD statement,
either specify a DCB with LRECL=133, or do not specify the DCB parameter.
PREPWARN
Specifies that DSNTEP2 or DSNTEP4 is to display the PREPARE
SQLWARNING message and set the return code to 4 when an SQLWARNING
is encountered at PREPARE.
|
|
|
SQLFORMAT
Specifies how DSNTEP2 or DSNTEP4 pre-processes SQL statements before
passing them to DB2. Select one of the following options:
This is the preferred mode for SQL statements other than SQL
procedural language. When you use this option, which is the default,
DSNTEP2 or DSNTEP4 collapses each line of an SQL statement into a
single line before passing the statement to DB2. DSNTEP2 or DSNTEP4
also discards all SQL comments.
|
|
|
|
|
SQL
|
|
|
|
|
|
|
|
|
SQLCOMNT
This mode is suitable for all SQL, but it is intended primarily for SQL
procedural language processing. When this option is in effect, behavior
is similar to SQL mode, except that DSNTEP2 or DSNTEP4 does not
discard SQL comments. Instead, it automatically terminates each SQL
comment with a line feed character (hex 25), unless the comment is
already terminated by one or more line formatting characters. Use this
option to process SQL procedural language with minimal modification
by DSNTEP2 or DSNTEP4.
|
|
SQLPL
This mode is suitable for all SQL, but it is intended primarily for SQL
942
|
|
|
|
|
|
Be careful to choose a character for the statement terminator that is not used
within the statement.
If you want to change the SQL terminator within a series of SQL statements,
you can use the --#SET TERMINATOR control statement.
Example: Suppose that you have an existing set of SQL statements to which
you want to add a CREATE TRIGGER statement that has embedded
semicolons. You can use the default SQLTERM value, which is a semicolon, for
all of the existing SQL statements. Before you execute the CREATE TRIGGER
statement, include the --#SET TERMINATOR # control statement to change the
SQL terminator to the character #:
SELECT * FROM DEPT;
SELECT * FROM ACT;
SELECT * FROM EMPPROJACT;
SELECT * FROM PROJ;
SELECT * FROM PROJACT;
--#SET TERMINATOR #
CREATE TRIGGER NEW_HIRE
AFTER INSERT ON EMP
FOR EACH ROW MODE DB2SQL
BEGIN ATOMIC
UPDATE COMPANY_STATS SET NBEMP = NBEMP + 1;
END#
943
See the following discussion of the SYSIN data set for more information about
the --#SET control statement.
TOLWARN
Specify NO (the default) or YES to indicate whether DSNTEP2 or DSNTEP4
continues to process SQL SELECT statements after receiving an SQL warning:
NO
YES
|
|
You can enter control statements of the following form in the DSNTEP2
and DSNTEP4 input data set:
--#SET control-option value
944
MULT_FETCH
This option is valid only for DSNTEP4. Use MULT_FETCH to specify
the number of rows that are to be fetched at one time from the result
table. The default fetch amount for DSNTEP4 is 100 rows, but you can
specify from 1 to 32676 rows.
TOLWARN
Indicates whether DSNTEP2 and DSNTEP4 continue to process an SQL
SELECT statement after an SQL warning is returned. value is either NO
(the default) or YES.
|
|
|
|
TOLARTHWRN
Indicates whether DSNTEP2 and DSNTEP4 continue to process an SQL
SELECT statement after an arithmetic SQL warning (SQLCODE +802)
is returned. value is either NO (the default) or YES.
|
|
|
PREPWARN
Indicates how DSNTEP2 and DSNTEP4 is to handle a PREPARE
SQLWARNING message.
|
|
|
|
|
NO
|
|
|
|
YES
Indicates that DSNTEP2 and DSNTEP4 displays the PREPARE
SQLWARNING message and sets the return code to 4 when an
SQLWARNING is encountered at PREPARE.
|
|
|
SQLFORMAT
Specifies how DSNTEP2 or DSNTEP4 pre-processes SQL statements
before passing them to DB2. Select one of the following options:
This is the preferred mode for SQL statements other than SQL
procedural language. When you use this option, which is the
default, DSNTEP2 or DSNTEP4 collapses each line of an SQL
statement into a single line before passing the statement to
DB2. DSNTEP2 or DSNTEP4 also discards all SQL comments.
|
|
|
|
|
SQL
|
|
|
|
|
|
|
|
|
|
SQLCOMNT
This mode is suitable for all SQL, but it is intended primarily
for SQL procedural language processing. When this option is in
effect, behavior is similar to SQL mode, except that DSNTEP2
or DSNTEP4 does not discard SQL comments. Instead, it
automatically terminates each SQL comment with a line feed
character (hex 25), unless the comment is already terminated
by one or more line formatting characters. Use this option to
process SQL procedural language with minimal modification
by DSNTEP2 or DSNTEP4.
|
|
|
|
|
|
|
SQLPL
This mode is suitable for all SQL, but it is intended primarily
for SQL procedural language processing. When this option is in
effect, DSNTEP2 or DSNTEP4 retains SQL comments and
terminates each line of an SQL statement with a line feed
character (hex 25) before passing the statement to DB2. Lines
that end with a split token are not terminated with a line feed
945
|
|
|
|
|
MAXERRORS
Specifies that number of errors that DSNTEP2 and DSNTEP4 handle
before processing stops. The default is 10.
SYSPRINT
Output data set. DSNTEP2 and DSNTEP4 write informational and error
messages in this data set. DSNTEP2 and DSNTEP4 write output records of
no more than 133 bytes.
Define all data sets as sequential data sets.
Meaning
Successful completion.
12
The length of an SQL statement was more than 32760 bytes, an SQL
statement returned a severe error code (-8nn or -9nn), or an error
occurred in the SQL message formatting routine.
946
DB2 utilities use real-time statistics to optimize data processing and operations.
|
|
|
Utilities can use real-time statistics to calculate how data processing is done. This is
more efficient than using statistics typically gathered by the RUNSTATS utility or
stored in catalogs.
|
|
|
|
|
|
If real -time statistics are available and the system parameter UTSORTAL is set to
YES, the following utilities use real-time statistics to help determine how data is
processed:
v CHECK DATA
v CHECK INDEX
v REBUILD INDEX
v REORG TABLESPACE
v RUNSTATS
|
|
|
|
|
|
DB2 issues message DSNU3343I if there are no real-time statistics available. This
message can be issued for either table spaces or indexes. When message
DSNU3343I is returned, DB2 tries to gather real time statistics either from
associated indexes or table spaces, depending on what kind of real-time statistics
were not available. If no real-time statistics are available, DB2 uses RUNSTATS
based estimations.
|
|
|
Utilities regularly gather information about table space or index characteristics. The
information is used to calculate statistics that help determine how a utility
processes data.
|
|
|
|
|
Utilities read the totals number of rows from the column TOTALROWS in the table
SYSIBM.SYSTABLESPACESTATS and the number of associated index keys from
column TOTALENTRIES in the table SYSIBM.SYSINDEXSPACESTATS. The
statistics that are calculated from this information are used to estimate the number
of records that need to be sorted and the size of the required sort work data sets.
|
|
|
|
|
|
|
|
|
|
947
948
No statistics are generated for the directory. For partitioned spaces, DB2 generates
information for each partition. However, you need to set the interval for writing
statistics and establish base values for statistics.
949
|
|
|
PSPI
|
|
|
|
|
DSNACCOX uses the set of criteria that are shown in DSNACCOX formulas for
recommending actions on page 907 to evaluate table spaces and index spaces. By
default, DSNACCOX evaluates all table spaces and index spaces in the subsystem
that have entries in the real-time statistics tables. However, you can override this
default through input parameters.
Important information about DSNACCOX recommendations:
v DSNACCOX makes recommendations based on general formulas that require
input from the user about the maintenance policies for a subsystem. These
recommendations might not be accurate for every installation.
v If the real-time statistics tables contain information for only a small percentage
of your DB2 subsystem, the recommendations that DSNACCOX makes might
not be accurate for the entire subsystem.
v Before you perform any action that DSNACCOX recommends, ensure that the
object for which DSNACCOX makes the recommendation is available, and that
the recommended action can be performed on that object. For example, REORG
might be recommended for an object, but the object might be stopped.
|
|
|
|
Environment
DSNACCOX must run in a WLM-established stored procedure address space.
You should bind the package for DSNACCOX with isolation UR to avoid lock
contention. You can find the installation steps for DSNACCOX in job DSNTIJSG.
Authorization required
To execute the CALL DSNACCOX statement, the owner of the package or plan
that contains the CALL statement must have one or more of the following
privileges on each package that the stored procedure uses:
950
v
v
v
v
The owner of the package or plan that contains the CALL statement must also
have:
|
Syntax diagram
The following syntax diagram shows the CALL statement for invoking
DSNACCOX. Because the linkage convention for DSNACCOX is GENERAL WITH
NULLS, if you pass parameters in host variables, you need to include a null
indicator with every host variable. Null indicators for input host variables must be
initialized before you execute the CALL statement.
951
CALL DSNACCOX (
QueryType
NULL
LocalSchema
NULL
ChkLvl
NULL
CRUpdatedPagesAbs
NULL
ICRUpdatedPagesAbs
NULL
RRTInsertAbs
NULL
RRTDisorgLOBPct
NULL
-1
RRIInsertPct
NULL
-1
RRIAppendInsertPct
NULL
-1
RRINumLevelsLimit
NULL
-1
SRIInsDelUpdPct
NULL
-1
Criteria
NULL
CRChangesPct
NULL
-1
CatlgSchema
NULL
RRTInsertPct
NULL
-1
RRIDeleteAbs
NULL
RRILeafLimit
NULL
-1
SRTMassDelLimit
NULL
-1
ExtentLimit
NULL
-1
RRTIndRefLimit
NULL
-1
RRIMassDelLimit
NULL
-1
SRIMassDelLimit
NULL
-1
ICRUpdatedPagesPct
NULL
-1
RRTUnclustInsPct
NULL
-1
SRTInsDelUpdAbs
NULL
CRUpdatedPagesPct
NULL
-1
,
RRTMassDelLimit
NULL
-1
RRIDeletePct
NULL
-1
SRTInsDelUpdPct
NULL
-1
SRIInsDelAbs
NULL
Restricted
NULL
RRTDeleteAbs
NULL
ICType
NULL
CRIndexSize
NULL
-1
RRIPseudoDeletePct
NULL
-1
CRDaySncLastCopy
NULL
-1
,
RRTDataSpaceRat
NULL
-1
RRIInsertAbs
NULL
-1
ICRChangesPct
NULL
-1
RRTDeletePct
NULL
-1
ObjectType
NULL
Option descriptions
In the following option descriptions, the default value for an input parameter is
the value that DSNACCOX uses if you specify a null value.
QueryType
Specifies the types of actions that DSNACCOX recommends. This field
contains one or more of the following values. Each value is enclosed in single
quotation marks and separated from other values by a space.
ALL
952
REORG
Makes a recommendation on whether to perform REORG. Choosing
this value causes DSNACCOX to process the EXTENTS value also.
EXTENTS
Indicates when data sets have exceeded a user-specified extents limit.
RESTRICT
Indicates which objects are in a restricted state.
DSNACCOX recommends REORG on the table space when one of the
following conditions is true, and REORG (or ALL) is also specified for the
value of QUERYTYPE:
v The table space is in REORG-pending status.
v The table space is in advisory REORG-pending status as the result of an
ALTER TABLE statement.
DSNACCOX recommends REORG on the index when on the following
conditions is true and REORG (or ALL) is also specified for the value of
QUERYTYPE::
v The index is in REORG-pending status.
v The index is in advisory REORG-pending as the result of an ALTER TABLE
statement.
DSNACCOX recommends FULL COPY on the table space when on the
following conditions is true and COPY (or ALL) is also specified for the value
of QUERYTYPE::
v The table space is in COPY-pending status.
v The table space is in informational COPY-pending status.
DSNACCOX recommends FULL COPY on the index when on the following
conditions is true and COPY (or ALL) is also specified for the value of
QUERYTYPE: and SYSINDEX.COPY=Y:
v The index is in COPY-pending status.
v The index is in informational COPY-pending status.
QueryType is an input parameter of type VARCHAR(40). The default value is
ALL.
ObjectType
Specifies the types of objects for which DSNACCOX recommends actions:
ALL
TS
IX
Incremental image copy. This value is valid for table spaces only.
953
CatlgSchema
Specifies the qualifier for DB2 catalog table names. CatlgSchema is an input
parameter of type VARCHAR(128). The default value is SYSIBM.
LocalSchema
Specifies the qualifier for the names of local tables that DSNACCOX references.
LocalSchema is an input parameter of type VARCHAR(128). The default value is
DSNACC.
|
|
|
ChkLvl
Specifies the types of checking that DSNACCOX performs, and indicates
whether to include objects that fail those checks in the DSNACCOX
recommendations result set. This value is the sum of any combination of the
following values:
|
|
|
16
32
64
954
CRUpdatedPagesPct
Specifies, when combined with CRUpdatedPagesAbs, a criterion for
recommending a full image copy on a table space or index space. If both of the
following conditions are true for a table space, DSNACCOX recommends an
image copy:
v The total number of distinct updated pages, divided by the total number of
preformatted pages (expressed as a percentage) is greater than
CRUpdatedPagesPct.
v The total number of distinct updates pages is greater than
CRUpdatedPagesABS.
If all of the following conditions are true for an index space, DSNACCOX
recommends an image copy:
v The total number of distinct updated pages, divided by the total number of
preformatted pages (expressed as a percentage) is greater than
CRUpdatedPagesPct.
v The total number of distinct updates pages is greater than
CRUpdatedPagesABS.
v The number of active pages in the index space or partition is greater than
CRIndexSize.
CRUpdatedPagesPct is an input parameter of type DOUBLE. The default is 20.0.
A negative value turns off both this criteria and CRUpdatedPagesABS.
CRUpdatedPagesABS
Specifies, when combined with CRUpdatedPagesPct, a criterion for
recommending a full image copy on a table space or index space. If both of the
following conditions are true for a table space, DSNACCOX recommends an
image copy:
v The total number of distinct updated pages, divided by the total number of
preformatted pages (expressed as a percentage) is greater than
CRUpdatedPagesPct.
v The total number of distinct updated pages is greater than
CRUpdatedPagesAbs.
If all of the following conditions are true for an index space, DSNACCOX
recommends an image copy:
v The total number of distinct updated pages, divided by the total number of
preformatted pages (expressed as a percentage) is greater than
CRUpdatedPagesPct.
v The total number of distinct updates pages is greater than
CRUpdatedPagesAbs.
v The number of active pages in the index space or partition is greater than
CRIndexSize.
CRUpdatedPagesAbs is an input parameter of type INTEGER. The default value
is 0.
CRChangesPct
Specifies a criterion for recommending a full image copy on a table space or
index space. If the following condition is true for a table space, DSNACCOX
recommends an image copy:
The total number of insert, update, and delete operations since the last
image copy, divided by the total number of rows or LOBs in a table space
or partition (expressed as a percentage) is greater than CRChangesPct.
955
If both of the following conditions are true for an index table space,
DSNACCOX recommends an image copy:
v The total number of insert and delete operations since the last image copy,
divided by the total number of entries in the index space or partition
(expressed as a percentage) is greater than CRChangesPct.
v The number of active pages in the index space or partition is greater than
CRIndexSize.
CRChangesPct is an input parameter of type DOUBLE. The default is 10.0. A
negative value turns off this criterion.
CRDaySncLastCopy
Specifies a criterion for recommending a full image copy on a table space or
index space. If the number of days since the last image copy is greater than
this value, DSNACCOX recommends an image copy.
CRDaySncLastCopy is an input parameter of type INTEGER. The default is 7. A
negative value turns off this criterion.
ICRUpdatedPagesPct
Specifies a criterion for recommending an incremental image copy on a table
space. If both of the following conditions are true, DSNACCOX recommends
an incremental image copy:
v The number of distinct pages that were updated since the last image copy,
divided by the total number of active pages in the table space or partition
(expressed as a percentage) is greater than ICRUpdatedPagesPct..
v The number of distinct pages that were updated since last image copy is
greater than ICRUpdatedPagesAbs.
ICRUpdatedPagesPct is an input parameter of type DOUBLE. The default value
is 1.0. A negative value turns off this criterion and ICRUpdatedPagesAbs.
ICRChangesPct
Specifies a criterion for recommending an incremental image copy on a table
space. If the following condition is true, DSNACCOX recommends an
incremental image copy:
The ratio of the number of insert, update, or delete operations since the last
image copy, to the total number of rows or LOBs in a table space or
partition (expressed as a percentage) is greater than ICRChangesPct.
ICRChangesPct is an input parameter of type DOUBLE. The default is 1.0. A
negative value turns off this criterion.
CRIndexSize
Specifies the minimum index size before checking the ICRUpdatedPagesPct or
ICRChangesPctcriteria for recommending a full image copy on an index space.
CRIndexSize is an input parameter of type INTEGER. The default is 50. A
negative value turns of this criterion and ICRChangesPct.
RRTInsertPct
Specifies, when combined with RRTInsertAbs, a criterion for recommending
that the REORG utility is to be run on a table space. If both of the following
condition are true, DSNACCOX recommends running REORG:
v The sum of insert, update, and delete operations since the last REORG,
divided by the total number of rows or LOBs in the table space or partition
(expressed as a percentage) is greater than RRTInsertPct
v The sum of insert operations since the last REORG is greater than
RRTInsertAbs.
956
957
958
959
960
v The number of mass deletes from a table space or partition since the last
REORG or LOAD REPLACE is greater than SRTMassDelLimit.
SRTMassDelLimit is an input parameter of type DOUBLE. The default is 0.0. A
negative value turns off this criterion.
SRIInsDelPct
Specifies, when combined with SRIInsDelAbs, a criterion for recommending
that the RUNSTATS utility is to be run on an index space. If both of the
following conditions are true, DSNACCOX recommends running RUNSTATS:
v The number of inserted and deleted index entries since the last RUNSTATS
on an index space or partition, divided by the total number of index entries
in the index space or partition (expressed as a percentage) is greater than
SRIInsDelUpdPct.
v The sum of the number of inserted and deleted index entries since the last
RUNSTATS on an index space or partition is greater than SRIInsDelUpdAbs.
SRIInsDelPct is an input parameter of type DOUBLE. The default is 20.0. A
negative value turns off this criterion.
SRIInsDelAbs
Specifies, when combined with SRIInsDelPct, specifies a criterion for
recommending that the RUNSTATS utility is to be run on an index space. If the
following condition is true, DSNACCOX recommends running RUNSTATS:
v The number of inserted and deleted index entries since the last RUNSTATS
on an index space or partition, divided by the total number of index entries
in the index space or partition (expressed as a percentage) is greater than
SRIInsDelUpdPct.
v The sum of the number of inserted and deleted index entries since the last
RUNSTATS on an index space or partition is greater than SRIInsDelUpdAbs,
SRIInsDelAbs is an input parameter of type INTEGER. The default is 0.
SRIMassDelLimit
Specifies a criterion for recommending that the RUNSTATS utility is to be run
on an index space. If the number of mass deletes from an index space or
partition since the last REORG, REBUILD INDEX, or LOAD REPLACE is
greater than this value, DSNACCOX recommends running RUNSTATS.
SRIMassDelLimit is an input parameter of type INTEGER. The default value is
0. A negative value turns off this criterion.
|
|
|
|
|
|
|
|
|
ExtentLimit
Specifies a criterion for recommending that the REORG utility is to be run on a
table space or index space. Also specifies that DSNACCOX is to warn the user
that the table space or index space has used too many extents. DSNACCOX
recommends running REORG, and altering data set allocations if the following
condition is true:
v The number of physical extents in the index space, table space, or partition
is greater than ExtentLimit.
ExtentLimit is an input parameter of type INTEGER. The default value is 254.
A negative value turns off this criterion.
LastStatement
When DSNACCOX returns a severe error (return code 12), this field contains
the SQL statement that was executing when the error occurred. LastStatement is
an output parameter of type VARCHAR(8012).
961
ReturnCode
The return code from DSNACCOX execution. Possible values are:
0
12
14
DSNACCOX terminated because the real time statistics table were not
yet migrated to the catalog.
15
16
962
Figure 164. DSNACCOX formula for recommending a full image copy on a table space
The figure below shows the formula that DSNACCOX uses to recommend a full
image copy on an index space.
Figure 165. DSNACCOX formula for recommending a full image copy on an index space
The figure below shows the formula that DSNACCOX uses to recommend an
incremental image copy on a table space.
Figure 166. DSNACCOX formula for recommending an incremental image copy on a table space
The figure below shows the formula that DSNACCOX uses to recommend a
REORG on a table space. If the table space is a LOB table space, and CHCKLVL=1,
the formula does not include EXTENTS>ExtentLimit.
963
The figure below shows the formula that DSNACCOX uses to recommend a
REORG on an index space.
The figure below shows the formula that DSNACCOX uses to recommend
RUNSTATS on a table space.
964
The figure below shows the formula that DSNACCOX uses to recommend
RUNSTATS on an index space.
965
Example
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The figure below is a COBOL example that shows variable declarations and an
SQL CALL for obtaining recommendations for objects in databases DSN8D91A and
DSN8D91L. This example also outlines the steps that you need to perform to
retrieve the two result sets that DSNACCOX returns. These result sets are
described in DSNACCOX output on page 915. See DB2 Application Programming
and SQL Guide for more information about how to retrieve result sets from a stored
procedure.
WORKING-STORAGE SECTION.
***********************
* DSNACCOX PARAMETERS *
***********************
01 QUERYTYPE.
49
QUERYTYPE-LN
PICTURE S9(4) COMP VALUE 40.
49
QUERYTYPE-DTA
PICTURE X(40) VALUE 'ALL'.
01 OBJECTTYPE.
49
OBJECTTYPE-LN
PICTURE S9(4) COMP VALUE 3.
49
OBJECTTYPE-DTA
PICTURE X(3) VALUE 'ALL'.
01 ICTYPE.
49
ICTYPE-LN
PICTURE S9(4) COMP VALUE 1.
49
ICTYPE-DTA
PICTURE X(1) VALUE 'B'.
01 STATSSCHEMA.
49
STATSSCHEMA-LN
PICTURE S9(4) COMP VALUE 128.
49
STATSSCHEMA-DTA
PICTURE X(128) VALUE 'SYSIBM'.
01 CATLGSCHEMA.
49
CATLGSCHEMA-LN
PICTURE S9(4) COMP VALUE 128.
49
CATLGSCHEMA-DTA
PICTURE X(128) VALUE 'SYSIBM'.
01 LOCALSCHEMA.
49
LOCALSCHEMA-LN
PICTURE S9(4) COMP VALUE 128.
49
LOCALSCHEMA-DTA
PICTURE X(128) VALUE 'DSNACC'.
01 CHKLVL
PICTURE S9(9) COMP VALUE +3.
01 CRITERIA.
49
CRITERIA-LN
PICTURE S9(4) COMP VALUE 4096.
49
CRITERIA-DTA
PICTURE X(4096) VALUE SPACES.
01 RESTRICTED.
49
RESTRICTED-LN
PICTURE S9(4) COMP VALUE 80.
49
RESTRICTED-DTA
PICTURE X(80) VALUE SPACES.
01 CRUPDATEDPAGESPCT
PICTURE S9(9) COMP VALUE +0.
01 CRUPDATEDPAGESABS
PICTURE S9(9) COMP VALUE +0.
01 CRCHANGESPCT
PICTURE S9(9) COMP VALUE +0.
01 CRDAYSNCLASTCOPY
PICTURE S9(9) COMP VALUE +0.
01 ICRUPDATEDPAGESPCT
PICTURE S9(9) COMP VALUE +0.
01 ICRCHANGESPCT
PICTURE S9(9) COMP VALUE +0.
01 CRINDEXSIZE
PICTURE S9(9) COMP VALUE +0.
01 RRTINSERTPCT
PICTURE S9(9) COMP VALUE +0.
01 RRTINSERTABS
PICTURE S9(9) COMP VALUE +0.
966
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
RRTDELETEPCT
RRTDELETEABS
RRTUNCLUSTINSPCT
RRTDISORGLOBPCT
RRTDATASPACERAT
RRTMASSDELLIMIT
RRTINDREFLIMIT
RRIINSERTPCT
RRIINSERTABS
RRIDELETEPCT
RRIDELETEABS
RRIAPPENDINSERTPCT
RRIPSEUDODELETEPCT
RRIMASSDELLIMIT
RRILEAFLIMIT
RRINUMLEVELSLIMIT
SRTINSDELUPDPCT
SRTINSDELUPDABS
SRTMASSDELLIMIT
SRIINSDELPCT
SRIINSDELABS
SRIMASSDELLIMIT
EXTENTLIMIT
LASTSTATEMENT.
49
LASTSTATEMENT-LN
49
LASTSTATEMENT-DTA
RETURNCODE
ERRORMSG.
49
ERRORMSG-LN
49
ERRORMSG-DTA
IFCARETCODE
IFCARESCODE
EXCESSBYTES
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
S9(9)
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
COMP
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
+0.
*****************************************
* INDICATOR VARIABLES.
*
* INITIALIZE ALL NON-ESSENTIAL INPUT
*
* VARIABLES TO -1, TO INDICATE THAT THE *
* INPUT VALUE IS NULL.
*
*****************************************
01 QUERYTYPE-IND
PICTURE S9(4)
01 OBJECTTYPE-IND
PICTURE S9(4)
01 ICTYPE-IND
PICTURE S9(4)
01 STATSSCHEMA-IND
PICTURE S9(4)
01 CATLGSCHEMA-IND
PICTURE S9(4)
01 LOCALSCHEMA-IND
PICTURE S9(4)
01 CHKLVL-IND
PICTURE S9(4)
01 CRITERIA-IND
PICTURE S9(4)
01 RESTRICTED-IND
PICTURE S9(4)
01 CRUPDATEDPAGESPCT-IND
PICTURE S9(4)
01 CRUPDATEDPAGESABS-IND
PICTURE S9(4)
01 CRCHANGESPCT-IND
PICTURE S9(4)
01 CRDAYSNCLASTCOPY-IND
PICTURE S9(4)
01 ICRUPDATEDPAGESPCT-IND
PICTURE S9(4)
01 ICRCHANGESPCT-IND
PICTURE S9(4)
01 CRINDEXSIZE-IND
PICTURE S9(4)
01 RRTINSERTPCT-IND
PICTURE S9(4)
01 RRTINSERTABS-IND
PICTURE S9(4)
01 RRTDELETEPCT-IND
PICTURE S9(4)
01 RRTDELETEABS-IND
PICTURE S9(4)
01 RRTUNCLUSTINSPCT-IND
PICTURE S9(4)
01 RRTDISORGLOBPCT-IND
PICTURE S9(4)
01 RRTDATASPACERAT-IND
PICTURE S9(4)
01 RRTMASSDELLIMIT-IND
PICTURE S9(4)
01 RRTINDREFLIMIT-IND
PICTURE S9(4)
01 RRIINSERTPCT-IND
PICTURE S9(4)
01 RRIINSERTABS-IND
PICTURE S9(4)
01 RRIDELETEPCT-IND
PICTURE S9(4)
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
+0.
+0.
+0.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
967
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
RRIDELETEABS-IND
RRIAPPENDINSERTPCT-IND
RRIPSEUDODELETEPCT-IND
RRIMASSDELLIMIT-IND
RRILEAFLIMIT-IND
RRINUMLEVELSLIMIT-IND
SRTINSDELUPDPCT-IND
SRTINSDELUPDABS-IND
SRTMASSDELLIMIT-IND
SRIINSDELPCT-IND
SRIINSDELABS-IND
SRIMASSDELLIMIT-IND
EXTENTLIMIT-IND
LASTSTATEMENT-IND
RETURNCODE-IND
ERRORMSG-IND
IFCARETCODE-IND
IFCARESCODE-IND
EXCESSBYTES-IND
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
+0.
+0.
+0.
+0.
+0.
+0
PROCEDURE DIVISION.
*********************************************************
* SET VALUES FOR DSNACCOX INPUT PARAMETERS:
*
* - USE THE CHKLVL PARAMETER TO CAUSE DSNACCOX TO CHECK *
*
FOR RELATED TABLE SPACES WHEN PROCESSING INDEX
*
*
SPACES, AND DELETE RECOMMENDATION FOR INDEXSPACES
*
*
WHEN AN ACTION (SUCH AS REORG) ON THE TABLE SPACE
*
*
WILL ALSO CAUSE THE ACTION TO BE DONE ON THE INDEX *
*
SPACE. (CHKLVL=64)
*
* - USE THE CRITERIA PARAMETER TO CAUSE DSNACCOX TO
*
*
MAKE RECOMMENDATIONS ONLY FOR OBJECTS IN DATABASES *
*
DSN8D91A AND DSN8D91L.
*
* - FOR THE FOLLOWING PARAMETERS, SET THESE VALUES,
*
*
WHICH ARE LOWER THAN THE DEFAULTS:
*
*
CRUPDATEDPAGESPCT 4
*
*
CRCHANGESPCT
2
*
*
RRTINSDELUPDPCT
2
*
*
RRTUNCLUSTINSPCT
5
*
*
RRTDISORGLOBPCT
5
*
*
RRIAPPENDINSERTPCT 5
*
*
SRTINSDELUPDPCT
5
*
*
SRIINSDELPCT
5
*
*
EXTENTLIMIT
3
*
* - EXCLUDE CHECKING FOR THESE CRITERIA BY SET THE
*
*
FOLLOWING VALUES TO A NEGATIVE VALUE.
*
*
RRTMASSDELLIMIT
-1
*
*
RRIMASSDELLIMIT
-1
*
*********************************************************
MOVE 64 TO CHKLVL.
MOVE SPACES TO CRITERIA-DTA.
MOVE 'DBNAME = ''DSN8D91A'' OR DBNAME = ''DSN8D91L'''
TO CRITERIA-DTA.
MOVE 46 TO CRITERIA-LN.
MOVE 4 TO CRUPDATEDPAGESPCT.
MOVE 2 TO CRCHANGESPCT.
MOVE 2 TO RRTINSERTPCT.
MOVE 5 TO RRTUNCLUSTINSPCT.
MOVE 5 TO RRTDISORGLOBPCT.
MOVE 5 TO RRIAPPENDINSERTPCT.
MOVE 5 TO SRTINSDELUPDPCT.
MOVE 5 TO SRIINSDELPCT.
MOVE 3 TO EXTENTLIMIT.
MOVE -1 TO RRTMASSDELLIMIT.
MOVE -1 TO RRIMASSDELLIMIT.
********************************
* INITIALIZE OUTPUT PARAMETERS *
********************************
MOVE SPACES TO LASTSTATEMENT-DTA.
968
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MOVE 1 TO LASTSTATEMENT-LN.
MOVE 0 TO RETURNCODE-O2.
MOVE SPACES TO ERRORMSG-DTA.
MOVE 1 TO ERRORMSG-LN.
MOVE 0 TO IFCARETCODE.
MOVE 0 TO IFCARESCODE.
MOVE 0 TO EXCESSBYTES.
*******************************************************
* SET THE INDICATOR VARIABLES TO 0 FOR NON-NULL INPUT *
* PARAMETERS (PARAMETERS FOR WHICH YOU DO NOT WANT
*
* DSNACCOX TO USE DEFAULT VALUES) AND FOR OUTPUT
*
* PARAMETERS.
*
*******************************************************
MOVE 0 TO CHKLVL-IND.
MOVE 0 TO CRITERIA-IND.
MOVE 0 TO CRUPDATEDPAGESPCT-IND.
MOVE 0 TO CRCHANGESPCT-IND.
MOVE 0 TO RRTINSERTPCT-IND.
MOVE 0 TO RRTUNCLUSTINSPCT-IND.
MOVE 0 TO RRTDISORGLOBPCT-IND.
MOVE 0 TO RRIAPPENDINSERTPCT-IND.
MOVE 0 TO SRTINSDELUPDPCT-IND.
MOVE 0 TO SRIINSDELPCT-IND.
MOVE 0 TO EXTENTLIMIT-IND.
MOVE 0 TO LASTSTATEMENT-IND.
MOVE 0 TO RETURNCODE-IND.
MOVE 0 TO ERRORMSG-IND.
MOVE 0 TO IFCARETCODE-IND.
MOVE 0 TO IFCARESCODE-IND.
MOVE 0 TO EXCESSBYTES-IND.
MOVE 0 TO RRTMASSDELLIMIT-IND.
MOVE 0 TO RRIMASSDELLIMIT-IND.
*****************
* CALL DSNACCOX *
*****************
EXEC SQL
CALL SYSPROC.DSNACCOX
(:QUERYTYPE
:OBJECTTYPE
:ICTYPE
:STATSSCHEMA
:CATLGSCHEMA
:LOCALSCHEMA
:CHKLVL
:CRITERIA
:RESTRICTED
:CRUPDATEDPAGESPCT
:CRUPDATEDPAGESABS
:CRCHANGESPCT
:CRDAYSNCLASTCOPY
:ICRUPDATEDPAGESPCT
:ICRCHANGESPCT
:CRINDEXSIZE
:RRTINSERTPCT
:RRTINSERTABS
:RRTDELETEPCT
:RRTDELETEABS
:RRTUNCLUSTINSPCT
:RRTDISORGLOBPCT
:RRTDATASPACERAT
:RRTMASSDELLIMIT
:RRTINDREFLIMIT
:RRIINSERTPCT
:RRIINSERTABS
:RRIDELETEPCT
:RRIDELETEABS
:RRIAPPENDINSERTPCT
:QUERYTYPE-IND,
:OBJECTTYPE-IND,
:ICTYPE-IND,
:STATSSCHEMA-IND,
:CATLGSCHEMA-IND,
:LOCALSCHEMA-IND,
:CHKLVL-IND,
:CRITERIA-IND,
:RESTRICTED-IND,
:CRUPDATEDPAGESPCT-IND,
:CRUPDATEDPAGESABS-IND,
:CRCHANGESPCT-IND,
:CRDAYSNCLASTCOPY-IND,
:ICRUPDATEDPAGESPCT-IND,
:ICRCHANGESPCT-IND,
:CRINDEXSIZE-IND,
:RRTINSERTPCT-IND,
:RRTINSERTABS-IND,
:RRTDELETEPCT-IND,
:RRTDELETEABS-IND,
:RRTUNCLUSTINSPCT-IND,
:RRTDISORGLOBPCT-IND,
:RRTDATASPACERAT-IND,
:RRTMASSDELLIMIT-IND,
:RRTINDREFLIMIT-IND,
:RRIINSERTPCT-IND,
:RRIINSERTABS-IND,
:RRIDELETEPCT-IND,
:RRIDELETEABS-IND,
:RRIAPPENDINSERTPCT-IND,
Appendix F. Real-time statistics
969
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*************************************************************
* ASSUME THAT THE SQL CALL RETURNED +466, WHICH MEANS THAT *
* RESULT SETS WERE RETURNED. RETRIEVE RESULT SETS.
*
*************************************************************
* LINK EACH RESULT SET TO A LOCATOR VARIABLE
EXEC SQL ASSOCIATE LOCATORS (:LOC1, :LOC2)
WITH PROCEDURE SYSPROC.DSNACCOX
END-EXEC.
* LINK A CURSOR TO EACH RESULT SET
EXEC SQL ALLOCATE C1 CURSOR FOR RESULT SET :LOC1
END-EXEC.
EXEC SQL ALLOCATE C2 CURSOR FOR RESULT SET :LOC2
END-EXEC.
* PERFORM FETCHES USING C1 TO RETRIEVE ALL ROWS FROM FIRST RESULT SET
* PERFORM FETCHES USING C2 TO RETRIEVE ALL ROWS FROM SECOND RESULT SET
DSNACCOX output
|
|
|
|
|
The first result set contains the results from IFI COMMAND calls that DSNACCOX
makes. The following table shows the format of the first result set.
Table 182. Result set row for first DSNACCOX result set
Column name
Data type
Contents
RS_SEQUENCE
INTEGER
|
|
RS_DATA
CHAR(80)
|
|
|
|
|
|
|
|
|
|
The second result set contains DSNACCOXs recommendations. This result set
contains one or more rows for a table space or index space. A nonpartitioned table
space or nonpartitioning index space can have at most one row in the result set. A
partitioned table space or partitioning index space can have at most one row for
each partition. A table space, index space, or partition has a row in the result set if
both of the following conditions are true:
v If the Criteria input parameter contains a search condition, the search condition
is true for the table space, index space, or partition.
:RRIPSEUDODELETEPCT
:RRIMASSDELLIMIT
:RRILEAFLIMIT
:RRINUMLEVELSLIMIT
:SRTINSDELUPDPCT
:SRTINSDELUPDABS
:SRTMASSDELLIMIT
:SRIINSDELPCT
:SRIINSDELABS
:SRIMASSDELLIMIT
:EXTENTLIMIT
:LASTSTATEMENT
:RETURNCODE
:ERRORMSG
:IFCARETCODE
:IFCARESCODE
:EXCESSBYTES
END-EXEC.
:RRIPSEUDODELETEPCT-IND,
:RRIMASSDELLIMIT-IND,
:RRILEAFLIMIT-IND,
:RRINUMLEVELSLIMIT-IND,
:SRTINSDELUPDPCT-IND,
:SRTINSDELUPDABS-IND,
:SRTMASSDELLIMIT-IND,
:SRIINSDELPCT-IND,
:SRIINSDELABS-IND,
:SRIMASSDELLIMIT-IND,
:EXTENTLIMIT-IND,
:LASTSTATEMENT-IND,
:RETURNCODE-IND,
:ERRORMSG-IND,
:IFCARETCODE-IND,
:IFCARESCODE-IND,
:EXCESSBYTES-IND)
v DSNACCOX recommends at least one action for the table space, index space, or
partition.
970
|
|
Table 183. Result set row for second DSNACCOX result set
Column name
Data type
Description
DBNAME
VARCHAR(24)
NAME
VARCHARCHAR(128)
PARTITION
INTEGER
|
|
INSTANCE
INTEGER
CLONE
CHAR(1)
|
|
|
OBJECTTYPE
CHAR(2)
INDEXSPACE
VARCHAR(24)
CREATOR
VARCHAR(128)
OBJECTSTATUS
CHAR(36)
CHAR(4)
COPY recommendation:
v If OBJECTTYPE is TS: FULL (full image copy), INC
(incremental image copy), or NO
v If OBJECTTYPE is IX: YES or NO
RUNSTATS
CHAR(3)
EXTENTS
CHAR(3)
REORG
CHAR(3)
971
Table 183. Result set row for second DSNACCOX result set (continued)
Column name
Data type
Description
INEXCEPTTABLE
CHAR(40)
ASSOCIATEDTS
CHAR(8)
COPYLASTTIME
TIMESTAMP
LOADRLASTTIME
TIMESTAMP
REBUILDLASTTIME
TIMESTAMP
CRUPDPGSPCT
DOUBLE
CRUPDPGSABS
INTEGER
972
Table 183. Result set row for second DSNACCOX result set (continued)
Column name
Data type
Description
CRCPYCHGPCT
INTEGER
CRDAYSCELSTCPY
INTEGER
CRINDEXSIZE
INTEGER
REORGLASTTIME
TIMESTAMP
RRTINSERTSPCT
DOUBLE
RRTINSERTSABS
INTEGER
973
Table 183. Result set row for second DSNACCOX result set (continued)
Column name
Data type
Description
RRTDELETESPCT
DOUBLE
RRTDELETESABS
INTEGER
RRTUNCINSPCT
DOUBLE
RRTDISORGLOBPCT
DOUBLE
| RRTDATASPACERAT
|
|
DOUBLE
RRTMASSDELETE
INTEGER
974
Table 183. Result set row for second DSNACCOX result set (continued)
Column name
Data type
Description
RRTINDREF
INTEGER
RRIINSERTPCT
DOUBLE
RRIINSERTABS
INTEGER
RRIDELETEPCT
DOUBLE
RRIDELETABS
INTEGER
975
Table 183. Result set row for second DSNACCOX result set (continued)
Column name
Data type
Description
RRIAPPINSPCT
DOUBLE
RRIPSDDELPCT
INTEGER
RRIMASSDELETE
INTEGER
RRILEAF
INTEGER
RRINUMLEVELS
INTEGER
976
Table 183. Result set row for second DSNACCOX result set (continued)
Column name
Data type
Description
STATSLASTTIME
TIMESTAMP
SRTINSDELUPDPCT
DOUBLE
SRTINSDELUPDABS
INTEGER
SRTMASSDELETE
INTEGER
SRIINSDELPCT
DOUBLE
SRIINSDELABS
INTEGER
977
Table 183. Result set row for second DSNACCOX result set (continued)
Column name
Data type
Description
SRIMASSDELETE
INTEGER
TOTALEXTENTS
SMALLINT
PSPI
|
|
|
|
|
|
PSPI
|
|
|
|
|
DSNACCOR uses the set of criteria that are shown in DSNACCOR formulas for
recommending actions on page 884 to evaluate table spaces and index spaces. By
default, DSNACCOR evaluates all table spaces and index spaces in the subsystem
that have entries in the real-time statistics tables. However, you can override this
default through input parameters.
Important information about DSNACCOR recommendations:
v DSNACCOR makes recommendations based on general formulas that require
input from the user about the maintenance policies for a subsystem. These
recommendations might not be accurate for every installation.
978
v If the real-time statistics tables contain information for only a small percentage
of your DB2 subsystem, the recommendations that DSNACCOR makes might
not be accurate for the entire subsystem.
v Before you perform any action that DSNACCOR recommends, ensure that the
object for which DSNACCOR makes the recommendation is available, and that
the recommended action can be performed on that object. For example, before
you can perform an image copy on an index, the index must have the COPY
YES attribute.
Environment
DSNACCOR must run in a WLM-established stored procedure address space.
You should bind the package for DSNACCOR with isolation UR to avoid lock
contention. You can find the installation steps for DSNACCOR in job DSNTIJSG.
Authorization required
To execute the CALL DSNACCOR statement, the owner of the package or plan
that contains the CALL statement must have one or more of the following
privileges on each package that the stored procedure uses:
v The EXECUTE privilege on the package for DSNACCOR
v Ownership of the package
v PACKADM authority for the package collection
v SYSADM authority
The owner of the package or plan that contains the CALL statement must also
have:
v SELECT authority on the real-time statistics tables
v Select authority on catalog tables
v The DISPLAY system privilege
Syntax diagram
The following syntax diagram shows the CALL statement for invoking
DSNACCOR. Because the linkage convention for DSNACCOR is GENERAL WITH
NULLS, if you pass parameters in host variables, you need to include a null
indicator with every host variable. Null indicators for input host variables must be
initialized before you execute the CALL statement.
979
CALL DSNACCOR (
CatlgSchema
NULL
CRUpdatedPagesPct
NULL
ICRChangesPct
NULL
RRTDisorgLOBPct
NULL
RRIAppendInsertPct
NULL
RRINumLevelsLimit
NULL
SRIInsDelUpdPct
NULL
QueryType
NULL
ObjectType
NULL
LocalSchema
NULL
ChkLvl
NULL
CRChangesPct
NULL
CRIndexSize
NULL
,
SRTInsDelUpdPct
NULL
Restricted
NULL
,
SRTInsDelUpdAbs
NULL
RRILeafLimit
NULL
SRTMassDelLimit
NULL
ExtentLimit
NULL
RRIInsertDeletePct
NULL
RRIMassDelLimit
NULL
SRIMassDelLimit
NULL
ICRUpdatedPagesPct
NULL
RRTUnclustInsPct
NULL
RRTIndRefLimit
NULL
StatsSchema
NULL
CRDaySncLastCopy
NULL
RRIPseudoDeletePct
NULL
SRIInsDelUpdAbs
NULL
ICType
NULL
Criteria
NULL
RRTInsDelUpdPct
NULL
RRTMassDelLimit
NULL
Option descriptions
In the following option descriptions, the default value for an input parameter is
the value that DSNACCOR uses if you specify a null value.
QueryType
Specifies the types of actions that DSNACCOR recommends. This field
contains one or more of the following values. Each value is enclosed in single
quotation marks and separated from other values by a space.
ALL
980
ALL
TS
IX
Incremental image copy. This value is valid for table spaces only.
For objects that are listed in the recommendations result set, check the
SYSTABLESPACE or SYSINDEXES catalog tables to ensure that those
objects have not been deleted. If value 16 is not also chosen, exclude
rows for the deleted objects from the recommendations result set.
DSNACCOR excludes objects from the recommendations result set if
those objects are not in the SYSTABLESPACE or SYSINDEXES catalog
tables.
|
|
|
For index spaces that are listed in the recommendations result set,
check the SYSTABLES, SYSTABLESPACE, and SYSINDEXES catalog
tables to determine the name of the table space that is associated with
each index space.
Choosing this value causes DSNACCOR to also check for rows in the
recommendations result set for objects that have been deleted but have
entries in the real-time statistics tables (value 1). This means that if
value 16 is not also chosen, rows for deleted objects are excluded from
the recommendations result set.
981
16
For objects that are listed in the recommendations result set, check the
SYSTABLESPACE or SYSINDEXES catalog tables to ensure that those
objects have not been deleted (value 1). In result set rows for deleted
objects, specify the word ORPHANED in the OBJECTSTATUS column.
32
64
982
CRChangesPct
Specifies a criterion for recommending a full image copy on a table space or
index space. If the following condition is true for a table space, DSNACCOR
recommends an image copy:
The total number of insert, update, and delete operations since the last
image copy, divided by the total number of rows or LOBs in a table space
or partition (expressed as a percentage) is greater than CRChangesPct.
See item 3 in Figure 148 on page 884. If both of the following conditions are
true for an index table space, DSNACCOR recommends an image copy:
v The total number of insert and delete operations since the last image copy,
divided by the total number of entries in the index space or partition
(expressed as a percentage) is greater than CRChangesPct.
v The number of active pages in the index space or partition is greater than
CRIndexSize.
See items 2 and 4 in Figure 149 on page 885. CRChangesPct is an input
parameter of type INTEGER. The default is 10.
CRDaySncLastCopy
Specifies a criterion for recommending a full image copy on a table space or
index space. If the number of days since the last image copy is greater than
this value, DSNACCOR recommends an image copy. (See item 1 in Figure 148
on page 884 and item 1 in Figure 149 on page 885.) CRDaySncLastCopy is an
input parameter of type INTEGER. The default is 7.
ICRUpdatedPagesPct
Specifies a criterion for recommending an incremental image copy on a table
space. If the following condition is true, DSNACCOR recommends an
incremental image copy:
The number of distinct pages that were updated since the last image copy,
divided by the total number of active pages in the table space or partition
(expressed as a percentage) is greater than CRUpdatedPagesPct.
(See item 1 in Figure 150 on page 885.) ICRUpdatedPagesPct is an input
parameter of type INTEGER. The default is 1.
ICRChangesPct
Specifies a criterion for recommending an incremental image copy on a table
space. If the following condition is true, DSNACCOR recommends an
incremental image copy:
The ratio of the number of insert, update, or delete operations since the last
image copy, to the total number of rows or LOBs in a table space or
partition (expressed as a percentage) is greater than ICRChangesPct.
(See item 2 in Figure 150 on page 885.) ICRChangesPct is an input parameter of
type INTEGER. The default is 1.
CRIndexSize
Specifies, when combined with CRUpdatedPagesPct or CRChangesPct, a criterion
for recommending a full image copy on an index space. (See items 2, 3, and 4
in Figure 149 on page 885.) CRIndexSize is an input parameter of type
INTEGER. The default is 50.
RRTInsDelUpdPct
Specifies a criterion for recommending that the REORG utility is to be run on a
table space. If the following condition is true, DSNACCOR recommends
running REORG:
983
The sum of insert, update, and delete operations since the last REORG,
divided by the total number of rows or LOBs in the table space or partition
(expressed as a percentage) is greater than RRTInsDelUpdPct
(See item 1 in Figure 151 on page 885.) RRTInsDelUpdPct is an input parameter
of type INTEGER. The default is 20.
RRTUnclustInsPct
Specifies a criterion for recommending that the REORG utility is to be run on a
table space. If the following condition is true, DSNACCOR recommends
running REORG:
The number of unclustered insert operations, divided by the total number
of rows or LOBs in the table space or partition (expressed as a percentage)
is greater than RRTUnclustInsPct.
(See item 2 in Figure 151 on page 885.) RRTUnclustInsPct is an input parameter
of type INTEGER. The default is 10.
RRTDisorgLOBPct
Specifies a criterion for recommending that the REORG utility is to be run on a
table space. If the following condition is true, DSNACCOR recommends
running REORG:
The number of imperfectly chunked LOBs, divided by the total number of
rows or LOBs in the table space or partition (expressed as a percentage) is
greater than RRTDisorgLOBPct.
(See item 3 in Figure 151 on page 885.) RRTDisorgLOBPct is an input parameter
of type INTEGER. The default is 10.
RRTMassDelLimit
Specifies a criterion for recommending that the REORG utility is to be run on a
table space. If one of the following values is greater than RRTMassDelLimit,
DSNACCOR recommends running REORG:
v The number of mass deletes from a segmented or LOB table space since the
last REORG or LOAD REPLACE
v The number of dropped tables from a nonsegmented table space since the
last REORG or LOAD REPLACE
(See item 5 in Figure 151 on page 885.) RRTMassDelLimit is an input parameter
of type INTEGER. The default is 0.
RRTIndRefLimit
Specifies a criterion for recommending that the REORG utility is to be run on a
table space. If the following value is greater than RRTIndRefLimit, DSNACCOR
recommends running REORG:
The total number of overflow records that were created since the last
REORG or LOAD REPLACE, divided by the total number of rows or LOBs
in the table space or partition (expressed as a percentage)
(See item 4 in Figure 151 on page 885.) RRTIndRefLimit is an input parameter of
type INTEGER. The default is 10.
RRIInsertDeletePct
Specifies a criterion for recommending that the REORG utility is to be run on
an index space. If the following value is greater than RRIInsertDeletePct,
DSNACCOR recommends running REORG:
The sum of the number of index entries that were inserted and deleted
since the last REORG, divided by the total number of index entries in the
index space or partition (expressed as a percentage)
984
(See item 1 in Figure 152 on page 886.) This is an input parameter of type
INTEGER. The default is 20.
RRIAppendInsertPct
Specifies a criterion for recommending that the REORG utility is to be run on
an index space. If the following value is greater than RRIAppendInsertPct,
DSNACCOR recommends running REORG:
The number of index entries that were inserted since the last REORG,
REBUILD INDEX, or LOAD REPLACE with a key value greater than the
maximum key value in the index space or partition, divided by the number
of index entries in the index space or partition (expressed as a percentage)
(See item 2 in Figure 152 on page 886.) RRIInsertDeletePct is an input parameter
of type INTEGER. The default is 10.
RRIPseudoDeletePct
Specifies a criterion for recommending that the REORG utility is to be run on
an index space. If the following value is greater than RRIPseudoDeletePct,
DSNACCOR recommends running REORG:
The number of index entries that were pseudo-deleted since the last
REORG, REBUILD INDEX, or LOAD REPLACE, divided by the number of
index entries in the index space or partition (expressed as a percentage)
(See item 3 in Figure 152 on page 886.) RRIPseudoDeletePct is an input
parameter of type INTEGER. The default is 10.
RRIMassDelLimit
Specifies a criterion for recommending that the REORG utility is to be run on
an index space. If the number of mass deletes from an index space or partition
since the last REORG, REBUILD, or LOAD REPLACE is greater than this
value, DSNACCOR recommends running REORG.
(See item 4 in Figure 152 on page 886.) RRIMassDelLimit is an input parameter
of type INTEGER. The default is 0.
RRILeafLimit
Specifies a criterion for recommending that the REORG utility is to be run on
an index space. If the following value is greater than RRILeafLimit,
DSNACCOR recommends running REORG:
The number of index page splits that occurred since the last REORG,
REBUILD INDEX, or LOAD REPLACE that resulted in a large separation
between the parts of the original page, divided by the total number of
active pages in the index space or partition (expressed as a percentage)
(See item 5 in Figure 152 on page 886.) RRILeafLimit is an input parameter of
type INTEGER. The default is 10.
RRINumLevelsLimit
Specifies a criterion for recommending that the REORG utility is to be run on
an index space. If the following value is greater than RRINumLevelsLimit,
DSNACCOR recommends running REORG:
The number of levels in the index tree that were added or removed since
the last REORG, REBUILD INDEX, or LOAD REPLACE
(See item 6 in Figure 152 on page 886.) RRINumLevelsLimit is an input
parameter of type INTEGER. The default is 0.
SRTInsDelUpdPct
Specifies, when combined with SRTInsDelUpdAbs, a criterion for
985
986
v The number of inserted and deleted index entries since the last RUNSTATS
on an index space or partition, divided by the total number of index entries
in the index space or partition (expressed as a percentage) is greater than
SRIInsDelUpdPct.
v The sum of the number of inserted and deleted index entries since the last
RUNSTATS on an index space or partition is greater than SRIInsDelUpdAbs,
(See items 1 and 2 in Figure 154 on page 886.) SRIInsDelAbs is an input
parameter of type INTEGER. The default is 0.
SRIMassDelLimit
Specifies a criterion for recommending that the RUNSTATS utility is to be run
on an index space. If the number of mass deletes from an index space or
partition since the last REORG, REBUILD INDEX, or LOAD REPLACE is
greater than this value, DSNACCOR recommends running RUNSTATS.
(See item 3 in Figure 154 on page 886.) SRIMassDelLimit is an input parameter
of type INTEGER. The default is 0.
|
|
|
|
|
|
|
|
|
ExtentLimit
Specifies a criterion for recommending that the REORG utility is to be run on a
table space or index space. Also specifies that DSNACCOR is to warn the user
that the table space or index space has used too many extents. DSNACCOR
recommends running REORG, and altering data set allocations if the following
condition is true:
v The number of physical extents in the index space, table space, or partition
is greater than ExtentLimit.
(See Figure 155 on page 886.) ExtentLimit is an input parameter of type
INTEGER. The default is 50.
LastStatement
When DSNACCOR returns a severe error (return code 12), this field contains
the SQL statement that was executing when the error occurred. LastStatement is
an output parameter of type VARCHAR(8012).
ReturnCode
The return code from DSNACCOR execution. Possible values are:
0
12
14
15
987
16
Figure 171. DSNACCOR formula for recommending a full image copy on a table space
The figure below shows the formula that DSNACCOR uses to recommend a full
image copy on an index space.
988
Figure 172. DSNACCOR formula for recommending a full image copy on an index space
The figure below shows the formula that DSNACCOR uses to recommend an
incremental image copy on a table space.
Figure 173. DSNACCOR formula for recommending an incremental image copy on a table space
The figure below shows the formula that DSNACCOR uses to recommend a
REORG on a table space. If the table space is a LOB table space, and CHCKLVL=1,
the formula does not include EXTENTS>ExtentLimit.
The figure below shows the formula that DSNACCOR uses to recommend a
REORG on an index space.
989
1
2
3
4
5
6
7
The figure below shows the formula that DSNACCOR uses to recommend
RUNSTATS on a table space.
The figure below shows the formula that DSNACCOR uses to recommend
RUNSTATS on an index space.
The figure below shows the formula that DSNACCOR uses to that too many index
space or table space extents have been used.
EXTENTS>ExtentLimit
Figure 178. DSNACCOR formula for warning that too many data set extents for a table space or index space are used
990
To create the exception table, execute a CREATE TABLE statement similar to the
following one. You can include other columns in the exception table, but you must
include at least the columns that are shown.
CREATE TABLE DSNACC.EXCEPT_TBL
(DBNAME CHAR(8) NOT NULL,
NAME CHAR(8) NOT NULL,
QUERYTYPE CHAR(40))
CCSID EBCDIC;
Example
The following COBOL example that shows variable declarations and an SQL CALL
for obtaining recommendations for objects in databases DSN8D91A and
DSN8D91L. This example also outlines the steps that you need to perform to
retrieve the two result sets that DSNACCOR returns.
WORKING-STORAGE SECTION.
.
.
.
***********************
* DSNACCOR PARAMETERS *
***********************
Appendix F. Real-time statistics
991
01
01
01
01
01
49
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
QUERYTYPE.
49
QUERYTYPE-LN
PICTURE S9(4) COMP VALUE 40.
49
QUERYTYPE-DTA
PICTURE X(40) VALUE 'ALL'.
OBJECTTYPE.
49
OBJECTTYPE-LN
PICTURE S9(4) COMP VALUE 3.
49
OBJECTTYPE-DTA
PICTURE X(3) VALUE 'ALL'.
ICTYPE.
49
ICTYPE-LN
PICTURE S9(4) COMP VALUE 1.
49
ICTYPE-DTA
PICTURE X(1) VALUE 'B'.
STATSSCHEMA.
49
STATSSCHEMA-LN
PICTURE S9(4) COMP VALUE 128.
49
STATSSCHEMA-DTA
PICTURE X(128) VALUE 'SYSIBM'.
CATLGSCHEMA.
CATLGSCHEMA-LN
PICTURE S9(4) COMP VALUE 128.
49
CATLGSCHEMA-DTA
PICTURE X(128) VALUE 'SYSIBM'.
LOCALSCHEMA.
49
LOCALSCHEMA-LN
PICTURE S9(4) COMP VALUE 128.
49
LOCALSCHEMA-DTA
PICTURE X(128) VALUE 'DSNACC'.
CHKLVL
PICTURE S9(9) COMP VALUE +3.
CRITERIA.
49
CRITERIA-LN
PICTURE S9(4) COMP VALUE 4096.
49
CRITERIA-DTA
PICTURE X(4096) VALUE SPACES.
RESTRICTED.
49
RESTRICTED-LN
PICTURE S9(4) COMP VALUE 80.
49
RESTRICTED-DTA
PICTURE X(80) VALUE SPACES.
CRUPDATEDPAGESPCT
PICTURE S9(9) COMP VALUE +0.
CRCHANGESPCT
PICTURE S9(9) COMP VALUE +0.
CRDAYSNCLASTCOPY
PICTURE S9(9) COMP VALUE +0.
ICRUPDATEDPAGESPCT
PICTURE S9(9) COMP VALUE +0.
ICRCHANGESPCT
PICTURE S9(9) COMP VALUE +0.
CRINDEXSIZE
PICTURE S9(9) COMP VALUE +0.
RRTINSDELUPDPCT
PICTURE S9(9) COMP VALUE +0.
RRTUNCLUSTINSPCT
PICTURE S9(9) COMP VALUE +0.
RRTDISORGLOBPCT
PICTURE S9(9) COMP VALUE +0.
RRTMASSDELLIMIT
PICTURE S9(9) COMP VALUE +0.
RRTINDREFLIMIT
PICTURE S9(9) COMP VALUE +0.
RRIINSERTDELETEPCT
PICTURE S9(9) COMP VALUE +0.
RRIAPPENDINSERTPCT
PICTURE S9(9) COMP VALUE +0.
RRIPSEUDODELETEPCT
PICTURE S9(9) COMP VALUE +0.
RRIMASSDELLIMIT
PICTURE S9(9) COMP VALUE +0.
RRILEAFLIMIT
PICTURE S9(9) COMP VALUE +0.
RRINUMLEVELSLIMIT
PICTURE S9(9) COMP VALUE +0.
SRTINSDELUPDPCT
PICTURE S9(9) COMP VALUE +0.
SRTINSDELUPDABS
PICTURE S9(9) COMP VALUE +0.
SRTMASSDELLIMIT
PICTURE S9(9) COMP VALUE +0.
SRIINSDELUPDPCT
PICTURE S9(9) COMP VALUE +0.
SRIINSDELUPDABS
PICTURE S9(9) COMP VALUE +0.
SRIMASSDELLIMIT
PICTURE S9(9) COMP VALUE +0.
EXTENTLIMIT
PICTURE S9(9) COMP VALUE +0.
LASTSTATEMENT.
49
LASTSTATEMENT-LN
PICTURE S9(4) COMP VALUE 8012.
49
LASTSTATEMENT-DTA
PICTURE X(8012) VALUE SPACES.
RETURNCODE
PICTURE S9(9) COMP VALUE +0.
ERRORMSG.
49
ERRORMSG-LN
PICTURE S9(4) COMP VALUE 1331.
49
ERRORMSG-DTA
PICTURE X(1331) VALUE SPACES.
IFCARETCODE
PICTURE S9(9) COMP VALUE +0.
IFCARESCODE
PICTURE S9(9) COMP VALUE +0.
EXCESSBYTES
PICTURE S9(9) COMP VALUE +0.
*****************************************
* INDICATOR VARIABLES.
*
* INITIALIZE ALL NON-ESSENTIAL INPUT
*
* VARIABLES TO -1, TO INDICATE THAT THE *
* INPUT VALUE IS NULL.
*
*****************************************
01 QUERYTYPE-IND
PICTURE S9(4) COMP-4 VALUE +0.
01 OBJECTTYPE-IND
PICTURE S9(4) COMP-4 VALUE +0.
992
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
ICTYPE-IND
STATSSCHEMA-IND
CATLGSCHEMA-IND
LOCALSCHEMA-IND
CHKLVL-IND
CRITERIA-IND
RESTRICTED-IND
CRUPDATEDPAGESPCT-IND
CRCHANGESPCT-IND
CRDAYSNCLASTCOPY-IND
ICRUPDATEDPAGESPCT-IND
ICRCHANGESPCT-IND
CRINDEXSIZE-IND
RRTINSDELUPDPCT-IND
RRTUNCLUSTINSPCT-IND
RRTDISORGLOBPCT-IND
RRTMASSDELLIMIT-IND
RRTINDREFLIMIT-IND
RRIINSERTDELETEPCT-IND
RRIAPPENDINSERTPCT-IND
RRIPSEUDODELETEPCT-IND
RRIMASSDELLIMIT-IND
RRILEAFLIMIT-IND
RRINUMLEVELSLIMIT-IND
SRTINSDELUPDPCT-IND
SRTINSDELUPDABS-IND
SRTMASSDELLIMIT-IND
SRIINSDELUPDPCT-IND
SRIINSDELUPDABS-IND
SRIMASSDELLIMIT-IND
EXTENTLIMIT-IND
LASTSTATEMENT-IND
RETURNCODE-IND
ERRORMSG-IND
IFCARETCODE-IND
IFCARESCODE-IND
EXCESSBYTES-IND
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
PICTURE
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
S9(4)
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
COMP-4
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
VALUE
+0.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
-1.
+0.
+0.
+0.
+0.
+0.
+0.
PROCEDURE DIVISION.
.
.
.
*********************************************************
* SET VALUES FOR DSNACCOR INPUT PARAMETERS:
*
* - USE THE CHKLVL PARAMETER TO CAUSE DSNACCOR TO CHECK *
*
FOR ORPHANED OBJECTS AND INDEX SPACES WITHOUT
*
*
TABLE SPACES, BUT INCLUDE THOSE OBJECTS IN THE
*
*
RECOMMENDATIONS RESULT SET (CHKLVL=1+2+16=19)
*
* - USE THE CRITERIA PARAMETER TO CAUSE DSNACCOR TO
*
*
MAKE RECOMMENDATIONS ONLY FOR OBJECTS IN DATABASES *
*
DSN8D91A AND DSN8D91L.
*
* - FOR THE FOLLOWING PARAMETERS, SET THESE VALUES,
*
*
WHICH ARE LOWER THAN THE DEFAULTS:
*
*
CRUPDATEDPAGESPCT
4
*
*
CRCHANGESPCT
2
*
*
RRTINSDELUPDPCT
2
*
*
RRTUNCLUSTINSPCT
5
*
*
RRTDISORGLOBPCT
5
*
*
RRIAPPENDINSERTPCT 5
*
*
SRTINSDELUPDPCT
5
*
*
SRIINSDELUPDPCT
5
*
*
EXTENTLIMIT
3
*
*********************************************************
MOVE 19 TO CHKLVL.
MOVE SPACES TO CRITERIA-DTA.
MOVE 'DBNAME = ''DSN8D91A'' OR DBNAME = ''DSN8D91L'''
TO CRITERIA-DTA.
MOVE 46 TO CRITERIA-LN.
MOVE 4 TO CRUPDATEDPAGESPCT.
Appendix F. Real-time statistics
993
MOVE 2 TO CRCHANGESPCT.
MOVE 2 TO RRTINSDELUPDPCT.
MOVE 5 TO RRTUNCLUSTINSPCT.
MOVE 5 TO RRTDISORGLOBPCT.
MOVE 5 TO RRIAPPENDINSERTPCT.
MOVE 5 TO SRTINSDELUPDPCT.
MOVE 5 TO SRIINSDELUPDPCT.
MOVE 3 TO EXTENTLIMIT.
********************************
* INITIALIZE OUTPUT PARAMETERS *
********************************
MOVE SPACES TO LASTSTATEMENT-DTA.
MOVE 1 TO LASTSTATEMENT-LN.
MOVE 0 TO RETURNCODE-O2.
MOVE SPACES TO ERRORMSG-DTA.
MOVE 1 TO ERRORMSG-LN.
MOVE 0 TO IFCARETCODE.
MOVE 0 TO IFCARESCODE.
MOVE 0 TO EXCESSBYTES.
*******************************************************
* SET THE INDICATOR VARIABLES TO 0 FOR NON-NULL INPUT *
* PARAMETERS (PARAMETERS FOR WHICH YOU DO NOT WANT
*
* DSNACCOR TO USE DEFAULT VALUES) AND FOR OUTPUT
*
* PARAMETERS.
*
*******************************************************
MOVE 0 TO CHKLVL-IND.
MOVE 0 TO CRITERIA-IND.
MOVE 0 TO CRUPDATEDPAGESPCT-IND.
MOVE 0 TO CRCHANGESPCT-IND.
MOVE 0 TO RRTINSDELUPDPCT-IND.
MOVE 0 TO RRTUNCLUSTINSPCT-IND.
MOVE 0 TO RRTDISORGLOBPCT-IND.
MOVE 0 TO RRIAPPENDINSERTPCT-IND.
MOVE 0 TO SRTINSDELUPDPCT-IND.
MOVE 0 TO SRIINSDELUPDPCT-IND.
MOVE 0 TO EXTENTLIMIT-IND.
MOVE 0 TO LASTSTATEMENT-IND.
MOVE 0 TO RETURNCODE-IND.
MOVE 0 TO ERRORMSG-IND.
MOVE 0 TO IFCARETCODE-IND.
MOVE 0 TO IFCARESCODE-IND.
MOVE 0 TO EXCESSBYTES-IND.
.
.
.
*****************
* CALL DSNACCOR *
*****************
EXEC SQL
CALL SYSPROC.DSNACCOR
(:QUERYTYPE
:QUERYTYPE-IND,
:OBJECTTYPE
:OBJECTTYPE-IND,
:ICTYPE
:ICTYPE-IND,
:STATSSCHEMA
:STATSSCHEMA-IND,
:CATLGSCHEMA
:CATLGSCHEMA-IND,
:LOCALSCHEMA
:LOCALSCHEMA-IND,
:CHKLVL
:CHKLVL-IND,
:CRITERIA
:CRITERIA-IND,
:RESTRICTED
:RESTRICTED-IND,
:CRUPDATEDPAGESPCT
:CRUPDATEDPAGESPCT-IND,
:CRCHANGESPCT
:CRCHANGESPCT-IND,
:CRDAYSNCLASTCOPY
:CRDAYSNCLASTCOPY-IND,
:ICRUPDATEDPAGESPCT :ICRUPDATEDPAGESPCT-IND,
:ICRCHANGESPCT
:ICRCHANGESPCT-IND,
:CRINDEXSIZE
:CRINDEXSIZE-IND,
:RRTINSDELUPDPCT
:RRTINSDELUPDPCT-IND,
:RRTUNCLUSTINSPCT
:RRTUNCLUSTINSPCT-IND,
:RRTDISORGLOBPCT
:RRTDISORGLOBPCT-IND,
:RRTMASSDELLIMIT
:RRTMASSDELLIMIT-IND,
994
:RRTINDREFLIMIT
:RRTINDREFLIMIT-IND,
:RRIINSERTDELETEPCT :RRIINSERTDELETEPCT-IND,
:RRIAPPENDINSERTPCT :RRIAPPENDINSERTPCT-IND,
:RRIPSEUDODELETEPCT :RRIPSEUDODELETEPCT-IND,
:RRIMASSDELLIMIT
:RRIMASSDELLIMIT-IND,
:RRILEAFLIMIT
:RRILEAFLIMIT-IND,
:RRINUMLEVELSLIMIT
:RRINUMLEVELSLIMIT-IND,
:SRTINSDELUPDPCT
:SRTINSDELUPDPCT-IND,
:SRTINSDELUPDABS
:SRTINSDELUPDABS-IND,
:SRTMASSDELLIMIT
:SRTMASSDELLIMIT-IND,
:SRIINSDELUPDPCT
:SRIINSDELUPDPCT-IND,
:SRIINSDELUPDABS
:SRIINSDELUPDABS-IND,
:SRIMASSDELLIMIT
:SRIMASSDELLIMIT-IND,
:EXTENTLIMIT
:EXTENTLIMIT-IND,
:LASTSTATEMENT
:LASTSTATEMENT-IND,
:RETURNCODE
:RETURNCODE-IND,
:ERRORMSG
:ERRORMSG-IND,
:IFCARETCODE
:IFCARETCODE-IND,
:IFCARESCODE
:IFCARESCODE-IND,
:EXCESSBYTES
:EXCESSBYTES-IND)
END-EXEC.
*************************************************************
* ASSUME THAT THE SQL CALL RETURNED +466, WHICH MEANS THAT *
* RESULT SETS WERE RETURNED. RETRIEVE RESULT SETS.
*
*************************************************************
* LINK EACH RESULT SET TO A LOCATOR VARIABLE
EXEC SQL ASSOCIATE LOCATORS (:LOC1, :LOC2)
WITH PROCEDURE SYSPROC.DSNACCOR
END-EXEC.
* LINK A CURSOR TO EACH RESULT SET
EXEC SQL ALLOCATE C1 CURSOR FOR RESULT SET :LOC1
END-EXEC.
EXEC SQL ALLOCATE C2 CURSOR FOR RESULT SET :LOC2
END-EXEC.
* PERFORM FETCHES USING C1 TO RETRIEVE ALL ROWS FROM FIRST RESULT SET
* PERFORM FETCHES USING C2 TO RETRIEVE ALL ROWS FROM SECOND RESULT SET
Output
If DSNACCOR executes successfully, in addition to the output parameters
described in Option descriptions on page 876, DSNACCOR returns two result
sets.
The first result set contains the results from IFI COMMAND calls that DSNACCOR
makes. The following table shows the format of the first result set.
Table 184. Result set row for first DSNACCOR result set
Column name
Data type
Contents
RS_SEQUENCE
INTEGER
RS_DATA
CHAR(80)
The second result set contains DSNACCORs recommendations. This result set
contains one or more rows for a table space or index space. A nonpartitioned table
space or nonpartitioning index space can have at most one row in the result set. A
partitioned table space or partitioning index space can have at most one row for
each partition. A table space, index space, or partition has a row in the result set if
both of the following conditions are true:
Appendix F. Real-time statistics
995
v If the Criteria input parameter contains a search condition, the search condition
is true for the table space, index space, or partition.
v DSNACCOR recommends at least one action for the table space, index space, or
partition.
The following table shows the columns of a result set row.
Table 185. Result set row for second DSNACCOR result set
Column name
Data type
Description
DBNAME
CHAR(8)
NAME
CHAR(8)
PARTITION
INTEGER
OBJECTTYPE
CHAR(2)
OBJECTSTATUS
CHAR(36)
IMAGECOPY
CHAR(3)
COPY recommendation:
v If OBJECTTYPE is TS: FUL (full image copy), INC
(incremental image copy), or NO
v If OBJECTTYPE is IX: YES or NO
RUNSTATS
CHAR(3)
EXTENTS
CHAR(3)
Indicates whether the data sets for the object have exceeded
ExtentLimit: YES or NO.
REORG
CHAR(3)
INEXCEPTTABLE
CHAR(40)
ASSOCIATEDTS
996
CHAR(8)
Table 185. Result set row for second DSNACCOR result set (continued)
Column name
Data type
Description
COPYLASTTIME
TIMESTAMP
LOADRLASTTIME
TIMESTAMP
REBUILDLASTTIME
TIMESTAMP
CRUPDPGSPCT
INTEGER
CRCPYCHGPCT
INTEGER
CRDAYSCELSTCPY
INTEGER
CRINDEXSIZE
INTEGER
REORGLASTTIME
TIMESTAMP
RRTINSDELUPDPCT
INTEGER
RRTUNCINSPCT
INTEGER
RRTDISORGLOBPCT
INTEGER
RRTMASSDELETE
INTEGER
RRTINDREF
INTEGER
997
Table 185. Result set row for second DSNACCOR result set (continued)
Column name
Data type
Description
RRIINSDELPCT
INTEGER
RRIAPPINSPCT
INTEGER
RRIPSDDELPCT
INTEGER
RRIMASSDELETE
INTEGER
RRILEAF
INTEGER
RRINUMLEVELS
INTEGER
STATSLASTTIME
TIMESTAMP
SRTINSDELUPDPCT
INTEGER
SRTINSDELUPDABS
INTEGER
SRTMASSDELETE
INTEGER
SRIINSDELPCT
INTEGER
SRIINSDELABS
INTEGER
998
Table 185. Result set row for second DSNACCOR result set (continued)
Column name
Data type
Description
SRIMASSDELETE
INTEGER
TOTALEXTENTS
SMALLINT
PSPI
Related reference
CREATE DATABASE (DB2 SQL Reference)
CREATE TABLESPACE (DB2 SQL Reference)
|
|
|
999
|
|
TOTALROWS
DATASIZE
Actual value
NPAGES
Actual value
NACTIVE
Actual value
SPACE
Actual value
EXTENTS
Actual value
LOADRLASTTIME
Current timestamp
REORGINSERTS
REORGDELETES
REORGUPDATES
REORGDISORGLOB
REORGUNCLUSTINS
REORGMASSDELETE
REORGNEARINDREF
REORGFARINDREF
STATSLASTTIME
Current timestamp2
STATSINSERTS
02
STATSDELETES
02
STATSUPDATES
02
STATSMASSDELETE
02
COPYLASTTIME
Current timestamp3
COPYUPDATEDPAGES
03
COPYCHANGES
03
COPYUPDATELRSN
Null3
COPYUPDATETIME
Null3
Notes:
1. Under certain conditions, such as a utility restart, the LOAD utility might not have an
accurate count of loaded records. In those cases, DB2 sets this value to null. Some rows
that are loaded into a table space and are included in this value might later be removed
during the index validation phase or the referential integrity check. DB2 includes counts
of those removed records in the statistics that record deleted records.
2. DB2 sets this value only if the LOAD invocation includes the STATISTICS option.
3. DB2 sets this value only if the LOAD invocation includes the COPYDDN option.
The table below shows how running LOAD REPLACE affects the
SYSINDEXSPACESTATS statistics for an index space or physical index partition.
|
|
1000
Column name
TOTALENTRIES
NLEAF
Actual value
NLEVELS
Actual value
NACTIVE
Actual value
SPACE
Actual value
EXTENTS
Actual value
LOADRLASTTIME
Current timestamp
REORGINSERTS
REORGDELETES
REORGAPPENDINSERT
REORGPSEUDODELETES
REORGMASSDELETE
REORGLEAFNEAR
REORGLEAFFAR
REORGNUMLEVELS
STATSLASTTIME
Current timestamp2
STATSINSERTS
02
STATSDELETES
02
STATSMASSDELETE
02
COPYLASTTIME
Current timestamp3
COPYUPDATEDPAGES
03
COPYCHANGES
03
COPYUPDATELRSN
Null3
COPYUPDATETIME
Null3
Notes:
1. Under certain conditions, such as a utility restart, the LOAD utility might not have an
accurate count of loaded records. In those cases, DB2 sets this value to null.
2. DB2 sets this value only if the LOAD invocation includes the STATISTICS option.
3. DB2 sets this value only if the LOAD invocation includes the COPYDDN option.
|
|
|
|
|
|
1001
v When DB2 does a LOAD RESUME YES on a partition, after the BUILD phase,
DB2 increments TOTALENTRIES by the number of index entries that were
inserted during the BUILD phase.
Column name
TOTALROWS
| DATASIZE
Actual value
Actual value
| NPAGES
Actual value
Actual value
NACTIVE
Actual value
Actual value
SPACE
Actual value
Actual value
EXTENTS
Actual value
Actual value
REORGLASTTIME
Current timestamp
Current timestamp
REORGINSERTS
Actual value2
REORGDELETES
Actual value2
REORGUPDATES
Actual value2
REORGDISORGLOB
Actual value2
REORGUNCLUSTINS
Actual value2
REORGMASSDELETE
Actual value2
REORGNEARINDREF
Actual value2
REORGFARINDREF
Actual value2
3
Current timestamp3
STATSLASTTIME
Current timestamp
STATSINSERTS
03
Actual value2
STATSDELETES
03
Actual value2
STATSUPDATES
03
Actual value2
STATSMASSDELETE
03
Actual value2
COPYLASTTIME
Current timestamp4
Current timestamp
COPYUPDATEDPAGES
Actual value2
COPYCHANGES
04
Actual value2
COPYUPDATELRSN
Null4
Actual value5
COPYUPDATETIME
Null4
Actual value5
1002
Column name
Notes:
1. Under certain conditions, such as a utility restart, the REORG utility might not have an accurate count of loaded
records. In those cases, DB2 sets this value to null. Some rows that are loaded into a table space and are included
in this value might later be removed during the index validation phase or the referential integrity check. DB2
includes counts of those removed records in the statistics that record deleted records.
2. This is the actual number of inserts, updates, or deletes that are due to applying the log to the shadow copy.
3. DB2 sets this value only if the REORG invocation includes the STATISTICS option.
4. DB2 sets this value only if the REORG invocation includes the COPYDDN option.
5. This is the LRSN or timestamp for the first update that is due to applying the log to the shadow copy.
The table below shows how running REORG affects the SYSINDEXSPACESTATS
statistics for an index space or physical index partition.
Table 189. Changed SYSINDEXSPACESTATS values during REORG
Column name
TOTALENTRIES
| NLEAF
Actual value
Actual value
NLEVELS
Actual value
Actual value
NACTIVE
Actual value
Actual value
SPACE
Actual value
Actual value
EXTENTS
Actual value
Actual value
REORGLASTTIME
Current timestamp
Current timestamp
REORGINSERTS
Actual value2
REORGDELETES
Actual value2
REORGAPPENDINSERT
Actual value2
REORGPSEUDODELETES
Actual value2
REORGMASSDELETE
Actual value2
REORGLEAFNEAR
Actual value2
REORGLEAFFAR
Actual value2
REORGNUMLEVELS
Actual value2
STATSLASTTIME
Current timestamp3
Current timestamp3
STATSINSERTS
03
Actual value2
STATSDELETES
03
Actual value2
STATSMASSDELETE
03
Actual value2
COPYLASTTIME
Current timestamp4
Unchanged5
Appendix F. Real-time statistics
1003
Column name
COPYUPDATEDPAGES
04
Unchanged5
COPYCHANGES
04
Unchanged5
COPYUPDATELRSN
Null4
Unchanged5
COPYUPDATETIME
Null4
Unchanged5
Notes:
1. Under certain conditions, such as a utility restart, the REORG utility might not have an accurate count of loaded
records. In those cases, DB2 sets this value to null.
2. This is the actual number of inserts, updates, or deletes that are due to applying the log to the shadow copy.
3. DB2 sets this value only if the REORG invocation includes the STATISTICS option.
4. DB2 sets this value only if the REORG invocation includes the COPYDDN option.
5. Inline COPY is not allowed for SHRLEVEL CHANGE or SHRLEVEL REFERENCE.
For a logical index partition, DB2 does not reset the nonpartitioned index when it
does a REORG on a partition. Therefore, DB2 does not reset the statistics for the
index. The REORG counters and REORGLASTTIME are relative to the last time the
entire nonpartitioned index is reorganized. In addition, the REORG counters might
be low because, due to the methodology, some index entries are changed during
REORG of a partition.
1004
Column name
TOTALENTRIES
NLEAF
Actual value
NLEVELS
Actual value
NACTIVE
Actual value
SPACE
Actual value
EXTENTS
Actual value
REBUILDLASTTIME
Current timestamp
REORGINSERTS
REORGDELETES
REORGAPPENDINSERT
REORGPSEUDODELETES
REORGMASSDELETE
REORGLEAFNEAR
REORGLEAFFAR
REORGNUMLEVELS
Note:
1. Under certain conditions, such as a utility restart, the REBUILD utility might not have an
accurate count of loaded records. In those cases, DB2 sets this value to null.
For a logical index partition, DB2 does not collect TOTALENTRIES statistics for the
entire nonpartitioned index when it runs REBUILD INDEX. Therefore, DB2 does
not reset the statistics for the index. The REORG counters from the last REORG are
still correct. DB2 updates REBUILDLASTTIME when the entire nonpartitioned
index is rebuilt.
STATSLASTTIME
Current timestamp
STATSINSERTS
Actual value1
Actual value2
STATSDELETES
Actual value1
Actual value2
STATSUPDATES
Actual value1
Actual value2
STATSMASSDELETE
Actual value1
Actual value2
Notes:
1. DB2 externalizes the current in-memory values.
2. This value is 0 for SHRLEVEL REFERENCE, or the actual value for SHRLEVEL
CHANGE.
The table below shows how running RUNSTATS UPDATE ALL on an index affects
the SYSINDEXSPACESTATS statistics.
Table 192. Changed SYSINDEXSPACESTATS values during RUNSTATS UPDATE ALL
Column name
STATSLASTTIME
Current timestamp
STATSINSERTS
Actual value1
Actual value2
STATSDELETES
Actual value1
Actual value2
STATSMASSDELETE
Actual value1
Actual value2
Notes:
1. DB2 externalizes the current in-memory values.
2. This value is 0 for SHRLEVEL REFERENCE, or the actual value for SHRLEVEL
CHANGE.
1005
COPYLASTTIME
Current timestamp
COPYUPDATEDPAGES
Actual value1
Actual value2
COPYCHANGES
Actual value1
Actual value2
COPYUPDATELRSN
Actual value1
Actual value3
COPYUPDATETIME
Actual value1
Actual value3
Notes:
1. DB2 externalizes the current in-memory values.
2. This value is 0 for SHRLEVEL REFERENCE, or the actual value for SHRLEVEL
CHANGE.
3. This value is null for SHRLEVEL REFERENCE, or the actual value for SHRLEVEL
CHANGE.
The table below shows how running COPY on an index affects the
SYSINDEXSPACESTATS statistics.
Table 194. Changed SYSINDEXSPACESTATS values during COPY
Column name
COPYLASTTIME
Current timestamp
COPYUPDATEDPAGES
Actual value1
Actual value2
COPYCHANGES
Actual value1
Actual value2
COPYUPDATELRSN
Actual value1
Actual value3
COPYUPDATETIME
Actual value1
Actual value3
Notes:
1. DB2 externalizes the current in-memory values.
2. This value is 0 for SHRLEVEL REFERENCE, or the actual value for SHRLEVEL
CHANGE.
3. This value is null for SHRLEVEL REFERENCE, or the actual value for SHRLEVEL
CHANGE.
1006
1007
UPDATE
When you perform an UPDATE, DB2 increments the update counters.
INSERT
When you perform an INSERT, DB2 increments the insert counters. DB2 keeps
separate counters for clustered and unclustered INSERTs.
DELETE
When you perform a DELETE, DB2 increments the delete counters.
ROLLBACK
When you perform a ROLLBACK, DB2 increments the counters, depending on the
type of SQL operation that is rolled back:
Rolled-back SQL statement
Incremented counters
UPDATE
Update counters
INSERT
Delete counters
DELETE
Insert counters
Notice that for INSERT and DELETE, the counter for the inverse operation is
incremented. For example, if two INSERT statements are rolled back, the delete
counter is incremented by 2.
Incremented counters
If an update to a partitioning key does not cause rows to move to a new partition,
the counts are accumulated as expected:
Action
1008
Incremented counters
Mass DELETE
Performing a mass delete operation on a table space does not cause DB2 to reset
the counter columns in the real-time statistics tables. After a mass delete operation,
the value in a counter column includes the count from a time prior to the mass
delete operation, as well as the count after the mass delete operation.
|
|
When the EXCHANGE command is used for clone tables real-time statistics are
affected.
|
|
|
|
|
|
|
|
Utility operations and SQL operations can be run separately on each instance of
the cloned object. Therefore, each instance of an object can be used to monitor
activity, and allow recommendations on whether the base, the clone, or both
objects require a REORG, RUNSTATS, or COPY operation.
1009
Statistics accuracy
In general, the real-time statistics values are very accurate.
However, several factors can affect the accuracy of the statistics:
v Certain utility restart scenarios
v Certain utility operations that leave indexes in a database restrictive state, such
as RECOVER-pending (RECP)
Always consider the database restrictive state of objects before accepting a utility
recommendation that is based on real-time statistics.
v A DB2 subsystem failure
v A notify failure in a data sharing environment
If you think that some statistics values might be inaccurate, you can correct the
statistics by running REORG, RUNSTATS, or COPY on the objects for which DB2
generated the statistics.
1010
1011
Related concepts
Loading delimited files on page 263
Unloading delimited files on page 710
CHAR, VARCHAR
DECFLOAT EXTERNAL
FLOAT
1012
BLOB, CLOB
DBCLOB
DATE
Table 195. Acceptable data type forms for delimited files (continued)
Data type
TIME
TIMESTAMP
Note:
1. Field specifications of INTEGER or SMALLINT are treated as INTEGER EXTERNAL.
2. Field specifications of DECIMAL, DECIMAL PACKED, or DECIMAL ZONED are treated
as DECIMAL EXTERNAL.
3. Field specifications of FLOAT, REAL, or DOUBLE are treated as FLOAT EXTERNAL.
4. EBCID graphic data must be enclosed in shift-out and shift-in characters.
1013
1014
Title
Publication
number
Available in
information
center
Available in
Available in BookManager Available in
format
printed book
PDF
SC18-9840
SC18-9841
SC18-9842
GC18-9843
SC18-9844
SC18-9845
1015
Table 196. DB2 Version 9.1 for z/OS book titles (continued)
Publication
number
Title
Available in
information
center
Available in
Available in BookManager Available in
format
printed book
PDF
LY37-3218
LY37-3219
GC18-9846
GC18-9848
GC18-9849
SC18-9850
SC18-9851
GI10-8737
SC18-9852
SC18-9853
SX26-3854
SC18-9855
GC18-9856
SC18-9858
GC19-2666
Note:
1. DB2 Version 9.1 for z/OS Diagnosis Guide and Reference is available in PDF and BookManager formats on the DB2
Version 9.1 for z/OS Licensed Collection kit, LK3T-7195. You can order this License Collection kit on the IBM
Publications Center site (http://www.elink.ibmlink.ibm.com/public/applications/publications/cgibin/pbi.cgi).
This book is also available in online format in DB2 data set DSN910.SDSNIVPD(DSNDR).
1016
Information resources
DB2 Connect
IMS
1017
Information resources
IMS Tools
Integrated Data
Management products
PL/I
System z
http://publib.boulder.ibm.com/infocenter/eserver/v1r2/index.jsp
WebSphere Application
Server
WebSphere Replication
Server for z/OS
z/Architecture
1018
Information resources
z/OS
z/OS XL C/C++
http://www.ibm.com/software/awdtools/czos/library/
The following information resources from IBM are not necessarily specific to a
single product:
v The DB2 for z/OS Information Roadmap; available at: http://www.ibm.com/
software/data/db2/zos/roadmap.html
v DB2 Redbooks and Redbooks about related products; available at:
http://www.ibm.com/redbooks
v IBM Educational resources:
Information about IBM educational offerings is available on the Web at:
http://www.ibm.com/software/sw-training/
1019
1020
1021
The books for DB2 for z/OS are also available on the following CD-ROM
and DVD collection kits, which contain online books for many IBM
products:
v IBM z/OS Software Products Collection , SK3T-4270, in English
v IBM z/OS Software Products DVD Collection , SK3T4271, in English
PDF format
Many of the DB2 books are available in PDF (Portable Document Format)
for viewing or printing from CD-ROM or the DB2 home page on the Web
or from the information center. Download the PDF books to your intranet
for distribution throughout your enterprise.
BookManager format
You can use online books on CD-ROM to read, search across books, print
portions of the text, and make notes in these BookManager books. Using
the IBM Softcopy Reader, appropriate IBM Library Readers, or the
BookManager Read product, you can view these books in the z/OS,
Windows, and VM environments. You can also view and search many of
the DB2 BookManager books on the Web.
DB2 education
IBM Education and Training offers a wide variety of classroom courses to help you
quickly and efficiently gain DB2 expertise. IBM schedules classes are in cities all
over the world. You can find class information, by country, at the IBM Learning
Services Web site:
www.ibm.com/services/learning
IBM also offers classes at your location, at a time that suits your needs. IBM can
customize courses to meet your exact requirements. For more information,
including the current local schedule, contact your IBM representative.
1022
Be prepared to give your customer number, the product number, and either the
feature codes or order numbers that you want.
1023
1024
If you are new to DB2 for z/OS, Introduction to DB2 for z/OS provides a
comprehensive introduction to DB2 Version 9.1 for z/OS. Topics included in this
book explain the basic concepts that are associated with relational database
management systems in general, and with DB2 for z/OS in particular.
The most rewarding task associated with a database management system is asking
questions of it and getting answers, the task called end use. Other tasks are also
necessarydefining the parameters of the system, putting the data in place, and so
on. The tasks that are associated with DB2 are grouped into the following major
categories.
Installation
If you are involved with installing DB2, you will need to use a variety of resources,
such as:
v
v
v
v
v
v
DB2
DB2
DB2
DB2
DB2
DB2
Program Directory
Installation Guide
Administration Guide
Application Programming Guide and Reference for Java
Codes
Internationalization Guide
v
v
v
v
DB2
DB2
DB2
DB2
Messages
Performance Monitoring and Tuning Guide
RACF Access Control Module Guide
Utility Guide and Reference
If you will be using data sharing capabilities you also need DB2 Data Sharing:
Planning and Administration, which describes installation considerations for data
sharing.
If you will be installing and configuring DB2 ODBC, you will need DB2 ODBC
Guide and Reference.
If you are installing IBM Spatial Support for DB2 for z/OS, you will need IBM
Spatial Support for DB2 for z/OS Users Guide and Reference.
If you are installing IBM OmniFind Text Search Server for DB2 for z/OS, you will
need IBM OmniFind Text Search Server for DB2 for z/OS Installation, Administration,
and Reference.
1025
End use
End users issue SQL statements to retrieve data. They can also insert, update, or
delete data, with SQL statements. They might need an introduction to SQL,
detailed instructions for using SPUFI, and an alphabetized reference to the types of
SQL statements. This information is found in DB2 Application Programming and SQL
Guide, and DB2 SQL Reference.
End users can also issue SQL statements through the DB2 Query Management
Facility (QMF) or some other program, and the library for that licensed program
might provide all the instruction or reference material they need. For a list of the
titles in the DB2 QMF library, see the bibliography at the end of this book.
Application programming
Some users access DB2 without knowing it, using programs that contain SQL
statements. DB2 application programmers write those programs. Because they
write SQL statements, they need the same resources that end users do.
Application programmers also need instructions for many other topics:
v How to transfer data between DB2 and a host programwritten in Java, C, or
COBOL, for example
v How to prepare to compile a program that embeds SQL statements
v How to process data from two systems simultaneously, for example, DB2 and
IMS or DB2 and CICS
|
|
|
|
v How to write applications to store XML data on DB2 servers and retrieve XML
data from DB2 servers.
The material needed for writing a host program containing SQL is in DB2
Application Programming and SQL Guide.
The material needed for writing applications that use JDBC and SQLJ to access
DB2 servers is in DB2 Application Programming Guide and Reference for Java. The
material needed for writing applications that use DB2 CLI or ODBC to access DB2
servers is in DB2 ODBC Guide and Reference. The material needed for working with
XML data in DB2 is in DB2 XML Guide. For handling errors, see DB2 Messages and
DB2 Codes.
|
|
|
|
|
|
If you are a software vendor implementing DRDA clients and servers, you will
need DB2 Reference for Remote DRDA Requesters and Servers.
Information about writing applications across operating systems can be found in
IBM DB2 SQL Reference for Cross-Platform Development.
1026
v DB2 concepts: Introduces DB2 structures, the DB2 environment, and high
availability.
v Designing a database: Discusses the decisions that must be made when
designing a database and tells how to implement the design by creating and
altering DB2 objects, loading data, and adjusting to changes.
v Security and auditing: Describes ways of controlling access to the DB2 system
and to data within DB2, to audit aspects of DB2 usage, and to answer other
security and auditing concerns.
v Operation and recovery: Describes the steps in normal day-to-day operation and
discusses the steps one should take to prepare for recovery in the event of some
failure.
DB2 Performance Monitoring and Tuning Guide explains how to monitor the
performance of the DB2 system and its parts. It also lists things that can be done to
make some parts run faster.
If you will be using the RACF access control module for DB2 authorization
checking, you will need DB2 RACF Access Control Module Guide.
If you are involved with DB2 only to design the database, or plan operational
procedures, you need DB2 Administration Guide. If you also want to carry out your
own plans by creating DB2 objects, granting privileges, running utility jobs, and so
on, you also need:
v DB2 SQL Reference, which describes the SQL statements you use to create, alter,
and drop objects and grant and revoke privileges
v DB2 Utility Guide and Reference, which explains how to run utilities
v DB2 Command Reference, which explains how to run commands
If you will be using data sharing, you need DB2 Data Sharing: Planning and
Administration, which describes how to plan for and implement data sharing.
Additional information about system and database administration can be found in
DB2 Messages and DB2 Codes, which list messages and codes issued by DB2, with
explanations and suggested responses.
Diagnosis
Diagnosticians detect and describe errors in the DB2 program. They might also
recommend or apply a remedy. The documentation for this task is in DB2 Diagnosis
Guide and Reference, DB2 Messages, and DB2 Codes.
1027
1028
Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in
other countries. Consult your local IBM representative for information on the
products and services currently available in your area. Any reference to an IBM
product, program, or service is not intended to state or imply that only that IBM
product, program, or service may be used. Any functionally equivalent product,
program, or service that does not infringe any IBM intellectual property right may
be used instead. However, it is the users responsibility to evaluate and verify the
operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not give you
any license to these patents. You can send license inquiries, in writing, to:
IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
Intellectual Property Licensing
Legal and Intellectual Property Law
IBM Japan, Ltd.
3-2-12, Roppongi, Minato-ku
Tokyo 106-8711
Japan
The following paragraph does not apply to the United Kingdom or any other
country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS
PUBLICATION AS IS WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS
FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or
implied warranties in certain transactions, therefore, this statement may not apply
to you.
This information could include technical inaccuracies or typographical errors.
Changes are periodically made to the information herein; these changes will be
incorporated in new editions of the publication. IBM may make improvements
and/or changes in the product(s) and/or the program(s) described in this
publication at any time without notice.
Any references in this information to non-IBM Web sites are provided for
convenience only and do not in any manner serve as an endorsement of those Web
sites. The materials at those Web sites are not part of the materials for this IBM
product and use of those Web sites is at your own risk.
Copyright IBM Corp. 1983, 2009
1029
IBM may use or distribute any of the information you supply in any way it
believes appropriate without incurring any obligation to you.
Licensees of this program who wish to have information about it for the purpose
of enabling: (i) the exchange of information between independently created
programs and other programs (including this one) and (ii) the mutual use of the
information which has been exchanged, should contact:
IBM Corporation
J46A/G4
555 Bailey Avenue
San Jose, CA 95141-1003
U.S.A.
Such information may be available, subject to appropriate terms and conditions,
including in some cases, payment of a fee.
The licensed program described in this document and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement,
IBM International Program License Agreement, or any equivalent agreement
between us.
This information contains examples of data and reports used in daily business
operations. To illustrate them as completely as possible, the examples include the
names of individuals, companies, brands, and products. All of these names are
fictitious and any similarity to the names and addresses used by an actual business
enterprise is entirely coincidental.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which
illustrate programming techniques on various operating platforms. You may copy,
modify, and distribute these sample programs in any form without payment to
IBM, for the purposes of developing, using, marketing or distributing application
programs conforming to the application programming interface for the operating
platform for which the sample programs are written. These examples have not
been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or
imply reliability, serviceability, or function of these programs. The sample
programs are provided AS IS, without warranty of any kind. IBM shall not be
liable for any damages arising out of your use of the sample programs.
If you are viewing this information softcopy, the photographs and color
illustrations may not appear.
1030
Information... PSPI
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered marks of
International Business Machines Corp., registered in many jurisdictions worldwide.
Other product and service names might be trademarks of IBM or other companies.
A current list of IBM trademarks is available on the Web at http://www.ibm.com/
legal/copytrade.shtml.
Adobe, the Adobe logo, Postscript, and the Postscript logo are either registered
trademarks or trademarks of Adobe Systems Incorporated in the United States,
and/or other countries.
Intel, Intel logo, Intel Inside, Intel Inside logo, Intel Centrino, Intel Centrino
logo, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are
trademarks or registered trademarks of Intel Corporation or its subsidiaries in the
United States and other countries.
Linux is a registered trademark of Linus Torvalds in the United States, other
countries, or both.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of
Microsoft Corporation in the United States, other countries, or both.
Notices
1031
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Java and all Java-based trademarks and logos are trademarks of Sun Microsystems,
Inc. in the United States, other countries, or both.
1032
Glossary
abend See abnormal end of task.
aggregate function
An operation that derives its result by
using values from one or more rows.
Contrast with scalar function.
|
|
|
|
|
address space
A range of virtual storage pages that is
identified by a number (ASID) and a
collection of segment and page tables that
map the virtual pages to real pages of the
computers memory.
address space connection
The result of connecting an allied address
space to DB2. See also allied address
space and task control block.
address space identifier (ASID)
A unique system-assigned identifier for
an address space.
|
|
|
|
|
|
|
AFTER trigger
A trigger that is specified to be activated
after a defined trigger event (an insert,
update, or delete operation on the table
that is specified in a trigger definition).
Contrast with BEFORE trigger and
INSTEAD OF trigger.
agent
|
|
|
|
|
|
alias
API
1033
automatic bind
(More correctly automatic rebind.) A
process by which SQL statements are
bound automatically (without a user
issuing a BIND command) when an
application process begins execution and
the bound application plan or package it
requires is not valid.
application requester
The component on a remote system that
generates DRDA requests for data on
behalf of an application.
application server
The target of a request from a remote
application. In the DB2 environment, the
application server function is provided by
the distributed data facility and is used to
access DB2 data from remote applications.
archive log
The portion of the DB2 log that contains
log records that have been copied from
the active log. See also active log.
ASCII An encoding scheme that is used to
represent strings in many environments,
typically on PCs and workstations.
Contrast with EBCDIC and Unicode.
ASID See address space identifier.
attachment facility
An interface between DB2 and TSO, IMS,
CICS, or batch address spaces. An
attachment facility allows application
programs to access DB2.
attribute
A characteristic of an entity. For example,
in database design, the phone number of
an employee is an attribute of that
employee.
|
|
|
|
|
authorization ID
A string that can be verified for
connection to DB2 and to which a set of
privileges is allowed. An authorization ID
can represent an individual or an
organizational group.
1034
auxiliary index
An index on an auxiliary table in which
each index entry refers to a LOB or XML
document.
auxiliary table
A table that contains columns outside the
actual table in which they are defined.
Auxiliary tables can contain either LOB or
XML data.
backout
The process of undoing uncommitted
changes that an application process made.
A backout is often performed in the event
of a failure on the part of an application
process, or as a result of a deadlock
situation.
backward log recovery
The final phase of restart processing
during which DB2 scans the log in a
backward direction to apply UNDO log
records for all aborted changes.
base table
A table that is created by the SQL
CREATE TABLE statement and that holds
persistent data. Contrast with clone table,
materialized query table, result table,
temporary table, and transition table.
base table space
A table space that contains base tables.
|
|
|
|
|
|
|
|
|
|
|
|
|
BEFORE trigger
A trigger that is specified to be activated
before a defined trigger event (an insert,
an update, or a delete operation on the
table that is specified in a trigger
definition). Contrast with AFTER trigger
and INSTEAD OF trigger.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binary string
A sequence of bytes that is not associated
with a CCSID. Binary string data type can
be further classified as BINARY,
VARBINARY, or BLOB.
|
|
|
|
|
|
|
|
bind
bit data
|
|
|
|
|
|
|
|
|
|
|
|
block fetch
A capability in which DB2 can retrieve, or
fetch, a large set of rows together. Using
block fetch can significantly reduce the
number of messages that are being sent
across the network. Block fetch applies
only to non-rowset cursors that do not
update data.
bootstrap data set (BSDS)
A VSAM data set that contains name and
status information for DB2 and RBA
range specifications for all active and
archive log data sets. The BSDS also
contains passwords for the DB2 directory
and catalog, and lists of conditional
restart and checkpoint records.
BSAM
See basic sequential access method.
BSDS See bootstrap data set.
|
|
|
buffer pool
An area of memory into which data pages
are read, modified, and held during
processing.
|
|
|
|
|
|
|
|
|
built-in function
A function that is generated by DB2 and
that is in the SYSIBM schema. Contrast
with user-defined function. See also
function, cast function, external function,
sourced function, and SQL function.
business dimension
A category of data, such as products or
time periods, that an organization might
want to analyze.
cache structure
A coupling facility structure that stores
data that can be available to all members
of a Sysplex. A DB2 data sharing group
uses cache structures as group buffer
pools.
CAF
DB2 glossary
1035
character conversion
The process of changing characters from
one encoding scheme to another.
cascade delete
A process by which DB2 enforces
referential constraints by deleting all
descendent rows of a deleted parent row.
CASE expression
An expression that is selected based on
the evaluation of one or more conditions.
cast function
A function that is used to convert
instances of a (source) data type into
instances of a different (target) data type.
castout
The DB2 process of writing changed
pages from a group buffer pool to disk.
castout owner
The DB2 member that is responsible for
casting out a particular page set or
partition.
|
|
|
|
|
|
|
|
character set
A defined set of characters.
catalog
In DB2, a collection of tables that contains
descriptions of objects such as tables,
views, and indexes.
catalog table
Any table in the DB2 catalog.
CCSID
See coded character set identifier.
CDB
CDRA
See Character Data Representation
Architecture.
CEC
1036
|
|
|
|
|
character string
A sequence of bytes that represent bit
data, single-byte characters, or a mixture
of single-byte and multibyte characters.
Character data can be further classified as
CHARACTER, VARCHAR, or CLOB.
check constraint
A user-defined constraint that specifies
the values that specific columns of a base
table can contain.
check integrity
The condition that exists when each row
in a table conforms to the check
constraints that are defined on that table.
check pending
A state of a table space or partition that
prevents its use by some utilities and by
some SQL statements because of rows
that violate referential constraints, check
constraints, or both.
checkpoint
A point at which DB2 records status
information on the DB2 log; the recovery
process uses this information if DB2
abnormally terminates.
child lock
For explicit hierarchical locking, a lock
that is held on either a table, page, row,
or a large object (LOB). Each child lock
has a parent lock. See also parent lock.
|
|
|
|
CI
CICS
claim class
A specific type of object access that can be
one of the following isolation levels:
v Cursor stability (CS)
v Repeatable read (RR)
v Write
class of service
A VTAM term for a list of routes through
a network, arranged in an order of
preference for their use.
clause In SQL, a distinct part of a statement,
such as a SELECT clause or a WHERE
clause.
CLI
client
See requester.
clone object
An object that is associated with a clone
table, including the clone table itself and
check constraints, indexes, and BEFORE
triggers on the clone table.
|
|
|
clone table
A table that is structurally identical to a
base table. The base and clone table each
|
|
|
|
closed application
An application that requires exclusive use
of certain statements on certain DB2
objects, so that the objects are managed
solely through the external interface of
that application.
clustering index
An index that determines how rows are
physically ordered (clustered) in a table
space. If a clustering index on a
partitioned table is not a partitioning
index, the rows are ordered in cluster
sequence within each data partition
instead of spanning partitions.
| CM
| CM*
C++ member
A data object or function in a structure,
union, or class.
C++ member function
An operator or function that is declared
as a member of a class. A member
function has access to the private and
protected data members and to the
member functions of objects in its class.
Member functions are also called
methods.
C++ object
A region of storage. An object is created
when a variable is defined or a new
function is invoked.
An instance of a class.
coded character set
A set of unambiguous rules that establish
a character set and the one-to-one
relationships between the characters of
the set and their coded representations.
coded character set identifier (CCSID)
A 16-bit number that uniquely identifies a
coded representation of graphic
characters. It designates an encoding
scheme identifier and one or more pairs
that consist of a character set identifier
and an associated code page identifier.
code page
A set of assignments of characters to code
DB2 glossary
1037
code point
In CDRA, a unique bit pattern that
represents a character in a code page.
commit
The operation that ends a unit of work by
releasing locks so that the database
changes that are made by that unit of
work can be perceived by other processes.
Contrast with rollback.
code unit
The fundamental binary width in a
computer architecture that is used for
representing character data, such as 7 bits,
8 bits, 16 bits, or 32 bits. Depending on
the character encoding form that is used,
each code point in a coded character set
can be represented by one or more code
units.
coexistence
During migration, the period of time in
which two releases exist in the same data
sharing group.
commit point
A point in time when data is considered
consistent.
|
|
|
|
|
cold start
A process by which DB2 restarts without
processing any log records. Contrast with
warm start.
collection
A group of packages that have the same
qualifier.
comparison operator
A token (such as =, >, or <) that is used
to specify a relationship between two
values.
column
The vertical component of a table. A
column has a name and a particular data
type (for example, character, decimal, or
integer).
command
A DB2 operator command or a DSN
subcommand. A command is distinct
from an SQL statement.
command prefix
A 1- to 8-character command identifier.
The command prefix distinguishes the
command as belonging to an application
or subsystem rather than to z/OS.
command recognition character (CRC)
A character that permits a z/OS console
1038
compatibility mode
See conversion mode.
compatibility mode* (CM*)
See conversion mode*.
column function
See aggregate function.
come from checking
An LU 6.2 security option that defines a
list of authorization IDs that are allowed
to connect to DB2 from a partner LU.
|
|
composite key
An ordered set of key columns or
expressions of the same table.
compression dictionary
The dictionary that controls the process of
compression and decompression. This
dictionary is created from the data in the
table space or table space partition.
concurrency
The shared use of resources by more than
one application process at the same time.
conditional restart
A DB2 restart that is directed by a
user-defined conditional restart control
record (CRCR).
connection
In SNA, the existence of a communication
path between two partner LUs that allows
information to be exchanged (for example,
two DB2 subsystems that are connected
and communicating by way of a
conversation).
connection context
In SQLJ, a Java object that represents a
connection to a data source.
conversation
Communication, which is based on LU
6.2 or Advanced Program-to-Program
Communication (APPC), between an
application and a remote transaction
program over an SNA logical
unit-to-logical unit (LU-LU) session that
allows communication while processing a
transaction.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1039
copy pool
A collection of names of storage groups
that are processed collectively for fast
replication operations.
copy target
A named set of SMS storage groups that
are to be used as containers for copy pool
volume copies. A copy target is an SMS
construct that lets you define which
storage groups are to be used as
containers for volumes that are copied by
using FlashCopy functions.
copy version
A point-in-time FlashCopy copy that is
managed by HSM. Each copy pool has a
version parameter that specifies the
number of copy versions to be maintained
on disk.
correlated columns
A relationship between the value of one
column and the value of another column.
correlated subquery
A subquery (part of a WHERE or
HAVING clause) that is applied to a row
or group of rows of a table or view that is
named in an outer subselect statement.
correlation ID
An identifier that is associated with a
specific thread. In TSO, it is either an
authorization ID or the job name.
|
|
|
|
|
|
|
|
|
|
correlation name
An identifier that is specified and used
within a single SQL statement as the
exposed name for objects such as a table,
view, table function reference, nested table
expression, or result of a data change
statement. Correlation names are useful in
an SQL statement to allow two distinct
references to the same base table and to
allow an alternative name to be used to
represent an object.
cost category
A category into which DB2 places cost
estimates for SQL statements at the time
the statement is bound. The cost category
is externalized in the COST_CATEGORY
1040
coupling facility
A special PR/SM logical partition (LPAR)
that runs the coupling facility control
program and provides high-speed
caching, list processing, and locking
functions in a Parallel Sysplex.
coupling facility resource management (CFRM)
A component of z/OS that provides the
services to manage coupling facility
resources in a Parallel Sysplex. This
management includes the enforcement of
CFRM policies to ensure that the coupling
facility and structure requirements are
satisfied.
CP
CPC
CRC
CSA
CT
current data
Data within a host structure that is
current with (identical to) the data within
the base table.
cursor sensitivity
The degree to which database updates are
visible to the subsequent FETCH
statements in a cursor.
database server
The target of a request from a local
application or a remote intermediate
database server.
data currency
The state in which the data that is
retrieved into a host variable in a
program is a copy of the data in the base
table.
database
A collection of tables, or a collection of
table spaces and index spaces.
database access thread (DBAT)
A thread that accesses data at the local
subsystem on behalf of a remote
subsystem.
data dictionary
A repository of information about an
organizations application programs,
databases, logical data models, users, and
authorizations.
data partition
A VSAM data set that is contained within
a partitioned table space.
data-partitioned secondary index (DPSI)
A secondary index that is partitioned
according to the underlying data.
Contrast with nonpartitioned secondary
index.
|
|
|
1041
data sharing
A function of DB2 for z/OS that enables
applications on different DB2 subsystems
to read from and write to the same data
concurrently.
DDF
DB2 catalog
A collection of tables that are maintained
by DB2 and contain descriptions of DB2
objects, such as tables, views, and
indexes.
DBCLOB
See double-byte character large object.
deadlock
Unresolvable contention for the use of a
resource, such as a table or an index.
1042
DB2 thread
The database manager structure that
describes an applications connection,
traces its progress, processes resource
functions, and delimits its accessibility to
the database manager resources and
services. Most DB2 for z/OS functions
execute under a thread structure.
DCLGEN
See declarations generator.
DB2 command
An instruction to the DB2 subsystem that
a user enters to start or stop DB2, to
display information on current users, to
start or stop databases, to display
information on the status of databases,
and so on.
DBMS
data warehouse
A system that provides critical business
information to an organization. The data
warehouse system cleanses the data for
accuracy and currency, and then presents
the data to decision makers so that they
can interpret and use it effectively and
efficiently.
DBA
DB2I
data type
An attribute of columns, constants,
variables, parameters, special registers,
and the results of functions and
expressions.
data source
A local or remote relational or
non-relational data manager that is
capable of supporting data access via an
ODBC driver that supports the ODBC
APIs. In the case of DB2 for z/OS, the
data sources are always relational
database managers.
DBD
|
|
default value
A predetermined value, attribute, or
option that is assumed when no other
|
|
|
|
|
distinct type
A user-defined data type that is
represented as an existing type (its source
DB2 glossary
1043
distributed data
Data that resides on a DBMS other than
the local system.
DRDA access
An open method of accessing distributed
data that you can use to connect to
another database server to execute
packages that were previously bound at
the server location.
DSN
v The default DB2 subsystem name.
v The name of the TSO command
processor of DB2.
v The first three characters of DB2
module and macro names.
domain
The set of valid values for an attribute.
domain name
The name by which TCP/IP applications
refer to a TCP/IP host within a TCP/IP
network.
dynamic cursor
A named control structure that an
application program uses to change the
size of the result table and the order of its
rows after the cursor is opened. Contrast
with static cursor.
1044
| document ID
|
A value that uniquely identifies a row
|
that contains an XML column. This value
|
is stored with the row and never changes.
drain
DRDA
| DOCID
|
See document ID.
|
|
|
|
|
|
|
drain lock
A lock on a claim class that prevents a
claim from occurring.
DNS
DPSI
dynamic dump
A dump that is issued during the
execution of a program, usually under the
control of that program.
|
|
|
|
|
dynamic SQL
SQL statements that are prepared and
executed at run time. In dynamic SQL,
the SQL statement is contained as a
character string in a host variable or as a
constant, and it is not precompiled.
EA-enabled table space
A table space or index space that is
enabled for extended addressability and
See exabyte.
EBCDIC
Extended binary coded decimal
interchange code. An encoding scheme
that is used to represent character data in
the z/OS, VM, VSE, and iSeries
environments. Contrast with ASCII and
Unicode.
embedded SQL
SQL statements that are coded within an
application program. See static SQL.
| enabling-new-function mode (ENFM)
|
A transitional stage of the
|
version-to-version migration process
|
during which the DB2 subsystem or data
|
sharing group is preparing to use the new
|
functions of the new version. When in
|
enabling-new-function mode, a DB2 data
|
sharing group cannot coexist with
|
members that are still at the prior version
|
level. Fallback to a prior version is not
|
supported, and most new functions of the
|
new version are not available for use in
|
enabling-new-function mode. Contrast
|
with conversion mode, conversion mode*,
|
enabling-new-function mode*, and
|
new-function mode.
| enabling-new-function mode* (ENFM*)
|
A transitional stage of the
|
version-to-version migration process that
|
applies to a DB2 subsystem or data
|
sharing group that was in new-function
|
mode (NFM) at one time. When in
|
enabling-new-function mode*, a DB2
|
subsystem or data sharing group is
|
preparing to use the new functions of the
|
new version but cannot yet use them. A
|
data sharing group that is in
|
enabling-new-function mode* cannot
|
coexist with members that are still at the
|
prior version level. Fallback to a prior
|
version is not supported. Contrast with
|
conversion mode, conversion mode*,
|
enabling-new-function mode, and
|
new-function mode.
enclave
In Language Environment , an
independent collection of routines, one of
which is designated as the main routine.
environment handle
A handle that identifies the global context
for database access. All data that is
pertinent to all objects in the environment
is associated with this handle.
equijoin
A join operation in which the
join-condition has the form expression =
expression. See also join, full outer join,
inner join, left outer join, outer join, and
right outer join.
error page range
A range of pages that are considered to be
physically damaged. DB2 does not allow
users to access any pages that fall within
this range.
escape character
The symbol, a double quotation () for
example, that is used to enclose an SQL
delimited identifier.
exabyte
A unit of measure for processor, real and
virtual storage capacities, and channel
volume that has a value of 1 152 921 504
606 846 976 bytes or 260.
DB2 glossary
1045
|
|
|
|
|
|
exception
An SQL operation that involves the
EXCEPT set operator, which combines
two result tables. The result of an
exception operation consists of all of the
rows that are in only one of the result
tables.
exposed name
A correlation name or a table or view
name for which a correlation name is not
specified.
expression
An operand or a collection of operators
and operands that yields a single value.
exception table
A table that holds rows that violate
referential constraints or check constraints
that the CHECK DATA utility finds.
exclusive lock
A lock that prevents concurrently
executing application processes from
reading or changing data. Contrast with
share lock.
executable statement
An SQL statement that can be embedded
in an application program, dynamically
prepared and executed, or issued
interactively.
execution context
In SQLJ, a Java object that can be used to
control the execution of SQL statements.
exit routine
A user-written (or IBM-provided default)
program that receives control from DB2 to
perform specific functions. Exit routines
run as extensions of DB2.
expanding conversion
A process that occurs when the length of
a converted string is greater than that of
the source string. For example, this
process occurs when an ASCII mixed-data
string that contains DBCS characters is
converted to an EBCDIC mixed-data
string; the converted string is longer
because shift codes are added.
explicit hierarchical locking
Locking that is used to make the
parent-child relationship between
resources known to IRLM. This kind of
locking avoids global locking overhead
when no inter-DB2 interest exists on a
resource.
|
|
|
|
|
explicit privilege
A privilege that has a name and is held as
the result of an SQL GRANT statement
and revoked as the result of an SQL
REVOKE statement. For example, the
SELECT privilege.
1046
|
|
|
|
|
|
|
|
|
|
|
|
|
external function
A function that has its functional logic
implemented in a programming language
application that resides outside the
database, in the file system of the
database server. The association of the
function with the external code
application is specified by the EXTERNAL
clause in the CREATE FUNCTION
statement. External functions can be
classified as external scalar functions and
external table functions. Contrast with
sourced function, built-in function, and
SQL function.
|
|
|
|
|
|
|
|
|
|
|
|
external procedure
A procedure that has its procedural logic
implemented in an external programming
language application. The association of
the procedure with the external
application is specified by a CREATE
PROCEDURE statement with a
LANGUAGE clause that has a value other
than SQL and an EXTERNAL clause that
implicitly or explicitly specifies the name
of the external application. Contrast with
external SQL procedure and native SQL
procedure.
external routine
A user-defined function or stored
procedure that is based on code that is
written in an external programming
language.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fan set
A direct physical access path to data,
which is provided by an index, hash, or
link; a fan set is the means by which DB2
supports the ordering of data.
federated database
The combination of a DB2 server (in
Linux, UNIX, and Windows
environments) and multiple data sources
to which the server sends queries. In a
federated database system, a client
application can use a single SQL
statement to join data that is distributed
across multiple database management
systems and can view the data as if it
were local.
fetch orientation
The specification of the desired placement
of the cursor as part of a FETCH
statement. The specification can be before
or after the rows of the result table (with
BEFORE or AFTER). The specification can
also have either a single-row fetch
orientation (for example, NEXT, LAST, or
ABSOLUTE n) or a rowset fetch
|
|
|
|
|
|
|
fallback
The process of returning to a previous
release of DB2 after attempting or
completing migration to a current release.
Fallback is supported only from a
subsystem that is in conversion mode.
false global lock contention
A contention indication from the coupling
facility that occurs when multiple lock
names are hashed to the same indicator
and when no real contention exists.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fixed-length string
A character, graphic, or binary string
whose length is specified and cannot be
changed. Contrast with varying-length
string.
|
|
|
|
|
FlashCopy
A function on the IBM Enterprise Storage
Server that can, in conjunction with the
BACKUP SYSTEM utility, create a
point-in-time copy of data while an
application is running.
foreign key
A column or set of columns in a
dependent table of a constraint
relationship. The key must have the same
number of columns, with the same
descriptions, as the primary key of the
parent table. Each foreign key value must
either match a parent key value in the
related parent table or be null.
forest An ordered set of subtrees of XML nodes.
forward log recovery
The third phase of restart processing
during which DB2 processes the log in a
forward direction to apply all REDO log
records.
free space
The total amount of unused space in a
page; that is, the space that is not used to
store records or control information is free
space.
DB2 glossary
1047
| fullselect
|
A subselect, a fullselect in parentheses, or
|
a number of both that are combined by
|
set operators. Fullselect specifies a result
|
table. If a set operator is not used, the
|
result of the fullselect is the result of the
|
specified subselect or fullselect.
getpage
An operation in which DB2 accesses a
data page.
function
A mapping, which is embodied as a
program (the function body) that is
invocable by means of zero or more input
values (arguments) to a single value (the
result). See also aggregate function and
scalar function.
global lock
A lock that provides concurrency control
within and among DB2 subsystems. The
scope of the lock is across all DB2
subsystems of a data sharing group.
global lock contention
Conflicts on locking requests between
different DB2 members of a data sharing
group when those members are trying to
serialize shared resources.
GBP
GBP-dependent
The status of a page set or page set
partition that is dependent on the group
1048
governor
See resource limit facility.
|
|
|
graphic string
A sequence of DBCS characters. Graphic
data can be further classified as
GRAPHIC, VARGRAPHIC, or DBCLOB.
| GRECP
|
See group buffer pool recovery pending.
gross lock
The shared, update, or exclusive mode locks
on a table, partition, or table space.
group buffer pool duplexing
The ability to write data to two instances
of a group buffer pool structure: a
primary group buffer pool and a
secondary group buffer pool. z/OS
publications refer to these instances as the
old (for primary) and new (for
secondary) structures.
group buffer pool (GBP)
A coupling facility cache structure that is
hole
host identifier
A name that is declared in the host
program.
group name
The z/OS XCF identifier for a data
sharing group.
host language
A programming language in which you
can embed SQL statements.
group restart
A restart of at least one member of a data
sharing group after the loss of either locks
or the shared communications area.
host program
An application program that is written in
a host language and that contains
embedded SQL statements.
handle
In DB2 ODBC, a variable that refers to a
data structure and associated resources.
See also statement handle, connection
handle, and environment handle.
host structure
In an application program, a structure
that is referenced by embedded SQL
statements.
help panel
A screen of information that presents
tutorial text to assist a user at the
workstation or terminal.
host variable
In an application program written in a
host language, an application variable
that is referenced by embedded SQL
statements.
heuristic damage
The inconsistency in data between one or
more participants that results when a
heuristic decision to resolve an indoubt
LUW at one or more participants differs
from the decision that is recorded at the
coordinator.
heuristic decision
A decision that forces indoubt resolution
at a participant by means other than
automatic resynchronization between
coordinator and participant.
| histogram statistics
|
A way of summarizing data distribution.
|
This technique divides up the range of
|
possible values in a data set into intervals,
|
such that each interval contains
|
approximately the same percentage of the
|
values. A set of statistics are collected for
|
each interval.
host expression
A Java variable or expression that is
referenced by SQL clauses in an SQLJ
application program.
group level
The release level of a data sharing group,
which is established when the first
member migrates to a new release.
GTF
DB2 glossary
1049
|
|
|
|
|
|
|
|
IDCAMS LISTCAT
A facility for obtaining information that is
contained in the access method services
catalog.
index
identity column
A column that provides a way for DB2 to
automatically generate a numeric value
for each row. Identity columns are
defined with the AS IDENTITY clause.
Uniqueness of values can be ensured by
defining a unique index that contains
only the identity column. A table can
have no more than one identity column.
index-controlled partitioning
A type of partitioning in which partition
boundaries for a partitioned table are
controlled by values that are specified on
the CREATE INDEX statement. Partition
limits are saved in the LIMITKEY column
of the SYSIBM.SYSINDEXPART catalog
table.
IFI call
An invocation of the instrumentation
facility interface (IFI) by means of one of
its defined functions.
image copy
An exact reproduction of all or part of a
table space. DB2 provides utility
programs to make full image copies (to
copy the entire table space) or incremental
image copies (to copy only those pages
that have been modified since the last
image copy).
IMS attachment facility
A DB2 subcomponent that uses z/OS
subsystem interface (SSI) protocols and
cross-memory linkage to process requests
from IMS to DB2 and to coordinate
resource commitment.
in-abort
A status of a unit of recovery. If DB2 fails
after a unit of recovery begins to be rolled
back, but before the process is completed,
DB2 continues to back out the changes
during restart.
in-commit
A status of a unit of recovery. If DB2 fails
after beginning its phase 2 commit
processing, it knows, when restarted,
that changes made to data are consistent.
Such units of recovery are termed
in-commit.
independent
An object (row, table, or table space) that
is neither a parent nor a dependent of
another object.
1050
index key
The set of columns in a table that is used
to determine the order of index entries.
index partition
A VSAM data set that is contained within
a partitioning index space.
index space
A page set that is used to store the entries
of one index.
indicator column
A 4-byte value that is stored in a base
table in place of a LOB column.
indicator variable
A variable that is used to represent the
null value in an application program. If
the value for the selected column is null,
a negative value is placed in the indicator
variable.
indoubt
A status of a unit of recovery. If DB2 fails
after it has finished its phase 1 commit
processing and before it has started phase
2, only the commit coordinator knows if
an individual unit of recovery is to be
committed or rolled back. At restart, if
DB2 lacks the information it needs to
make this decision, the status of the unit
of recovery is indoubt until DB2 obtains
this information from the coordinator.
More than one unit of recovery can be
indoubt at restart.
indoubt resolution
The process of resolving the status of an
indoubt logical unit of work to either the
committed or the rollback state.
inflight
A status of a unit of recovery. If DB2 fails
before its unit of recovery completes
phase 1 of the commit process, it merely
1051
|
|
IP address
A value that uniquely identifies a TCP/IP
host.
IRLM See internal resource lock manager.
isolation level
The degree to which a unit of work is
isolated from the updating operations of
other units of work. See also cursor
stability, read stability, repeatable read,
and uncommitted read.
ISPF
iterator
In SQLJ, an object that contains the result
set of a query. An iterator is equivalent to
a cursor in other host languages.
iterator declaration clause
In SQLJ, a statement that generates an
iterator declaration class. An iterator is an
object of an iterator declaration class.
JAR
KB
Kerberos
A network authentication protocol that is
designed to provide strong authentication
for client/server applications by using
secret-key cryptography.
Kerberos ticket
A transparent application mechanism that
transmits the identity of an initiating
principal to its target. A simple ticket
contains the principals identity, a session
key, a timestamp, and other information,
which is sealed using the targets secret
key.
| key
1052
|
|
|
|
|
LCID
LDS
leaf page
An index page that contains pairs of keys
and RIDs and that points to actual data.
Contrast with nonleaf page.
left outer join
The result of a join operation that
includes the matched rows of both tables
that are being joined, and that preserves
the unmatched rows of the first table. See
also join, equijoin, full outer join, inner
join, outer join, and right outer join.
limit key
The highest value of the index key for a
partition.
linear data set (LDS)
A VSAM data set that contains data but
no control information. A linear data set
can be accessed as a byte-addressable
string in virtual storage.
linkage editor
A computer program for creating load
modules from one or more object
modules or load modules by resolving
cross references among the modules and,
if necessary, adjusting addresses.
link-edit
The action of creating a loadable
computer program using a linkage editor.
list
list structure
A coupling facility structure that lets data
be shared and manipulated as elements of
a queue.
L-lock See logical lock.
load module
A program unit that is suitable for
loading into main storage for execution.
The output of a linkage editor.
LOB
LOB locator
A mechanism that allows an application
program to manipulate a large object
value in the database system. A LOB
locator is a fullword integer value that
represents a single LOB value. An
application program retrieves a LOB
locator into a host variable and can then
apply SQL operations to the associated
LOB value using the locator.
LOB lock
A lock on a LOB value.
LOB table space
A table space that contains all the data for
a particular LOB column in the related
base table.
local
local lock
A lock that provides intra-DB2
concurrency control, but not inter-DB2
concurrency control; that is, its scope is a
single DB2.
local subsystem
The unique relational DBMS to which the
user or application program is directly
connected (in the case of DB2, by one of
the DB2 attachment facilities).
location
The unique name of a database server. An
application uses the location name to
access a DB2 database server. A database
alias can be used to override the location
name when accessing a remote server.
location alias
Another name by which a database server
identifies itself in the network.
Applications can use this name to access a
DB2 database server.
lock
lock duration
The interval over which a DB2 lock is
held.
lock escalation
The promotion of a lock from a row, page,
or LOB lock to a table space lock because
the number of page locks that are
concurrently held on a given resource
exceeds a preset limit.
locking
The process by which the integrity of data
is ensured. Locking prevents concurrent
users from accessing inconsistent data.
See also claim, drain, and latch.
lock mode
A representation for the type of access
that concurrently running programs can
have to a resource that a DB2 lock is
holding.
lock object
The resource that is controlled by a DB2
lock.
lock promotion
The process of changing the size or mode
of a DB2 lock to a higher, more restrictive
level.
DB2 glossary
1053
lock size
The amount of data that is controlled by a
DB2 lock on table data; the value can be a
row, a page, a LOB, a partition, a table, or
a table space.
lock structure
A coupling facility data structure that is
composed of a series of lock entries to
support shared and exclusive locking for
logical resources.
log
logical claim
A claim on a logical partition of a
nonpartitioning index.
log initialization
The first phase of restart processing
during which DB2 attempts to locate the
current end of the log.
logically complete
A state in which the concurrent copy
process is finished with the initialization
of the target objects that are being copied.
The target objects are available for
update.
log truncation
A process by which an explicit starting
RBA is established. This RBA is the point
at which the next byte of log data is to be
written.
1054
LPL
LRECP
See logical recovery pending.
LRH
LU name
Logical unit name, which is the name by
which VTAM refers to a node in a
network.
LUW
LUWID
See logical unit of work identifier.
mapping table
A table that the REORG utility uses to
map the associations of the RIDs of data
records in the original copy and in the
shadow copy. This table is created by the
user.
modify locks
An L-lock or P-lock with a MODIFY
attribute. A list of these active locks is
kept at all times in the coupling facility
lock structure. If the requesting DB2
subsystem fails, that DB2 subsystems
modify locks are converted to retained
locks.
mass delete
The deletion of all rows of a table.
materialize
v The process of putting rows from a
view or nested table expression into a
work file for additional processing by a
query.
v The placement of a LOB value into
contiguous storage. Because LOB
values can be very large, DB2 avoids
materializing LOB data until doing so
becomes absolutely necessary.
multidimensional analysis
The process of assessing and evaluating
an enterprise on more than one level.
multithreading
Multiple TCBs that are executing one
copy of DB2 ODBC code concurrently
(sharing a processor) or in parallel (on
separate central processors).
MVS
|
|
|
|
|
|
|
|
|
|
|
1055
normalization
A key step in the task of building a
logical relational database design.
Normalization helps you avoid
redundancies and inconsistencies in your
data. An entity is normalized if it meets a
set of constraints for a particular normal
form (first normal form, second normal
form, and so on). Contrast with
denormalization.
not-variant function
See deterministic function.
| node ID index
|
See XML node ID index.
nondeterministic function
A user-defined function whose result is
not solely dependent on the values of the
input arguments. That is, successive
invocations with the same argument
values can produce a different answer.
This type of function is sometimes called
a variant function. Contrast with
deterministic function (sometimes called a
not-variant function).
|
|
|
|
|
|
|
1056
NUL
null
null terminator
In C, the value that indicates the end of a
string. For EBCDIC, ASCII, and Unicode
UTF-8 strings, the null terminator is a
single-byte value (X00). For Unicode
UTF-16 or UCS-2 (wide) strings, the null
terminator is a double-byte value
(X0000).
ODBC
nonleaf page
A page that contains keys and page
numbers of other pages in the index
(either leaf or nonleaf pages). Nonleaf
pages never point to actual data. Contrast
with leaf page.
nonpartitioned index
An index that is not physically
partitioned. Both partitioning indexes and
secondary indexes can be nonpartitioned.
NPSI
|
|
|
|
|
|
|
|
|
package name
The name of an object that is used for an
application package or an SQL procedure
package. An application package is a
bound version of a database request
module (DBRM) that is created by a
|
|
|
|
|
|
|
|
| page
|
|
|
|
|
|
|
page set
Another way to refer to a table space or
index space. Each page set consists of a
collection of VSAM data sets.
page set recovery pending (PSRCP)
A restrictive state of an index space. In
this case, the entire page set must be
recovered. Recovery of a logical part is
prohibited.
panel
parallel complex
A cluster of machines that work together
to handle multiple transactions and
applications.
parallel group
A set of consecutive operations that
execute in parallel and that have the same
number of parallel tasks.
parallel I/O processing
A form of I/O processing in which DB2
initiates multiple concurrent requests for a
single user query and performs I/O
processing concurrently (in parallel) on
multiple data partitions.
parallelism assistant
In Sysplex query parallelism, a DB2
subsystem that helps to process parts of a
parallel query that originates on another
DB2 subsystem in the data sharing group.
DB2 glossary
1057
parallelism coordinator
In Sysplex query parallelism, the DB2
subsystem from which the parallel query
originates.
Parallel Sysplex
A set of z/OS systems that communicate
and cooperate with each other through
certain multisystem hardware components
and software services to process customer
workloads.
participant
An entity other than the commit
coordinator that takes part in the commit
process. The term participant is
synonymous with agent in SNA.
parallel task
The execution unit that is dynamically
created to process a query in parallel. A
parallel task is implemented by a z/OS
service request block.
|
|
|
|
|
|
parameter marker
A question mark (?) that appears in a
statement string of a dynamic SQL
statement. The question mark can appear
where a variable could appear if the
statement string were a static SQL
statement.
|
|
|
|
|
|
|
|
parameter-name
An SQL identifier that designates a
parameter in a routine that is written by a
user. Parameter names are required for
SQL procedures and SQL functions, and
they are used in the body of the routine
to refer to the values of the parameters.
Parameter names are optional for external
routines.
parent key
A primary key or unique key in the
parent table of a referential constraint.
The values of a parent key determine the
valid values of the foreign key in the
referential constraint.
|
|
|
|
|
|
|
parent table
A table whose primary key is referenced
by the foreign key of a dependent table.
parent lock
For explicit hierarchical locking, a lock
that is held on a resource that might have
child locks that are lower in the hierarchy.
A parent lock is usually the table space
lock or the partition intent lock. See also
child lock.
parent row
A row whose primary key value is the
foreign key value of a dependent row.
partition
A portion of a page set. Each partition
corresponds to a single, independently
extendable data set. The maximum size of
a partition depends on the number of
partitions in the partitioned page set. All
partitions of a given page set have the
same maximum size.
1058
PDS
precompilation
A processing of application programs
containing SQL statements that takes
place before compilation. SQL statements
are replaced with statements that are
recognized by the host language compiler.
Output from this precompilation includes
source code that can be submitted to the
compiler and the database request
module (DBRM) that is input to the bind
process.
physical consistency
The state of a page that is not in a
partially changed state.
physical lock (P-lock)
A type of lock that DB2 acquires to
provide consistency of data that is cached
in different DB2 subsystems. Physical
locks are used only in data sharing
environments. Contrast with logical lock
(L-lock).
physically complete
The state in which the concurrent copy
process is completed and the output data
set has been created.
piece
plan
plan allocation
The process of allocating DB2 resources to
a plan in preparation for execution.
plan member
The bound copy of a DBRM that is
identified in the member clause.
plan name
The name of an application plan.
P-lock See physical lock.
point of consistency
A time when all recoverable data that an
application accesses is consistent with
other data. The term point of consistency
is synonymous with sync point or commit
point.
policy See CFRM policy.
postponed abort UR
A unit of recovery that was inflight or
in-abort, was interrupted by system
failure or cancellation, and did not
complete backout during restart.
precision
In SQL, the total number of digits in a
predicate
An element of a search condition that
expresses or implies a comparison
operation.
prefix A code at the beginning of a message or
record.
|
|
|
preformat
The process of preparing a VSAM linear
data set for DB2 use, by writing specific
data patterns.
prepare
The first phase of a two-phase commit
process in which all participants are
requested to prepare for commit.
prepared SQL statement
A named object that is the executable
form of an SQL statement that has been
processed by the PREPARE statement.
primary authorization ID
The authorization ID that is used to
identify the application process to DB2.
primary group buffer pool
For a duplexed group buffer pool, the
structure that is used to maintain the
coherency of cached data. This structure
is used for page registration and
cross-invalidation. The z/OS equivalent is
old structure. Compare with secondary
group buffer pool.
primary index
An index that enforces the uniqueness of
a primary key.
primary key
In a relational database, a unique, nonnull
key that is part of the definition of a
DB2 glossary
1059
|
|
|
|
1060
PSRCP
See page set recovery pending.
PTF
QSAM
See queued sequential access method.
query A component of certain SQL statements
that specifies a result table.
query block
The part of a query that is represented by
one of the FROM clauses. Each FROM
clause can have multiple query blocks,
depending on DB2 processing of the
query.
query CP parallelism
Parallel execution of a single query, which
is accomplished by using multiple tasks.
See also Sysplex query parallelism.
query I/O parallelism
Parallel access of data, which is
accomplished by triggering multiple I/O
requests within a single query.
queued sequential access method (QSAM)
An extended version of the basic
sequential access method (BSAM). When
this method is used, a queue of data
blocks is formed. Input data blocks await
processing, and output data blocks await
transfer to auxiliary storage or to an
output device.
quiesce point
A point at which data is consistent as a
result of running the DB2 QUIESCE
utility.
RACF Resource Access Control Facility. A
component of the z/OS Security Server.
| range-partitioned table space
|
A type of universal table space that is
|
based on partitioning ranges and that
|
contains a single table. Contrast with
|
partition-by-growth table space. See also
|
universal table space.
RBA
RCT
| RDO
recovery log
A collection of records that describes the
events that occur during DB2 execution
and indicates their sequence. The
recorded information is used for recovery
in the event of a failure during DB2
execution.
rebind
The creation of a new application plan for
an application program that has been
bound previously. If, for example, you
have added an index for a table that your
application accesses, you must rebind the
application in order to take advantage of
that index.
recovery manager
A subcomponent that supplies
coordination services that control the
interaction of DB2 resource managers
during commit, abort, checkpoint, and
restart processes. The recovery manager
also supports the recovery mechanisms of
other subsystems (for example, IMS) by
acting as a participant in the other
subsystems process for protecting data
that has reached a point of consistency.
rebuild
The process of reallocating a coupling
facility structure. For the shared
communications area (SCA) and lock
structure, the structure is repopulated; for
the group buffer pool, changed pages are
usually cast out to disk, and the new
structure is populated only with changed
pages that were not successfully cast out.
recovery token
An identifier for an element that is used
in recovery (for example, NID or URID).
RECP See recovery pending.
record length
The sum of the length of all the columns
in a table, which is the length of the data
as it is physically stored in the database.
Records can be fixed length or varying
length, depending on how the columns
are defined. If all columns are
fixed-length columns, the record is a
fixed-length record. If one or more
columns are varying-length columns, the
record is a varying-length record.
Recoverable Resource Manager Services
attachment facility (RRSAF)
A DB2 subcomponent that uses Resource
Recovery Services to coordinate resource
commitment between DB2 and all other
resource managers that also use RRS in a
z/OS system.
recovery
The process of rebuilding databases after
a system failure.
redo
reentrant code
Executable code that can reside in storage
as one shared copy for all threads.
Reentrant code is not self-modifying and
provides separate storage areas for each
thread. See also threadsafe.
referential constraint
The requirement that nonnull values of a
designated foreign key are valid only if
they equal values of the primary key of a
designated table.
|
|
|
|
|
referential cycle
A set of referential constraints such that
each base table in the set is a descendent
of itself. The tables that are involved in a
referential cycle are ordered so that each
DB2 glossary
1061
|
|
|
referential integrity
The state of a database in which all
values of all foreign keys are valid.
Maintaining referential integrity requires
the enforcement of referential constraints
on all operations that change the data in a
table on which the referential constraints
are defined.
referential structure
A set of tables and relationships that
includes at least one table and, for every
table in the set, all the relationships in
which that table participates and all the
tables to which it is related.
refresh age
The time duration between the current
time and the time during which a
materialized query table was last
refreshed.
registry
See registry database.
registry database
A database of security information about
principals, groups, organizations,
accounts, and security policies.
relational database
A database that can be perceived as a set
of tables and manipulated in accordance
with the relational model of data.
relational database management system
(RDBMS)
A collection of hardware and software
that organizes and provides access to a
relational database.
| relational schema
|
See SQL schema.
relationship
A defined connection between the rows of
a table or the rows of two tables. A
relationship is the internal representation
of a referential constraint.
relative byte address (RBA)
The offset of a data record or control
interval from the beginning of the storage
space that is allocated to the data set or
file to which it belongs.
1062
remigration
The process of returning to a current
release of DB2 following a fallback to a
previous release. This procedure
constitutes another migration process.
remote
Any object that is maintained by a remote
DB2 subsystem (that is, by a DB2
subsystem other than the local one). A
remote view, for example, is a view that is
maintained by a remote DB2 subsystem.
Contrast with local.
remote subsystem
Any relational DBMS, except the local
subsystem, with which the user or
application can communicate. The
subsystem need not be remote in any
physical sense, and might even operate
on the same processor under the same
z/OS system.
reoptimization
The DB2 process of reconsidering the
access path of an SQL statement at run
time; during reoptimization, DB2 uses the
values of host variables, parameter
markers, or special registers.
| reordered row format
|
A row format that facilitates improved
|
performance in retrieval of rows that have
|
varying-length columns. DB2 rearranges
|
the column order, as defined in the
|
CREATE TABLE statement, so that the
|
fixed-length columns are stored at the
|
beginning of the row and the
|
varying-length columns are stored at the
|
end of the row. Contrast with basic row
|
format.
REORG pending (REORP)
A condition that restricts SQL access and
most utility access to an object that must
be reorganized.
REORP
See REORG pending.
repeatable read (RR)
The isolation level that provides
maximum protection from other executing
application programs. When an
application program executes with
repeatable read protection, rows that the
program references cannot be changed by
other programs until the program reaches
|
|
|
|
|
|
|
|
1063
rowset
RID pool
See record identifier pool.
rollback
The process of restoring data that was
changed by SQL statements to the state at
its last commit point. All locks are freed.
Contrast with commit.
root page
The index page that is at the highest level
(or the beginning point) in an index.
routine
A database object that encapsulates
procedural logic and SQL statements, is
stored on the database server, and can be
invoked from an SQL statement or by
using the CALL statement. The main
classes of routines are procedures and
functions.
|
|
|
|
|
|
|
row
|
|
|
|
|
rowset cursor
A cursor that is defined so that one or
more rows can be returned as a rowset
for a single FETCH statement, and the
cursor is positioned on the set of rows
that is fetched.
|
|
|
|
|
|
|
savepoint
A named entity that represents the state
of data and schemas at a particular point
in time within a unit of work.
SBCS See single-byte character set.
SCA
scale
row lock
A lock on a single row of data.
schema
1064
scalar function
An SQL operation that produces a single
value from another value and is
expressed as a function name, followed
by a list of arguments that are enclosed in
parentheses.
security label
A classification of users access to objects
or data rows in a multilevel security
environment.
segment
A group of pages that holds rows of a
single table. See also segmented table
space.
search condition
A criterion for selecting rows from a table.
A search condition consists of one or
more predicates.
secondary authorization ID
An authorization ID that has been
associated with a primary authorization
ID by an authorization exit routine.
self-referencing constraint
A referential constraint that defines a
relationship in which a table is a
dependent of itself.
self-referencing table
A table with a self-referencing constraint.
scrollable cursor
A cursor that can be moved in both a
forward and a backward direction.
secondary index
A nonpartitioning index that is useful for
enforcing a uniqueness constraint, for
clustering data, or for providing access
paths to data for queries. A secondary
index can be partitioned or
nonpartitioned. See also data-partitioned
secondary index (DPSI) and
nonpartitioned secondary index (NPSI).
section
The segment of a plan or package that
contains the executable structures for a
single SQL statement. For most SQL
statements, one section in the plan exists
for each SQL statement in the source
program. However, for cursor-related
statements, the DECLARE, OPEN,
FETCH, and CLOSE statements reference
the same section because they each refer
to the SELECT statement that is named in
the DECLARE CURSOR statement. SQL
sensitive cursor
A cursor that is sensitive to changes that
are made to the database after the result
table has been materialized.
sequence
A user-defined object that generates a
sequence of numeric values according to
user specifications.
sequential data set
A non-DB2 data set whose records are
organized on the basis of their successive
physical positions, such as on magnetic
tape. Several of the DB2 database utilities
require sequential data sets.
sequential prefetch
A mechanism that triggers consecutive
asynchronous I/O operations. Pages are
fetched before they are required, and
several pages are read with a single I/O
operation.
serialized profile
A Java object that contains SQL
statements and descriptions of host
variables. The SQLJ translator produces a
serialized profile for each connection
context.
DB2 glossary
1065
service class
An eight-character identifier that is used
by the z/OS Workload Manager to
associate user performance goals with a
particular DDF thread or stored
procedure. A service class is also used to
classify work on parallelism assistants.
|
|
session
A link between two nodes in a VTAM
network.
session protocols
The available set of SNA communication
requests and responses.
| set operator
|
The SQL operators UNION, EXCEPT, and
|
INTERSECT corresponding to the
|
relational operators union, difference, and
|
intersection. A set operator derives a
|
result table by combining two other result
|
tables.
SMP/E
See System Modification
Program/Extended.
share lock
A lock that prevents concurrently
executing application processes from
changing data, but not from reading data.
Contrast with exclusive lock.
SNA
SNA network
The part of a network that conforms to
the formats and protocols of Systems
Network Architecture (SNA).
shift-in character
A special control character (X0F) that is
used in EBCDIC systems to denote that
the subsequent bytes represent SBCS
characters. See also shift-out character.
shift-out character
A special control character (X0E) that is
used in EBCDIC systems to denote that
the subsequent bytes, up to the next
shift-in control character, represent DBCS
characters. See also shift-in character.
sign-on
A request that is made on behalf of an
individual CICS or IMS application
1066
sourced function
A function that is implemented by
another built-in or user-defined function
that is already known to the database
manager. This function can be a scalar
function or an aggregate function; it
returns a single value from a set of values
|
|
|
SQLDA
See SQL descriptor area.
SQL descriptor area (SQLDA)
A structure that describes input variables,
output variables, or the columns of a
result table.
source program
A set of host language statements and
SQL statements that is processed by an
SQL precompiler.
source table
A table that can be a base table, a view, a
table expression, or a user-defined table
function.
source type
An existing type that DB2 uses to
represent a distinct type.
space
|
|
|
|
|
|
special register
A storage area that DB2 defines for an
application process to use for storing
information that can be referenced in SQL
statements. Examples of special registers
are SESSION_USER and CURRENT
DATE.
|
|
|
|
|
|
|
|
SQL ID
See SQL authorization ID.
SQLJ
SQL path
An ordered list of schema names that are
used in the resolution of unqualified
references to user-defined functions,
distinct types, and stored procedures. In
dynamic SQL, the SQL path is found in
the CURRENT PATH special register. In
static SQL, it is defined in the PATH bind
option.
SQL function
A user-defined function in which the
CREATE FUNCTION statement contains
the source code. The source code is a
single SQL expression that evaluates to a
single value. The SQL user-defined
function can return the result of an
expression. See also built-in function,
external function, and sourced function.
|
|
|
|
|
|
|
|
SQL procedure
A user-written program that can be
invoked with the SQL CALL statement.
An SQL procedure is written in the SQL
procedural language. Two types of SQL
procedures are supported: external SQL
procedures and native SQL procedures.
See also external procedure and native
SQL procedure.
SQL processing conversation
Any conversation that requires access of
DB2 data, either through an application or
by dynamic query requests.
SQL Processor Using File Input (SPUFI)
A facility of the TSO attachment
subcomponent that enables the DB2I user
DB2 glossary
1067
statement trigger
A trigger that is defined with the trigger
granularity FOR EACH STATEMENT.
static cursor
A named control structure that does not
change the size of the result table or the
order of its rows after an application
opens the cursor. Contrast with dynamic
cursor.
| SQL schema
|
A collection of database objects such as
|
tables, views, indexes, functions, distinct
|
types, schemas, or triggers that defines a
|
database. An SQL schema provides a
|
logical classification of database objects.
SQL statement coprocessor
An alternative to the DB2 precompiler
that lets the user process SQL statements
at compile time. The user invokes an SQL
statement coprocessor by specifying a
compiler option.
SQL string delimiter
A symbol that is used to enclose an SQL
string constant. The SQL string delimiter
is the apostrophe (), except in COBOL
applications, where the user assigns the
symbol, which is either an apostrophe or
a double quotation mark ().
SRB
stand-alone
An attribute of a program that means that
it is capable of executing separately from
DB2, without using DB2 services.
star join
A method of joining a dimension column
of a fact table to the key column of the
corresponding dimension table. See also
join, dimension, and star schema.
star schema
The combination of a fact table (which
contains most of the data) and a number
of dimension tables. See also star join,
dimension, and dimension table.
statement handle
In DB2 ODBC, the data object that
contains information about an SQL
statement that is managed by DB2 ODBC.
This includes information such as
dynamic arguments, bindings for
dynamic arguments and columns, cursor
information, result values, and status
1068
|
|
|
|
|
|
|
|
static SQL
SQL statements, embedded within a
program, that are prepared during the
program preparation process (before the
program is executed). After being
prepared, the SQL statement does not
change (although values of variables that
are specified by the statement might
change).
|
|
|
|
|
storage group
A set of storage objects on which DB2 for
z/OS data can be stored. A storage object
can have an SMS data class, a
management class, a storage class, and a
list of volume serial numbers.
stored procedure
A user-written application program that
can be invoked through the use of the
SQL CALL statement. Stored procedures
are sometimes called procedures.
string See binary string, character string, or
graphic string.
strong typing
A process that guarantees that only
user-defined functions and operations that
are defined on a distinct type can be
applied to that type. For example, you
cannot directly compare two currency
types, such as Canadian dollars and U.S.
dollars. But you can provide a
user-defined function to convert one
currency to the other and then do the
comparison.
structure
SVC dump
A dump that is issued when a z/OS or a
DB2 functional recovery routine detects
an error.
structure owner
In relation to group buffer pools, the DB2
member that is responsible for the
following activities:
sync point
See commit point.
syncpoint tree
The tree of recovery managers and
resource managers that are involved in a
logical unit of work, starting with the
recovery manager, that make the final
commit decision.
subselect
That form of a query that includes only a
SELECT clause, FROM clause, and
optionally a WHERE clause, GROUP BY
clause, HAVING clause, ORDER BY
clause, or FETCH FIRST clause.
substitution character
A unique character that is substituted
during character conversion for any
characters in the source program that do
not have a match in the target coding
representation.
subsystem
A distinct instance of a relational database
management system (RDBMS).
surrogate pair
A coded representation for a single
character that consists of a sequence of
|
|
|
|
|
|
synonym
In SQL, an alternative name for a table or
view. Synonyms can be used to refer only
to objects at the subsystem in which the
synonym is defined. A synonym cannot
be qualified and can therefore not be used
by other users. Contrast with alias.
Sysplex
See Parallel Sysplex.
Sysplex query parallelism
Parallel execution of a single query that is
accomplished by using multiple tasks on
more than one DB2 subsystem. See also
query CP parallelism.
system administrator
The person at a computer installation
who designs, controls, and manages the
use of the computer system.
system agent
A work request that DB2 creates such as
prefetch processing, deferred writes, and
service tasks. See also allied agent.
| system authorization ID
|
The primary DB2 authorization ID that is
|
used to establish a trusted connection. A
|
system authorization ID is derived from
|
the system user ID that is provided by an
|
external entity, such as a middleware
|
server.
DB2 glossary
1069
system conversation
The conversation that two DB2
subsystems must establish to process
system messages before any distributed
processing can begin.
System Modification Program/Extended (SMP/E)
A z/OS tool for making software changes
in programming systems (such as DB2)
and for controlling those changes.
Systems Network Architecture (SNA)
The description of the logical structure,
formats, protocols, and operational
sequences for transmitting information
through and controlling the configuration
and operation of networks.
table
table-controlled partitioning
A type of partitioning in which partition
boundaries for a partitioned table are
controlled by values that are defined in
the CREATE TABLE statement.
table function
A function that receives a set of
arguments and returns a table to the SQL
statement that references the function. A
table function can be referenced only in
the FROM clause of a subselect.
|
|
|
|
|
table locator
A mechanism that allows access to trigger
tables in SQL or from within user-defined
functions. A table locator is a fullword
integer value that represents a transition
table.
table space
A page set that is used to store the
records in one or more tables. See also
partitioned table space, segmented table
space, and universal table space.
table space set
A set of table spaces and partitions that
should be recovered together for one of
the following reasons:
v Each of them contains a table that is a
parent or descendent of a table in one
of the others.
1070
TCB
TCP/IP
A network communication protocol that
computer systems use to exchange
information across telecommunication
links.
TCP/IP port
A 2-byte value that identifies an end user
or a TCP/IP network application within a
TCP/IP host.
template
A DB2 utilities output data set descriptor
that is used for dynamic allocation. A
template is defined by the TEMPLATE
utility control statement.
temporary table
A table that holds temporary data.
Temporary tables are useful for holding
or sorting intermediate results from
queries that contain a large number of
rows. The two types of temporary table,
which are created by different SQL
statements, are the created temporary
table and the declared temporary table.
Contrast with result table. See also created
temporary table and declared temporary
table.
thread See DB2 thread.
threadsafe
A characteristic of code that allows
multithreading both by providing private
storage areas for each thread, and by
properly serializing shared (global)
storage areas.
three-part name
The full name of a table, view, or alias. It
transition variable
A variable that contains a column value
of the affected row of the subject table in
its state before or after the triggering
event occurs. Triggered SQL statements in
the trigger definition can reference the set
of old values or the set of new values.
timeout
Abnormal termination of either the DB2
subsystem or of an application because of
the unavailability of resources. Installation
specifications are set to determine both
the amount of time DB2 is to wait for
IRLM services after starting, and the
amount of time IRLM is to wait if a
resource that an application requests is
unavailable. If either of these time
specifications is exceeded, a timeout is
declared.
Time-Sharing Option (TSO)
An option in z/OS that provides
interactive time sharing from remote
terminals.
timestamp
A seven-part value that consists of a date
and time. The timestamp is expressed in
years, months, days, hours, minutes,
seconds, and microseconds.
trace
| transaction
|
An atomic series of SQL statements that
|
make up a logical unit of work. All of the
|
data modifications made during a
|
transaction are either committed together
|
as a unit or rolled back as a unit.
transaction lock
A lock that is used to control concurrent
execution of SQL statements.
transaction program name
In SNA LU 6.2 conversations, the name of
the program at the remote logical unit
that is to be the other half of the
conversation.
transition table
A temporary table that contains all the
affected rows of the subject table in their
state before or after the triggering event
occurs. Triggered SQL statements in the
trigger definition can reference the table
of changed rows in the old state or the
tree structure
A data structure that represents entities in
nodes, with a most one parent node for
each node, and with only one root node.
trigger
|
|
|
|
|
|
|
DB2 glossary
1071
triggering event
The specified operation in a trigger
definition that causes the activation of
that trigger. The triggering event is
comprised of a triggering operation
(insert, update, or delete) and a subject
table or view on which the operation is
performed.
1072
| trusted context
|
A database security object that enables the
|
establishment of a trusted relationship
|
between a DB2 database management
|
system and an external entity.
| trusted context default role
|
A role associated with a trusted context.
|
The privileges granted to the trusted
|
context default role can be acquired only
|
when a trusted connection based on the
|
trusted context is established or reused.
| trusted context user
|
A user ID to which switching the current
|
user ID on a trusted connection is
|
permitted.
| trusted context user-specific role
|
A role that is associated with a specific
|
trusted context user. It overrides the
|
trusted context default role if the current
|
user ID on the trusted connection matches
|
the ID of the specific trusted context user.
| trusted relationship
|
A privileged relationship between two
|
entities such as a middleware server and
|
a database server. This relationship allows
|
for a unique set of interactions between
|
the two entities that would be impossible
|
otherwise.
TSO
type 2 indexes
Indexes that are created on a release of
DB2 after Version 7 or that are specified
as type 2 indexes in Version 4 or later.
UCS-2 Universal Character Set, coded in 2 octets,
which means that characters are
represented in 16-bits per character.
UDF
UDT
underlying view
The view on which another view is
directly or indirectly defined.
undo
Unicode
A standard that parallels the ISO-10646
standard. Several implementations of the
Unicode standard exist, all of which have
the ability to represent a large percentage
of the characters that are contained in the
many scripts that are used throughout the
world.
updatability
The ability of a cursor to perform
positioned updates and deletes. The
updatability of a cursor can be influenced
by the SELECT statement and the cursor
sensitivity option that is specified on the
DECLARE CURSOR statement.
update hole
The location on which a cursor is
positioned when a row in a result table is
fetched again and the new values no
longer satisfy the search condition. See
also delete hole.
unique constraint
An SQL rule that no two values in a
primary key, or in the key of a unique
index, can be the same.
unique index
An index that ensures that no identical
key values are stored in a column or a set
of columns in a table.
unit of recovery (UOR)
A recoverable sequence of operations
within a single resource manager, such as
an instance of DB2. Contrast with unit of
work.
unit of work (UOW)
A recoverable sequence of operations
within an application process. At any
time, an application process is a single
unit of work, but the life of an application
process can involve many units of work
as a result of commit or rollback
operations. In a multisite update
operation, a single unit of work can
include several units of recovery. Contrast
with unit of recovery.
update trigger
A trigger that is defined with the
triggering SQL operation update.
UR
DB2 glossary
1073
variable
A data element that specifies a value that
can be changed. A COBOL elementary
data item is an example of a host
variable. Contrast with constant.
variant function
See nondeterministic function.
|
|
|
varying-length string
A character, graphic, or binary string
whose length varies within set limits.
Contrast with fixed-length string.
version
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1074
| view
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WTOR
Write to operator (WTO) with reply.
XCF
XES
XML
XML attribute
A name-value pair within a tagged XML
element that modifies certain features of
the element.
| XML column
|
A column of a table that stores XML
|
values and is defined using the data type
|
XML. The XML values that are stored in
|
XML columns are internal representations
|
of well-formed XML documents.
| XML data type
|
A data type for XML values.
XML element
A logical structure in an XML document
that is delimited by a start and an end
tag. Anything between the start tag and
the end tag is the content of the element.
| XML index
|
An index on an XML column that
|
provides efficient access to nodes within
|
an XML document by providing index
|
keys that are based on XML patterns.
| XML lock
|
A column-level lock for XML data. The
|
operation of XML locks is similar to the
|
operation of LOB locks.
XML node
The smallest unit of valid, complete
structure in a document. For example, a
node can represent an element, an
attribute, or a text string.
| XML node ID index
|
An implicitly created index, on an XML
|
table that provides efficient access to XML
|
documents and navigation among
|
multiple XML data rows in the same
|
document.
| XML pattern
|
A slash-separated list of element names,
|
an optional attribute name (at the end), or
|
|
|
|
|
|
|
|
|
|
|
| XML schema
|
In XML, a mechanism for describing and
|
constraining the content of XML files by
|
indicating which elements are allowed
|
and in which combinations. XML schemas
|
are an alternative to document type
|
definitions (DTDs) and can be used to
|
extend functionality in the areas of data
|
typing, inheritance, and presentation.
| XML schema repository (XSR)
|
A repository that allows the DB2 database
|
system to store XML schemas. When
|
registered with the XSR, these objects
|
have a unique identifier and can be used
|
to validate XML instance documents.
| XML serialization function
|
A function that returns a serialized XML
|
string from an XML value.
| XML table
|
An auxiliary table that is implicitly
|
created when an XML column is added to
|
a base table. This table stores the XML
|
data, and the column in the base table
|
points to it.
| XML table space
A table space that is implicitly created
when an XML column is added to a base
table. The table space stores the XML
table. If the base table is partitioned, one
partitioned table space exists for each
XML column of data.
X/Open
An independent, worldwide open systems
organization that is supported by most of
the worlds largest information systems
suppliers, user organizations, and
software companies. X/Opens goal is to
increase the portability of applications by
combining existing and emerging
standards.
DB2 glossary
1075
XRF
| XSR
| zIIP
z/OS
1076
Index
Numerics
32K
option of DSN1COMP utility 773
option of DSN1COPY utility 783
option of DSN1PRNT utility 825
A
abend, forcing 177
ABEND, option of DIAGNOSE utility 175
abnormal-termination, option of TEMPLATE statement 643
Access Method Services, new active log definition 743
access path, catalog table columns used to select 620
accessibility
keyboard xvi
shortcut keys xvi
ACCESSPATH
option of MODIFY STATISTICS utility 328
option of REORG TABLESPACE utility 458
ACHKP 64
ACTION, option of DSN1SDMP utility 835
ACTION2
option of DSN1SDMP utility 835
active log
adding 743
data set with I/O error, deleting 746
defining in BSDS 743
deleting from BSDS 743
enlarging 743
recording from BSDS 743
active status, of a utility 33
AFTER, option of DSN1SDMP utility 835
AFTER2, option of DSN1SDMP utility 835
ALIAS, option of DSNJU003 utility 733
ALL
option of LISTDEF utility 187
option of REBUILD INDEX utility 355
option of RUNSTATS utility 604
ALLDUMPS, option of DIAGNOSE utility 175
ANCHOR, option of DSN1CHKR utility 765
archive log
adding to BSDS 745
deleting from BSDS 745
ARCHLOG, option of REPORT utility 565
ASCII
option of LOAD utility 210
option of UNLOAD utility 666
authorization ID
naming convention xvii
primary 3
secondary 3
SQL 3
AUXERROR INVALIDATE, option of CHECK DATA
utility 79
AUXERROR REPORT, option of CHECK DATA utility 79
AUXERROR, option of CHECK DATA utility 64
auxiliary CHECK-pending (ACHKP) status
description 925
resetting
for a LOB table space 925
Copyright IBM Corp. 1983, 2009
B
BACKOUT, option of DSNJU003 utility 733
BACKUP SYSTEM utility
authorization 43
compatibility 47
data sets needed 47
description 43
dumping 47
examples 48
data-only backup 48
dump to tape 49
force 49
full backup 48
execution phases 43
history, printing 751
option descriptions 45
output 43
restarting 48
running 46
syntax diagram 44
terminating 48
BASE, option of LISTDEF utility 187
basic predicate 458, 679
before running
COPY 124
BETWEEN predicate 458, 679
BIGINT
option of LOAD utility 229
option of UNLOAD utility 679
BINARY
option of LOAD utility 229
option of UNLOAD utility 679
BIT
option of LOAD utility for CHAR 229
1077
BLOB
option of LOAD utility 229
option of UNLOAD utility 679
BLOBF
option of LOAD utility for CHAR 229
BOTH, option of RUNSTATS utility 596, 604
BSDS
active log data set status 760
communication records, printing 751
converting 725
data set references, adding and deleting 747
GENERIC LUNAME parameter, updating 733
LOCATION value, updating 733
LUNAME value, updating 733
PASSWORD value, updating 733
updating 729
VSAM catalog name, changing 733
BUFNO, option of TEMPLATE statement 643
C
CANCEL, option of DSNJU003 utility 733
CARDF column
SYSCOLDIST catalog table 620
SYSINDEXPART catalog table 623
SYSTABLEPART catalog table 623
SYSTABLES catalog table 620
SYSTABSTATS catalog table 620
catalog
updating 55
catalog and directory
reorganizing 502
REPORT utility 570
catalog indexes, rebuilding 373
catalog name
changing 58
catalog table spaces, corresponding directory table spaces
catalog tables 396
columns used for tuning 623
columns used to select access path 620
integrity, verifying 763
loading data into 248
outdated information, removing 317
RUNSTATS utility 613
statistics history, clearing outdated information 327
statistics, deleting 331
SYSCOLDIST
CARDF column 620
COLGROUPCOLNO column 620
COLVALUE column 620
FREQUENCYF column 620
HIGHVALUE column 620
LOWVALUE column 620
NUMCOLUMNS column 620
SYSCOLUMNS
COLCARDF column 620
HIGH2KEY column 620
LOW2KEY column 620
SYSCOPY
deleting rows 322
SYSCOPY, removing outdated information 317
SYSINDEXES
AVGKEYLEN column 623
CLUSTERING column 620
CLUSTERRATIOF column 620
data collected by STOSPACE utility 637
DATAREPEATFACTORF column 620
1078
502
637
1079
1080
compatibility (continued)
COPY utility 126
COPYTOCOPY utility 162
declared temporary table 4
DEFINE NO objects 4
DIAGNOSE utility 177
EXEC SQL utility 183
LISTDEF utility 193
LOAD utility 253
MERGECOPY utility 311
MODIFY RECOVERY utility 322
MODIFY STATISTICS utility 330
OPTIONS utility 338
QUIESCE utility 346
REBUILD INDEX utility 364
RECOVER utility 388
REORG INDEX utility 437
REORG TABLESPACE utility 493
REPAIR utility 552
REPORT utility 568
RESTORE SYSTEM utility 589
RUNSTATS utility 610
STOSPACE utility 637
TEMPLATE utility 654
UNLOAD utility 700
utilities access description 33
COMPLETE, option of CATENFM utility 52
compression
data, UNLOAD utility description 714
estimating disk savings 771
compression dictionary, building 505
concurrency
BACKUP SYSTEM utility 47
utilities access description 33
utility jobs 35
with real-time statistics 1010
concurrent copies
COPYTOCOPY utility restriction 155
invoking 117
making 136
CONCURRENT, option of COPY utility 117, 136
conditional restart control record
creating 733, 745
reading 761
sample 761
status printed by print log map utility 751
connection-name, naming convention xvii
CONSTANT, option of UNLOAD utility 679
constraint violations, checking 61
CONTINUE, option of RECOVER utility 394
CONTINUEIF, option of LOAD utility 210
continuous operation, recovering an error range 394
control interval
LOAD REPLACE, effect of 257, 292
RECOVER utility, effect of 414
REORG TABLESPACE, effect of 520
control statement 15
CONTROL, option of DSNU CLIST command 22
conversion of data, LOAD utility 275
CONVERT, option of CATENFM utility 52
copies
merging 307
online, merging 313
copy pool 43
COPY SCOPE PENDING
COPY-pending 133
COPY statement, using more than one 134
COPY utility
adding conditional code 138
allowing other programs to access data 117
authorization 113
block size, specifying 124
catalog table, copying 129
checking pages 117
claims and drains 126
compatibility 126
consistency 131
COPY-pending status, resetting 113
copying a list of objects 133
copying segmented table spaces 135
data sets needed 124
description 113
directory, copying 129
effect on real-time statistics 1006
examples 143
allowing updates 150
CHANGELIMIT 150
CLONE 153
conditional copies 150
COPYDDN 143
copying LOB table spaces 151
DFSMSdss concurrent copy 151
filter data sets 151
FILTERDDN 151
full image copy 143, 152
incremental image copy 130, 150
JCL-defined and template-defined data sets 148
list of objects, making full image copy of 144
LISTDEF 149
lists 149
local site and recovery site copies 143
multiple image copies 131
PARALLEL 144, 147
parallel processing 147
RECOVERYDDN 143
reporting information 150
REPORTONLY 150
SCOPE PENDING 153
SHRLEVEL 144
TAPEUNITS 147
templates 149
execution phases 113
full image copy, making 129
informational COPY-pending status, resetting 113
JCL parameters 124
MERGECOPY utility, when to use 313
multiple image copies 131
naming data sets 131
option descriptions 117
output 113
partition, copying 130
performance recommendations 140
processing in parallel
description 117, 133
number of threads 113, 133
recovery, preparing for 139
restart current 142
restarting
description 142
new data set 142
out-of-space condition 142
restricted states 126
restrictions 130
separate jobs 135
Index
1081
D
data
adding 260
compressing 267
converting 269
converting with LOAD utility 275
deleting 260
DATA
option of CHECK DATA utility 64
option of LOAD utility 210
option of REPAIR DUMP 547
option of REPAIR REPLACE 546
option of REPAIR VERIFY 545
option of UNLOAD utility 666
data compression
dictionary
building 267, 505
number of records needed 267
using again 267
LOAD utility
description 267
KEEPDICTIONARY option 210, 267
REORG TABLESPACE utility, KEEPDICTIONARY
option 458
DATA ONLY, option of BACKUP SYSTEM utility 45
data set
name format in ICF catalog 117
name limitations 655
data sets
BACKUP SYSTEM utility 47
CATENFM utility 53
CATMAINT utility 56
change log inventory utility (DSNJU003) 729
CHECK DATA utility 70
CHECK INDEX utility 89
1082
679
DB2I (continued)
using to invoke online utilities 18
DBCLOB
option of LOAD utility 229
option of UNLOAD utility 679
DBCLOBF
option of LOAD utility for CHAR 229
DBD statement of REPAIR utility 117, 548
DBD, reclaiming space in 323
DBD01 directory table space
MERGECOPY restrictions 307, 308
order of recovering 396
DBETE status
description 928
resetting
by using START DATABASE command 928
DBID
option of DSN1LOGP utility 806
option of REPAIR utility 549
DBRM (database request module)
member naming convention xvii
partitioned data set naming convention xvii
DD name, naming convention xvii
DDF (distributed data facility), option of DSNJU003
utility 733
DDNAME, option of DSNJU004 utility 752
DEADLINE
option of REORG INDEX utility 423
option of REORG TABLESPACE utility 458
DECFLOAT
option of LOAD utility 229
option of UNLOAD utility 679
DECFLOAT EXTERNAL
option of UNLOAD utility 679
DECFLOAT_ROUNDMODE
option of LOAD utility 210
option of UNLOAD utility 666
DECIMAL EXTERNAL
option of LOAD utility 229
option of UNLOAD utility 679
DECIMAL PACKED
option of the LOAD utility 229
option of UNLOAD utility 679
DECIMAL ZONED
option of the LOAD utility 229
option of UNLOAD utility 679
DECIMAL, option of UNLOAD utility 679
declared temporary table
REPAIR utility 548
utility compatibility 4
DECPT
option of LOAD utility 210
option of UNLOAD utility 666
DEFAULTIF, option of LOAD utility 229
defects, calculating, LOAD utility 249
DEFINE NO objects
populating 4
utility compatibility 4
DEFINE NO table space, loading data 260
defining work data sets
CHECK DATA utility 71
DELAY
option of REBUILD INDEX utility 355
option of REORG INDEX utility 423
option of REORG TABLESPACE utility 458
DELETE
option of CHECK DATA utility 64
DELETE (continued)
option of DSNJU003 utility 733
option of MODIFY RECOVERY utility 318
option of MODIFY STATISTICS utility 328
option of the CHECK DATA utility 78
statement of REPAIR utility, used in LOCATE block 541
DELETE statement of REPAIR utility 546
deleting
active log from BSDS 743
log data sets with errors 746
DELIMITED
option of LOAD utility 210
option of UNLOAD utility 666
delimited file format
acceptable data types 263, 1012
default delimiter values 263, 710
description 1011
examples 1013
loading 210, 263
maximum delimiter values 263
restrictions 263
delimited files
acceptable data type forms for LOAD and UNLOAD
utilities 710
unloading 710
delimiters
column 1011
default values 263, 710
maximum values 263
restrictions 710
string 1011
using 263
determining input copies 313
DFSMS (Data Facility Storage Management Subsystem)
concurrent copy
invoking with COPY utility 117, 136
requirements for using 136
restrictions 136
products, using with DB2 141, 165
DFSORT (Data Facility Sort)
data sets for REORG TABLESPACE, specifying device
type 458
messages from REORG TABLESPACE, specifying
destination 486
DIAGNOSE utility
ABEND statement
description 175
syntax diagram 173
authorization 173
compatibility 177
concurrency 177
data sets needed 177
description 173
DISPLAY statement
description 175
syntax diagram 173
examples 178
ABEND 179
ALLDUMPS 178
CLONE 180
diagnosis of a specific type 179
displaying MEPLs 178
forcing a dump 178
forcing an abend 179
service level, finding 178
suspending utility execution 179
TYPE 179
Index
1083
1084
773
797
1085
1086
623
EBCDIC
option of LOAD utility 210
option of UNLOAD utility 666
edit routine
LOAD utility 205
REORG TABLESPACE utility 458
EDIT, option of DSNU CLIST command 22
embedded semicolon
embedded 940
enabling-new-function mode processing, stopping 54
encrypted data
running DSN1PRNT on 823
running REORG TABLESPACE on 481
running REPAIR on 550
running UNLOAD on 699
running utilities on 5
encryption
DSN1PRNT utility effect on 823
REORG TABLESPACE utility effect on 481
REPAIR utility effect on 550
UNLOAD utility effect on 699
utilities effect on 5
END FCINCREMENTAL
explanation 45
END FCINCREMENTAL, option of BACKUP SYSTEM
utility 45
END, option of DIAGNOSE utility 175
ENDLRSN, option of DSNJU003 utility 733
ENDRBA, option of DSNJU003 utility 733
ENDTIME, option of DSNJU003 utility 733
ENFMON, option of CATENFM utility 52
Index
1087
1088
F
fallback recovery considerations 481
FARINDREF column of SYSTABLEPART catalog table, use by
RUNSTATS 623
FAROFFPOSF column of SYSINDEXPART catalog table
catalog query to retrieve value for 498
description 623
field procedure, LOAD utility 282
filter data set, determining size 124
FILTER, option of DSN1LOGP utility 806
FILTER, option of DSN1SDMP utility 835
FILTERDDN, option of COPY utility 117
FIRSTKEYCARDF column, SYSINDEXES catalog table 620
FLOAT
option of LOAD utility 210
option of UNLOAD utility 666, 679
FLOAT EXTERNAL, option of LOAD utility 229
FLOAT, option of LOAD utility 229
FOR EXCEPTION, option of CHECK DATA utility 64
FOR, option of DSN1SDMP utility 835
FOR2, option of DSN1SDMP utility 835
force
example 49
FORCE, option of BACKUP SYSTEM utility 45
FORCEROLLUP
option of LOAD STATISTICS 210
option of REBUILD INDEX utility 355
option of REORG INDEX utility 423
option of REORG TABLESPACE utility 458
option of RUNSTATS utility 596, 604
foreign key, calculating, LOAD utility 249
FORMAT
option of DSN1CHKR utility 765
option of DSN1PRNT utility 825
option of LOAD utility 210
FORMAT SQL/DS, option of LOAD utility 210
FORMAT UNLOAD, option of LOAD utility 210
FORWARD, option of DSNJU003 utility 733
free space
REORG INDEX utility 445
FREEPAGE, option of DSN1COMP utility 773
FREESPACE column of SYSLOBSTATS catalog table 623
FREQUENCYF column, SYSCOLDIST catalog table 620
FREQVAL
option of LOAD STATISTICS 210
option of REBUILD INDEX utility 355
option of REORG INDEX utility 423
option of RUNSTATS utility 596, 604
FROM TABLE
option of UNLOAD utility 674, 715
FROMCOPY
option of COPYTOCOPY utility 158
option of the COPYTOCOPY utility 164
option of UNLOAD utility 666, 703
FROMCOPYDDN, option of UNLOAD utility 666, 703
FROMLASTCOPY, option of COPYTOCOPY utility 158
FROMLASTFULLCOPY, option of COPYTOCOPY utility 158
FROMLASTINCRCOPY, option of COPYTOCOPY utility 158
FROMSEQNO, option of the UNLOAD utility 666
FROMVOLUME
option of COPYTOCOPY utility 158
option of UNLOAD utility 666
FULL
option of BACKUP SYSTEM utility 45
option of COPY utility 117
full backup
description 45
G
GDGLIMIT
option of MODIFY RECOVERY utility 318
GDGLIMIT, option of TEMPLATE statement 643
GDGs 141
general-use programming information, described 1031
generation data groups
defining 141, 165
using with conditional copy 138
GENERIC, option of DSNJU003 utility 733
GRAPHIC
option of LOAD utility 229
option of UNLOAD utility 679
GRAPHIC EXTERNAL
option of LOAD utility 229
option of UNLOAD utility 679
GRECP 928
group buffer pool RECOVER-pending (GRECP) status
description 928
resetting 928
GUPI symbols 1031
H
HALT, option of OPTIONS statement 336
HASH, option of DSN1CHKR utility 765
HEADER, option of UNLOAD utility 679
hexadecimal-constant, naming convention xvii
hexadecimal-string, naming convention xvii
HIGH2KEY column, SYSCOLUMNS catalog table 620
HIGHRBA, option of DSNJU003 utility 733
HIGHVALUE column, SYSCOLDIST catalog table 620
HISTOGRAM
option of RUNSTATS utility 596, 604
HISTORY
option of LOAD STATISTICS 210
option of REBUILD INDEX utility 355
option of REORG INDEX utility 423
option of REORG TABLESPACE utility 458
option of RUNSTATS utility 596, 604
I
ICBACKUP column in SYSIBM.SYSCOPY 131
ICOPY status 113
ICUNIT column
SYSIBM.SYSCOPY 131
identity columns, loading 259
IDENTITYOVERRIDE
option of LOAD PART 229
IGNOREFIELDS, option of LOAD utility 229
image copy
cataloging 124, 161
conditional, specifying 138
COPY utility 113
620
Index
458
1089
INDEX
option of RECOVER utility 380
option of REORG TABLESPACE utility 458
indexes
copying 136
INDEXSPACE
option of COPY utility 117
option of COPYTOCOPY utility 158
option of LISTDEF utility 187
option of MODIFY STATISTICS utility 328
option of REBUILD INDEX utility 355
option of RECOVER utility 380
option of REORG INDEX utility 423
option of REPAIR utility
SET statement 539
option of REPAIR utility for LEVELID statement 537
option of REPORT utility 565
INDEXSPACES, option of LISTDEF utility 187
indoubt state 733
INDSN, option of DSNU CLIST command 22
inflight state 733
informational COPY-pending (ICOPY) status
COPY utility 117
description 929
resetting 113, 139, 929
informational referential constraints, LOAD utility 205
INLCOPY
option of DSN1COPY utility 783
option of DSN1PRNT utility 825
inline COPY
base table space 285
copying 164
creating with LOAD utility 271
creating with REORG TABLESPACE utility 507
inline statistics
collecting during LOAD 285
using in place of RUNSTATS 614
input fields, specifying 276
INPUT, option of CATENFM utility 52
INSTANCE, option of DIAGNOSE utility 175, 177
INTEGER
option of LOAD utility 229
option of UNLOAD utility 679
INTEGER EXTERNAL
option of LOAD utility 229
option of UNLOAD utility 679
Interactive System Productivity Facility (ISPF) 18
INTO TABLE, option of LOAD utility 226
invalid LOB 79
invalid SQL terminator characters 940
invalidated plans and packages
identifying 58, 390, 811
invalidating statements
dynamic statement cache 615
ISPF (Interactive System Productivity Facility), utilities
panels 18
ITEMERROR, option of OPTIONS statement 336
J
JCL (job control language)
COPYTOCOPY utility 163
DSNUPROC utility 21
JCL PARM statement 336
JES3 environment, making copies 314
job control language 129
JOB statement, built by CLIST 26
1090
K
KEEPDICTIONARY
option of LOAD PART 229
option of LOAD utility 210, 267
option of REORG TABLESPACE utility 267, 458
key
calculating, LOAD utility 249
foreign, LOAD operation 265
length
maximum 847
primary, LOAD operation 265
KEY
option of OPTIONS utility 336
option of REPAIR utility on LOCATE statement 542
KEYCARD
option of LOAD STATISTICS 210
option of REBUILD INDEX utility 355
option of REORG INDEX utility 423
option of RUNSTATS utility 596, 604
L
labeled-duration expression 458
LARGE
option of DSN1COMP utility 773
option of DSN1COPY utility 783
option of DSN1PRNT utility 825
large partitioned table spaces, RUNSTATS utility 616
LAST
option of MODIFY RECOVERY utility 318
LEAFDIST column of SYSINDEXPART catalog table 623
LEAFDISTLIMIT, option of REORG INDEX utility 423
LEAFFAR column of SYSINDEXPART catalog table 623
LEAFLIM, option of DSN1COMP utility 773
LEAFNEAR column of SYSINDEXPART catalog table 623
LEAST, option of RUNSTATS utility 596, 604
LENGTH, option of REPAIR utility 547
level identifier, resetting 537
LEVELID, option of REPAIR utility 537
LIB, option of DSNU CLIST command 22
LIB, option of DSNUPROC utility 28
library 1021
library of LISTDEF statements 197
LIKE predicate 458, 679
limit
option of TEMPLATE statement 643
LIMIT, option of UNLOAD utility 679
limits, DB2 847
LIST
option of CHECK INDEX utility 87
option of COPY utility 117
option of COPYTOCOPY utility 158
option of LISTDEF utility 187
option of MERGECOPY utility 308
option of MODIFY RECOVERY utility 318
option of MODIFY STATISTICS utility 328
option of QUIESCE utility 344
option of REBUILD INDEX utility 355
option of RECOVER utility 380
option of REORG INDEX utility 423
option of REORG TABLESPACE utility 458
option of REPORT utility 565
option of REPORT with INDEXSPACE option 565
option of REPORT with TABLESPACE option 565
option of RUNSTATS INDEX utility 604
option of RUNSTATS TABLESPACE utility 596
LIST (continued)
option of UNLOAD utility 666
list of objects, copying 113
LISTDEF
EXCLUDE option 194
INCLUDE option 194
objects, excluding 194
objects, including 194
LISTDEF library, specifying 339
LISTDEF utility
authorization 185
catalog and directory objects, specifying 194
compatibility 193
concurrency 193
control statement
creating 193
description 193
placement 198
processing 194
COPY NO indexes, specifying 187
COPY YES indexes, specifying 187
description 185
examples 200
all objects in a database 201
CLONED 204
COPY YES 202
excluding objects 202
including all but one partition 202
including COPY YES indexes 202
library data set 202
lists that reference other lists 202
matching name patterns 201
partition-level lists 201
pattern-matching characters 201
related objects, including 204
RI option 204
simple list 200
using LIST 198
using with QUIESCE utility 202
execution phases 185
indexes, specifying 187
LOB indicator keywords 187
LOB objects, including 187
option descriptions 187
OPTIONS, using 200
output 185
partitions, specifying 187
pattern-matching expressions
characters 194
description 194
restriction 194
using 194
previewing 197
restarting 200
restrictions 185, 194
statement library 197
syntax diagram 185
TEMPLATE, using 199
terminating 200
LISTDEFDD, option of OPTIONS statement 336
lists
objects
excluding 194
including 194
previewing 197
processing order 198
using with other utilities 198
1091
1092
log (continued)
data set
active, renaming 748
archive, renaming 748
printing map 751
printing names 751
forward recovery 733
record structure, types 806
truncation 749
utilities
DSNJU003 (change log inventory) 729
DSNJU004 (print log map) 751
LOG
option of LOAD utility 210
option of REPAIR utility 537
log data sets with errors, deleting 746
log RBAs, resetting 795
logical partition, checking 94
logical unit name, naming convention xvii
LOGLIMIT
option of MODIFY RECOVERY utility 318
LOGONLY
option of RECOVER utility 380
option of RESTORE SYSTEM utility 586
LOGRANGES, option of RECOVER utility 380
LONGLOG
option of REORG INDEX utility 423
option of REORG TABLESPACE utility 458
LOW2KEY column, SYSCOLUMNS catalog table 620
LOWVALUE column, SYSCOLDIST catalog table 620
LPL status 925
LRSNEND option of DSN1LOGP utility 806
LRSNSTART, option of DSN1LOGP utility 806
LUNAME, option of DSNJU003 utility 733
LUWID option of DSN1LOGP utility 806
M
MAP
option of DSN1CHKR utility 765
option of REPAIR utility 547
map, calculating, LOAD utility 249
MAPDDN, option of LOAD utility 210
MAPPINGTABLE, option of REORG TABLESPACE
utility 458
MAXERR, option of UNLOAD utility 666
MAXPRIME, option of TEMPLATE statement 643
MAXRO
option of REBUILD INDEX utility 355
option of REORG INDEX utility 423
option of REORG TABLESPACE utility 458
MAXROWS, option of DSN1COMP utility 773
MB, option of TEMPLATE statement 643
media failure
resolving 111
member name, naming convention xvii
MEMBER option of DSNJU004 utility 752
MERGECOPY utility
authorization 307
compatibility 311
COPY utility, when to use 313
data sets needed 310
DBD01 307, 308
description 307
different types, merging restrictions 313
directory table spaces 307
Index
1093
1094
N
NACTIVE column, SYSTABLESPACE catalog table 620
NACTIVEF column, SYSTABLESPACE catalog table 620
naming convention, variables in command syntax xvii
NBRSECND, option of TEMPLATE statement 643
NEARINDREF column, SYSTABLEPART catalog table 623
NEAROFFPOSF column of SYSINDEXPART catalog table
catalog query to retrieve value for 498
description 623
new-function mode, converting to 53
NEWCAT, option of DSNJU003 utility 733
NEWCOPY, option of MERGECOPY utility 308
NEWLOG
option of DSNJU003 utility 733
statement 743
NGENERIC, option of DSNJU003 utility 733
NLEAF column, SYSINDEXES catalog table 620
NLEVELS column, SYSINDEXES catalog table 620
NOALIAS, option of DSNJU003 utility 733
NOAREORPENDSTAR, option of REPAIR utility 539
NOAUXCHKP, option of REPAIR utility 539
NOAUXWARN, option of REPAIR utility 539
NOCHECKPEND, option of REPAIR utility 539
NOCOPYPEND
option of LOAD utility 210
option of REPAIR utility 539
NODUMPS, option of DIAGNOSE utility 175
non-DB2 utilities
effect on real-time statistics 1007
NOPAD
option of REORG TABLESPACE utility 458
option of UNLOAD utility 666
NOPASSWD, option of DSNJU003 utility 733
NORBDPEND, option of REPAIR utility 539
NORCVRPEND, option of REPAIR utility 539
normal-termination, option of TEMPLATE utility 643
NOSUBS
option of LOAD utility 210
option of UNLOAD utility 666
NOSYSREC, option of REORG TABLESPACE utility
LOG
option of REORG TABLESPACE utility 458
REORG TABLESPACE utility
logging, specifying 458
not sign, problems with 458
NPAGES column, SYSTABLES catalog table 620
NPAGES column, SYSTABSTATS catalog table 620
NPAGESF column, SYSTABLES catalog table 620
NULL predicate 458, 679
NULLIF, option of LOAD utility 229
NUMCOLS
option of LOAD STATISTICS 210
option of REBUILD INDEX utility 355
option of REORG INDEX utility 423
option of RUNSTATS utility 596, 604
NUMCOLUMNS column, SYSCOLDIST catalog table 620
NUMPARTS
option of DSN1COMP utility 773
option of DSN1COPY utility 783
option of DSN1PRNT utility 825
NUMQUANTILES
option of RUNSTATS utility 596, 604
O
OBID, option of DSN1LOGP utility 806
OBIDXLAT, option of DSN1COPY utility 783
object lists
adding related objects 194
creating 185
object status
advisory, resetting 925
restrictive, resetting 925
OBJECT, option of REPAIR utility 537
OFF, option of OPTIONS statement 336
OFFLRBA, option of DSNJU003 utility 733
OFFPOSLIMIT, option of REORG TABLESPACE utility
OFFSET
option of DSN1LOGP utility 806
OFFSET (continued)
option of REPAIR utility
DUMP statement 547
REPLACE statement 546
VERIFY statement 545
OLDEST_VERSION column, updating 324
online 1021
online books 1021
online copies, merging 313
online utilities 13
description 3
invoking 13
option description, example 15
OPTIONS utility
altering return codes 339
authorization 335
compatibility 338
concurrency 338
description 335
errors, handling 336
examples 340
checking syntax 340
COPY 341
EVENT 340
forcing return code 0 340
ITEMERROR 341
LISTDEF 340
LISTDEF definition libraries 340
LISTDEFDD 340
MODIFY RECOVERY 340
PREVIEW 340
SKIP 341
TEMPLATE 340
TEMPLATE definition libraries 340
TEMPLATEDD 340
execution phases 335
LISTDEF definition library, specifying 336
option descriptions 336
output 335
PREVIEW with LISTDEF 336
PREVIEW with TEMPLATE 336
restarting 339
syntax diagram 335
TEMPLATE definition library, specifying 336
terminating 339
order of recovering objects 396
ORGRATIO column of SYSLOBSTATS catalog table 623
orphan LOB 79
out-of-synch LOB 79
OUTDDN, option of REPAIR utility 549
owner, creator, and schema
renaming 57
ownership of objects
changing from an authorization ID to a role 57
458
page
checking 117
damaged, repairing 555
recovering 394
size, relationship to number of pages 825
PAGE
option of DSN1CHKR utility 765
option of DSN1LOGP utility 806
option of RECOVER utility 380
option of REPAIR utility on LOCATE statement
542
Index
1095
PAGE option
RECOVER utility 394
REPAIR utility 543
page set REBUILD-pending (PSRBD) status
description 372, 929
resetting 372, 929
PAGES, option of REPAIR utility 547
PAGESAVE column of SYSTABLEPART catalog table, use by
RUNSTATS 623
PAGESIZE
option of DSN1COMP utility 773
option of DSN1COPY utility 783
option of DSN1PRNT utility 825
panel
Control Statement Data Set Names 18
Data Set Names 18
DB2 Utilities 18
PARALLEL
option of COPY utility 113, 117
option of RECOVER utility 380
parallel index build 368
parsing rules, utility control statements 15, 723
PART
option of CHECK DATA utility 64
option of CHECK INDEX utility 87
option of LOAD utility 229, 260
option of QUIESCE utility 344
option of REBUILD INDEX utility 355
option of REORG INDEX utility 423
option of REORG TABLESPACE utility 458
option of REPAIR utility
LOCATE INDEX and LOCATE INDEXSPACE
statements 543
LOCATE TABLESPACE statement 542
SET TABLESPACE and SETINDEX options 539
option of REPAIR utility for LEVELID 537
option of RUNSTATS utility 596, 604
option of UNLOAD utility 666, 702
partition-by-growth table space
loading 262
partition-by-growth table spaces, rebuilding 367
partition-by-growth table spaces, reorganizing 513
partition, copying 130
partitioned table space
loading 260
replacing a partition 260
unloading 702
partitioned table spaces, reorganizing 513
partitions
concatenating copies with UNLOAD utility 703
rebalancing with REORG 505
PARTLEVEL, option of LISTDEF utility 187
PASSWORD, option of DSNJU003 utility 733
pattern-matching characters, LISTDEF 194
patterns
advanced information 458, 679
PCTFREE, option of DSN1COMP utility 773
PCTPRIME, option of TEMPLATE statement 643
PCTROWCOMP column, SYSTABLES catalog table 620
pending status, resetting 925
PERCACTIVE column of SYSTABLEPART catalog table, use by
RUNSTATS 623
PERCDROP column of SYSTABLEPART catalog table, use by
RUNSTATS 623
performance
affected by
I/O activity 498
1096
performance (continued)
affected by (continued)
table space organization 498
COPY utility 140
LOAD utility, improving 272
monitoring with the STOSPACE utility 637
RECOVER utility 409
REORG INDEX utility, improving 442
REORG TABLESPACE utility, improving 508
RUNSTATS utility 614
phase restart, description 37
phases of execution
BACKUP SYSTEM utility 43
CHECK DATA utility 61
CHECK INDEX utility 85
CHECK LOB utility 103
COPY utility 113
COPYTOCOPY utility 155
description 33
EXEC SQL utility 181
LISTDEF utility 185
LOAD utility 205
MERGECOPY utility 307
MODIFY RECOVERY utility 317
MODIFY STATISTICS utility 327
OPTIONS utility 335
QUIESCE utility 343
REBUILD INDEX utility 353
RECOVER utility 377
REORG INDEX utility 419
REORG TABLESPACE utility 449
REPAIR utility 535
REPORT utility 563
RESTORE SYSTEM utility 585
RUNSTATS utility 593
STOSPACE utility 635
TEMPLATE utility 641
UNLOAD utility 663
utilities
CATENFM 51
PIECESIZ
option of DSN1COPY utility 783
option of DSN1PRNT utility 825
point-in-time recovery
options 380
performing 396, 403
planning for 396
PORT, option of DSNJU003 utility 733
POSITION
option of LOAD utility 229
option of UNLOAD utility 679
PQTY column
SYSINDEXPART catalog table 623
SYSTABLEPART catalog table, use by RUNSTATS
predicate
basic 458
BETWEEN 458
IN 458
LIKE 458
NULL 458
overview 458
predicates
basic 679
BETWEEN 679
IN 679
LIKE 679
NULL 679
623
PREFORMAT
option of LOAD PART 229
option of LOAD utility 210, 274
option of REORG INDEX utility 423
option of REORG TABLESPACE utility 458
option of REORG utility 274
preformatting active logs
data sets required 727
description 727
example 727
output 727
PRESERVE WHITESPACE
option of LOAD utility 229
PREVIEW
option of OPTIONS utility 336
using with LISTDEF utility 197
preview mode 339
PREVIEW mode, executing utilities in 654, 656
PRINT
option of DSN1COPY utility 783
option of DSN1PRNT utility 825
print log map utility (DSNJU004)
JCL requirements 751
SYSIN stream parsing 751
privilege
description 3
granting 3
revoking 3
privilege set of a process 3
process, privilege set of 3
product-sensitive programming information, described 1031
programming interface information, described 1030
PSEUDO_DEL_ENTRIES column of SYSINDEXPART catalog
table 623
pseudo-deleted keys 623
PSPI symbols 1031
PUNCHDDN
option of CHECK DATA utility 64
option of CHECK LOB utility 105
option of REORG TABLESPACE utility 458
option of UNLOAD utility 666
PUNCHDSN, option of DSNU CLIST command 22
Q
qualifier-name, naming convention xvii
QUIESCE
before running 345
quiesce point, establishing 343
QUIESCE utility
authorization 343
catalog and directory objects 348
compatibility 346
data sets needed 346
description 343
examples
CLONE 352
list 350
quiesce point for three table spaces
table space set 351
WRITE NO 351
history record, printing 751
lists 348
lists, using 344
option descriptions 344
output 343
partitions 344
350
R
RBA (relative byte address), range printed by print log
map 753
RBAEND, option of DSN1LOGP utility 806
RBASTART, option of DSN1LOGP utility 806
RBDP 929
RBDP (REBUILD-pending) status
description 372, 411
resetting 411
RBDP* (REBUILD-pending star) status, resetting 372
RC0, option of OPTIONS statement 336
RC4, option of OPTIONS statement 336
RC8, option of OPTIONS statement 336
RCPYDSN1, option of DSNU CLIST command 22
RCPYDSN2, option of DSNU CLIST command 22
REAL TIME STATS
field of panel DSNTIPO 949
real-time statistics
accuracy 1010
data processing 947
for DEFINE NO objects 1007
for read-only objects 1007
for TEMP table spaces 1007
for work file table spaces 1007
improving concurrency 1010
in data sharing 1009
stored procedure 874, 895, 950, 978
used by utilities 947
when DB2 externalizes 999
Real-time statistics
clone tables 1009
EXCHANGE command 1009
real-time statistics tables
contents 949
effect of dropping objects 1007
effect of mass delete operations 1009
effect of SQL operations 1008
effect of updating partitioning keys 1008
recovering 1010
setting up 949
setting update interval 949
starting 949
REAL, option of UNLOAD utility 679
REBALANCE, option of REORG TABLESPACE utility 458
rebinding, recommended after LOAD 285
REBUILD INDEX utility
access, specifying 366
authorization 353
Before running 361
building indexes in parallel 368
catalog indexes 373
compatibility 364
data sets needed 362
Index
1097
1098
380
recovery
catalog objects 396
compressed data 403
consistency, ensuring 403
data set, partition 393
database
LOB table space 139
REBUILD INDEX utility 353
RECOVER utility 377
REORG makes image copies invalid 129
directory objects 396
error range 394
image copies 412
JES3 environment 411
page 394
partial 403
preparing for with copies 139
real-time statistics tables 1010
reporting information 568
table space
description 391
multiple spaces 391
recovery base 391
recovery information, reporting 565
recovery log
backward 733
forward 733
RECOVERY, option of REPORT utility 565
RECOVERYDDN
option of COPY utility 117
option of COPYTOCOPY utility 158
option of LOAD utility 210, 271
option of MERGECOPY utility 308
option of REORG TABLESPACE utility 458, 507
RECOVERYSITE
option of RECOVER utility 380
option of REPORT utility 565
RECP 289, 930
referential constraint
loading data 265
violations, correcting 267
REFP 931
REFRESH-pending (REFP) status
description 931
resetting 931
remote site recovery 131
REORG INDEX
before running 432
REORG INDEX utility
access, allowing 423
access, specifying 440
authorization 419
catalog updates 445
CHECK-pending status, compatibility 432
compatibility 437
data set
shadow, determining name 435
data sets
definitions, changing 433
needed 433
shadow, estimating size 435
unload, specifying 423
user-managed 435
data-sharing considerations 432
description 419
drain behavior, specifying 423
DRAIN_WAIT, when to use 442
1099
1100
1101
1102
restarting (continued)
utilities
BACKUP SYSTEM 48
CATMAINT 59
CHECK DATA 80
CHECK INDEX 99
CHECK LOB 111
COPY 142
creating your own JCL 39
current restart 37
data set name 37
data sharing 35
DIAGNOSE 178
EXEC SQL 183
EXEC statement 30
JCL, updating 39
LISTDEF 200
LISTS 41
LOAD 286
MERGECOPY 314
methods of restart 39
MODIFY RECOVERY utility 324
MODIFY STATISTICS 331
OPTIONS 339
out-of-space condition 40
phase restart 37
QUIESCE 350
REBUILD INDEX 373
RECOVER 413
REORG INDEX 443, 444
REORG TABLESPACE 515, 517
RESTORE SYSTEM 589
RUNSTATS 615
STATISTICS keyword 37
STOSPACE 638
TEMPLATE 658
templates 40
UNLOAD 714
using DB2I 39
using the DSNU CLIST command 39
utility statements 40
UTPROC 28
volume serial 37
restarting a utility
DSNUTILS 860
DSNUTILU 871
RESTORE SYSTEM utility
actions after running 590
authorization 585
compatibility 589
creating system point in time for 733
data sets needed 588
data sharing environment 589
description 585
DISPLAY UTILITY command 589
effects of running 590
examples 590
FROMDUMP 591
LOGONLY 590
recovering a system 590
option descriptions 586
output 585
phases of execution 585
preparation 587
restarting 589
syntax diagram 586
terminating 589
RESTOREBEFORE
option of RECOVER utility 380
RESTP 932
restrictive status
resetting 554, 555, 925
RESUME, option of LOAD PART 229
RESUME, option of LOAD utility 210
RETAIN
option of MODIFY RECOVERY utility 318
RETPD, option of TEMPLATE statement 643
RETRY
option of CHECK DATA utility 64
option of CHECK INDEX utility 87
option of CHECK LOB utility 105
option of REBUILD INDEX utility 355
option of REORG INDEX utility 423
option of REORG TABLESPACE utility 458
RETRY_DELAY
option of CHECK DATA utility 64
option of CHECK INDEX utility 87
option of CHECK LOB utility 105
option of REBUILD INDEX utility 355
return code, altering 339
return code, CHANGELIMIT 138
REUSE
option of LOAD PART 229
option of LOAD utility 210
option of REBUILD INDEX 355
option of RECOVER utility 380
option of REORG INDEX utility 423
option of REORG TABLESPACE utility 458
RI, option of LISTDEF utility 187
RID
option of DSN1CHKR utility 765
option of DSN1LOGP utility 806
option of REPAIR utility on LOCATE statement
row format
REORG TABLESPACE, effect of 520
ROWID
option of LOAD utility 229
option of REPAIR utility on LOCATE statement
option of UNLOAD utility 679
ROWID columns
generating 282
loading 259, 282
ROWLIMIT, option of DSN1COMP utility 773
running online utilities
data sharing environment 35
JCL 30
RUNSTATS utility
access, specifying 596, 604
actions after running 629
after LOAD 285
aggregation of statistics, specifying 596, 604
assessing table spaces 613
authorization 593
catalog table spaces
processing 613
sample output 613
catalog table updates 616
COLGROUP option 593
column frequency statistics, gathering 596
column information, gathering 596
compatibility 610
data sets needed 608
deciding when to run 612
description 593
542
542
S
SAMPLE
option of LOAD STATISTICS 210
option of REORG TABLESPACE utility 458
option of RUNSTATS utility 596
option of UNLOAD utility 679
scanning rules, utility control statements 15, 723
SCOPE
option of CHECK DATA utility 64, 77
option of COPY utility
ALL 117
Index
1103
SCOPE (continued)
option of COPY utility (continued)
PENDING 117
option of REBUILD INDEX utility 355
option of REORG TABLESPACE utility 458
SCOPE PENDING, CHECK DATA after LOAD utility 289
SECPORT, option of DSNJU003 utility 733
SECQTYI column
SYSINDEXPART catalog table 623
SYSTABLEPART catalog table, use by RUNSTATS 623
security
multilevel with row-level granularity
authorization restrictions for online utilities 18
authorization restrictions for stand-alone utilities 724
security, data sets 14
SEGMENT, option of DSN1COPY utility 783
segmented table spaces, reorganizing 514
SELECT statement
list
maximum number of elements 847
SYSIBM.SYSTABLESPACE, example 637
select-statement, option of EXEC SQL utility 182
SELECT, option of DSN1SDMP utility 835
SELECT2, option of DSN1SDMP utility 835
semicolon
embedded 940
SET INDEX statement 538
SET INDEX statement of REPAIR utility 538
SET INDEXSPACE statement 538
SET INDEXSPACE statement of REPAIR utility 538
SET TABLESPACE statement 538
SET TABLESPACE statement of REPAIR utility 538
setting SQL terminator
DSNTIAD 940
shadow data sets
CHECK DATA utility 72
CHECK INDEX utility 90
CHECK LOB utility 108
defining
REORG INDEX utility 435
REORG TABLESPACE utility 490
estimating size, REORG INDEX utility 435
shift-in character, LOAD utility 229
shift-out character, LOAD utility 229
shortcut keys
keyboard xvi
SHRLEVEL
option of CHECK DATA utility 64
option of CHECK INDEX utility 87
option of CHECK LOB utility 105
option of COPY utility
CHANGE 117, 133
REFERENCE 117, 133
option of LOAD utility 210
option of REBUILD INDEX utility 355
option of REORG INDEX utility 423
option of REORG TABLESPACE utility 458
option of REPAIR utility on LOCATE statement 542
option of RUNSTATS utility 596, 604
option of UNLOAD utility 666
SHRLEVEL CHANGE
option of REPAIR utility on LOCATE statement 542
SIZE, option of DSNUPROC utility 28
SKIP, option of OPTIONS statement 336
SMALLINT
option of LOAD utility 229
option of UNLOAD utility 679
1104
statistics
deciding when to gather 612
gathering 593
STATISTICS
option of LOAD utility 210
option of REBUILD INDEX 355
option of REORG INDEX utility 423
option of REORG TABLESPACE utility 458
statistics history
deleting specific entries 331
reasons to delete 331
statistics, space utilization and the REORG INDEX utility
status
CHECK-pending, resetting 289
COPY-pending, resetting 288
displaying 925
option of TEMPLATE statement 643
page set REBUILD-pending (PSRBD) 372
REBUILD-pending (RBDP) 372
REBUILD-pending star (RBDP*) 372
status of utility
active 33
stopped 33
terminated 33
STOGROUP, option of STOSPACE utility 636
stopped status, of a utility 33
stopping, state of utility execution 33
storage group, DB2
disk space 637
storage allocated 637
STORCLAS, option of TEMPLATE statement 643
stored procedure
DSNACCOR 874, 978
DSNACCOX 895, 950
DSNUTILS 860
DSNUTILU 871
real-time statistics 874, 895, 950, 978
stored procedures
>DSNACCOX 853
ADMIN_COMMAND_DB2 853
ADMIN_COMMAND_DSN 853
ADMIN_COMMAND_UNIX 853
ADMIN_DS_BROWSE 853
ADMIN_DS_DELETE 853
ADMIN_DS_LIST 853
ADMIN_DS_RENAME 853
ADMIN_DS_SEARCH 853
ADMIN_DS_WRITE 853
ADMIN_INFO_HOST 853
ADMIN_INFO_SSID 853
ADMIN_JOB_CANCEL 853
ADMIN_JOB_FETCH 853
ADMIN_JOB_QUERY 853
ADMIN_JOB_SUBMIT 853
ADMIN_TASK_ADD 853
ADMIN_TASK_REMOVE 853
ADMIN_UTL_SCHEDULE 853
ADMIN_UTL_SORT 853
DB2-supplied 853
DSNACCOR 853
DSNACICS 853
DSNAEXP 853
DSNAHVPM 853
DSNAIMS 853
DSNAIMS2 853
DSNLEUSR 853
DSNTBIND 853
439
1105
SUMMARY (continued)
option of REPORT utility 565
switching
templates
TEMPLATE 658
syntax diagram 538
BACKUP SYSTEM utility 44
CATENFM utility 51
CATMAINT utility 55
change log inventory utility (DSNJU003) 730
CHECK DATA utility 62
CHECK INDEX utility 86
CHECK LOB utility 104
COPY utility 114
COPYTOCOPY utility 156
DIAGNOSE utility 173
DSN1CHKR utility 765
DSN1COMP utility 773
DSN1COPY utility 783
DSN1LOGP utility 805
DSN1PRNT utility 825
DSN1SDMP utility 835
DSNJU003 utility 730
DSNJU004 utility 752
DSNU CLIST command 22
DSNUTILS stored procedure 863
DSNUTILU stored procedure 872
EXEC SQL utility 181
how to read xx
LISTDEF utility 185
LOAD utility 207
MERGECOPY utility 308
MODIFY RECOVERY utility 318
MODIFY STATISTICS utility 328
OPTIONS statement 335
print log map utility 752
QUIESCE utility 344
REBUILD INDEX utility 354
RECOVER utility 379
REORG INDEX utility 420
REORG TABLESPACE utility 452
REPAIR utility 536
REPORT utility 564
RESTORE SYSTEM utility 586
RUNSTATS INDEX 603
RUNSTATS TABLESPACE 594
STOSPACE utility 636
TEMPLATE statement 641
UNLOAD utility 664
SYSCOPY
catalog table, information from REPORT utility 568
directory table space, MERGECOPY restrictions 307, 308
option of DSN1LOGP utility 806
SYSCOPY, deleting rows 322
SYSDISC data set
LOAD utility, estimating size 249
SYSERR data set
LOAD utility, estimating size 249
SYSIBM.SYSCOPY
ICBACKUP column 131
ICUNIT column 131
SYSIN DD statement, built by CLIST 26
SYSLGRNX directory table, information from REPORT
utility 568
SYSLGRNX, deleting rows 322
SYSMAP data set
estimating size 249
1106
249
T
table
dropping, reclaiming space 502
exception, creating 76
multiple, loading 226
replacing 257
replacing data 257
TABLE
option of LISTDEF utility 187
option of LOAD STATISTICS 210
option of REORG TABLESPACE utility 458
option of RUNSTATS utility 596
table name, naming convention xvii
table space
assessing status with RUNSTATS 613
checking 61
checking multiple 83
determining when to reorganize 439, 498
LOAD LOG 292
merging copies 307
mixed volume IDs, copying 141
naming convention xvii
nonsegmented, finding unused space 498
partitioned, updating statistics 613
REORG LOG 520
reorganizing
determining when to reorganize 498
using SORTDATA option of REORG utility
utilization 439
segmented
copying 135
LOAD utility 257
status, resetting 554
table spaces
LOAD on NOT LOGGED, effect of 292, 520
TABLESPACE
option of CHECK DATA utility 64
option of CHECK INDEX utility 87
option of CHECK LOB utility 105
option of COPY utility 117
option of COPYTOCOPY utility 158
option of LISTDEF utility 187
498
TABLESPACE (continued)
option of MERGECOPY utility 308
option of MODIFY RECOVERY utility 318
option of MODIFY STATISTICS utility 328
option of QUIESCE utility 344
option of REBUILD INDEX utility 355
option of RECOVER utility 380
option of REORG TABLESPACE utility 458
option of REPAIR utility
general description 537
on LOCATE TABLESPACE statement 542
on SET TABLESPACE and SET INDEX statements 539
option of REPORT utility 565
option of RUNSTATS utility 596, 604
option of UNLOAD utility 666
TABLESPACES, option of LISTDEF utility 187
TABLESPACESET
option of QUIESCE utility 344
option of REPORT utility 565
TAPEUNITS
option of COPY utility 117
option of RECOVER utility 380
TEMPLATE library 654
TEMPLATE library, specifying 339
TEMPLATE utility
authorization 641
BSAM buffers, specifying number 643
compatibility 654
data set names
convention for specifying 643
creating 655
guidelines 655
data set size
controlling 656
default space calculations 656
letting DB2 estimate 656
DD name for tape, specifying 643
description 641
devices
specifying 643
specifying number 643
disposition of data set
defaults for dynamically allocated data sets for new
utility executions 643
defaults for dynamically allocated data sets on
RESTART 643
specifying 643
examples
basic template 658
COPY job with LISTDEF and TEMPLATE 654
COPY job with TEMPLATE and LISTDEF 659
creating a GDG data set 660
GDG data set, copying to tape 660
LOB objects, unloading 661
specifying an expiration date 659
specifying disposition 659
specifying space parameters 659
template switching 146, 661
using default size 659
variable substring notation 658
expiration date for data set, specifying 643
GDG base, specifying number of entries 643
GDGs, working with 657
instructions 641, 654
model data set, specifying 643
operations 654
option descriptions 643
1107
terminating (continued)
utilities (continued)
REPORT 570
RESTORE SYSTEM 589
RUNSTATS 615
STOSPACE 638
TEMPLATE 658
UNLOAD 714
TEST, option of REPAIR utility 549
TIME EXTERNAL
option of LOAD utility 229
option of UNLOAD utility 679
TIME, option of DSNJU003 utility 733
TIMEOUT
option of REORG INDEX utility 423
option of REORG TABLESPACE utility 458
TIMESTAMP EXTERNAL
option of LOAD utility 229
option of UNLOAD utility 679
timestamp, BSDS 758
timestamp, incrementing and decrementing value 679
timestamps, printing system and utility 751
TOCOPY, option of RECOVER utility 380
TOKEN, option of BACKUP SYSTEM utility 45
TOLASTCOPY, option of RECOVER utility 380
TOLASTFULLCOPY option of RECOVER utility 380
TOLOGPOINT, option of RECOVER utility 380
TORBA option of RECOVER utility 380
TOSEQNO, option of RECOVER utility 380
TOVOLUME, option of RECOVER utility 380
TRACEID, option of DIAGNOSE utility 175, 177
TRK, option of TEMPLATE statement 643
TRTCH, option of TEMPLATE statement 643
TRUNCATE
option of LOAD utility
BINARY data type 229
CHAR data type 229, 277
GRAPHIC data type 229, 277
GRAPHIC EXTERNAL data type 229
VARBINARY data type 229
VARCHAR data type 229, 277
VARGRAPHIC data type 229, 277
TYPE
option of DIAGNOSE utility 175
option of DSN1LOGP utility 806
U
UID
option of DSNU command 22
option of DSNUPROC utility 28
UNCNT, option of TEMPLATE statement 643
UNICODE
option of LOAD utility 210
option of UNLOAD utility 666
UNIT
option of DSNJU003 utility 733
option of DSNU CLIST command 22
option of TEMPLATE statement 643
unit of recovery
in-abort 733
inflight 733
unit of work
in-commit 733
indoubt, conditional restart 733
UNLDDN
option of REORG TABLESPACE utility 458
1108
UNLDDN (continued)
option of UNLOAD utility 666
UNLOAD
option of REORG INDEX utility 423
option of REORG TABLESPACE utility 458
UNLOAD utility
64-bit floating point notation, specifying 679
access, specifying 666
ASCII format, specifying 666
authorization required 663
binary floating-point number format, specifying 679
blanks in VARBINARY fields, removing 679
blanks in VARCHAR fields, removing 679
blanks in VARGRAPHIC fields, removing 679
BLOB data type, specifying 679
BLOB strings, truncating 679
CCSID format, specifying 666
CHAR data type, specifying 679
character string representation of date, specifying 679
character string representation of time, specifying 679
character strings, truncating 679
CLOB data type, specifying 679
CLOB strings, truncating 679
compatibility 700
compressed data 714
constant field, specifying 679
converting data types 705
copies, concatenating 703
data sets used 699
data type compatibility 705
data, identifying 666
DBCLOB format, specifying 679
DBCS string, truncating 679
DD name of unload data set, specifying 666
DD statement for image copy, specifying 666
decimal format, specifying 679
decimal point character, specifying for delimited
formats 666
delimited files 710
delimited format, specifying 666
delimiters
column 666
string 666
description 663
EBCDIC format, specifying 666
examples 715
CLONE 720
delimited file format 719
FROMCOPY option 716
HEADER option 716
LOBs 720
partitioned table space 717
SAMPLE option 716
specifying a header 716
unloading a sample of rows 716
unloading all columns 715
unloading data from an image copy 716
unloading data in parallel 717
unloading from two tables 716
unloading LOBs 720
unloading multiple table spaces 718
unloading specific columns 715
unloading specified partitions 717, 719
using a field specification list 715
using LISTDEF 717, 718, 719
using TEMPLATE 717
field position, specifying 679
utilities
controlling 33
data set disposition 14
effect on real-time statistics 999
executing
DB2I 18
DSNU CLIST command 21
JCL 28, 30
problems during 33
restart 37
failure, determining cause 33
loading 7
MERGECOPY 314
mixed-release data sharing environment, operating in
monitoring 33
online 30
description 3
invoking 13
packaging 7
phase, determining 33
real-time statistics 947
running concurrently 35
SMP/E jobs 7
stand-alone
description 3
invoking 723
suite
installing 7
target objects, declared temporary table 4
types
BACKUP SYSTEM 43
CATENFM 51
CATMAINT 55
change log inventory (DSNJU003) 729
CHECK DATA 61
CHECK INDEX 85
CHECK LOB 103
COPY 113
COPYTOCOPY 155
DIAGNOSE 173
DSN1CHKR 763
DSN1COMP 771
DSN1COPY 781
DSN1LOGP 803
DSN1PRNT 823
DSN1SDMP 833
DSNJCNVB 725
EXEC SQL 181
LISTDEF 185
LOAD 205
MERGECOPY 307
MODIFY RECOVERY 317
MODIFY STATISTICS 327
OPTIONS 335
preformat active log (DSNJLOGF) 727
print log map (DSNJU004) 751
QUIESCE 343
REBUILD INDEX 353
RECOVER 377
REORG 437
REORG INDEX 419
REORG TABLESPACE 449
REPAIR 535
REPORT 563
RESTORE SYSTEM 585
RUNSTATS 593
STOSPACE 635
Index
1109
utilities (continued)
types (continued)
TEMPLATE 641
UNLOAD 663
UTILITIES panel, DB2 18
utility control statements
creating 15
parsing rules 15
scanning rules 15
utility-id naming convention xvii
UTILITY, option of DSNU CLIST command 22
UTPRINT DD statement, built by CLIST 26
UTPROC, option of DSNUPROC utility 28
V
validation routine
LOAD utility 205
REORG TABLESPACE utility 458
VALUE
option of DSN1COPY utility 783
option of DSN1LOGP utility 806
option of DSN1PRNT utility 825
VARBINARY
option of the LOAD utility 229
VARCHAR
data type, loading 256
option of LOAD utility 229
option of UNLOAD utility 679
VARGRAPHIC
data type, loading 256
option of LOAD utility 229
option of UNLOAD utility 679
varying-length rows, relocated to other pages, finding number
of 498
VERIFY, statement of REPAIR utility 541, 544
version information
updating when moving to another system 557
version number management 324
LOAD utility 292
REBUILD INDEX utility 374
REORG INDEX utility 445
REORG TABLESPACE utility 520
version numbers, recycling 324
VERSION, option of REPAIR utility on LOCATE
statement 542
VERSIONS, option of REPAIR utility 537
versions, REORG TABLESPACE effect on 520
violation messages 77
violations
correct 78
finding 77
VOLCNT, option of TEMPLATE statement 643
VOLUME, option of DSNU CLIST command 22
VOLUMES, option of TEMPLATE statement 643
VSAM (Virtual Storage Access Method)
used by REORG TABLESPACE 486
used by STOSPACE 637
VSAMCAT, option of DSNJU003 utility 733
W
WAIT, option of DIAGNOSE utility 175
WARNING, option of OPTIONS statement
WHEN
option of LOAD utility 229
1110
336
WHEN (continued)
option of REORG TABLESPACE utility
option of UNLOAD utility 679
work data sets
CHECK DATA utility 64, 70
CHECK INDEX utility 90
LOAD utility 249
WORKDDN
option of CHECK DATA utility 64
option of CHECK INDEX utility 87
option of CHECK LOB utility 107
option of LOAD utility 210
option of MERGECOPY utility 308
option of REORG INDEX utility 423
WRITE, option of QUIESCE utility 344
458
X
XML
option of LISTDEF utility 187
option of LOAD utility 229
XML column
loading 283
XML columns
loading 262
XML data
loading 262
XML table space
copying 135
LOAD LOG 284
XMLERROR, option of CHECK DATA utility
64
Printed in USA
SC18-9855-05
Spine information: