Chapter 5. Restoring Data

BusinesSuite Module for Informix provides a means for ON-Bar to restore data backed up by NetWorker to your OnLine Dynamic Server in the event of data corruption or a disk crash.  BusinesSuite Module for Informix allows you to recover OnLine Dynamic Server instances and individual objects on-demand, using the ON-Bar command-line interface.

Use the information in this chapter in conjunction with the sections “Syntax for Restoring Data” in the INFORMIX–Online Dynamic Server Backup and Restore Guide, “Recovering from a Disk Crash” in the IRIX NetWorker Administrator's Guide, and the nsr_crash(1M) reference page.  The command examples presented in this chapter are in C-shell format.

Preparing to Restore Data

During a scheduled or on–demand backup, the NetWorker server makes an entry in an online client index and records the location of the data in an online media index.  These entries provide recovery information needed for every OnLine Dynamic Server object backed up.  The client index entry is maintained in the index until the browse policy configured for the client's save set expires.  The media index entry is maintained until the retention policy configured for the client's save set expires.

Once the browse and retention policies expire, the backup media is eligible for recycling and may be overwritten.  Until the media is relabeled, the data is still recoverable, using the NetWorker scanner command.  The scanner(1M) reference page provides complete details on recovering save sets whose client index entries have expired.

To view online client index entries, click the Indexes speedbar button in the NetWorker administration program's main window and select an entry to view.  The listing displayed for the entry you select shows the save set ID assigned during a backup session, the number of files and their size, and the date and level of the backup session.

NetWorker sends a record of the server's bootstrap save set generated during the backup to your default printer, so you have a printed record of the dates, locations, and save set ID numbers for the server's online indexes needed for recovering data.  Keep the bootstrap printouts in a file for quick reference in the event a disaster, such as a disk crash or server malfunction, occurs.

Restoring Data with ON-Bar

You use ON-Bar commands to restore data backed up from a scheduled or on–demand NetWorker backup.  The shared XBSA library translates OnLine Dynamic Server instance names passed by ON-Bar into NetWorker save set names for retrieval from the NetWorker server's online client index and restoration to OnLine Dynamic Server.


Caution: If you do not specify a value for the NetWorker XBSA variable NSR_SERVER before issuing an ON-Bar command, NetWorker searches the network for the correct server to restore data from.  Setting the NSR_SERVER variable helps avoid a potential delay in the restore process.


What Types of Restores Can ON-Bar Perform?

ON-Bar supports several types of database and dbobject restores from the backup media managed by NetWorker:

  • Physical

    setenv NSR_SERVER networker_servername 
    onbar -r -p [dbspace_name] 
    

    Physical restores replace lost or corrupted OnLine Dynamic Server dbobjects from NetWorker backup media.  A physical restore can be performed as a whole–system or selected-dbspace restore.

  • Logical

    setenv NSR_SERVER networker_servername 
    onbar -r -l 
    

    Logical restores recover the server transactions made since last dbobject backup, followed by a rolling forward of the logical logs backed up for the dbobjects.  If different backup sessions are involved, the log rolls forward transactions made since the backup time recorded for each dbobject restored.

  • Combined

    setenv NSR_SERVER networker_servername 
    onbar -r [dbspace_name] 
    

    Combined restores allow you to issue a single command to perform a physical restore immediately followed by a logical restore.

  • Point-in-time

    setenv NSR_SERVER networker_servername 
    onbar -r -t time -w -p 
    

    Point-in-time restores involve performing a whole-system, physical restore of OnLine Dynamic Server data from a whole-system backup to a specified time instead of the default, which is the last time of OnLine Dynamic Server backup.

  • Imported

    setenv NSR_SERVER networker_servername 
    setenv NSR_CLIENT networker_clientname 
    onbar -r -w 
    

    Imported restores allow movement of data from one OnLine Dynamic Server instance to another.  The versions of XBSA must be compatible between the OnLine Dynamic Server instances involved.


    Caution: To perform an imported restore, you must first set the Remote access field in the NetWorker Clients window for the OnLine Dynamic Server instance to allow a different OnLine Dynamic Server instance to access the backed–up data, if the instances reside on different hosts.

    Before you perform an imported restore, do the following:

    • Perform a whole-system backup on the OnLine Dynamic Server you are importing data from—you cannot transfer specific dbobjects.

    • Set up the new OnLine Dynamic Server system with exactly the same disk layout as the one you are transferring from.

    • Copy the ONCONFIG file from the existing system to the new system.

    • Change the servername and servernumber entries specified in the new system's ONCONFIG file.

    • Copy the emergency boot file from the existing system to the new system, renaming the file ixbar.new_servernumber.

    • Copy the sqlhosts file from the existing system to the new system.

    • Copy the oncfg_servername.servernumber file from the existing system to the new system.

    For complete details on performing an imported restore, refer to the INFORMIX–Online Dynamic Server Backup and Restore Guide.

OnLine Dynamic Server Restore Modes

You perform three types of restores with OnLine Dynamic Server:

  • Cold, which consists of a physical and logical restore of the critical dbspaces, then a physical and logical restore of the noncritical dbspaces.  A cold restore is performed with the OnLine Dynamic Server in off–line mode.  After a cold restore completes, OnLine Dynamic Server is left in “quiescent” mode.


    Note: A cold restore of selected dbspaces succeeds only if the critical dbspaces are included on the restore command line.  Critical dbspaces are defined as the root dbspace and any dbspace containing either physical or logical logs.  Refer to the INFORMIX–OnLine Dynamic Server Backup and Restore Guide for further details on performing cold restores of OnLine Dynamic Server.


  • Warm, which consists of one or more physical restores, a closing and backup of the current logical log, followed by a logical log restore.  A warm restore is performed with the OnLine Dynamic Server in on–line or quiescent mode.

  • Mixed, which consists of a cold restore of the critical dbspaces, with OnLine Dynamic Server in off-line mode followed by a warm restore of noncritical dbspaces, with OnLine Dynamic Server in quiescent or on-line mode.  Using a mixed restore allows you to quickly recover critical dbspaces, plus any data that users require immediate access to.  Once OnLine Dynamic Server is returned to quiescent mode, you can perform a warm restore of the other dbobjects.

Disaster Recovery

Hardware malfunctions rarely occur at convenient times, but if you have a disaster recovery plan in place and use BusinesSuite Module for Informix to maintain regular backups of your OnLine Dynamic Server instances and the logical logs associated with them, you are well-equipped to recover critical data in a timely manner.

The information presented in this section presumes that you have read and are familiar with the procedures outlined in your OnLine Dynamic Server documentation and the information presented in the section “Recovering from a Disk Crash” in the IRIX NetWorker Administrator's Guide.

OnLine Dynamic Server Disk Crash

If the primary disk containing critical OnLine Dynamic Server dbobjects and NetWorker client-side binaries is damaged, do the following:

  1. Reinstall the NetWorker client binaries, the BusinesSuite Module for Informix software, and the OnLine Dynamic Server software, if needed.  If you perform regular NetWorker backups of your system binaries, you can use NetWorker to recover the system data.

  2. Use NetWorker to recover the emergency boot file and configuration file for the OnLine Dynamic Server instance.

    recover -t date -a \
    /usr/informix/etc/sqlhosts \
    /usr/informix/etc/onconfig.std \
    /usr/informix/etc/ixbar.servernum \
    /usr/informix/etc/oncfg_servername.servernum 
    

  3. If the physical media containing the logical logs must be replaced before beginning the restore, manually salvage the current logical log file.

    onbar -l -s 
    

  4. Use ON-Bar to restore data from the most recent backup.

    onbar -r 
    

    Once the restore completes, OnLine Dynamic Server is left in quiescent mode.

NetWorker and OnLine Dynamic Server Disk Crash

If the NetWorker server's primary disk containing the online indexes (the /nsr filesystem) and the primary disk for OnLine Dynamic Server are both damaged:

  1. Reinstall the NetWorker server binaries, if needed.

  2. Find the latest bootstrap printout for the NetWorker server and follow the procedure outlined in “Recovering from a Disk Crash” in the IRIX NetWorker Administrator's Guide to recover the server's online indexes.


    Caution: Do not attempt to recover the NetWorker server's online file or media indexes to a different directory than the one they were backed up from.  Once you recover the indexes to their original location, you can safely move them to another directory.  Refer to the IRIX NetWorker Administrator's Guide for details on moving the indexes.


  3. Reinstall the BusinesSuite Module for Informix software and OnLine Dynamic Server, if needed.

  4. Use NetWorker to recover the emergency boot file and configuration file for the OnLine Dynamic Server instance.

    recover -t date -a \
    /usr/informix/etc/sqlhosts \
    /usr/informix/etc/onconfig.std \
    /usr/informix/etc/ixbar.servernum \
    /usr/informix/etc/oncfg_servername.servernum 
    

  5. If the physical media containing the logical logs must be replaced before beginning the restore, manually salvage the current logical log file.

    onbar -l -s 
    

  6. Use ON-Bar to restore data from the most recent backup.

    onbar -r 
    

    Once the restore completes, OnLine Dynamic Server is left in quiescent mode.

Refer to the INFORMIX–Online Dynamic Server Backup and Restore Guide, provided with your OnLine Dynamic Server software, for further information on using ON-Bar to restore data from backup media managed by NetWorker.