Re: Informix Backups
Posted in 1998
Coburn wrote:
>
> (Try something like the following. I wrote it when I first started working
> with informix. Its the first draft that never went anywhere but gets used
> ofter. )
> # The purpose of this script to to automate the backup of the database
> # and to help ensure its integrity. The DB status is tested initially
> # so that the DB can be restored to its pre backup status.
> # Future mods will echo outputs to file and CRON the job. For now this will
> # do
>
> # Function to test the status of the database prior to backup.
> Status_func () {
> if [ `onstat -g ntm | grep INFORMIX | awk '{print $5}'` = "On-Line" ]; then
> DBSTATUS="1"
> elif [ `onstat -g ntm | grep INFORMIX | awk '{print $5}'` = "Quiescent" ];
> then
> DBSTATUS="0"
> elif [ `onstat -g ntm | grep INFORMIX | awk '{print $5}'` = "for" ]; then
> DBSTATUS="2"
> #echo "You must bring the DB online to back it up"
> #exit
> fi
> }
As a point of interest, you can check the current mode of IDS by
checking the status ($?) after onstat -.
The values returned by 'onstat -' are:
-1 Offline
0 Initialisation
1 Quiescent
2 Recovery
3 Backup
4 Shutdown
5 Online
6 Abort
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
|Mark D. Stock - Informix SA http://www.informix.com |//////// /|
|mailto:mdstock@informix.com http://www.iiug.org |///// / //|
| +-----------------------------------+//// / ///|
| Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////|
| Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / /////|
|Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////|
+----------------------+-----------------------------------+-----------+