Starting HDR for the First Time

About this task

After you complete the HDR configuration, you are ready to start HDR. This topic describes the necessary steps for starting HDR.

You want to start HDR on two database servers, ServerA and ServerB. The procedure for starting HDR, using ServerA as the primary database server and ServerB as the secondary database server, is described in the following steps. The following table lists the commands required to perform each step and the messages sent to the message log. You can use ON-Bar to perform the backup and restore. You must use the same utility throughout the procedure.You can also set up HDR using external backup and restore. See the HCL OneDB™ Backup and Restore Guide for information about how to perform an external backup and restore. See Decrease setup time using the ontape STDIO feature for the quickest way to set up your HDR secondary directly from the HDR primary.

To start HDR:

Procedure

  1. Install user-defined types, user-defined routines, and DataBlade® modules on both database servers, and then register them on ServerA only.
  2. Create a level-0 backup of ServerA.
  3. Use the onmode -d command to set the type of ServerA to primary and to indicate the name of the associated secondary database server (in this case ServerB).

    When you issue an onmode -d command, the database server attempts to establish a connection with the other database server in the HDR pair and to start HDR operation. The attempt to establish a connection succeeds only if the other database server in the pair is already set to the correct type.

    At this point, ServerB is not online and is not set to type secondary, so the HDR connection is not established.

  4. Perform a physical restore of ServerB from the level-0 backup that you created in step 1. Do not perform a logical restore.
    If you are using:
    • ON-Bar, use the onbar -r -p command to perform a physical restore.
    • ON-Bar and performing an external restore, use the onbar -r -p -e command to perform the physical restore.
  5. Use the onmode -d command to set the type of ServerB to secondary and indicate the associated primary database server.

    ServerB tries to establish an HDR connection with the primary database server (ServerA) and start operation. The connection must be successfully established.

    Before HDR begins, the secondary database server performs a logical recovery using the logical-log records written to the primary database server since step 2. If all these logical-log records still are located on the primary database server disk, the primary database server sends these records directly to the secondary database server over the network and logical recovery occurs automatically.

    If you have backed up and freed logical-log files on the primary database server, the records in these files are no longer on disk. The secondary database server prompts you to recover these files from tape. In this case, you must perform step 6.
    Important: You must complete steps 4 to 5 during the same session. If you must shut down and restart the secondary database server after step 4, you must redo step 4.
  6. If logical-log records that were written to the primary database server are no longer on the primary disk, the secondary database server prompts you to recover these files from tape backups.

    If the secondary database server must read the backed-up logical-log files over the network, set the tape device parameters on the secondary database server to a device on the computer that is running the primary database server or to a device at the same location as the primary database server.

    After you recover all the logical-log files on tape, the logical restore completes using the logical-log files on the primary database server disk.

Results

The following table illustrates the preceding steps so that you can clearly determine which steps are performed on the primary server and which are performed on the secondary server. The table also shows information written to the log file after each step is performed.

Table 1. Steps to start HDR for the first time
Step On the primary (ServerA) On the secondary (ServerB)
1. Install UDRs, UDTs, and DataBlade modules.

Register UDRs, UDTs, and DataBlade modules.

Install UDRs, UDTs, and DataBlade modules.
3.

onmode command

onmode -d primary sec_name

Messages to message log:

DR: new type = primary  
    server name = sec_name
DR: Trying to connect to secondary server
DR: Cannot connect to secondary server
5. Run onmode -d secondary prim_name

Messages to message log:

DR: new type = secondary, primary server 
   name = prim_name

If all the logical-log records written to the primary database server since step 1 still are located on the primary database server disk, the secondary database server reads these records to perform logical recovery. (Otherwise, step 6 must be performed).

Messages to message log:

DR: Primary server connected
DR: Primary server operational

Messages to message log:

DR: Trying to connect to primary server
DR: Secondary server connected
DR: Failure recovery from disk in progress
n recovery worker threads will be started
Logical Recovery Started
Start Logical Recovery - Start Log n, End Log ?
Starting Log Position - n 0xnnnnn
DR: Secondary server operational

Messages to message log:

DR: Primary server connected
DR: Primary server operational

Messages to message log:

DR: Secondary server connected
DR: Failure recovery from disk in progress
n recovery worker threads will be started
Logical Recovery Started
Start Logical Recovery - Start Log n, End Log ?
Starting Log Position - n 0xnnnnn
DR: Secondary server operational