书要仔细的读,细细的读,才能读出不同的味道~~~~~~~~~~~
下午在地铁上,重新把utility细读了一遍,发现了很多知识盲点,发现自己的还得努力:
第一个参数:COPYDICTIONARY integer
从integer所对应的partition拷贝压缩字典,当然该partition必须是压缩的
COPYDICTIONARY integer
Allows the LOAD utility to copy an existing compression dictionary from a
partition to other partitions of a partitioned table space. LOAD copies the
current compression dictionary from the partition whose partition number is
integer, and uses that compression dictionary to compress the input data for
partitions that are being replaced. The default value of integer is 1.
resume指示了对表中数据的处理方式:
YES表示,表中的数据不为空,新load的数据追加到现有表的数据中(注 load数据时总是从表空间的最后可用空间开始追加数据)
NO表示该表为空表,新数据追加到空表中
RESUME
Indicates whether records are to be loaded into an empty or non-empty table
space. For nonsegmented table spaces, space is not reused for rows that have
been marked as deleted or for rows of dropped tables.
NO Loads records into an empty table space. If the table space 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 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.
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.
COPYDDN (ddname1,ddname2)
Specifies the DD statements for the primary (ddname1) and backup (ddname2)
copy data sets for the image copy.
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.
ENFORCE指示了对约束,引用,check是否启用,默认是启用,
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.
SORTNUM指示了你sort work DATA的大小,
SORTNUM integer
Specifies the number of temporary data sets that are to be dynamically
allocated by the sort application program.
load可以产生inline copy,需要注意的是inline copy与online copy 的不同;
Using inline COPY with LOAD
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 the following ways:
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.
If the compression dictionary is rebuilt with LOAD, the set of dictionary pages
occurs twice in the data set, with the second set being the correct one.
The total number of duplicate pages is small, with a negligible effect on the
required space for the data set.
指明了load对索引的处理方式,当发现duplicate KEY的时候,这两条记录都不会
load到表中
How LOAD builds indexes while loading data
LOAD builds all the indexes that are defined for any table that is being loaded.
At the same time the indexes are being built, LOAD checks for duplicate values of
any unique index key. If LOAD finds any duplicate values, none of the
corresponding rows are loaded. Error messages identify the input records that
produce duplicates; optionally, the records are copied to a discard data set. At the
end of the job, a summary report lists all errors that are found.
For unique indexes, any two null values are assumed to be equal, 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, although its other
values must be unique.
Neither the loaded table nor its indexes contain any of the records that might have
produced an error. Using the error messages, you can identify faulty input records,
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.
对索引的并行处理,
前提条件:
索引的数目大于1,且至sortkeys 大于1
每一个index,需要一对subtask,一个用于sort keys,一个用于build index
Building indexes in parallel for LOAD
Parallel index build reduces the elapsed time for a LOAD job by sorting the index
keys and rebuilding multiple indexes in parallel, rather than sequentially.
Optimally, a pair of subtasks process each index; one subtask sorts extracted keys
while the other subtask builds the index. LOAD begins building each index as
soon as the corresponding sort produces its first sorted record.
LOAD uses parallel index build if all of the following conditions are true:
v More than one index needs to be built.
v The LOAD utility statement specifies a non-zero estimate of the number of keys
on the SORTKEYS option.
You can either allow the utility to dynamically allocate the data sets that the SORT
phase needs, or provide the necessary data sets yourself. Select one of the
following methods to allocate sort work and message data sets:
Method 2: You control allocation of sort work data sets, while LOAD allocates
message data sets.
1. Provide DD statements with DD names in the form SWnnWKmm.
2. Allocate UTPRINT to SYSOUT.
Allocation of sort subtasks
The LOAD utility attempts to assign one sort subtask pair for each index that is to
be built. If the LOAD utility cannot start enough subtasks to build one index per
subtask pair, it allocates any excess indexes across the pairs (in the order that the
indexes were created), so that one or more subtask pairs might build more than
one index.
During parallel index build processing, LOAD assigns all foreign keys to the first
utility subtask pair. Remaining indexes are then distributed among the remaining
subtask pairs according to the creation date of the index
During parallel index build processing, LOAD assigns all foreign keys to the first
utility subtask pair. Remaining indexes are then distributed among the remaining
subtask pairs according to the creation date of the index
copypending 的由来:
Resetting COPY-pending status
If you load with LOG NO and do not take an inline copy, LOAD places a table
space in the COPY-pending status. Immediately after that operation, DB2 cannot
recover the table space (although you can, by loading it again).
解决方法:
You can also remove the restriction by using one of these operations:
v LOAD REPLACE LOG YES
v LOAD REPLACE LOG NO with an inline copy
v REORG LOG YES
v REORG LOG NO with an inline copy
v REPAIR SET with NOCOPYPEND
A table space that is in COPY-pending status can be read without restriction;
however, it cannot be updated.
rebuild-pend 的由来:
Resetting REBUILD-pending status
LOAD sets index spaces to REBUILD-pending status when a REBUILD job ends
before the INDEXVAL phase is complete.
recover-penging的由来:
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.
check-pending:
Resetting the CHECK-pending status
LOAD places a table space in the CHECK-pending status if its referential integrity
is in doubt or its check constraints are violated.
阅读(4430) | 评论(0) | 转发(0) |