Download Latest Version tpc-c-ifmx.tar.gz (392.7 kB)
Email in envelope

Get an email when there's a new version of IIUG Software Repository

Home / DBAdmin-Tools / on_to_unload
Name Modified Size InfoDownloads / Week
Parent folder
on_to_unload.c 2020-05-11 25.2 kB
README.1st 2020-05-11 3.4 kB
sql2fmt.awk 2020-05-11 603 Bytes
Totals: 3 Items   29.1 kB 0
Date: January 6, 2003

Utility: on_to_unload.c

Synopsis: This utility, was written to deblock and extract records from the

output of arcunload.  It will also read onunload output for a single
table and the arcunload feature of archecker.  Currently on_to_unload is
formatted to read an onunload format file and write out a dbload
compatible delimited data file.  Data decoding is based on a list of data
types, with length for char fields, as generated by sql2fmt.awk from a
dbschema or myschema listing of the single table.

This utility was written as a companion for the arcunload utility available
from IIUG Software Repository (Special Programs section) which extracts a
table's data from a level 0 ontape archive and writes the data pages to a
file suitable for reloading using onload.  However, since it is not always
convenient to restore that way and since such emergency extractions are
normally done to recover a subset of the data lost due to fumble fingers, I
wrote this utility to read an onunload file, such as that produced by
arcunload, and output a delimited file suitable for editing and manual
extraction and for loading using dbload or the dbaccess load command.

The purpose of this is to be able to edit and extract selected rows from
the arcunload output without having to load the data into a table first.
It also makes it possible to arcunload records from one server's archive
and restore them to another server.

Datatype support is not complete and may never be as arcunload is no
longer supported though the arcunload feature of archecker still exists. 
        
Author(s): Art S. Kagel, kagelfamily@netscape.net
Revision: 1.4
Version(s) supported: 7.2x+
File(s): on_to_unload.c, sql2fmt.awk
Comments: requires arcunload, though it can be used with a true onunload
    output file or tape containing a single table (testing was performed
    using both arcunload and onunload output).
 
Release Notes: 

Ver 1.2-1.4 implement additional datatypes including DATE, DATETIME,
DECIMAL, INTERVAL, and VARCHAR.

Ver 1.01 fixed bug outputting rows with misaligned data (ie binary row image 
contains columns that are not properly aligned for the hardware).

This initial release only contains rudimentary data type and table support.
Tables containing BLOBS, UDTs, etc and rows larger than a single page are
not supported.  Supported data types so far: serial, integer, smallint, float,
smallfloat, char (fixed length).  Also GLS support is not included.  It should
not be difficult to add support for the other fixed length data types.  Support
for variable length data types requires that the slot table parsing understand
about slot forwarding when a row outgrows its home page.  Also support for rows
that do not fit on a single page will require complex record caching techniques
as will BLOB support.

Usage instructions:

Pipe the output of dbschema or myschema to awk -f sql2fmt.awk and save
the output, ie:

myschema -d mydatabase -t table_to_unload | awk -f sql2fmt.awk >typefile

Edit the output file to remove any lines that DO NOT begin with a data type.

Now run the on_to_unload executable as:

on_to_unload typefile arcunload_output_file on_to_unload_output_file.unl

If you get any messages about unknown types you will have to update
on_to_unload.c to handle them.  Please send any update back to me for
distribution. 
Source: README.1st, updated 2020-05-11