Using alternative commands for compression

If the target system does not have compress and uncompress commands available, you can use any other compression routine that operates as a filter, which means that it reads from the standard input stream (stdin) and writes to the standard output stream (stdout). For example, if you want to transfer data from a UNIX source system to a Windows target, you can use the gzip/gunzip command pair. These commands are freely available for most systems, including Windows from http://www.gzip.org.

About this task

Complete the following steps to configure gzip/gunzip for use with Optim™ High Performance Unload:

Procedure

  1. Install the commands on both the UNIX source system and the Windows target system
  2. Modify the myhpu script and substitute gzip for the compress command
  3. Modify the .rhosts file by adding another line with the TCP/IP hostname and the user ID for the Windows system

Results

Now you can use gzip to compress data and gunzip to uncompress it.

Example

For example, to send the compressed DEPARTMENT table to a Windows machine (prodsrvr) use the syntax below. For this example, the dept.ctl control file is used.
C:> rsh prodsrvr -l db2inst1 bin/myhpu -f ~/dept.ctl
2> c:\hpu\dept.err | c:\gnu\bin\gunzip