OneDB - Loader configurations
You must use an OneDB database on the supported operating system. If you are using a different database, adjust the instructions accordingly.
You can use "dbload
" (IDS utility) as a load utility. This utility is only
available with IDS installation and not with ICSDK installation. So to achieve the load utility
functionality, the preferable tool is "dbaccess".
The following procedure describes the dbaccess tool for load utility.
- Create load control file template.
- Create a load control file template for adding records. The template must consist of the
following lines.
Sample template name :
onedbLoad.ctr
CONNECT TO 'hard_coded_db_name' USER '<USER>' USING '<PASSWORD>'; LOAD FROM '<DATAFILE>' DELIMITER '|' INSERT INTO <TABLENAME>;
Note: Tokens mentioned in the sample file should be in quotes. The DB name on which the loader utility is supposed to run, must be hard-coded, as mentioned in the example. - Create a script or executable to start the load utility. To invoke the load utility,
Campaign uses a shell script for Unix or executable for Windows, which is identified in
the
Loadercommand
configuration property. You can either specify a direct call to the database load utility executable or a call to a script that launches the database load utility.Sample shell script for Linux / AIX OS
onedbLoad.sh: #!/bin/sh cp $1 $Campaign_Home/partitions/partition1/tmp/controlfile.sql dbaccess - $Campaign_Home/partitions/partition1/tmp/controlfile.sql
Sample executable file for Windows
Case 1 : If OneDB server and OneDB client SDK are installed on same machine.
OneDBLoad.bat
set CTRL_FILE=%1 copy /Y "%CTRL_FILE%" "controlfile.sql" set INFORMIXDIR=<OneDB Directory> set REGMACHINE=\\<Server Hostname> set INFORMIXSERVER=<Server-name> set ONCONFIG=onconfig.<server-name> set INFORMIXSQLHOSTS=$OneDB_Software_Bundle\etc\sqlhosts.<server-name> set GL_USEGLU=1 set PATH=%INFORMIXDIR%\bin;%PATH% <INFORMIXDIR>/bin/dbaccess - controlfile.sql
If OneDB server and OneDB client SDK are installed on different machines.
OneDBLoad.bat
set CTRL_FILE=%1 copy /Y "%CTRL_FILE%" "controlfile.sql" set INFORMIXDIR=<CSDK installation path> set INFORMIXSERVER=<IDS server name> set INFORMIXSQLHOSTS=Path to sqlhosts file which is <CSDK_HOME>/etc/sqlhosts set GL_USEGLU=1 set PATH=%INFORMIXDIR%\bin;%PATH% <INFORMIXDIR>/bin/dbaccess - controlfile.sql
Note: If the setup is Unicode, add the following additional lines beforedbaccess
command.set LANG=en_US.utf8 set DB_LOCALE=en_US.utf8 set CLIENT_LOCALE=en_US.utf8 set SERVER_LOCALE=en_US.utf8
- Open C:\Windows\System32\drivers\etc\services file and add a new
entry for IDS like
IDS serviceName
which is a service name in IDS machine on which IDS is running andIDS port number
which is a port number on IDS machine on which IDS is listening. For example:<service-name>9091/tcp
- If required, make the following changes.
- Open the copied <HCL_OneDB_Client_SDK>\etc\sqlhosts.%informixserver% file.
- Copy the existing line and replace the machine name with its IP address.
- Set the loader configuration properties in Campaign.
- Select Campaign|partitions|partition1|dataSources|<datasourcename>
LoaderCommand
: The path to the script or executable to invoke the database load utility. The script must beCAMPAIGN_HOME/partition/partition[n]
.Sample value:
<CAMPAIGN_HOME>\partitions\partition1\OneDBLoad.bat <CONTROLFILE>
-
LoaderControlFileTemplate
: The control file template configured for Campaign. This file must also be inCAMPAIGN_HOME/partition/partition[n]
format.Sample value:
<CAMPAIGN_HOME>\partitions\partition1\OneDBLoad.ctr
LoaderDelimiter
: The delimiter used in the loader control file template.Sample value:
|
LoaderDelimiterAtEnd
: It specifies whether to put delimiter after last column value in control file or not.Sample value:
True
. For OneDB, this must betrue
.
and then select