RE: Informix 5, How to copy a table / database, HELP!
Posted in 1996
>Hans.Nieuwenburg@Cmg.Nl 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?
>------------------------------------------------------------
As we don't trust the "selective approach" (copy single tables) we use
dbexport/dbimport to copy the whole production db into a test environment.
Just find a file system with enough space to hold your db and make sure
there are no users on the production db (you may want to run a shell-script
at night in a cron-job which makes a shutdown of OnLine with onmode -ky
and then oninit and then dbexport db_name -o your_filesystem).
After that you'll find the db under your_filesystem/db_name.exp which
could then be copied to another system and imported (syntax see below) or
if you run the production and test databases on the same server you need
to rename your_filesystem/db_name.exp/db_name.sql to new_db_name.sql
and your_filesystem/db_name.exp to new_db_name.exp
You're all set: Find yourself a dbspace with enough free space and type:
dbimport new_db_name -d your_dbspace -i your_filesystem
Hope this helps - otherwise you might be forced to rtfm ...
Good Luck.
Ralph.
PS: For a single table try onunload/onload
________________________________________________________________________
Never attribute to malice that which is adequately explained by stupidity.
____________________ ralph.halter@pac.panmail.com ________________________