Hitachi

Hitachi Advanced Database Setup and Operation Guide


8.7.2 Rebuilding the database by using the previous version

This subsection explains how to downgrade the HADB server version by rebuilding the database on the previous version of the HADB server. You use this method when you do not have a full backup of the previous version of the database.

Note

If you have acquired a full backup of the previous version of the database, you can use that backup to downgrade the HADB server version. For details, see 8.7.1 Using a backup of the previous version of the database.

Organization of this subsection

(1) Tasks prior to version downgrade

Before you downgrade the HADB server version, make sure that the following tasks have been completed.

(a) Confirming the HADB server's environment settings

Before you downgrade the HADB server version, check that the values of environment variables, kernel parameters, and various server definition operands were not changed during the version upgrade processing. If any of these values were changed, you must restore the values that were being used by the previous version.

(b) Checking the status of DB areas (checking the initialization options)

Before you downgrade the HADB server version, use the adbdbstatus command to check the status of DB areas. This step is necessary when you execute the adbinit command with initialization options specified to rebuild the database on the previous version of the HADB server.

Apply the adbdbstatus to the past month to check DB area summary information. Among the output results, check the following output items:

  • DBarea_name (DB area name)

  • Page_size (page size)

Then use the adbdbstatus command to check Usage information. Among the output results, check the DBarea_filename (DB area file name) that corresponds to DBarea_name in the DB area summary information.

Note

For details about the adbdbstatus command, see adbdbstatus (Analyze the Database Status) in the manual HADB Command Reference.

When you rebuild the database, specify the initialization options of the adbinit command on the basis of the output items checked by the adbdbstatus command. The following table shows the correspondence of the output items of the adbdbstatus command to the initialization options of the adbinit command.

Table 8‒31: Correspondence of the output items of the adbdbstatus command to the initialization options of the adbinit command

No.

Output item of the adbdbstatus command

Initialization option of the adbinit command

1

DBarea_name (DB area name)

-n option of adbinitdbarea

2

Page_size (page size)

-p option of adbinitdbarea#

3

DBarea_filename (DB area file name)

-v option of adbinitdbarea

#

Specify the -p option of the adbinitdbarea initialization option in the adbinit command in kilobytes. Because the value of Page_size (page size) that is output by the adbdbstatus command is in bytes, you must convert this value to kilobytes and then specify the obtained value in the -p option. The following is the formula for converting a value in bytes to a value in kilobytes:

Formula (kilobytes)

[Figure]

(c) Checking the definition SQL statements

Before you downgrade the HADB server version, see the dictionary tables to check the definition SQL statements that need to be executed in the previous version of HADB server.

For details about dictionary tables, see B. Dictionary Tables.

(d) Exporting data

Before you downgrade the HADB server version, use the adbexport command to export all data from base tables.

If you want to maintain the chunk structure when you export base table data that had been stored by background import processing, execute the adbexport command with the -c option specified.

For details about the adbexport command, see adbexport (Export Data) in the manual HADB Command Reference.

(e) Stopping application programs and commands

Before you downgrade the HADB server version, terminate any application programs and commands that are executing.

(f) Terminating the HADB server normally

Before downgrading the HADB server version, use the adbstop command to terminate the HADB server normally.

If the HADB server has already stopped, use the following procedure to confirm that it terminated normally:

  1. Execute the adbls -d srv command.

    Confirm that the HADB server's status, which is output to the STATUS output item, is STOP.

    If it is STOP, proceed to step 2 or 3.

  2. Check the server message log file.

    Open the server message log file ($ADBDIR/spool/adbmessageXX.log#) and confirm that the termination mode reported in the KFAA91154-I message was normally.

    #

    XX is a sequential number between 01 and 04.

  3. Check syslog.

    Open syslog and confirm that the termination mode reported in the KFAA91154-I message was normally.

If the result in step 1 is STOP and the result in step 2 or 3 is normally, the HADB server has terminated normally.

If the HADB server did not terminate normally, use the adbstart command to start it, and then use the adbstop command to terminate it normally.

Multi-node function

If the HADB server in the multi-node configuration has not terminated normally, start the HADB servers on all nodes and then normally terminate the HADB servers on all nodes. In this case, there is no need to terminate HA Monitor (no need to execute the monstop command).

For details about how to start the HADB server in a multi-node configuration and how to terminate it normally, see 16.4.1 Starting the HADB servers in the multi-node configuration and 16.4.2 Terminating HADB servers in the multi-node configuration.

Cold standby configuration

If the HADB server in a cold standby configuration has not terminated normally, start all HADB servers on all hosts, and then terminate all of them normally. In this case, there is no need to terminate HA Monitor (no need to execute the monstop command).

For details about how to start the HADB server in a cold standby configuration and how to terminate it normally, see 17.4.1 How to start the cold standby configuration and 17.4.2 How to terminate the cold standby configuration.

(g) Acquiring a server directory backup

Before downgrading the HADB server version, you also need to back up the server directory.

When you downgrade the HADB server version, you delete the server directory because the HADB server needs to be uninstalled. When the server directory is deleted, files such as definition files and message log files are also deleted. Make a backup of the server directory in case these files are needed after version downgrade.

For details about the procedure for acquiring a backup of the server directory, see (2) Backup procedure in 10.3.1 Backup acquisition method.

(2) Downgrading the version

The procedure below explains how to downgrade the HADB server version.

Multi-node function

If you are using the multi-node function, perform this step on all HADB servers on all nodes.

Cold standby configuration

If you are using a cold standby configuration, perform this step on all HADB servers on all hosts.

Procedure

  1. Uninstall the HADB server

    Uninstall the HADB server as explained in 8.12 Uninstallation.

  2. Build the database.

    Build the database on the previous version of the HADB server based on the items confirmed in (1) Tasks prior to version downgrade. For details about the procedure for building a database, see 8.1 System construction procedure.

Note

If you want to restore a multi-chunk table with the previous chunk structure, execute the adbimport command to which the background-import facility applied (with the -b option specified) as many times as needed. Note that chunk IDs cannot be restored.

For details about the adbimport command, see adbimport (Import Data) in the manual HADB Command Reference.

(3) Tasks after a version downgrade

Once you have downgraded the HADB server version, you must also downgrade the HADB client versions (to match the version of the HADB server).

For details about how to downgrade HADB client versions, see Downgrading an HADB client version (restoring the previous version) in the HADB Application Development Guide.