backup

This section describes how to use the backup command to perform automatic instance backups.

backup & restore manager

The infx backup command uses a backup and restore manager that maps backup functions to commands.

If you use ontape or onbar, the infx backup commands remain the same.

More details BAR manager.

infx backup commands

function description
dbs Backup of storage spaces
ext External backup
fake Does no actual backup, but sets flags etc
hot Perform backup to STDOUT, part of the hot copy service
logs Backup all outstanding logical logs
verify Run archecker verification on the latest backup

default

The BARMANAGER setting is in config.ini.

In this example, I assume the default setting, which runs the backups with ontape commands.

BARMANAGER=ontape

ontape BAR manager

infx command ontape command
infx backup type=dbs ontape -s -v -d
infx backup type=ext /infx/local/script/sample/ext-backup.sh
infx backup type=fake ontape -s -F -L 0 -t /dev/null
infx backup type=hot ontape -s -F -L 0 -t STDIO
infx backup type=logs ontape -a -d
infx backup type=verify /infx/local/scripts/sample/ontape-verify
See BAR manager for information about making changes the these settings.

alias

infx uses alias definitions to define short hand versions of all the backup commands.

alias expanded command
infx L0 infx backup type=dbs level=0
infx L1 infx backup type=dbs level=1
infx L2 infx backup type=dbs level=2
infx logs infx backup type=logs

forking backups

infx automatically forks all backup commands into the background, and detaches them from the terminal. 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), then use the follow service to track progress.

Follow the execution of the backup-dbs service

infx follow service=backup-dbs

This short hand version is also valid.

infx follow s=backup-dbs

To follow the execution of the most recently started service.

infx follow

storage space backup

The dbs function of the backup command 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

The location is set in the TAPEDEV variable in the ONCONFIG file, but can also be overridden on the command line.

parameter description
level Level of backup, 0=fiull, 1=everything since last level 0, 2=everything since last level 1
tapedev Alternate directory for ontape backup output, this directory must already exist
ansi Change database logging mode to ANSI logging. Specify a comma separated list of database names
buf Change database logging mode to bufered logging. Specify a comma separated list of database names
unbuf Change database logging mode to unbuffered logging. Specify a comma separated list of database names
nolog Change database logging mode to non-logged. Specify a comma separated list of database names

example commands

command description
infx backup type=dbs buf=db1 Full backup to the default location. After the backup, db1 will be set to buffered logging mode.
infx backup type=dbs level=1 Performs a level 1 backup of the storage spaces, to the default location
infx backup tapedev=/tmp/backup Perform a level 0 backup, the backup will be written to the /tmp/backup directory
infx L0 buf=db1 Performs a backup based on the L0 alias definition, then set db1 to buffered logging mode

scheduled backups

Use the infx auto command to execute backups against all instances, in sequence.

/infx/scripts/infx auto noenv service=backup-dbs
To skip an instance in the automatic backup, create the file /infx/inst/${inst}/etc/deny-auto-backup-dbs.

transaction logs backup

The logs function of the backup command backs up all outstanding logical logs. It does not back up the current log.

Back up all outstanding logical logs.

infx backup-logs

The location of the logical log backup is determined by the LTAPEDEV parameter in the ONCONFIG file, and by default is /infx/inst/${inst}/backup/logs.

automatic transaction log backups

To automate the logical log backups, modify the ALARMPROGRAM script to run the infx backup-logs command.

To convert the standard alarmprogram.sh script that ships with Informix, make the following changes.

  1. Set BACKUPLOGS=Y (around line 30)
  2. Set BACKUP_CMD= "/infx/scripts/infx backup-logs fork=no" (around line 61)

Now, when a logical log fills up, Informix will call the infx backup command and back up the logical logs.

backup verification

The verify function of the backup command is used to run the archecker utility and verify the latest backup.

infx backup type=verify

For ontape backup, the verification is performed using the infx script /infx/local/script/sample/ontape-verify.

Make sure you match the archecker RESTORE_FILTER with the value from the backup

fake backup

A fake backup does not actually do a backup, but can be used to set database logging modes.

infx backup type=fake unbuf=db1

This will set the db1 database to unbuffered logging mode.

This database will not be recoverable until you have done a real level 0 archive.

external backup

infx backup type=ext

The ext function of the backup command 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 utility makes a physical copy of the database chunks.

The external backup command will block the instance, run your external backup command, and then unblock the instance. infx also captures the output into the backup command log.

The command that does the external backup can be any command or script.

This is the default script, which simply makes a tar of the archive files.