728x90

Question

How do I set up the High-Performance Loader (HPL) Informix utility?

Cause

Informix DBAs and System Administrators usually find HPL a little bit tricky, due to its own shared memory management engine and specific command line instructions to handle the load and unload jobs control.

This document gathers a compilation of useful links and ease-of-use instructions to quickly set HPL ready to run.


Answer

Eventually, some may find the GUI option the best path, but this document intends to prepare the reader to set HPL in just a few steps, thru the command line interface.

1. First of all, you should choose a table to create the HPL job (and the onpload database):

  $ onpladm create job j_items -d "items.unl" -D stores -t items 

   Successfully created Job j_items

    where:
    As soon as the first job is created, the onpload database is created too, if is doens't exist already.
    If it does exist, you should rename it so it won't cause any trouble.

2. To execute the j_items job as an unload job, just issue the command below, using the -fu flag:

   $ onpload -j j_items -fu -l items.log -i 100000 -R $PWD/a
     
    where:

3. To use the same job as a load job, just issue the command below, changing the -fu flag by the -fl flag: 

   $ onpload -j j_items -fl -l items.log -i 100000 -R $PWD/a 
 
4. Obviously, no one would use HPL facility to unload/load a single table. The sections bellow show some SQL queries to generate the onpload commands for each table. You can use the DBAccess utility to execute these commands.

Don't forget to change the <dbname> variable for your database name, i.e.: stores_demo.
    select tabname from systables where tabid > 99 and tabtype = "T" into temp a;
    output to hpl_create_job.sh without headings
    select onpladm create job job_"||trim(tabname)||" -d '/tmp/"||trim(tabname)||".unl' -D <dbname> -t "||trim(tabname) from a    
    select tabname from systables where tabid > 99 and tabtype = "T" into temp a;
    output to hpl_create_job_delux.sh without headings
    select onpladm create job job_"||trim(tabname)||" -d '/tmp/"||trim(tabname)||".unl' -D <dbname> -t "||trim(tabname)||" -fc" from a    

For all the tables that has BLOB columns only Deluxe Mode can be used.

5. When all the shell scripts are done, you can clean them up, avoiding line feeds and weird characters which may cause a failure at execution time.

Follows attached, two scripts that might be used as cleaning tools:
    a. Use this tool to remove line feeds, name it join.sh:
      :join 
      /\\$/{N 
      s/\\\n/ / 
      b join 
      }

    b. Use this tool to remove blank lines, name it del_blank.sh:
      sed '/^$/d' $1
      Here's an example on its use:

      cat hpl_load_job.sh | sed -f join.sh > zz 
      sh del_blank.sh zz > zzz 
      mv zzz hpl_create_job.sh

And the final hpl_create_job.sh script is clean.

4. one important notice that should be taken care of is the following HPL environment variables:
 

http://www-01.ibm.com/support/docview.wss?uid=swg21587169

728x90

+ Recent posts