7. restore

This section describes how to use the restore service to perform restores.

backup & restore manager

Like the backup service, the restore service uses the BAR manager to map the different types of restores to commands. See the next section, 8. BAR manager, for more information.

For the purposes of this guide, I will continue with the default infx ontape restore commands.

restore

infx supports the following types of restores:

 function  description
 full  All storage spaces and logical logs
 physical  Only storage spaces are restored
 ext  External restore
 logical  Apply transaction logs
 endlogical  End the application of transaction logs
 salvage  Salvage logical log
 warm  Online, partial restore
 hot  Hot copy of data from one instance to another

These are mapped to the following ontape commands.

 infx command  ontape command
 infx restore type=full  ontape -r -v -d
 infx restore type=physical  ontape -p -v -d
 infx restore type=ext  /infx/local/scripts/sample/ext-restore.sh
 infx restore type=logical  ontape -l -C -d
 infx restore type=endlogical  ontape -l -X -d   
 infx restore type=salvage  ontape -S -d
 infx restore type=warm  ontape -r -v -d
 infx restore type=hot  ontape -p -t STDIO -v

See the Informix Backup and Restore Guide for more information about the ontape command and options. 

full restore

The full function of the restore service completely restores the instance from all available storage space and logical log backups. Once the logical logs have been applied the restore is completed and the instance is brought up to quiescent mode. If possible, the restore process will attempt to salvage transaction logs that were not backed up.

The instance must be offline before the restore starts.

Storage space backups are restored from the ONCONFIG TAPEDEV setting, and all levels of archive in that directory will be restored.

Logical log backups are restored from the ONCONFIG LTAPEDEV directory, and all logical logs will be applied.

You must also meet certain configuration requirements in the instance being restored. See the Informix Backup and Restore Guide for more details.

To recover from a complete failure, you must first re-install the Informix and infx software, as well as recover the backups files to their directories.

The complete restore accepts the following parameters:

 parameter  description
 force  Force the instance offline if its up when the restore starts
 online  Instead of leaving the instance in quiescent mode, bring it up to online mode
 rename  Supply a file that renames chunks
 tapedev  Override the ONCONFIG TAPEDEV parameter with this value

Example full restore commands

 command description
 infx restore type=full Full restore of most recent storage space backups and logical logs. Instance must be offline.
 infx restore type=full force=yes online=yes Shutdown instance, full restore, set instance to online mode when complete
 infx restore type=full tapedev=/tmp/backup Full restore storage space backups from /tmp/backup

physical restore

The physical function of the restore service restores all available storage space backups, but does not apply any transaction logs. You use this function when you want to split the restore process into two parts.

At the end of the restore, the instance will be in "fast recovery" mode. At this point you can, apply transaction logs, start HDR replication, or, bring the instance online.

The physical restore accepts the following parameters.

 parameter description
 force Force the instance offline if its up when the restore starts
 online Instead of leaving the instance in quiescent mode, bring it up to online mode
 rename Supply a file that renames chunks
 salvage Salvage logical logs from disk first
 tapedev Override the ONCONFIG TAPEDEV parameter with this value

Example physical restore commands.

command description
 infx restore type=physical Physical restore only of latest storage space backups
 infx restore type=physical online=yes Physical restore only, set instance to online mode

external restore

Use the ext function of the restore service to perform an external restore. You use this function when you restore storage spaces with an external utilitiuy.

The external function is designed to work with your script. You write a script that wraps the commands needed to perform the external restore. The restore service the calls your script to do the restore. You specify the script and parameters with the BAR manager.

The external restore function accepts the following parameters:

 parameter description
 force Force the instance offline if its up when the restore starts
 online Instead of leaving the instance in quiescent mode, bring it up to online mode
 rename Supply a file that renames chunks
 salvage Salvage logical logs from disk first
 tapedev Override the ONCONFIG TAPEDEV parameter with this value

Example external restore commands.

 command description
 infx restore type=ext External restore
 infx restore type=ext online=yes External restore only, set instance to online mode

logical restore

Use the logical function of the restore service to apply transaction logs. You use this function after restoring storage spaces.

The restore services uses a "continuous" logical restore. This means that after each set of logical log transactions have been applied, the instance will stay ready for more transactions to be applied later. You can override this on the command line, or bring the instance online manually.

The logical restore function accepts the following parameters:

 parameter description
 cont Specify cont=no to end the logical restore when complete
 online Bring the instance online when the roll forward completes, otherwise instance is in quiescent mode

 command description
 infx restore type=logical Apply all transactions from default location, stays in continuous roll forward mode
 infx restore type=logical cont=no online=yes Apply transactions, end the roll forward and bring instance to online mode.

end continuous logical restore

Use the endlogical function of the restore service to signify that the transaction roll forward is complete. You use this function when you no longer want to apply transaction logs, and want to bring the instance online.

The endlogical restore function accepts the following parameters:

 parameter description
 online Bring the instance online when the roll forward completes, otherwise instance is in quiescent mode

 command description
 infx restore type=endlogical End the continuous roll forward
 infx restore type=endlogical online=yes Complete the roll forward and bring the instance online

warm restore

Use the warm function of the restore service to restore selected storage spaces while the instance is online. You use this function to recover down, non-critical storage spaces, while the instance is online. During this restore, data in online storage spaces is still available.

The warn restore function restores the storage spaces from the most recent backups, and then applies all transaction logs.

 parameter description
 dbspacelist Warm restore these spaces only, otherwise all down spaces are restored.

 command description
 infx restore type=warm Warm restore all down storage spaces
 infx restore type=warm dbspacelist=dat01,dat02 Only restore dat01 and dat02 storage spaces

hot copy

Use the hoy copy function of the restore service to copy the contents of one instance to another. A backup is performed on the fly in the source instance and restored directly to the destination instance.

If the source instance is on a different host, infx uses ssh to execute the backup.

If the source instance and destination instance chunk names differ, infx automatically generates a rename file to map the chunks. Example chunk renaming from instance infx01 to infx02.

chunk /infx/inst/infx01/chks/dat01.000 => /infx/inst/infx02/chks/dat01.000

If the chunk file does not exist in the destination instance, infx uses the command specified in the INFXCHUNK parameter to create the new chunk.

The hot copy function accepts the following parameters:

 parameter description
 force Force the instance offline if its up when the restore starts
 online Instead of leaving the instance in quiescent mode, bring it up to online mode
 rename Supply a file that renames chunks
 salvage Salvage logical logs from disk first
 tapedev Override the ONCONFIG TAPEDEV parameter with this value

Example hot copy commands.

 command description
 infx restore type=hot source=infx01 online=yes Copy from instance infx01, bring instance online when complete