Use the LOAD online utility to load one or more tables of a table space. The LOAD utility loads records into the tables and builds or extends any indexes that are defined on them.

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

The loaded data is processed by any edit or validation routine that is associated with the table, and any field procedure that is associated with any column of the table. The LOAD utility ignores and does not enforce informational referential constraints.

The LOAD utility uses a number of data sets during its operation.

The following table lists the data sets that LOAD uses. 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. Include statements in your JCL for each required data set, and any optional data sets that you want to use. Alternatively, you can use the TEMPLATE utility to dynamically allocate some of these data sets.

Table 1. Data sets that LOAD uses
Data set Description Required?
SYSIN Input data set that contains the utility control statement. Yes
SYSPRINT Output data set for messages. Yes
STPRIN01 A data set that contains messages from the sort program (usually, SYSOUT or DUMMY).

This data set is used when statistics are collected on at least one data-partitioned secondary index.

No 1
Input data set The input data set that contains the data that is to be loaded. Specify its template or DD name with the INDDN option of the utility control statement. The default name is SYSREC. It must be a sequential data set that is readable by BSAM. The input file can be an HFS or zFS file, in which case use a template with the PATH option. Yes3, 14
Sort data sets Two temporary work data sets for sort input and sort output. Specify their DD or template names with the WORKDDN option of the utility control statement. The default DD name for sort input is SYSUT1. The default DD name for sort output is SORTOUT. Yes4, 5, 14
Mapping data set Work data set for mapping the identifier of a table row back to the input record that caused an error. Specify its template or DD name with the MAPDDN option of the utility control statement. The default DD name is SYSMAP. Yes4,6
UTPRINT Contains messages from the sort program (usually, SYSOUT or DUMMY). Yes
Discard data set A work data set that contains copies of records that are not loaded. It must be a sequential data set that is readable by BSAM. Specify its DD or template name with the DISCARDDN option of the utility control statement. The default DD name is SYSDISC. Yes 8, 14
Error data set Work data set for error processing. Specify its DD or template name with the ERRDDN option of the utility control statement. The default DD or template name is SYSERR. Yes
Copy data sets One to four output data sets that contain image copy data sets. Specify their DD or template names with the COPYDDN and RECOVERYDDN options of the utility control statement. No9
FlashCopy® image copies For table space or index space level copies, a VSAM data set for the output FlashCopy image copy of each partition or piece.

For a partition level or piece level copy, a VSAM data set for the output FlashCopy image copy of the partition or piece.

No13
Sort work data sets Temporary data sets for sort input and output when sorting keys. If index build parallelism is used, the DD names have the form SWnnWKmm. If index build parallelism is not used, the DD names have the form SORTWKnn. Yes10,12
Sort work data sets Temporary data sets for sort input and output when collecting inline statistics on at least one data-partitioned secondary index.

The DD names have the form ST01WKnn.

No2,11,12
Note:
  1. STPRIN01 is required if statistics are being collected on at least one data-partitioned secondary index, but LOAD dynamically allocates the STPRIN01 data set if UTPRINT is allocated to SYSOUT.
  2. Required when collecting inline statistics on at least one data-partitioned secondary index.
  3. As an alternative to specifying an input data set, you can specify a cursor with the INCURSOR option.
  4. Required if referential constraints exist and ENFORCE(CONSTRAINTS) is specified (This option is the default).
  5. Used for tables with indexes.
  6. Required for discard processing when loading one or more tables that have unique indexes.
  7. Required if a sort is done.
  8. 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.
  9. Required for inline copies.
  10. Required if any indexes are to be built or if a sort is required for processing errors.
  11. If the DYNALLOC parm of the SORT program is not turned on, you need to allocate the data set. Otherwise, the sort program dynamically allocates the temporary data set.
  12. 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.
  13. Required if you specify either FLASHCOPY YES or FLASHCOPY CONSISTENT.
  14. If the SYSREC data set is on tape, and you use templates for the SYSUT1, SYSOUT, or SYSDISC data sets, include the SPACE parameter in the TEMPLATE utility control statements.
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.)

Defining work data sets

Use the formulas and instructions in The following table to calculate the size of work data sets for LOAD. Each row in the table lists the DD name that is used to identify the data set and either formulas or instructions that you should use to determine the size of the data set. The key for the formulas is located at the bottom of the table.

Table 2. Size of work data sets for LOAD jobs
Work data set Size
SORTOUT max(f,e)
ST01WKnn
  • 2 ×(maximum record length × numcols × (count + 2) × number of indexes)
SYSDISC Same size as input data set
SYSERR e
SYSMAP
  • Simple table space for discard processing:

    • m
  • Partitioned or segmented table space without discard processing:
    • max(m,e)
SYSUT1
  • Simple table space:

    • max(k,e)
  • Partitioned or segmented table space:
    • max(k,e,m)
    If you specify an estimate of the number of keys with the SORTKEYS option:

    • max(f,e) for a simple table space
    • max(f,e,m) for a partitioned or segmented table space
Note:
variable
meaning
k
Key calculation
f
Foreign key calculation
m
Map calculation
e
Error calculation
max()
Maximum value of the specified calculations
numcols
Number of key columns to concatenate when you collect frequent values from the specified index
count
Number of frequent values that DB2® is to collect
maximum record length
Maximum record length of the SYSCOLDISTSTATS record that is processed when collecting frequency statistics (You can obtain this value from the RECLENGTH column in SYSTABLES.)
  • Calculating the key: k

    If a mix of data-partitioned secondary indexes and nonpartitioned indexes exists on the table that is being loaded or a foreign key exists that is exactly indexed by a data-partitioned secondary index, use this formula:

    max(longest index key + 15, longest foreign key + 15) * (number of extracted keys).

    Otherwise, use this formula:

    max(longest index key + 13, longest foreign key + 13) * (number of extracted keys).

    For nonpadded indexes, the length of the longest key means the maximum possible length of a key with all varying-length columns padded to their maximum lengths, plus 2 bytes for each varying-length column.

  • Calculating the number of extracted keys:
    1. Count 1 for each index.
    2. Count 1 for each foreign key that is not exactly indexed (that is, where foreign key and index definitions do not correspond identically).
    3. For each foreign key that is exactly indexed (that is, where foreign key and index definitions correspond identically):
      1. Count 0 for the first relationship in which the foreign key participates if the index is not a data-partitioned secondary index. Count 1 if the index is a data-partitioned secondary index.
      2. Count 1 for subsequent relationships in which the foreign key participates (if any).
    4. Multiply count by the number of rows that are to be loaded.
  • Calculating the foreign key: f

    If a mix of data-partitioned secondary indexes and nonpartitioned indexes exists on the table that is being loaded or a foreign key exists that is exactly indexed by a data-partitioned secondary index, use this formula:

    max(longest foreign key + 15) * (number of extracted keys)

    Otherwise, use this formula:

    max(longest foreign key + 13) * (number of extracted keys)

  • Calculating the map: m

    The data set must be large enough to accommodate one map entry (length = 21 bytes) per table row that is produced by the LOAD job.

  • Calculating the error: e

    The data set must be large enough to accommodate one error entry (length = 560 bytes) per defect that is detected by LOAD (for example, conversion errors, unique index violations, violations of referential constraints).

  • Calculating the number of possible defects:
    • For discard processing, if the discard limit is specified, the number of possible defects is equal to the discard limit.

      If the discard limit is the maximum, calculate the number of possible defects by using the following formula:

      number of input records +
      (number of unique indexes * number of extracted keys) +
      (number of relationships * number of extracted foreign keys)
    • For nondiscard processing, the data set is not required.

Allocating twice the space that is used by the input data sets is usually adequate for the sort work data sets. Two or three large SORTWKnn data sets are preferable to several small ones.

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.

DB2 Z/os Load utility 使用的更多相关文章

  1. OGG for DB2 z/OS 12.2版本发布

    2016-04-15 Oracle发布了GoldenGate for DB2 z/OS  12.2.0.1.2.可以从OTN或eDelivery下载,该版本是ogg for DB2 z/OS的第一个1 ...

  2. DB2 bind on z/os

    BIND and REBIND options for packages and plans There are several options you can use for binding or ...

  3. REORG TABLESPACE on z/os

    这个困扰了我两天的问题终于解决了,在运行这个job时:总是提示 A REQUIRED DD CARD OR TEMPLATE IS MISSING NAME=SYSDISC A REQUIRED DD ...

  4. z/os上的tar和gzip(3)

    前面两篇文章分别讲过了如何合并并压缩批量文件,如何解压缩并恢复批量文件, 这些问题解决了之后还剩下一个大问题,如何在网络上传输这些压缩过的文件,如果是linux的话非常简单,制定binary,然后ge ...

  5. 在DB2 for z/os上创建指定pagesize的数据库

    ASNTDIFF的diff table有一列类型为varchar 15000,z上创建db默认的pagesize是4K,无法创建table,所以需要创建一个大pagesize的database. db ...

  6. DB2 for Z/os Statement prepare

    The PREPARE statement creates an executable SQL statement from a string form of the statement. The c ...

  7. Index on DB2 for z/OS: DB2 for z/OS 的索引

    可以创建在任何表上的索引: Unique Index:An index that ensures that the value in a particular column or set of col ...

  8. Shell获取Aix/linux/unix机器上db2和os的信息并上传到指定服务器

    (之前写过一篇类似的文章,当时传输文件用的是ftp,因为项目觉得ftp不够安全所以这次换成了scp,同时对脚本的一些地方也做了一些调整) 其实做这个东西还是因为项目的需求,需要获取某些机器(目前主要是 ...

  9. db2 import和load

    Import和Load 都可以将数据导入到DB2服务器中,但是2者是有很大区别的. Import 其实执行了SQL 的INSERT 操作.和INSERT 操作一样,Import 执行的时候会激活触发器 ...

随机推荐

  1. js表单元素checked、radio被选中的几种方式-遁地龙卷风

    0.环境 <input type="checkbox"  value="lol"/>lol var lol = document.getElemen ...

  2. Java 的printf(转)

    出处:http://blog.csdn.net/swandragon/article/details/4653600 public class TestPrintf{public static voi ...

  3. HDU 1174 爆头(计算几何)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1174 解题报告:就是用到了三维向量的点积来求点到直线的距离,向量(x1,y1,z1)与(x2,y2,z ...

  4. HDU 1085 Holding Bin-Laden Captive!(DP)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1085 解题报告:有1,2,5三种面值的硬币,这三种硬币的数量分别是num_1,num_2,num_5, ...

  5. iOS 开发笔记 -- 各种细枝末节的知识(水滴石穿)

    在此总结整理,遇到的各种的小问题: 1.通过从字典(数组)中取出的NSString的length==0 作为if的判断条件导致的carsh: 由于在字典中通过Key取出值之后直接做了length相关操 ...

  6. [转载]Web 研发模式演变

    原文链接:https://github.com/lifesinger/blog/issues/184 前不久徐飞写了一篇很好的文章:Web 应用的组件化开发.本文尝试从历史发展角度,说说各种研发模式的 ...

  7. JAVA_HOME path classpath 以及cmd编译运行java代码

    JAVA_HOME PATH CLASSPATH 三者的区别:安装完jdk之后,首先在环境变量里面添加JAVA_HOME ,例如安装路径为C:\Program Files\Java\jdk1.6.0_ ...

  8. log4j配置日志文件log4j.appender.R.File相对路径方法

    方法一. 解决的办法自然是用相对路径代替绝对路径,其实log4j的FileAppender本身就有这样的机制,如:log4j.appender.logfile.File=${WORKDIR}/logs ...

  9. Spring官网jar包下载方法

    Spring官网改版后,很多项目的完整zip包下载链接已经隐掉了,虽然Spring旨在引导大家用更“高大上”的maven方式来管理所依赖的jar包,但是完全没想到中国的国情,在伟大的墙内,直接通过ma ...

  10. 解决 QtCreator 3.5(4.0)无法输入中文的问题

    解决 QtCreator 3.5.1无法输入中文的问题 [TOC] 环境是ubuntu 15.10 ubuntu软件源中下载安装的fctix-libs-qt5现在没有用,版本太旧了. 自己下载fcti ...