RE: How to copy a database
Posted in 1996
Why use SQL:UNLOAD or dbexport, which both need filesystem space large
enough to hold your data? Simply use tbunload (v5.x)/onunload (v7.x) to
a tape device and then tbload/onload into the test area. This can be done
across the network to another machine, across instances of Online, or locally
on the production server. The only draw-back I can think of is that during
the unload process, your database will be locked exclusively.
You may even use the filesystem by 'touch'ing a file and using its name as
the tape device on the command line.
Try this:
cd /tmp
mknode mypipe p # a named UNIX pipe ( FIFO )
echo "\\n" | onunload -t /tmp/mypipe -b 8192 -s some_large_number database_name &
onload -t /tmp/mypipe -b 8192 -s same_number -d dbspace_name database_name
Here you have a file, 'mypipe' that will act as a pipe between the
unloader and the loader. This is somewhat slower than using a tape but
requires very little filesystem space.
Using tb/onunload and tb/onload is nearly always faster than any other method
because they read and write informix pages in binary format, not rows!!!
Kevin Brand