Decrease setup time using the ontape STDIO feature

You can dramatically improve the speed of setting up HDR by using the ontape STDIO feature. Using this feature, ontape writes the data to the shell's standard output during a backup, and then read it from standard input during a restore. Combining a STDIO backup with a simultaneous STDIO restore in a pipe using a remote command interpreter (such as rsh or ssh), allows performing the initial setup of an HDR (or RSS) secondary server using a single command line. This saves storage space by not writing to or reading from tape or disk, and does not require waiting for the backup to finish before the restore can start.

See the IBM® Informix Backup and Restore Guide for details about using the STDIO value.

This method for setting up HDR using ontape can be used regardless of which backup utility is used (ontape or ON-Bar).

Important: When you use STDIO in this way, no persistent backup is saved anywhere that can be used to perform a restore. The use of the -F (fake) option on the source (backup) side does not record the backup in the database server's reserved pages. Also, any interactive dialog is suppressed and no prompts or questions are displayed. You must also ensure that the remote part of the pipe picks the appropriate environment for the remote Informix® instance. The script must not produce any output other than the backup data since this would be read by the restore process (for example, do not enable tracing).

The steps in the following table must be performed by user informix, the scripts must be executable, and, if called without a complete path, must be located in your home directory. You can use ssh instead of rsh if you require secure data transmission across the network.

  1. On the secondary server, install UDRs, UDTs, and DataBlade modules.
  2. On the primary server, install UDRs, UDTs, and DataBlade modules.
  3. On the primary server, register UDRs, UDTs, and modules.
  4. On the primary server, run the following command:
    onmode -d primary secondary_server
  5. On the primary server, run the following command:
    ontape -s -L 0 -t STDIO -F | rsh secondary_host ontape_HDR_restore.ksh
  6. On the secondary server, run the following command:
    onmode -d secondary primary_server
In the previous table, the script ontape_HDR_restore.ksh on the secondary server must contain the following commands:
#!/bin/ksh 
# first get the proper Informix environment set 
. hdr_sec.env 
# redirecting stdout and stderr required since otherwise command might never return 
ontape -p -t STDIO > /dev/null 2>&1 
The following steps show how to set up HDR from the secondary server:
  1. On the secondary server, install UDRs, UDTs, and DataBlade modules.
  2. On the primary server, install UDRs, UDTs, and DataBlade modules.
  3. On the primary server, register UDRs, UDTs, and DataBlade modules.
  4. On the primary server, run the following command:
    onmode -d primary secondary_server
  5. On the secondary server, run the following command:
    rsh primary_host ontape_HDR_backup.ksh | ontape -p -t STDIO
  6. On the secondary server, run the following command:
    onmode -d secondary primary_server
In the previous table, the script ontape_HDR_backup.ksh on the primary server must contain the following commands:
#!/bin/ksh 
# first get the proper Informix environment set 
. hdr_pri.env 
ontape -s -L 0 -F -t STDIO 

Copyright© 2018 HCL Technologies Limited