Backup Considerations
Before performing any backup procedures for this agent, review the following information:
-
If you perform a backup of the default subclient without changing its default properties, the backup would include all the objects in the database, including any new objects that may have been created.
-
If you have created subclients for a database, you can create a complete backup of the database by backing up these subclients.
-
If you have created a group of selected subclients for the database, you must back up all of these subclients to create a complete backup.
-
If you have created separate subclients for the logical log files, backup emergency boot file, and or backup ONCONFIG file, and if these subclients are not included with the subclients defined for databases or subsets, then the subclients for these files must also be backed up to create a complete backup.
-
-
Informix recommends that you run an Incremental Level 0 backup (Full backup) after adding new dbspaces to the database. If this is not done, the next Incremental backup will fail because the system will not be able to find the parent files for the new dbspaces.
-
Multiple streams are supported for data protection and recovery operations with this agent; however, before utilizing multiple streams, you should understand how their use affects operations. For more information, see Streams.
-
A file system backup for the following files must be run from the CommCell immediately after a backup:
-
ONCONFIG file
-
Emergency boot files (ixbar)
-
sm_versions file
-
sqlhosts file (UNIX)
-
oncfg_servername.servernum.coserverid file from each co-server
-
xcfg_servername.servernum file in the etc subdirectory
The ON-Bar utility stores information about the backup and logical logs in the ixbar file (as well as in the sysutils database). This file must not be modified by users. If this file becomes corrupted, modified, or removed, ON-Bar may not be able to find the backups needed to perform a restore resulting in data loss.
-
Note
You must perform a level-0 backup after you run the unset command on the IFX_BAR_USE_DEDUP environment variable.
Full Backups
Full backups provide the most comprehensive data protection.
Backups for any client start with a full backup. The full backup becomes a baseline to which subsequent backup types are applied. For example, a full backup must be performed before an archive log backup can be initiated.
You can perform a full backup of an online or offline database. If the database is in NOARCHIVELOG mode, you should perform offline backup only.
-
From the CommCell Browser, expand Client Computers > client > Informix > instance.
-
Right-click the subclient, and then click Backup.
The Backup Options for Subclient dialog box appears.
-
Select the backup type and job initiation:
-
In the Backup Type section, select Full.
-
In the Job Initiation section, specify whether to run the backup now or whether to schedule it.
Note: If you specify to schedule the backup, define the schedule.
For information on scheduling backups, see Schedule backups.
-
-
Click OK.
Incremental Backups
Incremental backups can be performed when the database is online.
The incremental backups will fail if the database is offline.
For more information on incremental backups, see Incremental Backups.
Important: Do not perform incremental backups when the IFX_BAR_USE_DEDUP environment variable is set.
-
From the CommCell Browser, expand Client Computers > client > Informix > instance.
-
Right-click the subclient, and then click Backup.
The Backup Options for Subclient dialog box appears.
-
Select the backup type and job initiation:
-
In the Backup Type section, select Incremental.
-
In the Job Initiation section, specify whether to run the backup now or whether to schedule it.
Note: If you specify to schedule the backup, define the schedule.
For information on scheduling backups, see Schedule backups.
-
-
Click OK.
Third Party Command Line Backups
In addition to backups from CommCell Console, you can also perform backups of Informix databases using the third party command line (ON-Bar) utility. However, in the case of Informix XPS databases, backups are performed from the third party command line (ON-Bar) utility.
For information on configuring environment variables for third party command line (ON-Bar) utility , see Configuring Environment Variables for Third Party Command Line (ON-Bar) Utility.
For information on configuring third party command line (ON-Bar) utility for the Informix XPS Databases, see Configuring Backups and Restores for Informix Extended Parallel Server (XPS) Databases.
Level 0 Backup
Full backups are level 0 backups.
At the command prompt, type the following command to run a full backup:
onbar -b -L 0
Level 1 Backup
A level 1 backup is an incremental backup. It backs up records that have changed since the last level 0 backup.
At the command prompt, type the following command to run an incremental backup:
onbar -b -L 1
Level 2 Backup
A level 2 backup backs up records that have changed since the last level 1 backup.
At the command prompt, type the following command to run a level 2 backup:
onbar -b -L 2
Data Only Backup (Physical Backup)
At the command prompt, type the following command to backup the database without the logs.
onbar -b -p
Backup Individual DBspaces (Partial Backup)
At the command prompt, type the following command to backup selected dbspaces (partial backup):
onbar -b dbspace1 dbspace2
where dbspace1 and dbspace2 are the dbspace names.
Backup Multiple Storage Spaces
Use the following command to backup multiple storage spaces listed in a file. Each line in the file can list more than one storage space separated by a space or a tab space.
onbar -b -f /informix/backup_list/listfile3
where listfile3 is the name of the file containing the storage spaces list to be backed up.
Logical Log Backup
A logical log backup backs up the filled logical logs.
At the command prompt, type the following command to backup logical logs:
onbar -b -l
Automatic Log Backups
The alarmprogram file is the software that handles the event alarms and that control the logical log backups.
Set the ALARMPROGRAM parameter to the full path name of the alarmprogam file in the ONCONFIG file to back up each log as soon as it becomes full. The default path location
Environment |
Location |
---|---|
UNIX |
$INFORMIXDIR/etc/alarmprogram.sh |
Windows |
%INFORMIXDIR%\etc\alarmprogram.bat |
To automatically back up logical logs when the database server only issues a log-full event alarm, set the ALARMPROGRAM parameter to log_full.sh or log_full.bat.
Best Practice: If you want to run regular full backups that use a single stream, use log_full.sh or log_full.bat. This avoids a collision between a log and full backup.
Procedure
-
Edit the ONCONFIG parameter file and change the TAPEDEV and LTAPEDEV parameters to any non-existing directory.
-
The script must use the onbar command with the backup option (-b) and the back up full logical logs (-l) option. Very the script uses these options.
-
Add the following lines to the log_full.sh script file.
Set the parameters as:
Parameter
Value
CvClientName
The client that is configured in the CommCell Console
CvInstanceName
The name of the Informix instance that is configured in the CommCell Console
As the Informix user, export (in a UNIX environment), or set (in a Windows environment the CvClientName and CVInstanceName parameters.
UNIX Example
export CvClientName= <client_name_as_seen_in_commcell_console> export CvInstanceName=<Instance00x>
Windows Example
set CvClientName= <client_name_as_seen_in_commcell_console> set CvInstanceName=<Instance00x>
Example
To trigger the log backup after there are 5 or more full logical logs, set the parameters as:
Parameter |
Value |
---|---|
N |
5 |
CvClientName |
informix_client |
CvInstanceName |
Instance001 |
################################
# Added the following to only backup logs
# when there are 5 or more logs to be backed up.
echo "$3" >> $INFORMIXDIR/Log_Cnt
COUNT=`cat $INFORMIXDIR/Log_Cnt |wc -l`
if [ $COUNT -ge 5 ]
then
export CvClientName= informix_client
export CvInstanceName=Instance001
$BACKUP_CMD 2>&1 > /dev/null
#Clear Log_Cnt after backing up logs...
cat /dev/null > $INFORMIXDIR/Log_Cnt
fi
################################
Informix XPS Databases
Backups for Informix XPS Databases
In addition to the above mentioned backups, you can perform specific backups for Informix XPS databases.
Current Logical Log Backup
A logical log backup does not include the current logical log file. Backup the current logical log file separately using the following steps.
-
At the command prompt, type the command to move the database server to the next logical log.
xctl onmode -l
-
Type the command to backup the current logical log file.
onbar -b -l
Log Salvage Backup
When the database is offline, you can run a log salvage backup which backs up the logical logs residing directly on the disk and which are not yet backed up. These backups are run during a restore operation, when you want to recover the database to the last completed transaction.
-
At the command prompt, type the following command to shutdown the database server.
xctl onmode –yuk
-
Type the following command to start the co-server.
xctl –C oninit -m
-
Type the command to backup the salvaging logical log file.
onbar -b -l -s
See Advanced Backup Options for information on advanced backup/archive options.
Archiving Tables
You can archive Informix database tables by using the IBM command line interface. For information on how to archive tables, go to the IBM developerWorks website, Data archiving with Informix Dynamic Server table-level restore.
Validating a Backup
The ON–Bar utility writes informational, progress, warning, error, and debugging messages to the ON–Bar Activity Log. The information in the activity log helps in determining whether a backup or restore operation succeeded. The ON-Bar Activity Log location is the BAR_ACT_LOG parameter in the ONCONFIG file.