I have not used Informix before. I have an informix database on host1 and would like to copy this database to host2 for testing purposes. My end goal is to use the database on host2 and not corrupt the database on host1. Thanks.
3 Answers
You've not told us a lot of important information:
- Which Informix data server: IDS, SE, XPS, OnLine, ...
- Which version
- Which platform for host1 (o/s and version)
- Which platform for host2 (is it the same as host1; if not, what is it)
Depending on the answers to these questions, the response might vary. However, we'll assume that you have IDS version 11 (11.50 or 11.70), and the two hosts are the same basic hardware and o/s.
As Aragorn said, one way of doing this is with DB-Export and DB-Import. These create unload files for each table in the database, and an SQL file to control the recreation of the database and the loading of the data. It is a flexible approach; you can use the data on all sorts of different machines, and often on different versions of Informix. It is not necessarily fast.
Given the assumption that the machines are 'the same' and running the same o/s (and version of IDS), you could make a Level 0 archive on host1 and restore it on host2. With the versions assumed, you can even restore to a set of chunks in different locations from the chunks on host1 - a so-called redirected restore. By default, the files and devices on the two machines must be identical (or, at least, functionally identical); a redirected restore allows you to have different sets of chunks on the two machines. This is possibly the quickest way to do things. It is inflexible, though. You must be running on the same hardware and o/s and substantially the same version of IDS (you can sometimes get away with small differences in the version, but don't bet on it).
You can consider a backup to standard I/O with ON-Tape (in archive mode), piped over the network to host2 and run into ON-Tape again (in restore mode).
There are other options. You could do a selective restore from a Level 0 archive with AR-Checker. You could set up ER and synchronize the two systems. You could make host2 into a temporary HDR secondary, synchronize, then split the HDR pair and make the secondary into a primary again. You could investigate RSS (remote standalone secondary), making host2 into an RSS node and synchronizing it with host1, then breaking the coupling.
You could consider playing with HPL - the high performance (un)loader. It would force you to do thinking that DB-Export and DB-Import spare you. You might use DB-Schema to create the schema for the DB, then use external tables to unload the data on host1, and then create the DB and use external tables to load the data on host2. Again, this would force you to do some scripting and thinking.
There are probably some other options, but this mentions most of the main ones that use just tools from the Informix toolset. If you want other alternatives, you could look in the International Informix User Group (IIUG) Software Archive.