Informix database backups
Posted in 1992
Bob Kane wrote:
>In X-Informix-List-Id: <news.1091> Don Amby asks:
>> I am relatively new to Informix, and am wondering if it is possible to do
>> non-interactive backups of an Informix database? I can do this for my normal
>> backups, via cron, and I want to be able to do the same for backing up a
>> database.
>
>Depending on which version of Informix you are using, your best bet would
>be to use DBEXPORT. This will create a schema for rebuilding your database as
>well as unloading all of your tables into delimted ASCII. It also has the
>advantage of being able to write directly to tape.
There are three ways to do Informix backup: "tbtape", "tbunload" and
"dbexport". Each with different performance( time and storage required) and
dbexport is the WORST one in terms of time required !
1. tbtape command allows you to do on-line backup of the whole database
installation ( Yes, that's right; You can't just backup a single database
or table).
The advantages of using tbtape command are:
* On-line backup and databases are not locked. A must for commerical
environment.
* Incremental backup (level 0, 1 and 2) saves time and storage space.
* Output tapes can be used with logical log backups in recovery process
to bring database installation back to the content just before the
database corrupted.
* Fast. It unload data in binary in multiple disk page units with
minimal processing.
Disadvantages:
* Not fast enough :-) Reading data off the disk and writing to tape all
in single thread I/O. For a commerical MP environment with large
database installation( 10 - 50 GB), it's unacceptable !
2. tbunload/tbload commands allow you to do online backup of a specific
database of table.
The advantages:
* On-line backup.
* Fast. It also unload data in binary in multiple disk page units with
minimal processing.
The disadvantages:
* No incremental backup.
* Can't be used with log backup tapes in recovery process to bring
database to the most recent date.
* Database/table target is locked during unloading.
3. dbexport/dbimport: they are not really designed for doing database
backup IMO. They are used to dump database in ASCII format for
further processing or exporting to other RDBMS. The performance is
very bad due to extensive processing.
Now, as for doing non-interactive backup; I don't see how you can do it
with any of the above. They all interactively prompt you things like
"Please mount the tape and press return to continue ...". Tbtape command
also prompt for level of backup intended( Why can't they implement this as
a command line option ?!?). That's the only minor thing keep you from
doing unattended (cron job like) backup.
I mean, you have to change tapes, don't you ? If your database is small
and can be stored on one tape, as some other net people pointed
out, you can port the "tcl" and "expect" utilities to take care of the
very first prompt. Good Luck.
If you have any good strategy or experience in backup/recover Informix
database, I would lke to know and please send me an email !
Eric Chen
=============================================================================
Eric Chen Database Division, Pyramid Technology echen@pyramid.com
=============================================================================