![]() backup & restore managerThe infx backup service uses the infx BAR manager to map backup service types to backup commands.
For example, you could map the logs backup to the ontape -a command, to the onbar -b -l command, or, to your own script.
For the purposes of this guide, I will use the default BAR manager settings for ontape backup to directories. For details on setting up for other backups, see:8. BAR manager
The backup functions supported by infx are:
The default infx BAR manager definition maps the backup types to ontape commands.
aliasinfx includes default alias definitions to make running backups from the command line easier.
forking backupsinfx automatically forks all backup commands into the background, and detaches them from the terminal that started them. This means that if you log out or lose your network connection, the backup continues.
You can manually fork the infx command into background (adding a "&" to the command line), in that case, you can use the follow service to track the progress of the service. Example, follow the execution of the backup-dbs service. infx follow service=backup-dbsinfx follow s=backup-dbsExample, follow the execution of the most recently started service. infx followdbs backupThe dbs function of the backup service backs up the storage spaces, and can also be used to set logging modes of databases in the instance. By default the backups are stored in the instance backup directory (/infx/inst/${inst}/backup/db). This is set in the ONCONFIG TAPEDEV parameter, but can also be overridden on the command line.
examples
logs backupThe logs function of the backup service is used to back up all outstanding logs. That is, logical logs that are used but have not been backed up. It does not back up the current log. infx logsThe location of the logical log backup is determined by the ONCONFIG LTAPEDEV parameter, and by default is /infx/inst/${inst}/backup/logs. The easiest way to configure automatic back up of the logical logs is by using the ALARMPROGRAM setting in the ONCONFIG file. Different events and conditions in the instance will trigger this command. One of the triggers is a logical log filling up, and the Informix supplied script already has hooks in it for your backup command. To convert the standard alarmprogram.sh that ships with Informix, make the following changes.
Now, when a logical log fills up, Informix will call the infx backup service and back up the logical logs. external backupThe ext function of the backup service is used to run external backups. External backups are done by a utility outside of Informix. To support this back up type, Informix allows you to block the database server, holding updates while the external utilitie makes a physical copy of the database chunks. The external backup service will block the instance, run your external backup command, and then unblock the instance. infx also captures the output into the backup service log. The command that does the external backup can be any command or script. It can use the storage itself to copy or clone the data, or any other utility. Just remember that you cannot update the database while the external backup is running. Example script that uses tar to make a backup of the chunk files. #!/bin/kshcd /infx/inst/$INFORMIXSERVER/chkstar cvf - . | gzip -c >/scratch/infx/$INFORMIXSERVER.tar.gzfake backupA fake backup does not actually do a backup, but can be used to set flags within the instance, but a real backup must be performed shortly after. Examples
When you take these actions, your database is not recoverable until you have completed a real level 0 backup. For example, here is a sequence that benefits from using the fake backup.
hot backupThe hot backup function of the backup service is used to copy the data from one instance to another of the same format. You would not normally execute this command directly, but use the hot copy function of the restore service to copy one instance to another. The hot backup is executed as a "fake" backup, and has no impact on subsequent level 1 backups. backup verificationThe verify backup function of the backup service is used to run the archecker utility and verify the latest backup.. For ontape backup to directories verification is performed using the infx script /infx/local/script/sample/ontape-verify. Example script that performs archecker verification: #!/bin/sh## ontape-verify.sh## Verify the last backup using archecker#FLAG=$INFX_FLAGif [ -z "$FLAG" ] ; then FLAG=-tfirm -f /tmp/ac_msg.logarchecker ${FLAG}dvspassed=`grep "Archive Validation PASSED." /tmp/ac_msg.log | wc -l`if [ $passed -eq 1 ] ; then echo `date` infx_info archive validation passedelse echo `date` infx_error archive validation failedfi |

