Guide To The HPL
Guide To The HPL
Guide To The HPL
High-Performance
Loader
Version 7.3
February 1998
Part No. 000-4344
Published by INFORMIX Press Informix Software, Inc.
4100 Bohannon Drive
Menlo Park, CA 94025-1032
Copyright 1981-1998 by Informix Software, Inc. or its subsidiaries, provided that portions may be
copyrighted by third parties, as set forth in documentation. All rights reserved.
The following are worldwide trademarks of Informix Software, Inc., or its subsidiaries, registered in the
United States of America as indicated by “,” and in numerous other countries worldwide:
Answers OnLine; INFORMIX; Informix; Illustra; C-ISAM; DataBlade; Dynamic Server; Gateway;
NewEra
All other names or marks may be registered trademarks or trademarks of their respective owners.
Software and documentation acquired with US Government funds are provided with rights as follows: (1) if
for civilian agency use, with Restricted Rights as defined in FAR 52.227-19; (2) if for Dept. of Defense use, with
rights as restricted by vendor's standard license, unless superseded by negotiated vendor license as prescribed
in DFAR 227.7202. Any whole or partial reproduction of software or documentation marked with this legend
must reproduce the legend.
Table of Contents
Introduction
About This Manual . . . . . . . . . . . . . . . . . . 3
Types of Users . . . . . . . . . . . . . . . . . . 3
Software Dependencies . . . . . . . . . . . . . . . 4
Assumptions About Your Locale. . . . . . . . . . . . 4
Demonstration Database . . . . . . . . . . . . . . 4
New Features . . . . . . . . . . . . . . . . . . . . 5
Documentation Conventions . . . . . . . . . . . . . . 6
Typographical Conventions . . . . . . . . . . . . . 6
Icon Conventions . . . . . . . . . . . . . . . . . 7
Command-Line Conventions . . . . . . . . . . . . . 9
Screen-Illustration Conventions . . . . . . . . . . . . 11
Additional Documentation . . . . . . . . . . . . . . . 12
On-Line Manuals . . . . . . . . . . . . . . . . . 12
Printed Manuals . . . . . . . . . . . . . . . . . 12
On-Line Help . . . . . . . . . . . . . . . . . . 13
Error Message Files . . . . . . . . . . . . . . . . 13
Documentation Notes, Release Notes, Machine Notes . . . . 14
Compliance with Industry Standards . . . . . . . . . . . 15
Informix Welcomes Your Comments . . . . . . . . . . . . 16
Table of Contents v
Chapter 6 Defining Device Arrays
Device Arrays . . . . . . . . . . . . . . . . . . . 6-3
Using Multiple Devices in a Device Array . . . . . . . . 6-3
Using the Device Array Selection Window . . . . . . . . 6-4
Using the Device-Array Definition Window . . . . . . . 6-6
Chapter 14 Browsing
The Browsing Options . . . . . . . . . . . . . . . . 14-3
Previewing Data-File Records . . . . . . . . . . . . 14-3
Reviewing Records That the Conversion Rejected . . . . . 14-7
Viewing the Violations Table . . . . . . . . . . . . . 14-8
Viewing the Status of a Load Job or Unload Job . . . . . . 14-9
Index
Table of Contents ix
Introduction
Introduction
New Features . . . . . . . . . . . . . . . . . . . . . 5
Documentation Conventions . . . . . . . . . . . . . . . 6
Typographical Conventions . . . . . . . . . . . . . . 6
Icon Conventions . . . . . . . . . . . . . . . . . . 7
Comment Icons . . . . . . . . . . . . . . . . . 7
Feature, Product, and Platform Icons . . . . . . . . . . 8
Command-Line Conventions . . . . . . . . . . . . . . 9
How to Read a Command-Line Diagram . . . . . . . . 11
Screen-Illustration Conventions . . . . . . . . . . . . . 11
Additional Documentation . . . . . . . . . . . . . . . . 12
On-Line Manuals . . . . . . . . . . . . . . . . . . 12
Printed Manuals . . . . . . . . . . . . . . . . . . 12
On-Line Help . . . . . . . . . . . . . . . . . . . 13
Error Message Files . . . . . . . . . . . . . . . . . 13
Documentation Notes, Release Notes, Machine Notes . . . . . 14
This manual includes two tutorial examples that take you through the
process of loading and unloading data.
Types of Users
This manual is for the following users who must load and unload large
quantities of data:
■ Database administrators
■ Database server administrators
Introduction 3
Software Dependencies
Software Dependencies
This manual assumes that your database server is one of the following
products:
This manual assumes that you are using the default locale, en_us.8859-1. This
locale supports U.S. English format conventions for dates, times, and
currency. In addition, this locale supports the ISO 8859-1 code set, which
includes the ASCII code set plus many 8-bit characters such as é, è, and ñ.
If you plan to use nondefault characters in your data or your SQL identifiers,
or if you want to conform to the nondefault collation rules of character data,
you need to specify the appropriate nondefault locale(s). For instructions on
how to specify a nondefault locale, additional syntax, and other consider-
ations related to GLS locales, see the Guide to GLS Functionality.
Demonstration Database
The DB-Access utility, which is provided with your Informix database server
products, includes a demonstration database called stores7 that contains
information about a fictitious wholesale sporting-goods distributor. You can
use SQL scripts provided with DB-Access to derive a second database, called
sales_demo. This database illustrates a dimensional schema for data-
warehousing applications. Sample command files are also included for
creating and populating these databases.
The scripts that you use to install the demonstration databases reside
in the $INFORMIXDIR/bin directory on UNIX platforms and the
%INFORMIXDIR%\bin directory on Windows NT platforms. For a complete
explanation of how to create and populate the stores7 demonstration
database, refer to the DB-Access User Manual. For an explanation of how to
create and populate the sales_demo database, refer to the Informix Guide to
Database Design and Implementation.
New Features
Most of the new features for Version 7.3 of Informix Dynamic Server fall into
five major areas:
■ Performance
■ Reliability, availability, and serviceability
■ Manageability
■ Windows NT-specific features
■ Application migration
Introduction 5
Documentation Conventions
Documentation Conventions
This section describes the conventions that this manual uses. These conven-
tions make it easier to gather information from this and other Informix
manuals.
■ Typographical conventions
■ Icon conventions
■ Command-line conventions
■ Screen-illustration conventions
Typographical Conventions
This manual uses the following standard set of conventions to introduce new
terms, illustrate screen displays, describe command syntax, and so forth.
Convention Meaning
italics Within text, new terms and emphasized words appear in italics.
Within syntax diagrams, values that you are to specify appear
in italics.
monospace Information that the product displays and information that you
enter appear in a monospace typeface.
KEYSTROKE Keys that you are to press appear in uppercase letters in a sans
serif font.
(1 of 2)
Convention Meaning
Icon Conventions
Throughout the documentation, you will find text that is identified by several
different types of icons. This section describes these icons.
Comment Icons
Comment icons identify warnings, important notes, or tips. This information
is always displayed in italics.
Icon Description
Introduction 7
Icon Conventions
Icon Description
GLS
Identifies information that relates to the Informix GLS
feature.
IDS
Identifies information that is specific to Dynamic Server
and its editions. However, in some cases, the identified
section applies only to Informix Dynamic Server and not to
Informix Dynamic Server, Workgroup and Developer
Editions. Such information is clearly identified.
UNIX
Identifies information that is specific to the UNIX platform.
W/D
Identifies information that is specific to Informix Dynamic
Server, Workgroup and Developer Editions.
WIN NT
Identifies information that is specific to the Windows NT
environment.
These icons can apply to a row in a table, one or more paragraphs, or an entire
section. If an icon appears next to a section heading, the information that
applies to the indicated feature, product, or platform ends at the next heading
at the same or higher level. A ♦ symbol indicates the end of the feature-,
product-, or platform-specific information that appears within a table or a set
of paragraphs within a section.
Command-Line Conventions
This section defines and illustrates the format of commands that are available
in Informix products. These commands have their own conventions, which
might include alternative forms of a command, required and optional parts
of the command, and so forth.
Each diagram displays the sequences of required and optional elements that
are valid in a command. A diagram begins at the upper-left corner with a
command. It ends at the upper-right corner with a vertical line. Between
these points, you can trace any path that does not stop or back up. Each path
describes a valid form of the command. You must supply a value for words
that are in italics.
Element Description
Introduction 9
Command-Line Conventions
Element Description
' ' Single quotes are literal symbols that you must enter as
shown.
Privileges
A reference in a box represents a subdiagram. Imagine
p. 5-17 that the subdiagram is spliced into the main diagram at
this point. When a page number is not specified, the
Privileges subdiagram appears on the same page.
pathname
To construct a command correctly, start at the top left with the command.
Then follow the diagram to the right, including the elements that you want.
The elements in the diagram are case sensitive.
Screen-Illustration Conventions
The illustrations in this manual are generic renditions of various windowing
environments. The details of specific dialog boxes, controls, and windows are
deleted or redesigned to provide this generic look. Therefore, the illustrations
in this manual depict the windowing environment a little differently than the
way it appears on your screen.
Introduction 11
Additional Documentation
Additional Documentation
For additional information, you might want to refer to the following types of
documentation:
■ On-line manuals
■ Printed manuals
■ On-line help
■ Error message files
■ Documentation notes, release notes, and machine notes
On-Line Manuals
An Answers OnLine CD that contains Informix manuals in electronic format
is provided with your Informix products. You can install the documentation
or access it directly from the CD. For information about how to install, read,
and print on-line manuals, see the installation insert that accompanies
Answers OnLine.
Printed Manuals
To order printed manuals, call 1-800-331-1763 or send email to
[email protected]. Please provide the following information when
you place your order:
On-Line Help
The HPL on-line help facility provides a detailed, context-sensitive
explanation of program functions. To invoke the on-line help, click Help in
any window for window-specific help or choose options from the Help menu
on the HPL main window. The Help menu lets you choose Glossary to view
definitions that are related to the HPL or choose Contents to search for
specific topics.
UNIX To read the error messages under UNIX, use the following commands.
Command Description
WIN NT To read error messages and corrective actions under Windows NT, use the
Informix Find Error utility. To display this utility, choose
Start➞Programs➞Informix from the Task Bar. ♦
The HPL log file stores nonnumbered messages that are returned by onpload
during a data load or unload. For explanatory notes for the messages that
appear in the log file, refer to Appendix G.
Introduction 13
Documentation Notes, Release Notes, Machine Notes
IDS_7.3 The machine-notes file describes any special actions that are
required to configure and use Informix products on your
computer. Machine notes are named for the product described.
Replace x.y in the filename with the version number of your
database server to derive the name of the machine-notes file.
WIN NT The following items appear in the Informix folder. To display this folder,
choose Start➞Programs➞Informix from the Task Bar.
Introduction 15
Informix Welcomes Your Comments
■ The name and version of the manual that you are using
■ Any comments that you have about the manual
■ Your name, address, and phone number
650-926-6571
High-Performance Loader
Overview 1
Overview of Features of the HPL . . . . . . . . . . . . . . 1-4
Data Load . . . . . . . . . . . . . . . . . . . . . . 1-5
Data Unload . . . . . . . . . . . . . . . . . . . . . 1-7
Loading Modes . . . . . . . . . . . . . . . . . . . . 1-8
Deluxe Mode . . . . . . . . . . . . . . . . . . . 1-8
Express Mode . . . . . . . . . . . . . . . . . . . 1-8
Chapter 2 introduces the user interface, the ipload utility, that you can use to
set the parameters for the HPL. Subsequent chapters provide details about
the ipload user interface.
WIN NT If you do not have access to the ipload utility, and you want to use the full
functionality of the onpload utility, refer to this chapter and to Chapter 15,
“Managing the High-Performance Loader,” Chapter 16, “The onpload
Utility,” and Appendix A through Appendix G.
You can also use the Informix Enterprise Command Center (IECC) interface
to load large quantities of data to or from a database. For information on
loading with IECC, see the Informix Enterprise Command Center User Guide. ♦
Data Load
The data-load process reads a source data file, converts the data to a different
format, and inserts the converted data into a database table. The source data
can come from one or more of the following sources:
■ Files
■ Tapes
WIN
UNIX
NT ■ Pipes (application-generated data) ♦
When you prepare to run a data load using the HPL, you describe the actions
that the HPL must take by defining a set of meta-data components. The compo-
nents describe different aspects of the load process. Figure 1-1 illustrates the
data load process. The HPL uses information from:
The ipload utility helps you prepare the components. Chapter 12, “Loading
Data to a Database Table,” addresses the process of loading a file to a
database.
Figure 1-1
The Data-Load Process
Format
Data files Input records Selected records Table entries
Filter Map
Device
array
Data Unload
The data-unload process is essentially the same as the load process, but in
reverse. The data-unload process extracts the source data from one or more
database tables; converts the data to a new format; and writes the converted
data to a file, tape, or on UNIX to a pipe (application). As in a load, you can
manipulate the data from a database table so that the converted data displays
different characteristics.
Figure 1-2 illustrates how the components of the HPL affect the data as it
moves from a database to data files during the unload process. The HPL uses:
Format
Data files
Selected table Selected records Reorganized records
Query Map
Device
array
The HPL uses the same components for an unload as for a load, with one
exception. For an unload, the ipload utility creates a Structured Query
Language (SQL) query that extracts selected data from the table. As with a
load, unload components are grouped together into an unload job. Unload
jobs can be saved, retrieved, and rerun as many times as necessary. Unload
jobs can be grouped together with load jobs in the same project.
Loading Modes
The HPL offers two load modes: deluxe and express. Express mode is faster
and deluxe mode is more flexible. You can choose the mode that is best suited
for your environment. For a detailed comparison between express and
deluxe mode, refer to Chapter 15, “Managing the High-Performance
Loader.”
Deluxe Mode
The deluxe mode updates indexes, performs constraint checking, and
evaluates triggers as data is inserted into the table. Deluxe mode does not
lock the table, so the loading of data can take place while other users are
working. Deluxe mode is not as fast as express mode but allows table access
and update during a load.
Express Mode
The express mode disables indexes, constraints, and triggers during the load.
After the load, indexes are rebuilt and reenabled, constraints are evaluated
and reenabled if possible, and triggers are reenabled. (The triggers are not
evaluated with respect to the loaded data.) Express-mode loads are signifi-
cantly faster than deluxe loads; however, no one can update the table or read
the new data entries until the load is complete.
The largest part of this manual discusses the HPL user interface, the ipload
utility, because the user interface is the part that you see and with which you
interact. However, the ipload utility is merely the interface that allows you to
prepare the parameters (the onpload database) that the onpload utility uses
to perform the data loads and unloads. Theoretically, you could use
DB-Access or some other tool to populate the onpload database and never
use ipload. However, ipload is a more efficient and accurate way to populate
the onpload database.
One of the ipload options lets you start the onpload utility, so that you do not
need to start the onpload utility from the command line.
WIN
UNIX
NT The ipload Utility
The ipload utility is a graphical interface that you use to create and store
information for the onpload utility. The ipload utility lets you create, edit,
and group the components of the load and unload. The ipload utility creates
a database named onpload and stores information about the load compo-
nents in the database.
The onpload database can reside on any database server on your network.
Also, any onpload utility can use the onpload database as long as the
onpload utility can access the database server that contains the onpload
database. In contrast, the onpload utility must run on the same computer as
the database server that contains the target database.
Client/server
Client/server connections
connection
Database server
When you start onpload from the ipload or IECC interface, ipload or IECC
and onpload use a socket connection to send messages back and forth: start,
stop, and simple reports.
■ The ipload utility manages the descriptions of load and unload jobs.
It does not actively move data from one place to another.
■ The IECC interface manages the descriptions of load and unload jobs.
It does not actively move data from one place to another. For more
information about IECC options for loading, see the Informix
Enterprise Command Center User Guide.
■ The onpload utility moves data from one place to another (that is,
from a database to a storage device, or from a storage device to a
database).
■ The onpload database contains information that the onpload utility
uses. The ipload utility or IECC interface manages the onpload
database.
Theoretically, you could manage the onpload database yourself and never
use the ipload utility or IECC interface. However, that process would be
tedious and prone to errors. Informix strongly recommends that you use
ipload or the IECC interface. You can use DB-Access or other database tools
to examine the contents of the onpload database, but always use ipload or
IECC to modify the database.
Environment Variables
The HPL is part of the database server, so you must start the server before you
use the HPL. Before you start the server, you must set these environment
variables:
■ INFORMIXDIR
■ ONCONFIG
■ INFORMIXSERVER
■ LD_LIBRARY_PATH
In addition to the environment variables that you must always set when you
use the database server, the following environment variables refer to the HPL:
■ DBONPLOAD
■ PLCONFIG
■ PLOAD_SHMBASE
If you do not use an alternative onpload database, you do not need to set
DBONPLOAD.
To verify if a collision has occurred, use the onstat -g seg option. Check for
overlap between the shared-memory segments that the server is using and
the SHMBASE reported in the onpload log file. For more information on the
onstat -g seg option, refer to your Administrator’s Guide and Performance
Guide.
The onpload utility is a client application that attaches to the database server.
The utility is unusual because it uses the same multithreading architecture
that the server uses. Because it uses multithreading, onpload can take
advantage of parallel processing to do both I/O and data conversion as
efficiently as possible. Multithreading is described in your Administrator’s
Guide. The following sections describe how onpload uses multithreading for
deluxe loads, express loads, and unloads.
Deluxe-Mode Loads
Figure 1-4 shows the threads that onpload uses in a deluxe-mode load
process. In deluxe mode, data is subject to the same constraints as if you were
loading the data using SQL INSERT statements.
Figure 1-4
A Deluxe-Mode Load
Tape Tape
worker worker
pl_wkr_1 pl_wkr_2
cadiload cadiload
To see the status of the onpload threads, you must use the -j option of the
onstat utility. This option is documented in Appendix F.
■ pl_wkr threads
Each worker thread of the onpload utility is paired with a pl_wkr
thread in the database server. These threads receive the data from
onpload.
In a utility that shows that database server status, the pl_wkr threads
are named pl_wkr_1, pl_wkr_2, pl_wkr_3, and so forth.
■ cadiload threads
The cadiload threads are the insert threads. The insert threads
perform a normal insert into the database, just as if you were using
an INSERT statement. The SQL optimizer governs the method that is
used for inserting the data.
Express-Mode Loads
Figure 1-5 on page 1-19 shows a single express-mode load process. In express
mode, the data is inserted directly into an extent without any evaluation of
objects (constraints, indexes, and/or triggers).
The behavior of the onpload utility during an express load is the same as for
deluxe loads, as described in “Threads That the onpload Utility Uses” on
page 1-17. However, the behavior of the database server during an express
load is quite different. The express load bypasses all of the SQL layer of the
database server. The pl_wkr threads pass the data to stream threads (also
called fragmenter threads) that decide where the data should be stored. The
fragmenter threads pass the data to an exchange that distributes the data to
setrw threads. The setrw threads write table rows to disk a page at a time,
bypassing the buffer cache.
The number of input devices can be different from the number of table
fragments. The exchange operator handles multiplexing of data. The data is
processed in parallel with respect to the data read from the device array and
also with respect to the data written out to table fragments on separate disks.
There is also pipeline parallelism in the data flow from input devices out to
table fragments on disk. Parallelism is the main mechanism for achieving
high performance.
Figure 1-5
An Express-Mode Load
Tape Tape
onpload
utility sdriver sdriver
convert convert
convert convert
convert convert
worker worker
pl_wkr_1 pl_wkr_2
stream_2.0 stream_2.1
Exchange
Database
server
During express-mode load, the database server writes the data to new
extents on disk, but those extents are not yet part of the table, as illustrated in
Figure 1-6. At the end of express mode, the new extents are added to the
table.
Figure 1-6
Extents After an Express-Mode Load
After the express-mode load, you must perform a level-0 backup before you
can access the target database for writing. If you try to write to the table
before you perform a level-0 backup, the database server issues ISAM error
-197, as follows:
ANSI If your database is ANSI compliant, all access (both read and write) is denied
until you perform a level-0 backup. Because data is not logged in express
mode, the level-0 backup is necessary to allow for recovery in case of media
failure. ♦
Unloads
Figure 1-7 on page 1-21 shows the onpload unload process. In the unload
process, the behavior of onpload parallels the behavior described in
“Threads That the onpload Utility Uses” on page 1-17 and “Threads That the
Database Server Uses” on page 1-18, except that the threads are unloading
the data instead of loading it.
Figure 1-7
The Unload Procedure
Tape Tape
sdriver sdriver
onpload
utility
convert convert
convert convert
convert convert
ulworker ulworker
pl_wkr_1 pl_wkr_2
ulstrm_1.1 ulstrm_1.2
Exchange
Database
server
The ulstrm (unload-stream) thread packages data for output to the onpload
client from the query plan. The SQL optimizer creates the query plan. The
query plan behaves as if you were running a query from any other client,
such as DB-Access. The exchange operator distributes the resulting data to
the ulworker threads in a round-robin fashion, and onpload unloads the
data onto tapes or files.
Parallelism with respect to the output device, the source table fragments, and
the flow of the data is evident in Figure 1-7 on page 1-21.
Getting Started
2
Data-Load Example . . . . . . . . . . . . . . . . . . 2-4
Start the Database Server . . . . . . . . . . . . . . . 2-4
Create a File of Data . . . . . . . . . . . . . . . . . 2-4
Create a Database . . . . . . . . . . . . . . . . . . 2-5
The purpose of this chapter is to illustrate quickly how the components of the
High-Performance Loader (HPL) fit together. The chapter does not attempt to
explain the components in any detail. After you complete these examples,
you can refer to the later chapters in this book for more information about the
options that are available for each of the procedures.
WIN NT The ipload utility is a UNIX motif. On Windows NT, you can use the Informix
Enterprise Command Center (IECC) interface for loading and unloading
tables and databases.
If you do not have access to the ipload utility and you want to use the full
functionality of the onpload utility, refer to Chapter 1, “High-Performance
Loader Overview,” Chapter 15, “Managing the High-Performance Loader,”
Chapter 16, “The onpload Utility,” and Appendix A through Appendix G. ♦
Data-Load Example
The illustrations in the first example use a database with only one table. The
table contains three columns. The data to be loaded into the database is in a
file that has only four records. In a real production environment, you would
probably use the INSERT statement, the dbimport utility, or the LOAD
statement for such a simple operation. However, by using an extremely
simple example, the illustrations can show what happens at each step.
Important: The first time you run the HPL, you must be user informix.
Create a Database
The HPL loads data into an existing table in an existing database. The example
in this chapter loads the information from the file /work/mydata into a three-
column table named tab1 in a database named testdb. You can use DB-Access
to prepare the database and table, as follows:
CREATE DATABASE testdb;
CREATE TABLE tab1
(
col1 INTEGER,
col2 CHAR(1),
col3 INTEGER
);
GRANT ALL ON tab1 TO PUBLIC;
GRANT CONNECT TO PUBLIC;
After you finish preparing the database for the example, exit from DB-Access.
WIN
UNIX
NT The ipload Utility
The HPL uses information from the onpload database to control loading and
unloading of data. Theoretically, you could create the onpload database and
use DB-Access or some other database tool to populate it. However, Informix
recommends that you always use ipload to manage the onpload database.
The first time you start ipload, the utility automatically creates the onpload
database. The ipload utility also puts certain default values into the database.
Appendix A, “The onpload Database,” describes the database tables.
When ipload starts, the High-Performance Loader main window (the HPL
main window) appears, as Figure 2-1 illustrates.
<default>
Tip: To exit from ipload, choose Exit from the Jobs menu. To continue with the
example, do not exit.
Choose a Project
You use the HPL by preparing load jobs or unload jobs that import or export
data. You can assign your load and unload jobs to various projects to organize
the jobs into functional groups. Projects are described in Chapter 4, “Defining
Projects.”
For this example, you can use the default project. Click <default> on the HPL
main window to choose the default project.
If you need to change one of the values, refer to “Modifying the Machine
Description” on page 5-8. Click Cancel to exit from the Machines window.
Selection Type
Job Name: newjob
Open Create
Command Line:
Job Information
Notes
OK Cancel Help
3. Choose a name for the load job and type it in the Job Name text box.
This example uses newjob.
4. Click OK.
The Load Job window appears, as Figure 2-3 illustrates.
Figure 2-3
The Load Job Window
Load Job
Filter
Discard Records
Map
Logfile
Table Options
Message:
Task Click
Selection Type
Current Arrays
Notes
OK Cancel Help
3. Select a name for the device array and type it in the Device Array text
box.
This example uses an_array.
4. Click OK.
The device-array definition window appears, as Figure 2-5
illustrates.
Print Notes
Array Items
Add
Edit
Delete
OK Cancel Help
Figure 2-6
The Format Views Window
Format Views
Formats
Search Load Maps Unload Maps
NONE FOUND
Message: Click on a format name to see maps which reference the format
Mode Formats
Fixed
Delimited
COBOL
Notes
Message:
OK Cancel Help
3. Choose a name for your format and type it in the Create Format text
box.
This example uses the name a_format.
4. Click OK.
The format-definition window appears. Figure 2-8 illustrates a
partially completed format-definition window. The title bar of the
format-definition window shows the name that you chose for the
new format.
Name Type
input2 Chars Perform
Add
Insert
Edit
Delete
OK Cancel Help
The Load Job window now displays the name of your device and the name
of your format, as Figure 2-9 illustrates.
Figure 2-9
Partially Completed Load Job Window
Load Job
Filter
Discard Records
Map
Logfile
Table Options
Message:
Chapter 10, “Defining Filters,” describes how to create and use a filter.
“Viewing the Status of a Load Job or Unload Job” on page 14-9 describes how
to view the log file.
NONE FOUND
2. Click Create.
The Load Record Maps window appears, as Figure 2-11 illustrates.
Open Create
Notes
Selection
OK Cancel
OK Cancel Help
input1 col3
input2 col2
input3 col1
Figure 2-12 shows the map-definition window. The title bar of this window
shows the map name that you chose.
Figure 2-12
The Map-Definition Window
a_map
col1 input1
col2 input2
col3 input3
Message: Drag and drop columns/fields between windows to assign data transfers between database/file
input3
col1 input1
col2 input2
col1
col3 input3
Message: Drag and drop columns/fields between windows to assign data transfers between database/file
input3 col3
col1 input1
input2 col2
col2 input2
input1 col1
col3 input3
Message: Drag and drop columns/fields between windows to assign data transfers between database/file
The Load Job window now has entries in all of the required areas, as
Figure 2-15 illustrates. The ipload utility was able to fill in the Table and the
Target Database (upper right area) because you specified the database and
table as you built the map.
Figure 2-15
The Load Job Window with All Required Component Boxes Completed
Load Job
Filter
Discard Records
a_map
Map
Logfile
tab1
Table Options
Message:
You have finished all of the required parts of the Load Job window, but you
might want to modify the options, as discussed in the next section.
Tapes: 0
Number Records: 0
Start Record: 0
Max Errors: 0
Commit Interval: 0
Message:
OK Cancel Help
When the Active Job window reports that the load job is complete, click OK
to return to the Load Job Select or Unload Job Select window.
If you do not care about data recovery, you can make a level-0 backup using
/dev/null as the backup device. This action unsets the read-only flag without
backing up data to any real device.
Generate Example
The ipload utility has Generate options that you can use to automatically
create a format, map, query, and device. After the components are generated,
you can modify the components to meet your needs. The Generate options
are described in Chapter 13, “Generate Options.”
This example uses the Generate button in the Unload Job window to create
the components that are required for an unload job. After you create the
components, you can use the Run option to execute the unload job.
The generate example uses the Generate option to unload the contents of the
items table of the stores7 database into a file named /work/items_out. For
instructions on how to create the stores7 database, refer to the Informix Guide
to SQL: Reference.
3. Choose a name for the unload job and type it in the Job Name text
box.
This example uses the name unld.
Selection Type
Job Name: unld
Open Create
Command Line:
Job Information
Notes
OK Cancel Help
4. Click OK.
The Unload Job window appears, as Figure 2-19 illustrates. The
information box in the upper right part of the display shows the
name of the unload job, the name of the database server where the
onpload database is stored, and the name of the database server
where ipload is running.
Figure 2-19
The Unload Job Window
Unload Job
Discard Records
Format
Logfile
Device Options
Message:
6. Click Table.
You can unload an entire database table or only selected records from
the table. Table indicates that you want to unload the entire table.
Query indicates that you want to unload selected records.
7. Type stores7 in the Database text box.
For this step and steps 8 and 10, you can click the down arrow to the
right of the text box and select your entry from a selection list.
Figure 2-11 on page 2-22 shows an example of a selection list.
8. Type items in the Table text box.
Query:
Unload to
Device Array
/work/items_out
File
OK Cancel Help
9. Click File.
File indicates that you want to enter the name of a file. If you choose
Device Array, you must type the name of an already existing device
array.
10. Type the full pathname of the file that will store the unloaded data.
This file can be in any directory to which you have write access.
11. Click OK.
The Generate option creates the Query, Format, and Map components for the
unload job and fills in the Unload Job window. These components are all
named unld. The Generate option also creates a device array named unld
and puts the file that you specified (/work/items_out) into that array.
Tip: After you finish this exercise, you can choose Components➞Devices from the
HPL window and examine the unld device array.
Figure 2-21 shows the Unload Job window as completed by the Generate
option.
Figure 2-21
The Unload Job Window
Unload Job
unld /tmp/unld.rej
Discard Records
Format
unld /tmp/unld.log
Logfile
Device Options
Message:
In addition to completing the main flow of the Unload Job window, the
Generate option also fills in the Source Database information in the upper
right-hand corner and creates pathnames for the Discard Records file and the
Logfile. Chapter 14, “Browsing,” describes the rejected records file and the
log file.
After you issue the ipload command, a decorative splash screen appears that
stays on the display while the ipload utility finishes loading. If you do not
want to see the splash screen, use the -n flag, as follows:
ipload -n
High-Performance Loader
Figure 3-1
The HPL Main
Jobs Browsers Components Configure Help Window
Select Project
<default>
■ You can select the default project in the Select Project list.
■ You can choose Configure➞Project to create a new project. For infor-
mation on how to create a project, refer to “Creating a New Project”
on page 4-7.
■ You can choose Configure ➞Server to select a database server and an
onpload database server. For information about choosing a database
server, refer to “Selecting a Database Server” on page 5-3.
■ You can choose Help to look at the on-line help.
■ You can choose Jobs➞Exit to exit from ipload.
Jobs Load Create a load job and use the Load Job window to load data 12-3
into a database
Unload Create an unload job and use the Unload Job window to unload 11-6
data from a database to a file
Browsers Record Review records in a specified format, search the list of available 14-7
formats, or edit a format
Violations View records that passed the filter and conversion but were 14-8
rejected by the database
Logfile View load status and see where any errors occurred 14-9
Maps Create or modify maps that show the relationship between 9-3
data-file fields and database columns
Filter Create or modify filters that determine source data-file records 10-3
for conversion and load
Devices Specify a set of files, tapes, or pipes that will be read simulta- 6-3
neously for loading or unloading the database
Generate Job Automatically generate the components for load and unload 13-3
jobs
Configure Server Select the database servers that hold the onpload database and 5-3
the target database
Project Create a project under which formats, filters, queries, maps, 4-3
and load and unload jobs are stored
Defaults Specify the default character sets for the data file and databases 5-5
Machines Specify the machine parameters that are used to convert binary 5-8
data
Help Glossary View definitions of terms that pertain to the HPL 3-33
Contents View the main contents page that directs you to discussions of 3-33
various HPL topics
(2 of 2)
The details of a selection window vary depending on the operation that you
are performing. However, the component-selection windows have the
following standard features:
■ Toolbar buttons
■ Selection group
■ Component-name text box
■ Component list box
■ Notes area
■ Message line
■ Buttons
Figure 3-2 shows the Device Array Selection window to illustrate the
standard features of component-selection windows.
Figure 3-2
The Device Array Selection Window
Device Array Selection
Toolbar buttons
Current Arrays
array_one
cnvt894
largest
Component list box
personnel
sales_sum_out
Notes
Notes area
Before you can type a name in the Device Array text box, you must click
inside that text box to activate it. When the text box is active, it has a narrow
black border. If you type a character that is not valid, the interface beeps at
you, displays a message on the message line, and refuses to display the
invalid character.
The Buttons
The buttons across the bottom of the display let you indicate your next action.
For a more complete discussion, see “Using the HPL Buttons” on page 3-20.
■ Toolbar buttons
■ Item-selection group
■ Item-name text box
■ Special-parameters group
■ Item list box
■ Perform group
■ Message line
■ Buttons
Toolbar buttons
Print Notes Item-selection group
In the device-array definition window, the item-name text box is labeled Tape
Name, File Name, or Pipe Name, depending on the type of component that
you select from the Array Item Type group.
The Buttons
The buttons across the bottom of the display let you indicate your next action.
For a more complete discussion, see “Using the HPL Buttons” on page 3-20.
Filter
Discard Records
Map
Logfile
Table Options
Message:
Refer to
Window Name Purpose How to Access Page
Format Views Show the load and unload ■ Click Search in the Record Formats 2-13
maps that are associated with window
a particular format
■ Click Format in the Load Job window*
■ Click Format in the Unload Job window*
Map Views Show the databases, tables, ■ Click Search in the Load Record Maps 9-20
queries, and formats that are window
associated with a map 9-11
■ Click Search in the Unload Record Maps
window
■ Click Map in the Load Job window*
■ Click Map in the Unload Job window*
Database Views Show the tables in the ■ Click Search in the Query window 8-5
database or the queries that ■ Click Table in the Load Job window*
are associated with the
database ■ Click Query in the Unload Job window*
Filter Views Show the formats that are ■ Click Search in the Filter window 10-11
associated with a particular ■ Click Filter in the Load Job window*
filter
* These options display the View window only if the corresponding text box is empty. If the text box
*includes the name of a component, the component-definition window is displayed.
You can use the following wildcard search characters in the search text string.
For example, type unj100? to display components that are named unj100a,
unj100b, unj1001, and so on. The expression unj100? does not match
unj100aaa, unj100ab, or unj10015. However, the expression unj100* does
match unj100aaa, unj100ab, or unj10015 because the * symbol matches
multiple characters.
Formats
Search Load Maps Unload Maps
customer_del
items_fixed
Message: Click on a format name to see maps which reference the format
When you click an icon label in the Formats pane, the view expands to show
maps that are related to your choice. Figure 3-6 shows the expanded view.
Figure 3-6
Expanded View of a Format
Format Views
Formats
Search Load Maps Unload Maps
items_fixed
Message: Click on a format name to see maps which reference the format
You can click the desired icon to display a definition window for any format
or map that is shown.
Figure 3-7 shows the selection list that is available for the Machine Type text
box in the Defaults window. After you select an item in the list box, click OK,
and the item appears in the text box on the original window.
Figure 3-7
The Defaults Window and a Selection List
Defaults
Selection
Sparcstation
OK Cancel
Tip: If your entry is rejected, look at the selection list. Your entry is invalid if it is not
available in the selection list.
Selection-list windows are available for many text boxes throughout the HPL
user interface. These windows have various names, but this document refers
to them as selection lists.
OK
Toolbar Buttons
Toolbar buttons appear at the top of many windows. The function of the
window determines which buttons appear. The following sections describe
the toolbar buttons. Buttons that appear in only one window are described
with the specific window.
Button Refer to
Button Name Purpose Page
(1 of 2)
Button Refer to
Button Name Purpose Page
You can copy one component at a time, or you can select and copy multiple
components at the same time. You can copy components that are grouped
under a project (filters, formats, maps, and queries) within the same project
or to a different project.
If you copy a component within a project, you must give the copy a different
name. If you copy a component to a different project, you can retain the name
for the copy or give the copy a different name. If you copy multiple compo-
nents, you must copy them to a different project. When you copy multiple
components, the components retain their names.
Important: Devices are not project specific. When you copy a device, you must give
the copy a new name.
1. In the HPL main window, select the project that includes the format
that you want to copy.
2. Choose Components➞Formats to access the Record Formats
window.
For an example, see “Creating a Fixed Format” on page 7-5.
3. Select the format that you want to copy.
This example assumes that the format to copy is some_format.
<default>
practice
stores7
OK Cancel Help
1. In the HPL main window, select the project that includes the format
that you want to delete.
2. Choose Components➞Formats to access the Record Formats
window.
For an example, see “Creating a Fixed Format” on page 7-5.
3. Select the format that you want to delete.
4. Click the Delete button.
The Confirm Delete window appears, as Figure 3-10 illustrates. The
Confirm Delete window describes the impact of deleting this format.
The text in this window is different for each of the component types.
Figure 3-10
The Confirm Delete
Window
PLEASE CONFIRM FORMAT(S) DELETE!
OK Cancel Help
To create a note
OK Cancel
If you do not make any changes to a note, click Cancel instead of OK.
For example, the note created in Figure 3-11 is associated with the authors
format. The next time you go to the Record Formats page and select authors,
ipload displays the note text, as Figure 3-12 illustrates.
Mode Formats
Open
Open Format: authors
Create
Format Type
Type authors Fixed
characters Delimited
Fixed
plot Fixed
Delimited plot_copy Fixed
COBOL
Notes
This note is associated with the “authors” format.
Message:
OK Cancel Help
The ipload utility stores the information that you type in the Notes window
in the note table of the onpload database. For a description of the note table,
refer to “The note Table” on page A-15.
If you click the Print button in the map-definition window in Figure 2-14 on
page 2-26, the following printout results:
-------------------------------------------------------------------------------
LOAD MAP REPORT
-------------------------------------------------------------------------------
Project : <default>
Name : a_map
OPTIONS
Icon Buttons
Icon buttons appear in the middle sections of the Load Job and Unload Job
windows and Views windows. The icon buttons represent various compo-
nents. When you click it, each button opens another display. The following
table shows and describes the icon buttons that are used in these windows.
The device or Load Job ■ If the text box is empty, click the Device
device array where Unload Job button to display the Device Array Selection
the source files are window, where you can create or open a
located device type.
■ If the text box has an entry, click the Device
Device button to display the device-array definition
window for that specific device or type the
name of a different device in the text box.
The filter that Load Job ■ If the text box is empty, click the Filter
controls which Filter Views button to display the Filter Views window,
records are selected where you select a filter and associated
from the data file format. You can also create a filter from this
for a database window.
Filter update (The use of a
filter is optional.) ■ If the text box has an entry, click the Filter
button to display the filter-definition
window for that specific filter or type the
name of a different filter in the text box.
■ In the Filter Views window, click the Filter
button to display the filter-definition
window for a specific filter.
(1 of 3)
The format of the Load Job ■ If the text box is empty, click the Format
source data used for Unload Job button to display the Format Views window,
this load or unload where you can select a format and
associated map. You can also create a format
from this window.
Format ■ If the text box has an entry, click the Format
button to display the format-definition
window for that specific format or type the
name of a different format in the text box.
■ In all Views windows, click the Format
button to display the format definition for a
specific format. In these windows, the
button shows only one of the three symbols
(F, D, C) to indicate whether the type of
format is fixed, delimited, or COBOL.
The map that corre- Load Job ■ If the text box is empty, click the Map button
lates fields of the Unload Job to display the Map Views window, where
data source to you can select a map and associated table
database columns Map Views and format. You also can create a map from
Format Views this window.
Map Database Views ■ If the text box has an entry, click the Map
button to display the map-definition
window for that specific map or type the
name of a different map in the text box.
■ In a Views window, click the Map button to
display the map-definition window for a
specific map.
The options that let Load Job ■ Click the Options button to display the
you specify charac- Unload Job Mapping Options window. For a discussion
teristics of the load of these options, refer to “Changing the
or unload Load Options” on page 12-13.
Options
(2 of 3)
The query that Unload Job ■ If the text box is empty, click the Query
selects data from Database Views button to display the Database Views
S Q L the database table window from which you can select the table
Map Views and associated map and format.
■ If the text box has an entry, click the Query
Query button to display the query-definition
window for that specific query or type the
name of a different query in the text box.
■ In a Views window, click the Query button
to display the query-definition window for a
specific query.
The database table Load Job ■ Click the Table button to display the
into which the Database Views Database Views window from which you
converted data will can select the table and associated map and
be loaded Query Definition format. If an association is not apparent,
click Create to create one.
Table ■ Click the Table button in the query
definition window to choose a table and
columns for the Select entry.
(3 of 3)
Buttons
The buttons across the bottom of the display let you indicate the next action.
Most windows have one or more of the following buttons.
Button Action
Use OK only when you have actually made a change on the display. If you
are exiting from a series of displays, use Cancel to exit from the display.
Figure 3-13 illustrates the use of OK and Cancel.
Figure 3-13
Using OK and Cancel from the HPL Main Window
Click Cancel to exit from the Edit the array. Click OK to record
Device Array Selection window the changes and return to the
and return to the HPL main Device Array Selection window.
window.
■ Glossary
■ Contents
The Glossary option opens a scrolling list of items. Select an item to see its
definition. The Contents option takes you to the main contents page. This
page directs you to discussions of various HPL topics.
If you click Help in any window other than the HPL main window, Help
displays information that is related to the current window. After the Help
window opens, you can click its Help button for more information about
using the Help window.
Keystroke Result
TAB Move from area to area. Sometimes used to move from tab stop to
tab stop.
SHIFT-TAB Back up; that is, move from area to area in reverse order.
CONTROL-TAB Move from area to area when TAB is reserved to move from tab
stop to tab stop.
Most displays in the HPL user interface are divided into functional areas,
such as toolbar buttons, selection group, component-name text box,
component list box, and so on. Depending on the nature of the specific dis-
play, sometimes TAB moves from item to item (or even from tab stop to tab
stop) within a major area. On other displays, TAB moves only between func-
tional areas, and you must use SPACEBAR to move around within the
functional area.
Defining Projects
4
Project Organization . . . . . . . . . . . . . . . . . . 4-3
The Projects Window . . . . . . . . . . . . . . . . . 4-6
Creating a New Project . . . . . . . . . . . . . . . . 4-7
Selecting a Project . . . . . . . . . . . . . . . . . . 4-7
4-2 Guide to the High-Performance Loader
T he HPL lets you organize your work by specifying projects. A project
is a collection of individual pieces that you use to load and unload data. A
project can include load and unload jobs and the maps, formats, filters, and
queries that you use to build the load and unload jobs. This chapter explains
how to create a project and how projects are related. The individual compo-
nents that you store in projects are described in later chapters.
Project Organization
The HPL uses only one database, onpload, to keep track of the preparation
that you do for loading and unloading data. Using projects lets you organize
your work into functional areas. For example, you might regularly transfer
data to or from several unrelated databases. You could put all of the prepa-
ration for each database into a separate project.
When you first start the ipload utility, ipload creates a project named
<default>. If you prefer, you can select the <default> project and assign all
of your work to that project. The HPL does not require that you create any
additional projects. However, creating projects and putting separate tasks
into distinct projects makes your work easier to maintain.
Figure 4-1 shows the relationships among projects, jobs, and components.
Figure 4-1
Illustration of Project Hierarchy
High-Performance Loader
Figure 4-1 shows that jobs are linked directly to the projects. The format,
map, filter, and query components belong to a project but are not directly
linked to a job, as illustrated with Project one. In general, you create a format,
map, and filter or query for each job, as shown with Project two. However, in
some cases, you might use the same component for more than one job within
a project.
For example, for reports about a medical study, you might want to create
three reports: one about subjects under 50 years of age, one about subjects
over 50, and one about all subjects. In that case, the description of how to find
the information (the format and map) is the same for all three reports, but the
selection of information (the query) is different for each report. (Formats,
maps, and queries are described in detail in later chapters.)
All components (maps, formats, queries, filters, and load and unload jobs)
that you create in a project are associated with that project in the onpload
database. Components that are associated with a project are visible (usable)
only when the project is selected. When you select a different project, a
different set of components becomes available.
High-Performance Loader
Configuration
Project one Project two Devices
parameters
Device1 Defaults
Device2 Driver
Job one_1 Job one_2 Job two_1 Job two_2
Device3 Machines
(table1) (table 2) (table A) (table A)
Projects
<default>
practice
stores7
Create Project:
Notes
Message: Enter project name to create, or select project to copy, delete, or print
If you want to create one project and then exit, click OK instead of Apply.
Selecting a Project
The HPL provides two methods for selecting a project.
1. Select the project name from the Select Project list box in the HPL
main window.
2. Choose the action that you want to take from one of the menus on the
HPL main window.
The sqlhosts file controls connectivity to database servers. The ipload utility
scans the sqlhosts file to derive the lists of available database servers that the
Connect Server window displays. For more information on how to configure
connections, refer to your Administrator’s Guide.
svr1 svr1
server_spx server_spx
server_two server_two
personnel personnel Configure Server
OK Help
OK Cancel Help
2. Select the database server where the onpload database resides from
the Onpload Server list box.
3. Select the database server that includes the database that you will
load or unload from the Target Server list box.
4. Click OK.
The Configure Server confirmation window appears, as Figure 5-1
illustrates.
5. Click OK in the Configure Server window to return to the HPL main
window.
The default name of the database that the HPL uses is onpload. To give some
other name to the HPL database, set the DBONPLOAD environment variable.
Refer to “The DBONPLOAD Environment Variable” on page 1-13.
■ Server name
■ Machine type
■ Data code set
The ipload utility saves the information from the Defaults window in the
defaults table of the onpload database. For more information about the
defaults table, see page A-2.
Tip: You can use DB-Access to examine the default values. The following tables in
the onpload database contain default values: defaults, delimiters, driver, and
machines.
Server Name
The Server Name text box specifies the database server with which the
settings are associated. The information provided for the special server name
default applies to all database servers for which no explicit information is
provided. For example, if the majority of the database servers on your
network (that will be using the HPL) are BrandX computers, default should
describe the BrandX computers. To describe the computing environment of
the other database servers on the network, specify the database server name.
The selection list that is associated with the Server Name text box lists the
database servers that are in your sqlhosts file. For information about the
sqlhosts file, refer to your Administrator’s Guide.
Machine Type
The Machine Type text box describes fixed-length, binary-format records. It
defines the sizes and byte order of data in data files that the specified
database server produces. The selection list that is associated with the
Machine Type text box provides descriptions of several computers. You can
use the Machines option on the Configure menu to add descriptions of other
computers to this list (refer to “Modifying the Machine Description” on
page 5-8).
GLS You can select a desired GLS code set from this selection list. The character set
of the database is determined by the DB_LOCALE environment variable. For
information about locales and code sets, see the Informix Guide to GLS
Functionality. ♦
If you want to prepare the defaults for only one database server, click OK
instead of Apply.
When you first start the ipload utility, ipload stores the characteristics of
several computers. You can select one of the existing computer types, modify
an existing description, or create a new machine description.
You use the information from the Machines window when you prepare the
defaults for the database servers on your network. (See “Changing the
onpload Defaults” on page 5-7.) The information from the Machines window
is stored in the machines table of the onpload database. (For more infor-
mation on the machines table, see page A-11.) The default information for the
HPL includes descriptions of the binary data sizes for several popular
computers. If the default data does not include the computer from which you
are reading data, you can create a description for that computer.
Short Size: 2
Integer Size: 4
Long Size: 4
Float Size: 4
Double Size: 8
Item Description
Machine Type Name for the computer that this entry describes
Byte Order Bit ordering of binary information for this computer. The two
possible formats are LSB and MSB. In the LSB format, the least-
significant bits of a value are at lower memory addresses. In the
MSB format, the most-significant bits of a value are at lower
memory addresses.
Item Description
If you want to modify the description of only one computer, click OK rather
than Apply.
If you want to add only one computer type, click OK rather than Apply.
Device Arrays
The HPL lets you use device arrays to group computer resources to perform
parallel processing. Device arrays set up simultaneous access to one or more
tape devices, files, or pipes so that the onpload utility can take advantage of
parallel processing.
Device arrays are not project specific. You can use the same device array for
a load or unload job on any of the projects that you define.
When the HPL unloads data, it assigns records to the devices of a device array
in a round-robin fashion.
If you select an existing array, you can edit that array or use one of the toolbar
buttons to copy, delete, or print the array.
Selection Type
Current Arrays
largest
personnel
sales_sum_out
Notes
OK Cancel Help
Print Notes
Array Items
Add
Edit
Delete
OK Cancel Help
Print Notes
Tape Device:
Array Item Type
Defining Formats
7
Formats . . . . . . . . . . . . . . . . . . . . . . . 7-3
Fixed-Length Records . . . . . . . . . . . . . . . . . . 7-4
Creating a Fixed Format. . . . . . . . . . . . . . . . 7-5
Data Types Allowed in a Fixed Format . . . . . . . . . 7-7
Bytes . . . . . . . . . . . . . . . . . . . . . 7-8
Decimals. . . . . . . . . . . . . . . . . . . . 7-8
Editing a Format . . . . . . . . . . . . . . . . . . 7-9
Creating a Fixed Format That Uses Carriage Returns . . . . . . 7-11
Creating a Fixed Format That Includes BYTE or TEXT Data . . . 7-12
In-Line Data . . . . . . . . . . . . . . . . . . 7-12
Data in a Separate File . . . . . . . . . . . . . . . 7-14
Delimited Records . . . . . . . . . . . . . . . . . . . 7-15
Creating a Delimited Format . . . . . . . . . . . . . . 7-15
Data Types Allowed in a Delimited Format . . . . . . . . 7-16
Creating a Delimited Format That Includes BYTE or
TEXT Data . . . . . . . . . . . . . . . . . . . 7-16
This chapter describes the formats that the HPL provides and shows how to
prepare and edit the format component.
After you familiarize yourself with the concepts in this chapter, you might
save yourself some work by using one of the Generate options to create
formats automatically. For a description of these options, refer to Chapter 13,
“Generate Options.”
Formats
Data files can be structured in a variety of ways. The HPL supports data-file
records of the following formats:
■ Fixed-length
■ Delimited
■ COBOL
■ Other formats
You can define new format components at any time. Also, you can test your
format before you actually load or unload data. For information about testing
a format, refer to “Previewing Data-File Records” on page 14-3.
The ipload utility includes options that let you modify the data before it is
inserted into the database. For information about how to modify data, refer
to “Format Options” on page 7-21.
The ipload utility stores information about formats in the formatitem and
format tables of the onpload database. For more information about the
formatitem and format tables, see page A-7 and page A-9, respectively.
Important: To prepare the format component, you must know the format of the
records in the data file. If you do not know the data-file format, you must get it from
the person who provided the data file.
Fixed-Length Records
In fixed-length or fixed-format records, each field starts and ends at the same
place in every record. A data file that contains data records of equal and con-
stant length might be organized as Figure 7-1 illustrates.
Figure 7-1
Sample File with
aaabbbbcccddddggghhhh Fixed-Length
Records
The data file illustrated in Figure 7-1 has three records. Each record has a field
of three characters followed by a field of four characters, so the total record
length is seven characters. The file does not contain any separation between
records.
When you define a fixed-length format, you specify the length of each field.
The ipload utility calculates the offset for each field and the total length of the
record from the field lengths that you supply.
Mode Formats
Open
Create Format: a_format
Create
Format Type
Type
Fixed
Delimited
COBOL
Notes
Message:
OK Cancel Help
4. Choose a name for the format and type it in the Create Format text
box.
5. Click OK.
The Fixed Format definition window appears. The title bar includes
the name that you chose for the format. Figure 7-3 shows the Fixed
Format definition window as it might appear after you prepare the
format for the file that Figure 7-1 on page 7-4 illustrates.
Figure 7-3
A Completed Fixed-Format Definition Window with an Open Selection List
Fixed Format - a_format
OK Cancel
Short The number of bytes required in fixed format for integers and
Unsigned Short floating-point values is specified by the Machines description
Integer (Refer to “The Machines Window” on page 5-9.)
Unsigned Integer When you select one of these data types, ipload sets the
Long Integer number of bytes.
Unsigned Long
Float
Double
UNIX Date A long integer interpreted as the system date from a UNIX
system
Blob Length The number of bytes of BYTE and TEXT (binary large object)
information that follow this record
Decimals
In Figure 7-3 on page 7-6, the Decimals text box specifies the number of
decimal places that are displayed when you convert floating-point types to
ASCII. You can set the number of decimals only for the Float and Double data
types.
Editing a Format
After you create and save a format, you might need to add a new field, insert
a new field, edit a field, or delete a field. The process for editing an existing
format is essentially the same, regardless of the file type. The following
example uses a fixed-format file, but the same procedure applies to COBOL
and delimited files also.
6. Click OK.
The ipload utility saves your changes and returns to the Record
Formats window.
7. Click Cancel to return to the HPL main window.
When you prepare the format for this data file, you must include a dummy
field for the carriage return. When you create the load map for this format
(“Load Maps” on page 9-4), do not link the dummy field to a database col-
umn. Figure 7-5 shows the format for the data file illustrated in Figure 7-4.
OK Cancel Help
■ In-line data
■ Data in a separate file
In-Line Data
BYTE or TEXT data that is included as part of a fixed-format data file is called
in-line data. When BYTE or TEXT data is in-line, the data-file record has two
parts: a fixed-length part and a variable-length part. For example, a record
with two fields and BYTE or TEXT data might be organized as Figure 7-6 illus-
trates.
Figure 7-6
Organization of a
field1 textlength field2 textdata
Record that
Includes In-Line
TEXT Data
The length of the TEXT data is included in the fixed-length part of the record.
The actual TEXT data is inserted at the end of the fixed-length part of the
record. The HPL reads the TEXT length from the fixed-length part of the
record and uses that length to read the actual TEXT data. The HPL also uses
the TEXT length to calculate the offset to the beginning of the next record.
Figure 7-7 on page 7-13 illustrates the format definition of a record with in-
line BYTE and TEXT data. The arrows show how the HPL puts the record into
the database. The arrows from field 1 and field 2 indicate entries in fixed-
length format. The split arrow shows that the HPL uses the TEXTlength
information to find the TEXT data and insert it into the table. The HPL does
not insert the TEXT length into the database.
Figure 7-7
In-Line TEXT Data
When you define the format in the format-definition window, select Blob
Length as the data type for the TEXTlength field. Figure 7-8 shows the format
for the example in Figure 7-6 on page 7-12. The format does not include an
entry for TEXT data.
When you create a map to link the input fields that are defined by the format
to the columns of a database table (see Chapter 9), connect the TEXTlength
input field to the table column that contains the TEXT data.
file
When you create a map to link the fields of the input record to the columns
of a database table (see Chapter 9), link the name of the BYTE or TEXT file with
the BYTE or TEXT column. The arrows in Figure 7-9 illustrate how the HPL
inserts the BYTE or TEXT data into the column.
Delimited Records
Delimited records are records whose fields can vary in length. In a data file that
contains delimited records, the records and fields are separated by a delimiter.
The following data file uses a vertical bar (|) as the field delimiter and a
carriage return as the record delimiter:
John Brown|100 Main St.|Citadel|LA|215/887-1931
Mary Smith|3141 Temple Way|Chesapeake|AZ|415/812-9919
Larry Little|44 Elm Rd. # 6|Boston|MA|617/184-1231
The ipload utility uses the vertical bar and carriage return as the default field
and record delimiters. For instructions on how to choose a different delimiter,
refer to “Modifying Delimited-Format Options” on page 7-22.
TEXT Data TEXT data is formatted as ASCII text. If the text includes
carriage returns (new lines) or delimiters, a backslash (\)
must precede those characters.
Figure 7-11 illustrates a format for the file in Figure 7-10 on page 7-16.
OK Cancel Help
COBOL Records
The HPL supports COBOL sequential data files that do not contain internal
indexing. Figure 7-12 illustrates the COBOL-Format definition window for
preparing a COBOL format.
Add
Insert
Edit
Delete
Record Length: 58
OK Cancel Help
Packed-Decimal Conversions
When values are converted to packed-decimal formats, supply a picture
clause that matches the picture clauses in the COBOL programs that use the
data. Otherwise, the COBOL interpretation of the values will be wrong.
Other Formats
In addition to delimited, fixed, and COBOL formats, the HPL provides two
other formats for loading and unloading data: fast format and fast job. These
formats are not included on the Record Formats window because the format
specifications are predefined; you do not need to make any choices.
Fast format and fast job are the most efficient ways to load and unload data
because their formats are predefined.
Fast Format
Fast format loads or unloads data in which each individual column uses
Informix internal format. You can reorder, add, or delete columns, but you
cannot do any kind of conversion on the column itself.
Select Fixed internal in the Generate window to get this type of load. For
information about the Generate window, refer to Chapter 13, “Generate
Options.”
Fast Job
A fast job loads or unloads an entire row of an Informix database table in
Informix internal format. A fast job is also called a raw load or a no conversion
job. For more information, refer to “The Format Type Group” on page 13-12.
The -fn flag of the onpload command-line utility specifies a fast job. For
information about the onpload utility, refer to Chapter 16, “The onpload
Utility.”
Format Options
The format options let you change the default driver, the character set, the
default computer type, and the delimiters. Information about the format
options is stored in the formats table of the onpload database. For more
information about the formats table, see page A-9.
Option Description
Character set The code set that is used to translate the data in the data table
Machine The machine type that produced the data files. For more informa-
tion, refer to “Modifying the Machine Description” on page 5-8.
GLS For a fixed format, you can select a desired GLS code set from the Character
Set selection list. For information about locales and code sets, see the Informix
Guide to GLS Functionality. ♦
Driver: Fixed
Machine: Sparcstaton
OK Cancel Help
Option Description
Character set The code set used to translate the data in the data table.
Delimiting The delimiting characters, which are sometimes called record separa-
characters tors and field separators, indicate the beginning and end of records
and fields.
You can specify the delimiting characters in ASCII, HEX, OCTAL, or
DECIMAL format.
GLS You can select a desired GLS code set from the Character Set selection list. For
information about locales and code sets, see the Informix Guide to GLS
Functionality. ♦
OK Cancel Help
■ When you click Format in the Unload Job window and no format
name is in the Formats text box
■ When you click Search in the Query window
Figure 7-15
The Format-Views Window
Format Views
Formats
Search Load Maps Unload Maps
customer_del
items_fixed
Message: Click on format name to see maps which reference the format
Defining Queries
8
Queries . . . . . . . . . . . . . . . . . . . . . . . 8-3
Creating a Query . . . . . . . . . . . . . . . . . . . 8-4
Using the Table Button . . . . . . . . . . . . . . . . 8-7
Editing the WHERE Clause . . . . . . . . . . . . . . 8-11
Selected table
onpload Query
Target database
Extracted records
onpload database
Data file
Queries
The ipload query component lets you build an SQL statement. This manual
uses the word query in two ways:
■ To refer to the SQL statement that selects information from the
database
■ To refer to the HPL component that lets you build and store the SQL
statement
The ipload utility stores query information in the query table of the onpload
database. (For more information about the query table, see page A-16.) The
SQL statement is stored as TEXT data.
Creating a Query
Use the Query window to create a new query.
To create a query
1. Choose Components➞Query from the HPL main window.
The Query window appears, as Figure 8-2 illustrates.
2. Click Create in the Selection Type group.
3. Choose a name for your query and type it in the Query text box.
4. In the Database text box, type the name of the database that contains
the table(s) from which you want to extract data, or click the down
arrow to select from a database selection list.
Figure 8-2 shows the Query window with the Query text box
completed and stores7 selected from the selection list.
Selection Type
Selection
stores7
OK Cancel Help
5. Click OK.
The query-definition window appears, as Figure 8-3 on page 8-6
illustrates. The name that you chose for your query appears in the
title bar.
6. Type your query in the Select, From, and Where text boxes.
Figure 8-3 illustrates the following simple query against the
customer table of the stores7 database:
SELECT customer.fname, customer.lname,
customer.zipcode
FROM customer
WHERE zipcode > 50000
If you prefer, you can type the entire query into the Select text box. If
you later edit the query, ipload divides the query into SELECT, FROM,
and WHERE clauses.
Database: stores7
Select
customer.fname, customer.lname, customer.zipcode
From
customer
Where
zipcode> 50000
Message: Enter select, from, and where part of select query in appropriate window
OK Cancel Help
SELECT ALL
OK Cancel
SELECT ALL
OK Cancel
test_query
Figure 8-6
The Query-
Definition Window
After Using the
Table Button
Save As Notes Print File Table
Database: stores7
Select
customer.customer_num, customer.fname, customer.lname, customer.zipcode
From
customer
Where
Message: Enter select, from, and where part of select query in appropriate window
OK Cancel Help
Database: stores7
Select
customer.customer_num, customer.fname, customer.lname, customer.zipcode
From
customer
Where
customer.zipcode=? and customer.customer_num=?
Message: Enter select, from, and where part of select query in appropriate window
OK Cancel Help
Editing a Query
To edit a query, follow the same steps as for creating a query, but open an
already existing query in the Query window.
To edit a query
Importing a Query
You can use the Import/Export File Selection window to import a query that
you prepared outside of the HPL.
To import a query
Selection
/work/data/newquery.sql
Import Export
3. Click Import.
4. Specify the file that you want to import.
You can do this in either of the following ways:
■ Type a pathname and appropriate wildcard(s) in the Filter text
box and click Filter. Use an asterisk (*) to list all of the files in the
directory. Then select a file and click OK or double-click a
filename.
■ Type the full pathname in the Selection text box and then click
OK.
The text from the imported file appears in the query-definition
window.
If ipload can interpret the SQL statement, the SQL statement is
inserted into the appropriate Select, From, and Where text boxes.
If ipload cannot interpret the SQL statement, the entire content of the
imported file appears in the Select text box.
Exporting a Query
The File button also allows you to export the query as an SQL statement. You
can prepare a query for export in the following ways:
To export a file
5. Click OK.
If the file that you specified already exists, ipload asks if you want to
overwrite the existing file, as Figure 8-9 illustrates.
OK Cancel
■ When you click the Query button in the Unload Job window and no
query name is in the Query text box
■ When you click the Search button in the Query window
Figure 8-10 shows the Database Views window. “The Views Windows” on
page 3-15 discusses how to use Views windows.
Figure 8-10
The Database Views Window
Database Views
Defining Maps
9
Maps. . . . . . . . . . . . . . . . . . . . . . . . 9-3
Load Maps. . . . . . . . . . . . . . . . . . . . . . 9-4
Using the Map-Definition Window . . . . . . . . . . . . 9-4
Using the Table and the Format Panes . . . . . . . . . 9-5
Using Unassigned or Multiple-Assigned Fields
and Columns . . . . . . . . . . . . . . . 9-6
Using Identical Field Names and Column Names . . . . . 9-6
Creating a Load Map . . . . . . . . . . . . . . . . . 9-7
Maps
For loading data into a database, you define a load map. A load map associates
the fields from records in a data file to columns in a database table. For
unloading data from a table, you define an unload map. An unload map
associates the columns extracted from one or more tables by a query to the
fields in a data file. Figure 9-1 illustrates these relationships.
Figure 9-1
Using a Map
Contact custname custno State Unload map custno custname State Address
G. Kaye XYZ LTD 1234 CA 1234 XYZ LTD CA
J. Central XSPORTS 1235 KS 1235 XSPORTS KS
The ipload utility stores information about maps in the maps, mapitem,
mapoption, and mapreplace tables of the onpload database. Appendix A,
“The onpload Database,” describes these tables.
Load Maps
You can create a load map from the Load Job window or from the Compo-
nents menu of the High-Performance Loader (HPL) main window. You can
define a map at any time. After you define a map, you use it with the Load
Job window or the onpload utility.
The map-definition window lets you associate an input item with a table
column. Figure 9-2 on page 9-5 shows a map-definition window for a load
map. The map specifies which fields of the data file are loaded into database
columns. The direction of the arrows indicates that data moves from the
fields of a data file into the columns of a database.
Figure 9-2
The Map-Definition Window
manufact
field3 column2
column1
field1 column3
field1
column2
field1 field2
column3 column1
field3
Message: Drag and drop columns/fields between windows to assign data transfers between database/file
■ Scroll the panes to see all of the columns or fields of a long data file
or database table
■ Connect an input field to more than one column
The left-hand column of icons in each pane represents the active elements of
the display. These left-hand columns do not change. In a load map, the
columns in the Table pane receive the input. In the Format pane, data from the
fields moves into the columns of the database table.
The right-hand column of icons in each pane represents the associations that
you make. These columns change as you build the map. A field might be
listed more than once in the right-hand column of the Table pane because
you can store a field from the data file in more than one database column.
This field is mapped (with a split arrow) to two columns in the Format pane.
A column never appears more than once in the right-hand list of the Format
pane because a column can only receive input from one database field.
By scanning the left pane, you can easily see which columns are receiving
data from the data file. By scanning the right pane, you can see which fields
of the data file are providing data and which fields are not being used.
You can also have a column that has no mapping association. Field 1 in the
Format pane in Figure 9-4 on page 9-9 does not have an association. If a
column does not receive input, onpload sets the column to null.
Open Create
Map Data
Map Name:
Database:
Table:
Format:
Notes
OK Cancel Help
4. Type the names of the database and table where the data will be
loaded in their corresponding text boxes.
You can also click the down arrow to choose the names from a
selection list. The Tables selection list includes Synonyms that are
valid for the local database server.
5. Type the format that describes the data file in the Format text box.
You can also click the down arrow to choose the format from a
selection list.
6. Click OK to open the map-definition window.
A map-definition window similar to Figure 9-4 on page 9-9 appears.
7. Click a column icon in the left-hand column in the Table pane and
hold the mouse button down. A box appears around the icon and its
name.
8. Drag the box to a field icon in the Format pane.
When you connect columns to fields, it does not matter whether you
drag a column to a field or drag a field to a column, but you must
always connect items from the left-hand column of each pane.
Figure 9-4 shows a map-definition window with this step completed.
Figure 9-4
Map-Definition Window, One Association Completed
a_map
field3
col1 field1
col2 field2
col1
col3 field3
Message: Drag and drop columns/fields between windows to assign data transfers between database/file
9. Repeat steps 7 and 8 for each field that you want to transfer into the
database.
10. Add desired options, if any.
For instructions, refer to “Using Mapping Options” on page 9-13.
11. Click OK to return to the Load Record Maps window.
Unload Maps
An unload map associates columns extracted from a database by a query
with the fields in a data-file record. You can create an unload map from the
Load Job window or from the Components menu of the HPL main window.
After you define an unload map, you use it with the Unload Job window or
the onpload utility.
Open Create
Map Data
Map Name:
Database:
Query:
Format:
Notes
OK Cancel Help
7. Click OK.
A map-definition window similar to Figure 9-6 appears. In this
figure, some of the field names match column names. The ipload
utility automatically maps columns to fields of the same name. The
direction of the arrows indicates the flow of data, as shown in
Figure 9-6.
Figure 9-6
The Map-Definition Window
manufact
manu_code old_code
manu_name manu_name
manu_name manu_name
lead_time lead_time
lead_time lead_time
Message: Drag and drop columns/fields between windows to assign data transfers between database/file
Mapping Options
The mapping options define conversions that onpload applies to the data
before it inserts the data into the database (for a load job) or into the data file
(for an unload job). These conversions can include case conversion, text justi-
fication, data masking through picture strings, default values, and fill
characters. The mapping options also allow you to replace imported data
with data from other database tables.
Column Offset: 0
Field Offset:
Field Minimum:
Field Maximum:
Fill Character:
Picture:
Function:
OK Cancel Help
When you return to the map window, an options symbol (a small box) appears
between the field and the column, as Figure 9-8 illustrates. The options sym-
bol indicates that mapping options are in effect.
Figure 9-8
Fragment of the
old_code
Map-Definition
manu_code Window Showing an
Options Symbol
manu_name
manu_name
Justification
The Justification option positions text within a record. You can justify the text
to the left or right, or you can center it.
Case Convert
The Case Convert option converts the case of the data to the selected case.
The HPL supports upper, lower, and proper-name conversions. For example,
you can make the following conversions.
Default Value
The Default Value option specifies the value that is inserted into the column
when no field is mapped into that column.
Transfer Bytes
The Transfer Bytes option specifies the number of bytes in the record field to
transfer to the database column.
For variable-length format records, this number reflects the maximum size of
the field. The actual number of bytes to transfer is determined by the record
or field delimiters.
Column Offset
The Column Offset option specifies the offset from the beginning of a
column field at which to start transferring the data from the field of the data
record. Offsets are zero based.
Field Offset
The Field Offset option specifies the offset from the beginning of a record
field at which to start transferring data to the column. Offsets are zero based.
Fill Character
The Fill Character option lets you specify a character that you use to pad the
contents of a field. The fill character can be any character that you can type
on the keyboard. You can specify a fill character for fixed ASCII and COBOL
loads or unloads. The fill character is filled in as a trailing character.
Picture
The Picture option lets you reformat and/or mask data from the field of a
record before the data is transferred to the database. Appendix C, “Picture
Strings,” explains picture strings.
Function
The Function option specifies a user-defined function that is called for every
record that is processed. You must add the function to the dynamically linked
library. For information on using custom functions, see the API interface
documentation in Appendix E.
Editing Options
This section discusses specialized options in the map-definition window.
Format: a_format
input1 col3
input1
Selection
input3
OK Cancel
3. To select the item to find, you can use either of these methods:
■ Scroll through the list box to locate the item that you want to find
and then select the item.
■ Type the name of the item that you want to find in the Selection
text box.
4. Click OK.
The map-definition window appears again. The selected field or
column is highlighted with a box.
OK Help
The Specifications window displays the attributes of columns and fields. The
Specifications window does not allow you to edit the attributes it displays. To
change the attributes of a field, you must modify the format of the data file.
(See “Format Options” on page 7-21.) To change the attributes of a column,
you must use appropriate SQL statements to modify the database table.
■ If you click the Map button in the Load Job or Unload Job window
when no map name is in the Map text box
■ If you click the Search button in the Load Record Maps or Unload
Record Maps window
Figure 9-12 shows the Map Views window for a Load map.
Figure 9-12
The Map Views Window for a Load Map
Map Views
Format: Search
inventory
Map Table Format
stores7
testdb
5. Select a database.
The ipload utility displays a list of the maps associated with that
database, as Figure 9-13 illustrates. The Table and Format columns
show the database column and the format associated with each map.
If you want to edit a specific map or format, click its button and the
corresponding definition window appears.
Figure 9-13
The Map Views Window with the View Expanded
Map Views
Format: Search
stores7
inventory
Map Table Format
testdb
stores7
customer_del customer customer
Defining Filters
10
Using a Filter . . . . . . . . . . . . . . . . . . . . . 10-3
Creating a Filter . . . . . . . . . . . . . . . . . . . . 10-5
Editing a Filter . . . . . . . . . . . . . . . . . . . . 10-8
Filter Views . . . . . . . . . . . . . . . . . . . . . 10-11
Filters with Code-Set Conversion . . . . . . . . . . . . . . 10-12
10-2 Guide to the High-Performance Loader
F ilters are similar to queries. However, queries select data from database
tables, whereas filters select data from a data file. During the load process, the
ipload utility loads all of the records from a data file into a database table
unless you use a filter to exclude some of the records.
You can define filters at any time. After you define a filter, you can specify it
in the Load Job window. The Load Job window is illustrated in Figure 12-2
on page 12-9.
Using a Filter
Suppose that you have a worldwide telemarketing data file that contains the
name, country, yearly salary, and age of potential contacts, as the following
example shows:
John Brown US 125,000 57
Mary Smith Argentina 83,000 43
Larry Little US 118,000 42
Ann South Canada 220,000 53
David Peterson France 175,000 72
Richard North Spain 350,000 39
Nancy Richards Japan 150,000 54
William Parker Egypt 200,000 64
To create a database that includes people who earn over $100,000 a year, are over
the age of 50, and live outside the United States
1. Use the match condition discard salary < 100,000 to exclude people
who earn less than $100,000 a year. The selected records are as
follows:
John Brown US 125,000 57
Larry Little US 118,000 42
Ann South Canada 220,000 53
David Peterson France 175,000 72
Richard North Spain 350,000 39
Nancy Richards Japan 150,000 54
William Parker Egypt 200,000 64
2. Use the match condition keep age > 50 to include people over the age
of 50. The remaining records are as follows:
John Brown US 125,000 57
Ann South Canada 220,000 53
David Peterson France 175,000 72
Nancy Richards Japan 150,000 54
William Parker Egypt 200,000 64
3. Use the match condition discard country = US to exclude people
living in the United States. The remaining records are the records
that match all of the restrictions:
Ann South Canada 220,000 53
David Peterson France 175,000 72
Nancy Richards Japan 150,000 54
William Parker Egypt 200,000 64
If you want to use the same data file to create a database of only those people
who live in the United States, or only those people under the age of 30, simply
define another filter. There is no limit to the number of filters that you can
define for a data file.
Creating a Filter
Before you can create a filter, you must create a format that describes the data
file. For information about how to create a format, refer to Chapter 7,
“Defining Formats.”
The ipload utility stores the filter information in the filters table of the
onpload database. For more information about the filters table, see page A-6.
To create a filter
1. Choose Components➞Filter from the HPL main window.
The Filters window appears, as Figure 10-1 illustrates.
Filters
Figure 10-1
The Filters Window
Mode Filters
Open
Create
Filter:
Format:
Notes
Message:
OK Cancel Help
4. Type the name of an existing format in the Format text box, or click
the down arrow and choose a format from the selection list.
5. Click OK.
The filter-definition window appears. Figure 10-2 shows a partially
completed filter-definition window.
Figure 10-2
The Filter-Definition Window
newfilter
Status
Add
Insert
Edit
Delete
OK Cancel Help
The filter-definition window lets you prepare a filter that specifies which data
from the input file should be loaded into the database table.
Section Description
Filter Items/Status Lists existing filter items and their status. As you add
match conditions, the conditions are added to this list.
Editing a Filter
After you create a filter, you might need to change it.
To delete a filter
Filter Views
The Filter Views window lets you display a list of the filters and formats that
are associated with a project. The Filter Views window also lets you create or
edit a filter. The Filter Views window appears in the following situations:
■ If you click the Filter button in the Load Job window when no filter
name is in the Filter text box
■ If you click the Search button in the Filters window
Figure 10-3 shows the Filter Views window. “The Views Windows” on
page 3-15 discusses the use of Views windows.
Filters Formats
cust_del cust_del
1. The onpload utility converts the input data to the code set of the
database server.
2. The onpload utility performs the filtering operation.
If the code-set conversion process creates lossy errors, then the output of the
filter operation can be unexpected. For information on lossy errors and how
to define or evaluate a code-set conversion specification, see the Informix
Guide to GLS Functionality.
This chapter describes the Unload Job window. For instructions on using the
onpload command-line utility, refer to Chapter 16, “The onpload Utility.”
For information about how to use the generate options, refer to Chapter 13,
“Generate Options.”
The Unload Job window displays the target and onpload database servers in
the upper right-hand corner of the display.
The Unload Job window lets you create or modify the components of an
unload job and run the unload job. You can change unload options before you
run the unload job. The unload options include the isolation level and the
maximum number of errors to permit before the onpload program aborts the
unload job.
The ipload utility stores the information about the unload job in the session
table of the onpload database. The session table draws information from
other onpload tables, such as maps, formats, and so on. For more infor-
mation about the tables of the onpload database, see Appendix A.
Selection Type
Job Name:
Open Create
Command Line:
Job Information
Notes
OK Cancel Help
Discard Records
Format
Logfile
Device Options
Message:
The information that onpload displays in the Active Job window is also
stored in the log file whose name you selected in Step 7. For information on
how to review the log files, see the “Viewing the Status of a Load Job or
Unload Job” on page 14-9.
Important: If a write to a file fails because a disk is out of space, the operating system
does not return information on how much of the write succeeded. In this situation,
the onpload utility cannot accurately report the number of records that were
actually written to disk. Thus, the number of records that are logged as unloaded in
the log file is imprecise.
Selection Type
Job Name: testum2_out
Open Create
Command Line: onpload -p testum -j testum2_out -fu
Argument Description
You can copy the onpload command from the Command Line text box and
paste it at a system prompt to run the unload job. If you need to run the
unload job multiple times (for example, every evening at 5:00 P.M.), you can
save the onpload command and execute it later.
You do not need to start ipload to run a job from the system prompt. The
ipload and onpload utilities both use the onpload database, but each utility
uses it independently.
Option Description
Isolation Level The criteria for how the query selects records. The four levels
of isolation (from highest to lowest) are as follows:
■ Committed
■ Cursor Stability
■ Repeatable Read
■ Dirty Read
The higher the isolation level, the lower the unload perfor-
mance. For a more detailed definition of isolation levels, refer
to the Informix Guide to SQL: Syntax.
Max Errors: 0
Message:
OK Cancel Help
The generate options do not give you as much flexibility as the Unload Job
window, but the options let you create the components quickly. In addition,
the generate options let you create formats (Binary, Fixed Internal, and No
Conversion) that are not available from the format-definition window.
When you run a load job, you select which individual components to use.
The collection of the various components for a specific load is called the load
job. You can assign a name to a load job, save the job, and then retrieve and
rerun it as often as you need to. You can modify an existing job or save it
under another job name.
You can define as many different load jobs as you need. You can group your
load jobs under one or more projects to make the tasks easier to manage.
Tip: The onpload database and the ipload interface can be on different computers.
You can run the ipload interface on any computer that can connect to the database
server that contains the onpload database.
UNIX If you are using a UNIX cron job to run the load or unload jobs, let one job
finish before you start the next. ♦
Not owned by User does not have DBA User must have:
user privileges on the table. ■ resource privileges on
database.
■ alter privileges on table.
Owner must start violations
table.
For detailed information about user privileges and violations tables, refer to
the Informix Guide to SQL: Syntax and the Informix Guide to SQL: Reference.
The HPL manages the violations and diagnostics tables in the following
manner:
Failure to drop the violations table does not cause the load job to fail.
However, this failure leaves in the database a violations table that is not
associated with a table. If the user tries to run the job again, the START
VIOLATIONS TABLE statement in step 2 fails because the table tablename_vio
already exists.
To solve this problem, the owner of the table or the database administrator
must explicitly create the violations and diagnostics tables using the START
VIOLATIONS statement. When the owner creates the violations table, the
following actions take place:
After the load job is complete, an active violations table remains in the
database. This table might be empty, but it causes no harm. When the user
runs the load job a second time, the violations table is available, and the load
job succeeds.
The ipload utility assigns pathnames for the log files that document the load
and that capture records that do not pass the specified filter or that do not
pass conversion.
When you use ipload to create a job, ipload stores information for the job in
a row in the session table (page A-17) of the onpload database. The ipload
utility stores information about the components of the load job in other tables
of the onpload database, including format, maps, filters, and so on. When
you use the onpload command, columns in the session table reference the
components to assemble the information necessary for the job. These tables
are documented in Appendix A, “The onpload Database.”
Selection Type
Job Name:
Open Create
Command Line:
Job Information
Notes
OK Cancel Help
4. Click OK.
The Load Job window appears, as Figure 12-2 illustrates.
Figure 12-2
The Load Job Window
Load Job
Filter
Discard Records
Map
Logfile
Table Options
Message:
After you run an express-mode load, you must make a level-0 backup before
you can access the table that you loaded.
If you do not need to provide for data recovery, you can use /dev/null as the
backup device for the level-0 backup. This strategy makes the table available
for write access without actually backing up the data. If a user attempts to
write into the table before you make a level-0 backup, the database server
issues ISAM error -197.
If you run several express-load jobs on different tables in a database, you can
complete all of the loads before you perform the level-0 backup. However, if
you try to do a second load on the same table without making a level-0
backup, the database server issues ISAM error -197.
Selection Type
Job Name: newjob
Open Create
Command Line: onpload -p practice -j newjob -fl
The command line, onpload -p practice -j newjob -fl, contains the following
arguments.
Argument Description
You can copy the onpload command from the Command Line text box and
paste it at a system prompt to run the load job. If you need to run the load job
multiple times, you can save the onpload command and execute it later.
You do not need to start ipload to run a job from the system prompt. The
ipload and onpload utilities both use the onpload database, but each utility
uses it independently.
The ipload utility stores option information in the session table of the
onpload database. For more information on the session table, see
Appendix A.
Option Description
Start Record The record number in the data file from which to start
loading
Tapes: 0
Number Records: 0
Start Record: 0
Max Errors: 0
Commit Interval: 0
Message:
OK Cancel Help
The generate options do not give you as much flexibility as creating each
component individually, but these options let you create the components
quickly. (After you generate the components, you can edit the components
individually by accessing them through the Components menu.) In addition,
the generate options let you create formats (Fixed Internal and No
Conversion) that are not available from the format-definition window.
Generate Options
13
Types of Generate Tasks . . . . . . . . . . . . . . . . . 13-3
Generating from the Load Job Window . . . . . . . . . . . . 13-4
Using the Autogenerate Load Components Window . . . . . . 13-4
When you generate a load or unload job for an Informix database, ipload
creates a format for the data file and a map that associates the columns of the
table with the fields of the data-file records. Although the generated compo-
nents might not match your database schema or data-file records exactly, the
components created by the generate options provide useful starting points
for building HPL components. After you generate default components, you
can modify the components to match your specific needs.
Load To
Database:
Table:
OK Cancel Help
6. Click Device Array or File to indicate the location of the source data.
To load from an existing device array, click Device Array and type
the name of the device array.
To load from a file, click File and type the full pathname of the file.
The ipload utility automatically generates a device array that
includes the file.
7. In the Load To group, type the name of the database and table that
will receive the data.
8. Click OK.
The ipload utility generates the components of the load and returns
to the Load Job window.
9. If needed, click the Filter button to prepare a filter.
10. If you want, change the pathnames in the Discard Records and
Logfile text boxes.
11. Click Save to save the components and the job.
12. Click Run to execute job or Cancel to exit.
Query:
Unload To
Device Array
/work/cust_out
File
OK Cancel Help
cust_out /tmp/cust_out.reg
Discard Records
Format
cust_out /tmp/cust_out.loq
Logfile
Device Options
Message:
Figure 13-4
The Generate Window
Generate
Message: Select options for automatically generating jobs, maps, queries, and formats
OK Cancel Help
Refer to
Choice Effect Page
Maps and Formats only Generates only a format, a load map, and
an unload map
Refer to
Choice Description Page
Fixed Internal The data file uses Informix internal format. The only 7-20
changes to the data that you can make when you use
this format are ALTER TABLE changes: modify the
order of columns, delete or add columns, or change
the data type.
The HPL loads and unloads data in this format more
efficiently than data in the Delimited and Fixed
ASCII formats.
Fixed ASCII All records are the same length. Each record contains 7-5
characters in fixed-length fields.
This format is the same as the Fixed format choice of
the Record Formats window.
Tip: To generate EBCDIC data, select the Delimited or Fixed ASCII format and use
the format options to change the code set. Refer to “Format Options” on page 7-21.
Figure 13-5 shows appropriate choices for generating load and unload jobs
for delimited output from the state table of the stores7 database. After ipload
creates the components, you can run the job or use the component-definition
windows to make any necessary changes.
Figure 13-5
The Generate Window
Generate
Message: Select options for automatically generating jobs, maps, queries, and formats
OK Cancel Help
When you run a job that you created with the No Conversion Job option,
ipload displays a Fast Job Startup window instead of the usual load or
unload job window.
Database: stores7
Table: customer
Browsing
14
The Browsing Options. . . . . . . . . . . . . . . . . . 14-3
Previewing Data-File Records . . . . . . . . . . . . . . 14-3
Using the Record Browser Window . . . . . . . . . . 14-4
Reviewing Records That the Conversion Rejected . . . . . . . 14-7
Viewing the Violations Table . . . . . . . . . . . . . . 14-8
Viewing the Status of a Load Job or Unload Job. . . . . . . . 14-9
Viewing the Log File . . . . . . . . . . . . . . . 14-10
Sample Log File . . . . . . . . . . . . . . . . . 14-11
14-2 Guide to the High-Performance Loader
T he browsing options of the HPL let you preview records from the
data file and let you review various files associated with the HPL.
Browsing 14-3
Previewing Data-File Records
1. In the HPL main window, select the project that contains your load
job.
2. Choose Browsers➞Record.
The Record Browser window appears, as Figure 14-1 illustrates.
Data File:
cust_del
cust_num
cust_calls
OK Cancel Help
3. Type the name of the format to be applied to the source data file or
click the format name in the list box.
4. In the Data File text box, type the name of the data file that you plan
to load, or click the down arrow and select a file from the selection
list.
5. Click OK.
The second Record Browser window appears, as Figure 14-2 illus-
trates. This Record Browser window displays each of the fields in the
format, followed by the value of the field for the given Record
Number.
col1:
col2:
col3:
Message:
Browsing 14-5
Previewing Data-File Records
1. In the HPL main window, select the project that contains your load
job.
2. Choose Browsers➞Record.
The Record Browser window appears, as Figure 14-1 on page 14-4
illustrates.
3. In the Format text box, type the format name or partial format name
that you want to find.
You can use wildcards (for example, *cust*).
4. Click Search.
The ipload utility displays all formats of the current project that
include the letters cust.
5. Click Cancel to return to the HPL main window.
To edit a format
Browsing 14-7
Viewing the Violations Table
Viewing the violations table lets you browse through records that passed the
filter and conversion but that the database server rejected. The HPL writes
these records into the violations table (tablename_vio). The data in the viola-
tions table has the same format as the database table.
The Informix Guide to SQL: Syntax discusses in detail the information found
in the violations table.
Table: Select
2. Type the name of the database and table for which you want to
review the violations, or click the down arrows to make your choices
from selection lists.
3. Click Select.
Figure 14-4 shows the first record of a violations table.
informix_tupleid: 1
informix_optype:
objname: u104_10
order_num: 1
stock_num: 1
manu_code: HR
4. Click Next and Previous to move forward and backward through the
violations table.
5. Click Cancel to return to the HPL main window.
Browsing 14-9
Viewing the Status of a Load Job or Unload Job
You can specify a different name for the log file in the Load Job window
(Figure 12-2 on page 12-9) or Unload Job Window (Figure 11-2 on page 11-7).
Directories Files
/work/data/ /data/custlist.sql
/work/data/.. /data/fixdata
/data/fmanufact
/data/getcalls
/data/itemcost.sql
/data/longcalls.sql
/data/moredata
/data/mydata
/data/newquery.sql
Selection
/work/data/
2. In the Filter text box, type the full pathname of the directory that
contains the log.
You can use wildcards to select only certain files from that directory.
3. Click Filter.
The Files list box shows a list of the files that match the path that you
entered in the Filter text box.
4. In the Files list box, click the name of the file that you want to
examine.
The full pathname of the selected file appears in the Selection text
box.
5. Click OK.
A Browse window appears that displays the contents of the selected
file.
6. Review the log using the scroll bar to move through the log.
7. Click Cancel to return to the HPL main window.
Alternatively, if you know the full pathname of the log file, you can simply
type the pathname in the Selection text box and click OK.
Session ID 1
You can review the log file to determine load status and to see where any
errors occurred. The log file is a simple ASCII file. You can print it if necessary.
Browsing 14-11
Chapter
Performance . . . . . . . . . . . . . . . . . . . . . 15-10
Configuration Parameters . . . . . . . . . . . . . . . 15-11
Mode . . . . . . . . . . . . . . . . . . . . . . 15-12
onstat Options for onpload . . . . . . . . . . . . . . . 15-12
Devices for the Device Array . . . . . . . . . . . . . . 15-12
Usage Models . . . . . . . . . . . . . . . . . . . 15-13
Reorganizing Computer Configuration . . . . . . . . . 15-13
Altering the Schema of a Table . . . . . . . . . . . . 15-14
Loading and Unloading Data . . . . . . . . . . . . 15-14
Settings for a No-Conversion Load or Unload . . . . . . . 15-15
Express-Mode Load with Delimited ASCII . . . . . . . . 15-16
Performance Hints . . . . . . . . . . . . . . . . . 15-16
Choose an Efficient Format . . . . . . . . . . . . . 15-17
Ensure Enough Converter Threads and VPs . . . . . . . 15-17
Ensure Enough Buffers of Adequate Size . . . . . . . . 15-18
Increase the Commit Interval. . . . . . . . . . . . . 15-19
15-2 Guide to the High-Performance Loader
T ■
■
his chapter discusses the following aspects of managing the HPL:
Modes
Violations
■ Performance
Modes
The HPL offers two load modes: deluxe and express. Express mode is faster,
and deluxe mode is more flexible. You can choose the mode that is best suited
for your environment. The HPL has only one unload mode. Figure 15-1 illus-
trates the load and unload modes of the HPL.
Figure 15-1
The Load and
Selected database Data files Unload Modes of
Express load the HPL
Deluxe load
Unload
Deluxe Mode
The deluxe mode performs row-by-row referential and constraint checking
as the data is loaded. Deluxe mode also logs each insert. Deluxe mode does
not lock the table, so the loading of data can take place while other users are
working. Deluxe mode is not as fast as express mode but allows users to
access and update the table during a load. Loaded data is immediately visible
to the user.
■ Logs data
■ Updates indexes
■ Evaluates triggers
■ Sets constraints to FILTERING WITHOUT ERROR
■ Sets the isolation mode as if for an insert cursor.
Express Mode
Express-mode loads are significantly faster than deluxe-mode loads;
however, no one else can access the table until the load is complete. The
express mode locks the table for exclusive use by the load utility and disables
referential and constraint checking on the table during the load.
Express mode requires that you perform a level-0 backup after you finish the
load. This additional step is important when you consider the relative speeds
of the deluxe mode and express mode. If the table that you are loading is
empty and has no objects such as indexes or constraints, express mode is
almost surely faster. However, if the table that you are loading is large and/or
has many constraints, deluxe mode might be faster when you consider the
time that is required for enabling the objects and performing the level-0
backup.
If your load job has any of these conditions, you must use deluxe mode to
load your data.
If the load fails, onpload discards the extents and clears the internal
information that says the table is unrecoverable.
Foreign-Key Constraints
Express mode cannot disable primary constraints or unique constraints that
are referenced as foreign keys that are active on other tables. If you want to
load data into such a table, you must first use SET CONSTRAINTS DISABLED
statements to disable the foreign-key constraints in the referencing table or
tables. After the load is finished, reenable the foreign-key constraints.
Figure 15-2 shows an example of foreign-key constraints. The table target has
a primary key (thePK) and a unique key (unique) that table blue and table
green reference. Before you perform an express-mode load into the table
target, you must disable the foreign-key constraints in both table blue and
table green.
Figure 15-2
Foreign-Key
item1 columnA Constraints
item2 columnB
matchesthePK thePK
item3 columnC
columnD
blue
unique
columnE
entry1 unique2
entry2
matchesunique
entry3
green target
Performed Performed
Action by Action by
Load records from the onpload Load records from data file onpload
data file into the table into the table. Write records
(including rows that that violate constraints into
would cause violations if the violations table and not
constraints were on) into the target table
Violations
When you load records from a data file, some of the records might not meet
the criteria that you established for the database table. For example, the data
file might contain:
The way that the HPL treats these errors depends on the mode (deluxe or
express) and the type of job (load or unload).
Constraint Violations
When the onpload utility starts a deluxe-mode load, it invokes the following
SQL statement:
The use of filtering mode for constraints is covered in detail in the Informix
Guide to SQL: Syntax
Performance
You can improve HPL performance by preparing an environment that is
optimized for the particular load or unload job that you are performing. You
should consider the following aspects of your load and unload jobs:
■ Configuration-parameter values
■ Mode (express or deluxe)
■ Devices for the device array
■ Usage models
Configuration Parameters
The onpload configuration parameters control the number of threads that
onpload starts and the number and size of the buffers that are used to
transfer data. Figure 15-3 shows which part of the onpload process is affected
by each configuration parameter.
Figure 15-3
The onpload Configuration Parameters
AIOBUFSIZE
tape I/O AIOBUFFERS
sdriver
CONVERTTHREADS
CONVERTVPS
convert
convert
convert
STRMBUFFSIZE
STRMBUFFERS
worker
The AIOBUFSIZE and AIOBUFFERS parameters control the number and size of
the buffers that onpload uses for reading from the input device. CONVERT-
THREADS and CONVERTVPS control the amount of CPU resources to apply to
data conversion. STRMBUFFSIZE and STRMBUFFERS control the number and
size of the buffers used to transport data between onpload and the database
server.
Mode
“Modes” on page 15-3 discusses the characteristics of express mode and
deluxe mode. You cannot use express mode in certain situations. For
example, express mode does not support loading Simple LO or Ext Type data
types, ensuring constraints, or invoking triggers. For a list of situations in
which you must use deluxe mode, see “Express Mode Limitations” on
page 15-5.
The onstat -j option provides an interactive mode that lets you gather special
information about an onpload job. The -j option is documented in
Appendix F of this manual.
In most unload jobs, all devices receive equal amounts of data. Thus the
speed of all devices is limited by the speed of the slowest device. If you have
several fast devices and one or two slow devices, it might be advantageous
to remove the slow devices.
When CPU resources are plentiful during an HPL job, the device controllers
are a potential bottleneck. If you have configured extra converter threads and
extra converter VPs, CPU use should be close to 100 percent. If CPU use is not
close to 100 percent, the cause might be one of the following situations:
Usage Models
Three major usage models are envisioned for the HPL, as follows:
The following table lists sample values of configuration parameters for a raw
load.
Suggested
Configuration Parameter Value Comment
AIOBUFFERS 5 CONVERTTHREADS + 4 or
2*CONVERTTHREADS, whichever is
larger
Sample
Configuration Parameter Value Comment
STRMBUFFERS 4 CONVERTTHREADS + 4
AIOBUFFERS 5 CONVERTTHREADS + 4 or
2*CONVERTTHREADS, whichever is larger
Performance Hints
In general, the performance of the HPL depends on the underlying hardware
resources: CPU, memory, disks, tapes, controllers, and so on. Any of these
resources could be a bottleneck, depending on the speed of the resource, the
load on the resource, and the particular nature of the load or unload.
For example, load and unload jobs that perform no conversions consume
minimal CPU resources. These jobs are thus likely to be limited by device or
controller bandwidth. On the other hand, ASCII loads and unloads are CPU
intensive because of the overhead of conversion to and from ASCII. This
section discusses some topics that you should consider when you try to
improve performance.
Delimited and fixed ASCII formats are comparable in behavior except when
VARCHAR data is present. If the schema contains VARCHAR data and the
length of the VARCHAR data varies greatly, you might want to choose
delimited format.
The number of converter threads that is required for a device depends on the
relative speeds of the device and the CPU as well as the data types in the table
being loaded or unloaded. CHAR and VARCHAR formats are the cheapest to
convert. INT, DATE, SMFLOAT, and FLOAT are more expensive. DECIMAL and
MONEY are among the most expensive formats to convert.
The PLCONFIG file specifies the number of converter threads per device. You
can override this value on the onpload command line with the -M option.
The database server and onpload client VPs might both be competing for the
same physical CPU resources. To reduce contention, run only the number of
VPs that are necessary on both the database server and onpload sides.
However, if the number of database server VPs is already specified, you
might have a choice only in the number of onpload VPs. In this case, the
suggestions in the previous paragraph apply.
Too few converter threads and VPs can make conversion a bottleneck. On the
other hand, too many converter threads can waste time in scheduling threads
in and out of the VPs. In general, more than ten converter threads per VP is
too many.
Configuration
Parameter Size Comment
STRMBUFFERS 2 * CONVERTTHREADS
AIOBUFSIZE 64
AIOBUFFERS 2 * CONVERTTHREADS
While larger commit intervals can speed up loads, larger commit intervals
require larger logical-log space and increase the checkpoint time. These side
effects might impact other system users during onpload operations.
The onpload command uniquely specifies a row in the session table in the
onpload database. Each row in the session table specifies all the components
and options that are associated with a job.
Typically, you use ipload to start a job when you plan to perform that
particular load or unload once. For a job that needs to be run periodically,
such as a weekly report, you might choose to run the job from the command
line.
Tip: Enter onpload with no options at the command line to display a command-line
listing of all onpload options and their functions.
The following sections give additional information about the syntax and
individual options of the onpload utility.
Syntax
onpload
-j jobname -V
-d source -p projectname
-m map -d source
-p projectname
For example, you might use the Load Job window to prepare the following
command:
onpload -p zz -j bigload -fl
If you receive a tape that you know contains data with bugs, you might
choose to modify the command to allow errors and to save the log in a special
place, as follows:
onpload -p zz -j bigload -fl -e 1000 -l /mylogs/buggytape.log
For information on the -fl option, see “Setting the Run Mode with the -f
Option” on page 16-6.
-f
d l n
q
p c
v
a u
M
If you prefer, you can use multiple occurrences of the -f option instead of
combining all of the possible -f flags into one group. For example, the
following two command lines are equivalent:
onpload -m mymap -d mydev -flnc
■ If the command line does not specify a device type, onpload treats
the data source as the pathname of a cooked file on disk. Because no
device type is specified, the following onpload command treats
filename as the name of a file:
onpload -d filename -m mapname
■ The -fd in the following command causes onpload to treat
/dev/rmt/rst11 as the name of a tape device:
onpload -d /dev/rmt/rst11 -m mapname -fd
■ The -fa in the following command causes onpload to treat
tapearray3 as the name of a device array. The device array is
described in the onpload database.
onpload -d tapearray3 -m mapname -fa
■ The -fp in the following command causes onpload to treat
apipename as the name of a pipe. When onpload starts executing, it
causes the pipe process to start executing.
onpload -d apipename -m mapname -fp
The same semantics apply for an unload job. If you use the u flag of the -f
option to indicate an unload job, the interpretation of the data-source name
is as described previously. For example, the following command specifies
that onpload should unload data to the device /dev/rmt/rst11:
onpload -d /dev/rmt/rst11 -m mapname -fdu
-A tapehead
-B blocksize
-G swapbytes
-I commit_int
-a iobufsize
-b bufsize
-e maxerrors
-i prog_interval
-n numrecs
-s startrec
-t numtapes
The onpload utility updates the row count only once for each stream buffer
of data that it processes. Thus, reducing the row count on the -i option does
not necessarily increase the number of progress messages in the log file. For
example, if the stream buffer holds 910 rows of data, setting row_count to 10,
100, and 900 has the same effect: onpload writes one progress message.
-C caseconvert
-D override_db
-F filter
-L trace_level
-M converters
-R rejectfile
-S servername
-T target_db
-l logfile
When you start the ipload utility, the utility looks for a database
named onpload on the database server that your
INFORMIXSERVER environment variable specifies. If the
onpload database is not present, ipload creates an onpload
database as a non-ANSI database.
You can specify a set of defaults for each database server. If this table does not
contain an entry for a database server, the database uses the defaults that the
record named default specifies.
Use the Defaults window to modify this table. Refer to “Modifying the
onpload Defaults” on page 5-5.
header TEXT The tape header for a device that DDR uses
fname CHAR(18) The name of the field that this filter affects
Figure A-1
Possible Values for the ftype Column
ftype ftype
Value Type of Data Value Type of Data
2 Date 24 Comp-5
4 Integer 26 Comp-X
11 UNIX date
18 Packed Decimal
19 Zoned decimal
20 Comp-1
21 Comp-2
22 Comp-3
blobcolumn CHAR(18) The column that contains the name of the file
where the BYTE or TEXT data is stored
(2 of 2)
If the values of inputcode and storecode are different, onpload converts the
contents of the BYTE or TEXT data.
Tip: Deluxe-mode loads do not support the “no conversion” and “with conversion
and do not generate violations table” options.
The High-Performance
Loader Configuration File B
The default $INFORMIXDIR/etc/plconfig.std file on UNIX or
%\INFORMIXDIR\etc\plconfig.std on Windows NT is the high-
performance loader configuration file. The file is similar to the
ONCONFIG file in the etc directory in INFORMIXDIR. The
plconfig.std file sets various onpload buffer and system config-
uration parameters. You can modify the parameters to maximize
resource utilization.
File Conventions
Each parameter in the plconfig.std file in the etc directory in INFORMIXDIR
is on a separate line. The file can also contain blank lines and comment lines
that start with a # symbol. The syntax of a parameter line is as follows:
PARAMETER_NAME parameter_value# optional comment
Parameters and their values are case sensitive. The parameter names are
always all uppercase letters. If the parameter-value entry is described with
uppercase letters, you must use uppercase. You must put white space (tabs
or spaces or both) between the parameter name, parameter value, and
optional comment. Do not use any tabs or spaces within a parameter value.
AIOBUFFERS
default value Maximum of (4,CONVERTTHREADS)
The AIOBUFFERS parameter sets the number of buffers used to transport data
from converter threads to the AIO handler.
AIOBUFSIZE
default value 64
units Kilobytes
The AIOBUFSIZE parameter sets the size of the AIO memory buffers that
transfer data to and from tapes and files. The HPL uses the AIO buffers to pass
data between the converters and the I/O drivers.
The AIOBUFSIZE parameter is not the same as the tape-block size that you can
set in the device arrays (see page 6-7). The tape-block size lets you control the
size of the block that the device controller sends to the tape drive, while
AIOBUFSIZE lets you control the size of internal buffers that pass data. If your
computer has memory available, you can improve performance by
increasing the AIOBUFSIZE parameter.
CONVERTTHREADS
default value 1
Having more than one converter per thread, in general, allows the
conversion phase to run faster given that CPU resources are available.
Conversion can be a CPU-intensive phase if complex conversions are being
performed.
CONVERTVPS
default value Single-processor computer: 1
The CONVERTVPS parameter limits the maximum number of VPs used for
convert threads. This parameter limits the number of VPs that the onpload
client uses so that onpload does not monopolize system resources.
STRMBUFFERS
default value Maximum of (4,2*CONVERTTHREADS)
Each device has a separate server stream with STRMBUFFERS buffers. Thus
the total number of stream buffers is as follows:
STRMBUFFERS * numdevices
STRMBUFSIZE
default value 64
units Kilobytes
Picture Strings
C
The HPL uses two types of picture strings, as follows:
You specify the picture string in the Picture text box in the
Mapping Options window. For information about the Mapping
Options window, refer to “Mapping Options” on page 9-13.
Alphanumeric Pictures
Alphanumeric Pictures
Alphanumeric pictures control formatting of alphanumeric strings. An
alphanumeric picture allows you to mix constant characters in the picture
specification with the data being processed. You can also mask out unwanted
character types.
When a control character is found in the picture string, the input data is
scanned until a character that matches the type of the picture-replacement
character is found. This character is placed in the output string, and the
process is repeated.
Character Definition
X Replaces the control character with any character from input data.
aaaaaaaa 12P45-q Pq
Numeric Pictures
Numeric pictures allow you to decode and reformat integer and decimal
numeric values. A value is interpreted as a numeric value only if its picture
string contains numeric picture-control characters.
The input data is first scanned for the number of digits to the left and right of
the decimal point (if any), and for a negative sign that can either precede or
follow the data. The picture string is then used to reformat the value. The
numeric picture-control characters are 9, S, V, and Z.
Character Definition
S Replaces the control character with a minus sign if the input value is
negative.
Date Pictures
When you load data, the date-format picture specifies how the HPL formats
the input data before it writes the data into a database. When you extract data
from a database, the date-format picture specifies how the HPL reformats the
date before it writes the date to the output.
The date control characters are M, D, and Y. The following table provides
definitions of these control characters.
Character Definition
D Day value
H Hour value
S Second value
Y Year value
Match Condition
Operators and Characters D
Operator Descriptions and Examples
This appendix describes the operators that are available when
you match text and it provides an example of each operator.
Operator Descriptions and Examples
Operator Description
= value Matches if the character string in, or the value of, the data-record
field equals the specified text or value. If you specify a character
string, the characters must be delimited by quotes.
For example, if you are matching on a field named City, the match
condition = "Dallas" selects all records whose City field
contains the entry Dallas.
value Equals (=) is the default operator. Thus this case is equivalent to
=value, except that the characters do not have to be delimited by
quotes.
For example, if you are matching on a field named City, the match
condition Dallas selects all records whose City field contains
the entry Dallas.
> value Matches if the data record field is greater than the specified value.
For example, if you are matching on a field named Income, the
match condition > 50000 selects all records whose Income field
contains an entry greater than 50,000.
Character strings must be delimited by quotes (> "Jones").
< value Matches if the data record field is less than the specified value.
For example, if you are matching on a field named Income, the
match condition < 50000 selects all records whose Income field
contains an entry less than 50,000.
Character strings must be delimited by quotes (< "Jones").
>= value Matches if the data-record field is equal to or greater than the
specified value.
For example, if you are matching on a field named Income, the
match condition > 50000 selects all records whose Income field
contains an entry 50,000 or greater.
Character strings must be delimited by quotes (>= "Jones").
<= value Matches if the data-record field is less than or equal to the
specified value.
For example, if you are matching on a field named Income, the
match condition <= 50000 selects all records whose Income field
contains an entry 50,000 or less.
Character strings must be delimited by quotes (= "Jones").
(1 of 3)
Operator Description
<> value Matches if the data-record field is not equal to the specified value.
Character strings must be delimited by quotes.
For example, if you are matching on a field named State, the
match condition <>"TX" selects all records whose State field
contains an entry other than TX.
Operator Description
Custom Conversion
Functions E
Custom conversion functions allow you to add additional data
conversion capability to the HPL. This feature lets onpload call a
custom conversion function during the data-conversion process.
The custom conversion function API uses ASCII strings as the canonical data
type. The API functions present data as ASCII strings and expect data from the
custom conversion functions to be presented as ASCII strings. The API
functions convert source data of different types to ASCII strings, and also
convert ASCII string data from custom conversion functions to destination
data types.
/*
* The argument list must be adhered to.
*/
int your_conversion_func1(outbuffer, buflen, value)
char *outbuffer; /* where to put your output */
int buflen; /* max size of buffer in bytes*/
char *value; /* input value */
{
/* your processing here */
}
API Functions
The onpload utility expects your custom conversion function to have the
following prototype:
/*
* input:: char* outbuffer: where to put your output.
* int buflen: size you have for your output.
* char* value: the input value to work on.
* return:: 0 to indicate ok.
* non-zero to discard entire record.
*/
The following functions support your access to data in the source and
destination buffers.
DBXget_source_value(fldname,buffer,buflen)
This routine retrieves the source value that is associated with fldname and
copies the value to the specified buffer.
DBXget_dest_value(fldname,buffer,buflen)
This routine retrieves the destination value that is associated with fldname
and copies the value to the specified buffer.
DBXput_dest_value(fldname,buffer)
If a previous conversion has not set the destination value, this routine sets the
destination value that is passed to the buffer. The ipload utility automatically
clips the data value if it is too long.
DBXget_dest_length(fldname)
This routine returns the maximum length of the data buffer that is associated
with fldname.
SHMBASE 0x4400000
CLIENTNUM 0x49010000
Session ID 1
The two lines that start with SHMBASE and CLIENTNUM provide the infor-
mation that you need to locate shared memory for an instance of onpload.
The oninit process has similar values stored in the $ONCONFIG file. When
you use onstat to gather information about the oninit process, onstat uses
information from $INFORMIXDIR/etc/$ONCONFIG to locate shared memory.
When you use onstat to gather information about onpload, you must give
onstat the name of a file that contains SHMBASE and CLIENTNUM
information.
Typically the file that contains the SHMBASE and CLIENTNUM information is
the log file. For example, if the onpload log file is /tmp/cnv001a.log, you can
enter the following command:
onstat -j /tmp/cnv001a.log
Most of the options are the same as those that you use to gather information
about Dynamic Server with UD Option, with the following exceptions:
jal Print all Pload information
jct Print Pload control table
jpa Print Pload program arguments
jta Print Pload thread array
jmq Print Pload message queues, jms for summary only
These options apply only to onpload. You can use onstat -j to check the status
of a thread, locate the VP and its PID, and then attach a debugger to a
particular thread. The options for onstat that do not apply to onpload are not
available (for example, -g ses).
WIN
UNIX
NT /usr/include/errno.h ♦
For information on how to view the log file and some guidance
on how and when you might want to read it, see “Viewing the
Log File” on page 14-10.
How the Messages Are Ordered
A section that lists pop-up messages (or messages that are returned to
standard error) appears after the log-file message sections. Messages in this
section are arranged according to the same rules that apply to log-file
messages.
Message Categories
Four general categories of messages can be defined, although some messages
fall into more than one category:
■ Routine information
■ Assertion-failed messages
■ Administrative action needed
■ Fatal error detected
Log-File Messages
Blob conversion error occurred on record record_num.
WIN
UNIX
NT Cannot bind TLI connection: t_errno=t_error_num.
WIN
UNIX
NT Cannot configure driver driver_name.
WIN
UNIX
NT Cannot connect to message server: Socket error=UNIX_error_num.
WIN
UNIX
NT Cannot connect to message server: TLI error=t_error_num, TLI
event=t_event_num, errno=error_num.
♦
Cannot connect to server server_name: SQL error error_num, ISAM
error error_num.
Cause: The index objects are set to filtering mode during the
load and re-enabled after the load. An error occurred
when onpload attempted to set the indexes objects to
filtering mode.
Action: Refer to the Informix Error Messages in
Answers OnLine.
Cause: The data type for the load file is different than the data
type for the server. The code-set does not exist in the
$INFORMIXDIR/gls/cvx or
%INFORMIXDIR%\gls\cvx directory where x is the
version number of the cv subdirectory.
Action: Check that the file exists. Check the file for
permissions.
Cannot open.
WIN
UNIX
NT Custom conversion function function_name not found in shared
library.
Cause: The requested map for the load or unload does not
exist, or a problem exists with the onpload database.
Action: For an explanation, refer to Informix Error Messages
on Answers Online.
WIN
UNIX
NT Error listening for TLI connection: t_errno=t_error_num
errno=UNIX_error_num.
♦
Error on close of server load session: SQL error error_num, ISAM
error error_num.
Cause: The device array specifies that the file is a disk file, but
it is not.
Action: Change the type of the file in the device-array
definition, or make sure that the file is a disk file.
MT internal failure.
Cause: You cannot load the indicated table because the DBA
has not granted permission for you to do so.
Action: Make sure that you have insert permissions on the
table.
onpload must run on the host host_name that contains the target
database.
WIN
UNIX
NT onpload terminated by signal.
Cause: The record size exceeds the size of the onpload buffers
(AIOBUFSIZE). This error can occur when a delimited
record contains BYTE or TEXT data, and a format
specification for a field is missing, which causes BYTE
or TEXT data to be treated as a regular field.
Action: Increase the size of AIOBUFSIZE for this record, or
check that the format specification for the field
matches the input file.
Cause: A start record was specified for the load, but fewer
records are in the input file than the indicated number
of records to skip.
Action: Specify the start-record number again.
Pop-Up Messages
Cannot attach to server shared memory.
WIN
UNIX
NT Cannot create shared-memory message queue: error error_num.
WIN
UNIX
NT Cannot create shared-memory pool: errno UNIX_error_num.
WIN
UNIX
NT Cannot initialize multithreaded library.
Cannot open.
Enter (r)etry, (c)ontinue, (q)uit job when ready
Write error.
Enter (r)etry, (c)ontinue, (q)uit job when ready
Index
/doc4/rel4/2.0_CD/73ids/hpl/hpl.ix
June 11, 1998 11:30 am
/doc4/rel4/2.0_CD/73ids/hpl/hpl.ix
June 11, 1998 11:30 am
Index 3
/doc4/rel4/2.0_CD/73ids/hpl/hpl.ix
June 11, 1998 11:30 am
$INFORMIXDIR/etc/sqlhosts. See Load and unload session Log-file messages. See Log file.
sqlhosts file. maximum errors 16-10 Lowercase conversion 9-15, 16-13
INFORMIXDIR environment Load data with onpload 16-6 LSB 5-9
variable 1-13 Load job LVARCHAR data type. See
INFORMIXDIR/bin browsing options 14-3 Extended Types.
directory Intro-5 changing options 12-14
INFORMIXSERVER environment commit interval 12-13
variable 1-13 components 12-3 M
Input, starting record 16-11 creating 12-7, 12-15
Machine notes Intro-14
INSERT statement 15-4 description of 12-3
Machine type
INT data type 15-17 device-array speed 15-12
default 5-7
Internal format example 2-3, 2-7
modifying 5-8, 7-22
limitations 7-20 from the command line 16-3
machines table, in onpload
use with generate 13-14 generate violations records 12-13
database A-11
Invalid characters in entry log file 14-9
Machines window
fields 3-9 maximum errors 12-13
illustration 5-9
ipload utility mode options 12-13
using 5-10
command 3-4 multiple jobs 11-4, 12-4
Managing the HPL 15-3
configuration 5-3 number of records 12-13
Map
creates onpload database A-1 onpload database A-17
columns and fields of same
example 2-3 preview records 14-3
name 9-6, 9-12
purpose of 1-10 run example 2-29, 2-37
definition of 9-3
starting 2-5, 3-4 running 12-10, 12-15
for blobs in separate files 7-14
ISO 8859-1 code set Intro-4 server considerations 11-4, 12-4
for in-line blobs 7-13
Isolation level, in unload starting record 12-13
Map Views window 2-21, 9-21, 9-22
option 11-11 status log 12-10
Map-definition window 2-24, 2-25,
I/O tapes, number of 12-13
2-26, 9-5, 9-9, 9-12, 9-18
buffer size 16-10 using cron 11-4, 12-4
Map-edit window
number of tapes to load 16-11 Load Job Select window
description of 9-5
tape block size 16-10 command line information 12-12
purpose 9-4
illustration 2-8, 12-8
using the find button 9-17
Load Job window 2-9, 2-18, 2-27,
mapitem table, in onpload
J 3-14, 12-9
database A-12
Load log, examining 14-9
Jobs menu, description of 3-5 mapoption table, in onpload
Load map
Justification of data in mapping database A-12
definition of 9-3
options 9-15 Mapping options
how to create 9-4
bytes to transfer 9-15
Load mode, description of 1-8, 15-3
case conversion 9-15
Load Options window 2-28, 12-14
L Load Record Maps
column offset 9-16
default column value 9-15
language table, in onpload window 2-22, 9-7
defining 9-13
database A-10 Locale Intro-4
field minimum and/or
LD_LIBRARY_PATH environment Lock table. See Table locking.
maximum 9-16
variable 1-13 Log file
field offset 9-16
Least significant byte 5-9 created by ipload 12-7
fill character 9-16
Level-0 backup in express for load job 14-9
function, user-defined 9-16
mode 2-31, 15-6 messages 12-11, H-2
justification 9-15
Limitations, database server 12-4 sample entry 14-11
picture format 9-16
setting 11-8
Index 5
/doc4/rel4/2.0_CD/73ids/hpl/hpl.ix
June 11, 1998 11:30 am
Print button 3-28 Release notes Intro-14 to create a load map 9-7
Printed manuals Intro-12 Release notes, program to create an unload map 9-10
Privileges 12-5 item Intro-15 to define a device array 6-8
Problems during a load Reorganize computer to define a filter 10-5
job 11-10, 12-11 configuration 15-13 to define a query 8-4
Program group Repeatable read isolation to define fixed-length file 7-5
Documentation notes Intro-15 level 11-11 to define mapping options 9-13
Release notes Intro-15 Row types. See Extended Types. to edit a device array 6-8
Project to edit a filter 10-8, 10-10
creating a new project 4-7 to edit a format 7-9, 7-10
default name 4-3 S to generate components
Project name, in onpload 16-5 menu 13-13
Schema, of database table 13-3
project table, in onpload to modify delimited formats 7-23
Screen-illustration
database A-16 to modify format options 7-21
conventions Intro-11
Projects window 4-6 to review rejected records 14-7
sdriver threads 1-17
Proper-name case conversion 16-13 to review source records for
SELECT clause, preparing 8-6
Proper-name conversion 9-15 load 14-4
Selection Type box 3-9
to select a database server 5-4
Server name, default 5-6
to specify onpload defaults 5-7
Server. See Database server.
Q session table, in onpload
to use Map Views window 9-21
to use Specifications
Query database A-17
window 9-20
description of 8-3 SET CONSTRAINTS statement
to use the Fast Job window 13-15
export to a file 8-13, 8-15 DISABLED 15-7
to view load log 14-10
for unload map 9-10 ON 15-10
to view violations table 14-8
import from a file 8-13 setrw threads 1-18
stores7 database Intro-4
steps for defining 8-4 Simple LOs. See Simple large
Stream threads 1-18
using the Table button 8-7 objects.
STRMBUFFERS parameter
query table, in onpload Single CPU, performance B-4
affecting onpload process 15-11
database A-16 SMFLOAT data type 15-17
description of B-5
Query window 8-5 Software dependencies Intro-4
example 15-15
Query-definition window 8-6, Specifications window 9-19
STRMBUFFSIZE parameter
8-10, 8-11 Specs button 3-22, 9-19
affecting onpload process 15-11
Quiet, suppress output A-18 Speed
example 15-15
of deluxe mode 15-4
STRMBUFSIZE parameter
of express mode 15-4
description of B-5
R Splash screen 3-4
Structured query language. See SQL
SQL query. See Query.
Raw load and unload 7-20, 13-14 statement.
SQL statement, use in HPL 8-3
Record Browser window 14-4, 14-5 Suppress message output A-18
sqlhosts file 5-4
Record filter 16-13 Swap bytes 16-10, A-19
Start record for input 16-11
Record Formats window 2-15, Symbol, mapping options 9-14
Start record, for load job 12-13
3-27, 7-5 Synonyms 1-4, 8-7, 9-8
Statistics. See onstat utility.
Record map, assigned by Syntax, onpload utility 16-3
Status log. See Log file.
onpload 16-5
Steps
Records, number to process 16-11
to change load job options 12-14
Rejected records 15-9
to create a device array 6-5
conversion errors 15-9
to create a fixed-length format 7-5
filter conditions 15-9
to create a load job 12-8, 12-15
reviewing 14-7
Index 7
/doc4/rel4/2.0_CD/73ids/hpl/hpl.ix
June 11, 1998 11:30 am
mode 15-3
T multiple jobs 11-4, 12-4 W
table descriptions A-1 onpload database A-17 WHERE clause
Table locking options 11-11, 12-13 match conditions 8-12
deluxe mode 15-4 options, how to change 12-13 preparation 8-11
express mode 15-4 using cron 11-4 Whitespace in configuration
Table, create for example 2-5 Unload Job Select window file B-2
Tape I/O threads 1-17 command line information 11-10 Window
Tape parameters, specifying 6-7 illustration 11-6 Active Job 2-30, 11-9
Tapes Unload Job window 2-34, 2-36, Autogenerate Unload
number of 12-13, A-19 11-7, 13-8 Components 2-35, 13-5, 13-7
number to load 16-11 Unload map Browse Logfile 14-10
Tape, block size 16-10 definition of 9-3, 9-10 COBOL Format definition 7-18
Target server 5-3, 11-4, 12-4 how to create 9-10 Column Selection 8-8, 8-9
Testing formats 14-3 steps to create 9-10 confirm delete 3-25
TEXT data type. See Simple large Unload Options window 11-12 Confirm file-overwrite 8-16
objects. Unload Record Maps Connect Server 5-4
Thread window 9-10, 9-11 Copy Data 3-24
cadiload 1-18 Uppercase conversion 9-15, 16-13 Database Views 8-17
convert 1-17 Usage description, COBOL 7-19 Defaults 3-19, 5-6
fragmenter 1-18 Usage models for HPL 15-13 Delimited Format 2-16
pl_wkr 1-18 Utility, onpload. See onpload utility. Delimited Format definition 7-17
sdriver 1-17 Delimiter Options 7-23
setrw 1-18 Device Array Selection 2-11,
stream 1-18 V 3-8, 6-4
tape I/O 1-17 VARCHAR data type 15-17 device-array definition 2-12, 3-11,
ulstrm 1-22 Variable, binary size of 5-9 6-6, 6-7
unload-stream 1-22 View icon, description 3-29 Fast Job Startup 13-15
worker 1-17 View indicator, figure 9-18 Filter Views 10-11
Trace level A-18 Views 1-4, 8-7 Filters 10-5
Transfer bytes, in mapping Violations table Find Node 9-18
options 9-15 generate from load job 12-13 Fixed Format 7-6
viewing 14-8 Fixed Format definition 7-11, 7-13
Violations Table Browser Fixed Format definition
U window 14-8, 14-9 window 7-6
Violations, description of 15-9 Fixed Format Options 7-21, 7-22
ulstrm threads 1-22
VPs, performance 15-17 format definition 2-16
Universal Server 2-4
Format Views 2-14, 3-17,
Unload data
3-18, 7-24
using onpload 16-7
Generate 13-11, 13-14
Unload job
HPL main window 2-6
changing the options 11-11
Import/Export File Selection 8-14
components of 11-3
Load Job 2-9, 2-18, 2-27, 3-14, 12-9
creating 11-5
Load Job Select 2-8, 12-8, 12-12
definition of 11-3
Load Options 2-28, 12-14
example 2-32
Load Record Maps 2-22, 9-7
from the command line 16-3
Machines 5-9
generate option 13-6
map definition 2-24, 2-25, 2-26,
log file 14-9
9-5, 9-9, 9-12, 9-18
X
X/Open compliance
level Intro-15
Index 9