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.
To start HDR:
Procedure
- Install user-defined types, user-defined routines, and DataBlade® modules on both database servers, and then register them on ServerA only.
- Create a level-0 backup of ServerA.
- 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.
- 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.
- ontape, use the ontape -p option.
You cannot use the ontape -r option because it
performs both a physical and a logical restore.Note: You must place the physical restore of your primary server on the secondary server if they are on two different machines. The location of the physical restore is defined by the onconfig parameter TAPE. You must set your IFX_ONTAPE_FILE_PREFIX variable on your secondary server before you can run ontape -p.
- ontape and performing an external restore, use the ontape -p -e command to perform the physical restore.
- 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. - 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.
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. |
2. | ontape command: Run ontape -s -L 0 ON-Bar command :Run onbar -b -L 0Messages to message log:
|
|
3. | onmode command onmode -d primary sec_name Messages to message log:
|
|
4. | ontape command Run ontape -p or ontape -p -e Answer ON-Bar command Run onbar -r -p or onbar -r -p -e Messages to message log:
|
|
5. | Run onmode -d secondary prim_name Messages to message log:
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:
|
Messages to message log:
|
|
6. | ontape command ontape -l ON-Bar command onbar -r -l |
|
Messages to message log:
|
Messages to message log:
|