Starting an RS secondary server for the first time

After you complete the hardware configuration of the RS secondary server, you are ready to start the RS secondary server and connect it to the primary server.

About this task

Suppose you want to start a primary server and an RS secondary server, ServerA and ServerB. The procedure for starting the servers, using ServerA as the primary database server and ServerB as the RS secondary database server, is described in the following steps. The table ahead lists the commands required to perform each step.

The procedure requires that the primary server be backed up and then restored onto the secondary server. You can use ontape or ON-Bar to perform the backup and restore. You must use the same utility throughout the procedure.
Important: Even if you use ON-Bar to perform the backup and restore, the ontape utility is still required on both database servers to perform back ups and to apply logical logs. Do not remove the ontape utility from database servers that participate in an HDR cluster environment.
You can also set up an RS secondary server using standard ON-Bar or ontape commands for external backup and restore.

To start a primary server with an RS secondary server:

Procedure

  1. Install user-defined types, user-defined routines, and DataBlade® modules on both database servers, and then register them on ServerA only.

    For information about how to install user-defined types or user-defined routines see the HCL OneDB™ User-Defined Routines and Data Types Developer's Guide. For information about how to install DataBlade modules, see the HCL OneDB DataBlade Module Installation and Registration Guide.

  2. Activate index page logging on the primary server.
  3. Record the identity of the RS secondary server on the primary server. The optional password provides authentication between the primary and RS secondary server when the connection between the primary and secondary servers is established for the first time.
  4. Create a level-0 backup of ServerA.
  5. Perform a physical restore of ServerB from the level-0 backup that you created in step 4. Do not perform a logical restore.
    Use the appropriate command:
    • Use the onbar -r -p command to perform a physical restore.
    • Use the onbar -r -p -e command to perform a physical external restore.
    • Use the ontape -p option. (Do not use the ontape -r option because it performs both a physical and a logical restore.)
    • Use the ontape -p -e command to perform the physical external restore.
  6. Use the onmode -d RSS ServerA password command to set the type of ServerB to an RS secondary server and indicate the associated primary database server. For this example, ServerA's DBSERVERNAME and HA_ALIAS configuration parameters are both set to ServerA, and ServerB's DBSERVERNAME and HA_ALIAS configuration parameters are both set to ServerB.

    Using the database server's HA_ALIAS configuration parameter value, ServerB tries to establish a connection with the primary database server (ServerA) and start operation. The connection must be successfully established.

    The secondary database server performs a logical recovery using the logical-log records written to the primary database server since step 4. If all these logical-log records are still located on the primary database server disk, the primary database server sends these records directly to the RS secondary 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 7.
    Important: You must complete steps 5 through 6 during the same session. If you must shut down and restart the secondary database server after step 5, you must redo step 5.
  7. 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

Table 1. Steps to start a primary with an RS secondary server for the first time
Step On the primary On the RS secondary
1. Install UDRs, UDTs, and DataBlade modules.

Register UDRs, UDTs, and DataBlade modules.

Install UDRs, UDTs, and DataBlade modules.
2. onmode command

onmode -wf LOG_INDEX_BUILDS=1

3. onmode command

onmode -d add RSS rss_ha_alias password

4. ontape command

ontape -s -L 0

ON-Bar command

onbar -b -L 0

5. ontape command

ontape -p or ontape -p -e

Answer no when you are prompted to back up the logs.

ON-Bar command

onbar -r -p or onbar -r -p -e

6. onmode command

onmode -d RSS primary_ha_alias password

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 7 must be performed).

7. ontape command

ontape -l

ON-Bar command onbar -r -l

This step is required only when the secondary database server prompts you to recover the logical-log files from the tape backup.