Documentos de Académico
Documentos de Profesional
Documentos de Cultura
19972004 Ascential Software Corporation. All rights reserved. Ascential, Ascential Software, DataStage, MetaStage, and MetaBroker are trademarks of Ascential Software Corporation or its affiliates and may be registered in the United States or other jurisdictions. Adobe Acrobat is a trademark of Adobe Systems, Inc. Microsoft, Windows, Windows NT, and Windows Server are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Adaptive Server, Open Client, and Sybase are either registered trademarks or trademarks of Sybase, Inc. UNIX is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company, Ltd. Other marks mentioned are the property of the owners of those marks. This product may contain or utilize third party components subject to the user documentation previously provided by Ascential Software Corporation or contained herein.
Printing History
First Edition (74-0111) for Release 1.0, August 1997 Second Edition (74-0111) for Release 1.1, June 1998 Third Edition (74-0111) for Release 1.2, March 1999 Fourth Edition (74-0111) for Release 1.3, September 2001 Updated for Release 1.3, August 2002 Updated for Release 1.3, August 2003 Updated for Release 1.3, May 2004
May 2004
74-0111
Introduction
This technical bulletin describes the following for Release 1.3 of Sybase IQ Load, updated for Ascential DataStage Release 7.5: Functionality Terminology Installation Index sets Disk overflow handling Stage and link properties
The Sybase Adaptive Server IQ (Sybase IQ) is an advanced indexing engine, not a database management system. The goal of the Sybase IQ Load stage is to enable Ascential DataStage to load data into existing Sybase IQ index sets rapidly and efficiently. Each input link to the stage represents a stream of rows to load into a Sybase IQ index set or joined index set. Reference links and output links have no meaning in the context of Sybase IQ Load and are not allowed. Use Sybase IQ Load with versions of Sybase IQ before Version 12. Use Sybase IQ12 Load with Version 12 of Sybase IQ. You can create jobs with both the Sybase IQ12 Load and the Sybase IQ Load stages if you need to load different versions of Sybase IQ within the same job. See the online readme file for your platform for the latest information about the Ascential DataStage release.
Functionality
Sybase IQ Load supports the following functionality: Support for NLS (National Language Support). For more information, see Ascential DataStage NLS Guide. Support for Ascential MetaStage. For more information, see Ascential MetaStage Users Guide. Generation and optional automatic execution of the Sybase IQ commands to load index sets with data from input links. Two methods for loading an index set automatically: in-line with the job or using a post-job batch file. Automatic loading of joined index sets in the correct order.
74-0111
May 2004
Automatic generation of overflow data files if the first data file exhausts physical disk space. Support for data files that exceed the 2-GB file size limit for 64-bit file systems. Allows the job designer to specify Sybase IQ commands to be run before and after the insert for the primary purpose of sending diagnostic or verification output to the DataStage log. Generation of data files in fixed-width or delimiter-separated ASCII format. The following functionality is not supported: Deletion and recreation of the index set itself. Other modes of operation supported in database load utilities, for example, update existing rows only. Automatic execution of insert commands works only when the Sybase IQ Server resides on the same machine as the DataStage job. Loading of joined index sets can only be done using an after-job subroutine, because the stage instance has no way to guarantee that the columns of different tables in the index set will be loaded in the correct order. (The job compiler may draw a process boundary through a given stage instance so that there is no one process address space that knows the status of all the links connected to the stage.) Exploitation of named pipes as a way to avoid generating large data files.
May 2004
74-0111
Terminology
The next two sections explain the Sybase IQ and the Sybase IQ Load terms used in this document.
Sybase IQ Terminology
The following table lists the Sybase IQ terms used in this document: Term index index set Description A single column in an index set. The Sybase IQ equivalent of a table. It is a collection of named, typed indexes on columns of data which may have come from a Sybase SQL Server database, a foreign database, or a flat file. Sybase IQ Load loads data into index sets. Every index set definition has associated with it a Sybase SQL Server table definition, because Sybase IQ uses the SQL Server to catalog information about its index sets. The Sybase IQ entity that contains index sets. The index space owns disk and other resources, and provides a handle for administration. The Sybase IQ command used to delete data from an index set. This command does not delete any data from the underlying table. The Sybase IQ command used to insert data into an index set. This command does not insert any data into the underlying table. The server engine to which you connect in order to use Sybase IQ. An IQ Server instance provides access to one or more index spaces.
index space
IQ DELETE
IQ INSERT
IQ Server
joined index A set of indexes over the columns of a relational join between sets two or more tables. A given table in the associated Sybase SQL Server catalog can have an index set over itself, and can at the same time participate in any number of joined index sets. The joined index sets and the simple index set are distinct and must be loaded separately.
74-0111
May 2004
data file load sequence number post-job loading script stage instance
Index Sets
The next sections describe loading index sets and joined index sets.
May 2004
74-0111
Manual Loading
The Sybase IQ Load stage instance generates an ASCII data file and a control file for each input link, but does not load the data into Sybase IQ. You can load the data later by redirecting the control file to the Sybase isql utility. Manual loading is the default.
Automatic Loading
Rows arriving at an input link are written to a data file as in manual loading. When the link reaches end-of-data, appropriate IQ DELETE and IQ INSERT commands are generated and executed via a Sybase Client-Library connection to the IQ Server. The commands to be executed are also written to a control file to log the activity. Automatic loading works if both the DataStage Server and the IQ Server reside on the same machine. It also works if the two servers reside on different machines that are connected by a local area network (LAN) if both of the following conditions are met: Sybase Open Client must be installed on the machine hosting the DataStage Server. The control files, data files, and overflow directories are written to a directory visible to both the DataStage Server and the IQ Server. This directory must use the same absolute pathname on both machines. For more information about overflow directories, see Disk Overflow Handling on page 7.
Post-Job Loading
The data file and control file are written the same way as in manual loading, but the control file commands are executed by a batch file invoked as an ExecDos afterjob subroutine. When used with load sequence numbers, this method guarantees that multiple index sets are loaded in the correct order. The requirements for automatic loading of data when Ascential DataStage and IQ Servers reside on different machines on a LAN also apply to post-job loading. Note: This is the only method supported for loading joined index sets.
74-0111
May 2004
May 2004
74-0111
name.ctl, where n is an integer starting with 1). Within each directory, the batch file executes the control files in the order indicated by these prefixes. You can run IQLOAD.BAT manually from the DOS prompt by entering the following:
C:\> IQLOAD username password iqserver dir1 [dir2...]
Note: The IQLOAD.BAT file distributed with Sybase IQ Load only executes control files from links that have load sequence numbers, and it does not delete any previous data files or control files which may be there.
5.
74-0111
May 2004
the second directory in the list and continues. In this way, the data can be spread among multiple disk drives or partitions. The pathnames of overflow files are added to the USING clause of the IQ INSERT command that loads the data. Note: If you experience any timeout issues, increase the default values for CS_RETRY_COUNT and CS_TIMEOUT_VALUE to 10 or higher.
Properties
The tables in the next two sections include the following column heads: Prompt is the text that you see in the stage editor user interface. Default is the value used if you do not supply a value. Description describes the properties.
May 2004
74-0111
Password
IQ Server Name The IQ Server name as defined for any IQ client program. User ID
74-0111
May 2004
Prompt Data File Name Clear Before Load Post-insert Command Pre-insert Command IQ DELETEFROM
Default
Description
tablename.dat Data file (generated by Ascential DataStage) Yes None None None (Yes, No) Runs IQ DELETE command before load Optional IQ command to run after delete/insert operation Optional IQ command to run before delete/insert operation Optional FROM clause for IQ DELETE Optional WHERE clause for IQ DELETE command Optional WITH clause for IQ DELETE command Required if loading a joined index set Optional WITH clause for IQ INSERT command index set load order (required for joined index sets) (Required) Target Sybase IQ index set
IQ DELETEWHERE None IQ DELETEWITH Joined Indexset name IQ INSERTWITH Load Sequence Number Indexset Name None None None 0 None
10
May 2004
74-0111
CTRLFILE
DATAFILE
DODELETE
11
74-0111
May 2004
Property IQAFTERCMD
Help Text Full literal text of an optional IQ command to run after the DELETE and INSERT commands that perform the load. This can be used to run IQ SHOW or other commands that generate diagnostic output. Output from these commands appears in the DataStage job log if you request Automatic Loading. Full literal text of an optional IQ command to run before the DELETE and INSERT commands that perform the load. This can be used to run IQ SHOW or other commands that generate diagnostic output. Output from these commands appears in the DataStage job log if you request Automatic Loading. For joined index sets only, this permits full specification of the FROM table[,table] clause of the IQ DELETE FROM JOINED INDEXSET FOR table FROM command. Defaults to the name of the index set for this link. The keyword FROM is optional. Specifies optional search_condition(s) for the IQ DELETE command. If defined, search_condition(s) access the WHERE clause of the IQ DELETE or IQ DELETE FROM JOINED INDEXSET command. The keyword WHERE is optional. Specifies optional delete_load_option(s) for the WITH clause of the IQ DELETE command. This can be used to control various parameters of the deletion process (see Sybase IQ Language Reference). The keyword WITH is optional. Name of the joined index set to load. Required for joined index set loads, otherwise ignored. The presence of a joined index set name and a load sequence number greater than 1 causes an IQ INSERT INTO JOINED INDEXSET command to be generated as the load command for the link instead of an IQ INSERT INTO command. For more information, see the help on load sequence numbers. Specifies optional insert_load_option(s) for the WITH clause of the IQ INSERT or IQ INSERT INTO JOINED INDEXSET command that loads the data. This can be used to control various parameters of the load (see Sybase IQ Language Reference). The keyword WITH is optional.
IQBEFORECMD
IQDELFROM
IQDELWHERE
IQDELWITH
IQJOINIDXSET
IQLOADWITH
12
May 2004
74-0111
Property IQLSN
Help Text The load sequence number of a link governs the order in which its data is loaded relative to other links attached to this stage. A nonzero load sequence number disables Automatic Loading. The load sequence number becomes a prefix to the control file name. If a joined index set name is defined, then IQ INSERT INTO JOINED INDEXSET syntax is generated for links whose load sequence number is greater than 1. (The top table in the join hierarchy of the joined index set should be given a load sequence number of 1 because it needs an IQ INSERT INTO command. See Sybase IQ Language Reference and other Sybase IQ documentation.) Name of the Sybase IQ index set to load with data from this link. This name is the argument of the FOR clause in the IQ INSERT INTO command or the IQ INSERT INTO JOINED INDEXSET command. (Required)
TABLE
13
74-0111
May 2004
14