Re: Informix 5, How to copy a table / database, HELP!
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, you 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
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.
tbunload/onunload and tbload/onload are nearly always faster than any other
because they read and write informix pages in binary format not rows!!!
kevin
Malcolm Weallans (onlinedbc@cix.compulink.co.uk) wrote:
> > (I'm not a DBA, that is clear!)
> > A client has a Production database and a test database, to test sertain
> > conversions in the database we need to copy tables or the whole database
> > from the production into the test situation, is there a command for
> > this?
> > or is there any other way to do this?
> > ------------------------------------------------------------
> > Hans.Nieuwenburg@Cmg.Nl
> Hans,
> I would recommend that you should do this operation with the utmost care.
> If you are using OnLine I would recommend most strongly that you
> implement 2 instances one for production and one for testing. Then you
> select the production instance, do a DBEXPORT of the database, select the
> test instance, and do a DBIMPORT. That is the safest way. Then make
> sure that test accounts can only use the test instance, whereas
> production databases use the production instance.
> It sounds simple, but if you need help please call.
> Malcolm Weallans
> Online Database Consultancy
> Phone 01628-72154
> Fax 01628-37463
> CIX - onlinedbc