Advanced Restore for Informix

Overview

The Informix Data Agent supports the following types of restores:

  • Restoring entire Informix instance

  • Warm restore of informix dbspaces

  • Restoring logical log files

  • Restoring configuration files ixbar, onconfig and oncfg

  • Restores to the latest time

  • Point-in-time restores

  • Restores up to a specified logical log number - restore up to and including the logical log that you specify

  • Restores from a third-party command line (application commandline restore)

Important

If you perform 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 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 (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 Data Agent. See Restore/Recover/Retrieve Destinations - Support for a list of Agents supporting each restore destination type.

In-Place Restore

Same path/destination.

Out-of-Place Restore

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

Restore the Informix database data to a different host (or out of place) if the original (source) host is damaged.

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.

Perform a DR or 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 Data Agent software.

  3. Reboot the machine.

    Note

    If there are any problems with the Informix Data Agent 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. For out of place restore, Add an instance on the destination host. Include 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.$servernum to ixbar.$servernum.org

    onconfig.$servername to onconfig.$servername.org

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

    You can restore these files from the source host backups.

  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 In place Restore or Out of place Restore. Avoid performing a salvage backup by performing a physical restore followed by a logical restore.

    After a successful restore, the server remains in a quiescent state. You can bring it online by executing the onmode -m command.

Performing an Entire Instance Restore to Latest Time Without a Salvage Log Backup

Use the following steps to perform physical data restore:

  1. From the CommCell Browser, navigate to Client Computers | <Client> | Informix.

  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 General tab of the Restore Options dialog box, select the Entire Instance option and select the Physical check box.

  7. Click OK.

The corresponding third-party command is:

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.

To perform the partial restore from the physical data, do the following:

  1. From the CommCell Browser, navigate to Client Computers | <Client> | Informix.

  2. Right-click the , point to All Tasks, and then click Browse and Restore.

  3. Select Latest Backup.

  4. Click View Content.

  5. From the Browse window, select the entire database, and then click Recover All selected.

  6. On the Restore Options dialog box, under General tab, select the entire instance option, and then select the Logical check box.

  7. Click OK.

The corresponding third-party command is:

onbar -r -l

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.

  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 General tab of the Restore Options dialog box, select the Partial option and select the Physical check box.

  7. Select the dbspaces from the Latest database view.

  8. Click OK.

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

onbar -r -p db1 db2

To bring the server back on-line, run a logical restore. For do this, select the same dbspaces to restore, then unselect Physical check box, and then select Logical check box.

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

onbar -r -l db1 db2
Performing Point-in-Time or Point-In-Log Restore

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.

  2. Right-click the <Instance>, point to All Tasks and then click Browse and Restore.

  3. Select the point in time to which you want to restore the server.

  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 Entire Instance check box.

  7. Check both the Physical and Logical check boxes. If you want to avoid salvage log backup, select only physical check box.

  8. On the General tab of the Restore Options dialog box, click Advanced.

  9. On the Options tab, select to point In time and define a desired time to restore, then click OK. If you want to restore up to a certain logical log, select Up to Logical Log and enter the number.

  10. On the Copy Precedence tab of the Advanced Restore Options dialog box, check the Restore from Copy Precedence check box and select the Copy Precedence from the list.

  11. Click OK.

If you select only the Physical check box, the server will be in Fast-Recovery mode after the restore completes. the, select the Logical check box to perform a logical restore. Make sure you deselect the Physical check box while performing logical checkbox. After successful completion of logical restore, the server will be in a quiescent state. Bring it online by executing onmode -m.

Performing a Table-Level Restore

With archecker utility, you can perform a point-in-time, table-level restore of Informix iDataAgent. The table-level restore extracts tables or its portions from archives and logical logs. To restore tables, the utility determines the source table to extract, the destination table that contains the data, and an INSERT statement to link the two tables.

The restore operations that the archecker utility performs are:

  • A physical restore that is based on a level-0 archive

  • A physical restore followed by a logical restore that use both a level-0 archive and the logical logs to restore data to a specific point in time.

  • As an Informix user, export the CvClientName and CvInstanceName environment variables. Where,

    • CvInstanceName is the instance name of Commvault.

    • CvClientName is the source computer name as seen on CommCell Console.

  • Configure the AC_CONFIG archecker configuration file. The default location of the file is:

    For Unix:

    $INFORMIXDIR/etc/ac_config.std

    For Windows:

    $INFORMIXDIR\etc\ac_config.std

    A sample configuration file appears as follows:

    AC_MSGPATH /tmp/ac_msg.log 
     AC_STORAGE /tmp 
     AC_VERBOSE 1 
     AC_DEBUG 5
     AC_SCHEMA /opt/IBM/Informix/12.10/etc/ac_schema

    You can also change the default location of the archecker configuration file by setting the AC_CONFIG environment variable to its full path name. You must specify the entire path, including the configuration file name.

  • Configure the schema file.

    To define the schema of the data that archecker recovers, use the AC_SCHEMA archecker schema command file. A sample schema file appears as follows:

    database testdb;
     create table sourceTable
     (
     id smallint,
     name varchar(10),
     phonenum varchar(10),
     address varchar(30)
     ) in datadbs1;
     create table destinationTable
     (
     id smallint,
     name varchar(10),
     phonenum varchar(10),
     address varchar(30)
     ) in datadbs1;
     insert into destinationTable select * from sourceTable;
     restore to current;
  • To perform a restore, do one of the following:

    • If the AC_SCHEMA configuration parameter is set in the AC_CONFIG archecker configuration file, enter the following command to perform the restore:

      archecker –Xbvs
    • If schema file is not configured in the configuration file, use the -f cmdfile command line option and pass the command file.

      archecker –Xbvs –f cmdfile
    • If both methods are specified for the schema file, the -f command line option takes precedence.

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. For these jobs, the operation type is Application Command Line Restores in both the Comcell Console and Command Center.

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 dbspaces 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. Add an instance on the destination host.

  2. 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
  3. On the destination computer, as an Informix user, type the command at the Command Prompt and confirm that the Informix Dbspaces name and Dbspaces pathname match with source instance.

    onstat -d
  4. Make sure to include the following information in the source Informix user profile:

    CvInstanceName=Commvault Instance Name
    CvClientName=Destination 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
  5. Make sure to include the following information in the destination Informix user profile:

    CvInstanceName=Commvault Instance Name
    CvClientName=Destination Computer Name as seen on Commcell GUI
    CvSrcClientName=Source 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 CvSrcClientName= test01
    export or set for Windows INFORMIXSERVER = INFSERVER02
  6. Perform a full backup of source Informix server including emergency boot file (ixbar) file and ONCONFIG file

  7. 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
  8. 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.

  9. 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.

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

    onmode –yuk
  11. Type the following command to restore the Informix server on the destination computer.

    onbar –r

    This will initiate a salvage log backup on the destination instance. To avoid this, perform the restore in two steps:

    Step 1: onbar -r -p

    Step 2: onbar -r -l

  12. The server will be in a quiescent state at the end of the restore. Bring it online by executing onmode -m.

  13. After a successful Cross Informix Server Restore, delete the emergency boot file (ixbar) in Destination Informix server.

  14. Perform a full backup of destination Informix server.

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.

    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
  2. 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

    onbar -r -rename -f listfile
  2. 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

    onbar -r -rename -p /chunk1 -o 0 -n /chunk1N -o 20000 -p rootdbs dbspace1 dbspace2 
     onbar -r -rename -f listfile -p rootdbs dbspace1 dbspace2
  2. 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 physical restore for the latest data, enter:

    onbar -r

    The server will be in fast recovery mode after the restore completes. Follow this with a logical restore by running:

    onbar -r -l

    Once the logical restore is complete, the server will be in a quiescent state. Bring it online by executing onmode -m.

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 to go to fast recovery mode. After the physical restore completes, 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.

    onbar -r -p
  2. 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 the following command:

    Note

    Do not perform an incremental backup before you perform a cross machine restore.

    onbar -b -p
  2. Perform a current log backup

    xctl onmode -l
    onbar -b -l
  3. 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.

  4. 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 (ixbar) 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 ixbar.SourceServerName.CoserverNum to ixbar.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 (ixbar) 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 (ixbar) 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.

×

Loading...