Advanced Restore - Informix iDataAgent

Table of Contents

Overview

The following page describes the agent-specific restore options. Additional restore options are accessible from the Related Topics menu.

The Informix iDataAgent supports the following types of restores:

  • Restoring entire Informix databases in multistream or single stream (serially)
  • Restoring portions of Informix databases (i.e., dbspaces)
  • Restoring logical log files
  • Restoring emergency boot files (ixbar)
  • Restoring ONCONFIG files

Additionally, the Informix iDataAgent supports:

  • Restores from the latest full backup
  • Point-in-time restores - you can restore dbspaces from the full backup created at or before the point in time based on the date and time that you specify
  • Restores up to a specified logical log - you can restore all of the data for committed transactions up to and including the logical log that you specify
  • Restores from a third-party command line

The Informix Restore Options dialog box that provides the first three options in the previous list also provides an option that allows you to view restore-related information in the time zone that you require.

Log Only option in Informix Restore Options Dialog box, allow you to apply the transaction logs that were backed up on a primary system after a full database backup, to the secondary machine. After a full backup on a primary system, you must perform a cross machine full instance database restore by selecting Physical option and unselecting the Logical option in Informix Restore Options Dialog box. This will recover all committed data and keep Informix database in Fast Recovery state. If you wish to switch over from primary to the secondary machine, perform the Log Only restore job to restore all the collected logs from primary machine to the secondary.

For the Informix iDataAgent, restore operations can be performed from the client and instance levels in the CommCell Browser.

When there is a problem with the Informix database or the client system (operating system, hardware, hard drives, etc.), full system restores may be required. See Restore Data - Informix iDataAgent - Full System Restore for more information.

Important: If you performed the backup with the IFX_BAR_USE_DEDUP environment variable set, you must have the IFX_BAR_USE_DEDUP environment variable set when you perform the restore.

Restore Considerations for This Agent

  • If the database is upgraded, the next backup detects the new version. The version is refreshed and displayed in the instance Properties dialog box.
  • Before performing any restore procedures for this agent, review the following section.

Restore Sequence When INFORMIX HOME Is Not on the Shared Disk in a Clustered Environment

If you set up INFORMIX HOME on the local disk for each node in a clustered environment instead of on the shared directory (disk), and if a failover occurs during a backup, an additional restore step is required when (and before) you restore the data to the node to which the failover occurred. For example, suppose that while you are backing up the Informix data from Node 1, a failover to Node 2 occurs. Thereafter, suppose you want to restore the Informix data to Node 2. In such a case, you must first restore the CONFIG files (i.e., ixbar.1 and onconfig) originating from Node 1 to Node 2 before you restore the Informix data.

The additional restore is required under this scenario because the Informix application (including $INFORMIX_DIR/etc) is not shared when you run the backup on Node 1, and the ixbar.1 file on NODE 2 is not updated as the backup completes. This means that the ixbar.1 file on each node now has different contents. However, the contents of the ixbar.1 file on Node 1 are required to complete the restore of the Informix data, therefore necessitating the additional restore discussed in this section.

For information on clustered environments, see Cluster Configuration - Overview.

Restore Destinations

By default, the Informix iDataAgent restores data to the client computer from which it originated; this is referred to as an in-place restore. You can also restore the data to another Client computer in the CommCell. Keep in mind the following considerations when performing such restores:

  • The destination client must reside in the same CommCell as the client whose data was backed up.
  • Note that when you perform restores other than in-place restores, the restored data assumes the rights (i.e., permissions) of the parent directory.

The following section enumerates the types of restore destinations that are supported by the Informix iDataAgent. See Restore/Recover/Retrieve Destinations - Support for a list of Agents supporting each restore destination type.

In-Place Restore

Out-of-Place Restore

Keep in mind that out-of-place restore operations are also subject to the conditions described in Cross-Platform Restores.

You should restore Informix database data to a different host (or out of place) if the original (source) host is damaged. This is sometimes called a cross-machine restore.

Whenever you perform this type of restore, the source computer and destination computer must have the same operating system, Informix version, Informix User, Informix group, and database dbspace directory structure. In addition, the database server name, database server number, root path and all dbspace physical paths for the destination host must be the same as those for the source host. Also, the destination machine must have sufficient disk space to accommodate the restored database.

See Restore Out-of-Place or Cross-Platform (Informix) for step-by-step directions.

Cross-Platform Restores

Perform a Full System Restore

The following procedure demonstrates how to perform a full system restore when the client system is damaged or destroyed. The procedure assumes the following:

  • Latest file system, Informix backups, ixbar file, and ONCONFIG file are available.
  • File system backup does not include the Informix databases. (This is done by filtering the entire dbspace directory.)

To perform a full system restore:

  1. If necessary, rebuild the hardware as it existed before.
  2. Using the appropriate instructions, perform a full system restore of your file system to rebuild your operating system.  In addition to restoring your operating system, this operation restores the Informix application files and all of the iDataAgent software.
  3. Reboot the machine.

    If there are any problems with the Informix iDataAgent software, we recommend that you un-install and re-install the software in the same drive where it was previously installed. Use the same installation parameters, passwords, and backup type settings as were previously used.

  4. Add a simple instance on the destination host. Ensure that you are including the parameters that were used for the instance before the system failure. 
  5. On the destination host, start up the instance and then shut down the instance.
  6. Log into the destination host and navigate to the $INFORMIXDIR/etc directory and perform the following file copies (using "cp"):

    ixbar.$serevrnum  to  ixbar.$servernum.org

    onconfig.$servername  to  onconfig.$servername.org

    oncfg_$servername.$servernum  to  oncfg_$servername.$servernum .org

    Follow the directions in Browse and Restore to cross-restore the ixbar and onconfig files on the CommCell Console from the source host's backups.  Modify the onconfig.$servername.org file to be identical to the onconfig.$servername file  (i.e., ensure that DBSERVERNAME, SERVERNUM, and ROOTPATH are the same).

    Finally, copy the onconfig.$servername.org file to the onconfig.$servername file.

  7. Log into the destination host and prepare dbspaces that refer to the oncfg files. All dbspaces physical paths must be the same (e.g., prepare the cooked file space, cat /dev/null > $INFORMIXDIR/dbs/test1/data/testdbs1.c1,

    chmod 666 $INFORMIXDIR/dbs/test1/data/testdbs1.c1,

    chown -R informix:informix $INFORMIXDIR/dbs/test1/data/testdbs1.c1)

  8. Try to restore the whole system by following the directions in  Browse and Restore. Avoid performing a salvage backup (e.g., zeroing out the root dbspace before restoring or performing a physical whole system restore plus a logical whole system restore).

Performing a Full Restore from Physical and Logical Data

Use the following steps to perform the partial restore from the physical data:

  1. From the CommCell Browser, navigate to Client Computers | <Client> | Informix iDataAgent.
  2. Right-click the <Instance>, point to All Tasks and then click Browse and Restore.
  3. Select Latest Backup.
  4. Click View Content.
  5. From the Browse window, navigate and select the entire database and click Recover All selected.
  6. On the Informix Restore Options window, select Entire Instance Restore option and check the Physical check box.
  7. Click OK.

The third-party command is shown below.

onbar -r

The Informix server is in Fast-Recovery mode when the physical restore completes.  To bring the server back on-line, run a logical restore.

  1. From the CommCell Browser, navigate to Client Computers | <Client> | Informix iDataAgent.
  2. Right-click the <Instance>, point to All Tasks and then click Browse and Restore.
  3. Select Latest Backup.
  4. Click View Content.
  5. From the Browse window, navigate and select the entire database and click Recover All selected.
  6. On the Informix Restore Options window, select Entire Instance Restore option and check the Physical check box.
  7. Click OK.

Follow this with a Log Only Restore.

Performing a Partial Restore from Physical and Logical Data

Use the following steps to perform the partial restore from the physical data:

  1. From the CommCell Browser, navigate to Client Computers | <Client> | Informix iDataAgent.
  2. Right-click the <Instance>, point to All Tasks and then click Browse and Restore.
  3. Select Latest Backup.
  4. Click View Content.
  5. From the Browse window, navigate and select the dbspaces to restore and click Recover All selected.
  6. On the Informix Restore Options window, select Partial Restore option and check the Physical check box.
  7. Select the Dbspaces from the Latest database view.
  8. Click OK.

The third-party command is shown below. "db1" and "db2" are the selected dbspaces.

onbar -r -p db1 db2

The Informix server is in Fast-Recovery mode when the physical restore completes.  To bring the server back on-line, run a logical restore.

  1. From the CommCell Browser, navigate to Client Computers | <Client> | Informix iDataAgent.
  2. Right-click the <Instance>, point to All Tasks and then click Browse and Restore.
  3. Select Latest Backup.
  4. Click View Content.
  5. On the Browse window, navigate and select the dbspaces to restore and click Recover All selected.
  6. On the Informix Restore Options window, click Partial Restore option and check the Logical check box.
  7. Select the Database from the Latest database view.
  8. Click OK.

The third-party command is shown below. "db1" and "db2" are the selected dbspaces.

onbar -r -l db1 db2

Follow this with a Log Only Restore.

Use this option only if the Informix server status is in Fast Recovery Mode.

If you wish to switch over from a primary to the secondary computer, use this option to restore all the collected logs from primary computer to the secondary computer.

Performing a Log Only Restore

Use the following steps to perform a log only restore:

  1. From the CommCell Browser, navigate to Client Computers | <Client> | Informix iDataAgent.
  2. Right-click the <Instance>, point to All Tasks and then click Browse and Restore.
  3. Select Latest Backup.
  4. Click View Content.
  5. From the Browse window, navigate and select the dbspaces to restore and click Recover All selected.
  6. On the Informix Restore Options window, check the Log Only check box.
  7. Click OK.

The third-party command is shown below.

onbar -r -l

Restoring from a Secondary Copy

When the Informix database to be restored has been pruned from the primary copy, the data and logs can be restored from a secondary copy that has a different copy precedence. The restores from the secondary copy can be performed in the following methods:

  • Performing Partial Restore from Physical and Logical Data
  • Performing Point-in-Time Restore for an Entire Instance
  • Restoring the Latest Data from secondary copy using the Log Number
  • Restore data from a secondary copy using a third-party command line interface.

The Data and Log storage policies should be the same at the instance and subclient levels when you restore from a secondary copy.

Performing Point-in-Time Restore for an Entire Instance

Use the following steps to perform a point-in-time restore for an entire instance:

  1. From the CommCell Browser, navigate to Client Computers | <Client> | Informix iDataAgent.
  2. Right-click the <Instance>, point to All Tasks and then click Browse and Restore.
  3. Select Latest Backup.
  4. Click View Content.
  5. From the Browse window, navigate and select the dbspaces to restore and click Recover All selected.
  6. On the Informix Restore Options window, select the Entire Instance Restore option.
  7. Select the Physical and Logical check boxes.
  8. From the Informix Restore options check box, click Advanced.
  9. Click the Copy Precedence tab and select the Restore from Copy Precedence check box.
  10. Select the Copy Precedence from the list.
  11. Click the Options tab:
    1. Select the To Point-in-Time option and specify the date and time to restore
    2. Select your Time Zone from the list.
    3. Click OK.
  12. Click OK.

Performing Point-in-Log Restore for an Entire Instance

You can restore the from the secondary copy using the log number also to avoid restoring the salvaged logs. Use the following steps::

  1. From the CommCell Browser, navigate to Client Computers | <Client> | Informix iDataAgent.
  2. Right-click the <Instance>, point to All Tasks and then click Browse and Restore.
  3. Select Latest Backup.
  4. Click View Content.
  5. From the Browse window, navigate and select the dbspaces that needs to be restored and click Recover All selected.
  6. On the Informix Restore Options window, select the Entire Instance Restore option.
  7. Select both Physical and Logical check boxes.
  8. Click Advanced.
  9. Click the Copy Precedence tab and check the Restore from Copy Precedence check box.
  10. Select the Copy Precedence from the list.
  11. Click the Options tab.
  12. Select the Up To Logical Log and select the logical log number from the backed up log.
  13. Click OK.

Third Party Command Line Restores

In addition to the restores from CommCell Console, you can also use a third party command line utility (On-Bar) to restore Informix databases.

Performing a Cross Server Restore

You can perform a cross platform/ cross server restores using onbar. However, the source and destination Informix servers must have the same db spaces name and paths. Ensure that the source and destination Informix servers are configured within the same CommServe.

Use the following steps to perform a cross platform/cross server restore:

  1. On the source computer, as an Informix user, type the command at the Command Prompt to note the Informix Dbspaces name and Dbspaces pathname.

    onstat –d

  2. On the destination computer, as an Informix user, type the command at the Command Prompt to note the Informix Dbspaces name and Dbspaces pathname.

    onstat –d

  3. Make sure to include the following information in the source Informix user profile:

    CvInstanceName=<SnapProtect Instance Name>
    CvClientName=< Source Computer Name as seen on Commcell GUI>
     

    Example: As Informix user

    export[ or set for Windows] CvInstanceName= Instance001
    export[ or set for Windows] CvClientName= test01

  4. Make sure to include the following information in the destination Informix user profile:

    CvInstanceName=<SnapProtect Instance Name>
    CvClientName=<Destination Computer Name as seen on Commcell GUI>
    INFORMIXSERVER=< Destination Informix Server Name>
     

    Example:

    export [ or set for Windows] CvInstanceName=Instance001
    export [ or set for Windows] CvClientName = test02
    export [ or set for Windows] INFORMIXSERVER = INFSERVER02

  5. Perform a full backup of source Informix server including emergency boot file (ixbar) file and ONCONFIG file
  6. In the destination Informix server, rename the emergency boot file (ixbar), oncfg and ONCONFIG files.
    Example:

    mv ixbar.0 ixbar.org
    mv oncfg_$servername.$servernum oncfg_$servername.$servernum.org
    mv onconfig.$servername onconfig.$servername.org

  7. Copy the emergency boot file (ixbar), oncfg and ONCONFIG files manually from source Informix server to destination Informix server in INFORMIXDIR/etc directory.
    Rename the files if the file names were different from original files in destination.
  8. In the destination Informix server, update the DBSERVERNAME and SERVERNUM parameters with the Destination Informix Server name and number in ONCONFIG file which has been copied from Source Informix server.

    If SERVERNUM in source and destination are different, include the following information in the destination Informix user profile:
     

    CV_IFX_SOURCE_SERVERNUM=SERVERNUM at source

    Example:

    export [ or set for Windows] CV_IFX_SOURCE_SERVERNUM=1
     

    You can check parameter (SERVERNUM) in destination Informix server ONCONFIG file.

  9. Use the following command to stop the destination Informix server

    onmode –yuk

  10. Type the following command to restore the Informix server on the destination computer.

    onbar –r

  11. After a successful Cross Informix Server Restore, delete the emergency boot file (ixbar) in Destination Informix server.
  12. Perform a full backup of destination Informix server either using a CommCell Browser or onbar command line utility.

Renaming Database Spaces

Perform the following validations to rename the db spaces during a cold restore using ON–Bar command line utility:

  • Verify to see that the old db space pathnames and offsets exist in archive reserved pages.
  • Verify to see that the new db space pathnames and offsets do not overlap each other or existing db spaces.
  • If you rename the primary root or mirror root spaces, ON–Bar updates the ONCONFIG file parameters ROOTPATH and ROOTOFFSET, or MIRRORPATH, and MIRROROFFSET. The old version of the ONCONFIG file is saved as $ONCONFIG.localtime.
  • ON–Bar restores the data from the old db spaces to the new db spaces.
  • New db spaces must have the proper permissions.

If either of the above steps fail, the renaming process stops and ON–Bar writes an error message to the ON–Bar activity log. Provide the old dbspace location and the new db space location either at the command line or in a file to rename a db space. The following table lists example values for two db spaces:

Element Value for First DB Space Value for Second DB Space
Old Path /dbspace1_Old /dbspace2_Old
Old offset 0 10000
new path /dbspace1_New /dbspace2_New
new offset 20000  

Renaming Database Spaces with Command Line Options

  1. At the Command Prompt, type the following command to rename the chunks.
  2. onbar -r -rename -p /dbspace1_Old -o 0 -n /dbspace1_New -o 20000 onbar -r -rename -p /dbspace2_Old -o 0 -n /dbspace2_New -o 20000

  3. After a renaming and restoring operation, perform a level-0 backup.

Renaming Database Spaces with a File

  1. At the Command Prompt, type the following command to rename the db spaces by supplying a file named listfile.

    The ListFile contains the following information: /dbspace1_Old 0 /dbspace1_New 20000 /dbspace2_Old 10000 /dbspace2_New 0

  2. onbar -r -rename -f listfile

  3. After a renaming and restoring operation, perform a level-0 backup.

Renaming Chunks While Specifying Other Options

  1. At the Command Prompt, type the following command to rename the db spaces by supplying a file named listfile.

    The ListFile contains the following information: /dbspace1_Old 0 /dbspace1_New 20000 /dbspace2_Old 10000 /dbspace2_New 0

  2. onbar -r -rename -p /chunk1 -o 0 -n /chunk1N -o 20000 -p rootdbs dbspace1 dbspace2
    onbar -r -rename -f listfile -p rootdbs dbspace1 dbspace2

  3. After a renaming and restoring operation, perform a level-0 backup.

Restoring Data from a Secondary Copy

You can restore the latest data also from the secondary copy using a third-party command line interface.

  1. Open the command line interface.
  2. Stop the Informix server by entering:

    onmode -yuk

  3. Export the following environment variables by entering:

    On Unix platforms:

    export CvClientName=<Client>
    export CvInstanceName=<Instance>

    On Windows platforms:

    set CvClientName=<Client>
    set CvInstanceName=<Instance>

    where <Client> is the name of the Informix client and <Instance> is the name of the instance.

  4. Restore data from the secondary copy by entering:

    On Unix platforms:

    export CVGX_COPYID=<CopyPrecedence>

    On Windows platforms:

    set CVGX_COPYID=<CopyPrecedence>

    where <CopyPrecedence> is the copy precedence of the secondary copy.

  5. Enter the restore command.

    For example, to perform an entire instance restore for the latest data, enter:

    onbar -r

Performing a Cross Server Restore from the CommCell Console

Perform a cross-machine restore when the original database host has been damaged or destroyed, and you need to restore the data to a different host from the backup.

Note: The data is restored to the same path as the host and overwrites existing data.

Note: Cross-machine restores do not support partial or log only restores.

Before You Begin

  1. Perform a full backup of source Informix server and include the emergency boot file (ixbar) file and ONCONFIG file in the backup.
  2. Verify the source and destination Informix servers:
    • Have the same dbspaces name and paths
    • Have the same SERVERNUM number in ONCONFIG file
    • Are configured on the same CommCell Console

Procedure

  1. From the CommCell Browser, navigate to Client Computers | <Client> | Informix iDataAgent.
  2. Right-click the <Instance>, point to All Tasks and then click Browse and Restore.
  3. Click View Content.
  4. From the Browse window, navigate and then select the database to be restored and click Recover All Selected.

    The Restore Options dialog box appears.

  5. On the General tab:
    1. Select the destination client that you want to restore to, from the Destination Client list.
    2. Select the destination Informix server that you want to restore to, from the INFORMIX SERVER list.
    3. To perform an entire instance restore, in the Restore Mode section, select either the Entire Instance Restore option or the Whole Restore option.
    4. Select both the Physical and Logical check boxes.
    5. Select the Restore Emergency Boot File(ixbar) and Restore ONCONFIG File check boxes.
    6. Click OK.

Restoring Informix XPS Databases

Informix XPS databases can be restored using a third party command line utility (On-Bar). Prior to running restores, you need to configure the Informix XPS database for restores. See Configuring Backups and Restores of Informix XPS Databases for step-by-step instructions.

Offline (Cold) Restores

If a critical dbspace is damaged due to a disk failure or corrupted data, the database server automatically changes to offline mode. In this case you must perform an offline (cold) restore for all critical dbspaces.

Use the following steps to perform an offline restore:

  1. From the On-Bar command prompt, run the command to switch the Informix XPS instance to Micro Kernel mode.

    xctl onmode -yuk
    xctl -C oninit -m

  2. Run the restore command.

    onbar -r

  3. After a successful offline restore operation, the database server changes in to quiescent (inactive) mode.
  4. Run the following command to change the database server online.

    xctl onmode -m

Online (Warm) Restores

Unless your database server has failed, you can restore noncritical storage spaces in a warm restore in the following circumstances:

  • The storage space is online, but one of its chunks is offline, recovering, or inconsistent.
  • The storage space is offline or down.

If the database server goes offline but the critical dbspaces are all right, bring the database server online and perform a warm restore. Use the following steps to perform an online restore:

Run the following command to restore the dbspaces:

onbar -r dbspaceName1 dbspaceName2

Physical and Log Only Restores

When you perform a physical restore, you can restore the database server without the logs to allow the database server go to fast recovery mode. Once the physical restore is completed, you can restore the logs.

Use the following steps to perform a physical restore and log restore separately:

  1. Run the command to perform a physical restore.
  2. onbar -r -p

  3. Run the command to restore the logs.

    onbar -l

Restoring the Database to a Specific Point-in-Time

Run the command to restore the databases to a specific point-in-time

onbar -r -t "yyyy-mm-dd hh:mm:ss"

Restoring Individual DBSpaces

Run the following command to perform a partial restore (individual dbspaces):

onbar -r dbspaceName1 dbspaceName2

Restoring Logs

Run the command to restore the logs.

onbar -r -l

Restoring the Logs to a Specific Point-in-Time

Run the command to restore the logs to a specific point-in-time

onbar -r -l -t "yyyy-mm-dd hh:mm:ss"

Restoring Informix XPS Databases to a Different Instance or Host

You can restore objects to a different database server instance other than the one from which you have performed a backup. This restore is also known as Imported Restore.

Before performing a cross machine restore:

  1. Perform a full (level-0) physical backup by running:

onbar -b -p

Do not perform an incremental backup prior to performing a cross machine restore.

  1. Perform a current log backup

xctl onmode -l
onbar -b -l

  1. Make sure that every chunk (including mirrors) matches exactly in size, location, and offset on the source and target computers to successfully complete the imported restore operation.
  2. Ensure the source and destination Informix XPS servers have the same SERVENUM number.

Use the following steps to restore XPS databases to a different instance/host:

  1. On the target (destination) Informix server, run the following command to switch the Informix XPS instance to Micro Kernel mode.

    xctl onmode -yuk
    xctl -C oninit -m

  2. Configure the target Informix server instance in CommCell browser. See Create an Instance for step-by-step instructions.
  3. Copy the start_worker.sh file from the source computer to the target computer and add the target computer information.
  4. Copy the emergency boot (Bixbar) file from the source computer to the target computer and rename it with the target Informix server name.

    The emergency boot file needs only the entries from the full (level-0) backup on the source computer.

    Example:

    cp Bixbar.SourceServerName.CoserverNum to Bixbar.TargetServerName.CoserverNum

  5. Copy the oncfg file from the source computer to the target computer and rename it with the target Informix server name. The file name should match the DBSERVERNAME and SERVERNUM on the target computer.

    ON–Bar needs the oncfg file to know what dbspaces to retrieve.

    Example:

    cp oncfg_infserver01.0.1 to oncfg_dbserver01.0.1.

  6. Copy the ONCONFIG file from source computer to the target computer and update DBSERVERNAME with the target database name.

    Example:

    cp onconfig.$servername to onconfig.$servername.org

  7. Type and run the following command on the target computer to restore the Informix server.

    onbar –r -p
    onbar -r -l
    xctl onmode -m

  8. After a successful Cross Informix Server Restore, delete the emergency boot file (Bixbar) in the target Informix server.
  9. Perform a full backup of destination Informix server either using a CommCell Browser or ON-Bar command line utility.
  10. Perform a full backup of source Informix server including emergency boot file (Bixbar) file and ONCONFIG file.

Verifying Restores

You can verify whether the restore operation is successful or a failure from the ON-Bar activity log. The ON–Bar utility writes informational, progress, warning, error, and debugging messages to the ON–Bar activity log. The activity log also records which dbspaces and logical logs were backed up or restored, the progress of the operation, and approximately how long it took for each operation. You can use this information in the activity log to determine whether a backup or restore operation succeeded or failed. ON-Bar Activity Log location can be found in ONCONFIG file and parameter name is BAR_ACT_LOG.