Hitachi

Hitachi Advanced Database Setup and Operation Guide


8.6.1 Steps to take before upgrading the server version

The following describes the steps you must take before upgrading the HADB server version.

Important

Before upgrading the HADB server version, do not change the values specified in the environment variables ADBLANG and ADBCLTLANG. If they are changed, you might not be able to correctly upgrade the HADB server version.

The language code and nation code specified in the LANG environment variable can be changed as follows:

  • Change from ja_JP.UTF-8 to en_US.UTF-8

  • Change from en_US.UTF-8 to ja_JP.UTF-8

The encoding set (type of character encoding) cannot be changed.

Note that if you change the value of the LANG environment variable, you also need to change the value of the LANG environment variable for the HADB client.

Organization of this subsection

(1) Checking the size of the dictionary DB area and system-table DB area

Upgrading the HADB server version might increase the size of the dictionary DB area and system-table DB area.

Therefore, check the following two points for each DB area:

Compare the check results and make sure that an increase in the size of the DB area will not cause a problem. The following describes the check method for each value.

▪ Checking the size of the DB area that will increase during version upgrade

Re-estimate the size of the dictionary DB area as explained in 5.11 Estimating the size of the dictionary DB area.

Re-estimate the size of the system-table DB area as explained in 5.12 Estimating the size of the system-table DB area.

▪ Checking the amount of free space on the disk containing the DB area files of which the DB area consists

How to check the amount of free space on the disk containing the DB area files depends on the type of files that are used as DB area files.

For regular files

Execute the df command of the OS to check the amount of free space on the disk containing the DB area files. The following shows execution examples.

Execution example 1 (for dictionary DB area files)

df $DBDIR/ADBDIC

Execution example 2 (for system-table DB area files)

df $DBDIR/ADBSTBL

The amount of free space on the disk containing the DB area files specified in the df command is displayed in kilobytes.

For block special files

Execute the adbdbstatus command to output summary information for DB areas. For details about the adbdbstatus command, see adbdbstatus (Analyze the Database Status) in the manual HADB Command Reference. The following shows execution examples.

Execution example 1 (for dictionary DB areas)

adbdbstatus -c dbarea -n ADBDIC -S K

Execution example 2 (for system-table DB areas)

adbdbstatus -c dbarea -n ADBSTBL -S K

Check the following two items output as the summary information for DB areas:

  • KB_Total_segments

  • KB_Used_segments

Based on the values you checked, use the following formula to determine the amount of free space on the disk.

Formula (kilobytes)

[Figure]

If the check results indicate that the free disk space will be insufficient due to the increase in the DB area size, see 15.3.1 When a free space shortage is caused by an increase in the size of the DB area files and take the appropriate action.

(2) Checking the memory requirement

Upgrading the HADB server version might increase the HADB server's memory requirement. Re-estimate the memory requirements as explained in 6.3 Estimating the HADB server's memory requirement.

(3) Checking the environment variables

When upgrading the HADB server version, you might need to change the values assigned to environment variables. Check whether the environment variables need to be changed based on the explanation in 8.4 Setting environment variables.

(4) Checking the kernel parameters

When upgrading the HADB server version, you might need to change the kernel parameters. Check whether the kernel parameters need to be changed based on the explanation in 6.2 Estimating the kernel parameters.

(5) Checking the server definition

(6) Checking the reserved words to be added

Upgrading the HADB server version might add reserved words.

The following table shows the reserved word that will be added.

Table 8‒8: Reserved word to be added

HADB server version

Reserved word that will be added

02-01

CURRENT_USER_IS_DBA

03-00

MILLISECOND, MILLISECONDS, NANOSECOND, NANOSECONDS, PICOSECOND, PICOSECONDS

You cannot specify a reserved word as a table name or column name in SQL statements. If the same character string as the reserved word that will be added is used in an SQL statement, the SQL statement will cause an error after the HADB server version is upgraded.

Therefore, check whether a character string identical to the reserved word that will be added is specified in an SQL statement. If one is specified, enclose the character string that is the same as the reserved word in double quotation marks ("). For details, see Reserved words under SQL Basics in the manual HADB SQL Reference.

(7) Checking the number of schemas

If you try to upgrade the HADB server version when a database created by the HADB server version 02-00 contains no schema that was defined by an HADB user, upgrading will fail. Therefore, make sure that there is at least one schema defined by an HADB user.

If you try to upgrade the HADB server version when a database created by the HADB server version 02-00 contains 30,001 or more schemas that were defined by an HADB user, upgrading will fail. Therefore, use the DROP SCHEMA statement to delete unnecessary schemas so that the number of schemas does not exceed 30,000.

(8) Checking the schema name

When the HADB server is upgraded from version 02-00, an HADB user is created based on the schema name stored in the SQL_SCHEMATA dictionary table (base table). The authorization identifier and password of the created HADB user are the same as the schema name.

To connect to the upgraded HADB server, check the schema name that has been defined. A specification example follows of an SQL statement for checking the schema name.

Specification example
SELECT "SCHEMA_NAME" FROM "MASTER"."SQL_SCHEMATA"

After you finish upgrading the HADB server version, you must re-examine the password and privileges of the HADB user. For instructions, see (3) Re-examining the HADB user password and privileges (version 02-00) in 8.6.3 Steps to take after version upgrading.

(9) Stopping application programs and commands

Before you upgrade the HADB server version, terminate any application programs and commands that are being executed.

(10) Verifying that there are no non-updatable base tables

Before you upgrade your HADB server version, you need to confirm that there are no non-updatable base tables. If there are any non-updatable base tables, release them from non-updatable status before upgrading the HADB server version.

For details about how to check whether a base table is non-updatable, see (1) Checking whether a base table is non-updatable in 10.9.2 Checking the status and usage of a base table.

For details about how to release a base table from non-updatable status, see 15.8.1 Steps to take when a base table becomes non-updatable.

Important

If you upgrade the HADB server version without releasing base tables from non-updatable status, an error will occur when commands are re-executed after the upgrade. Because interrupted commands cannot be re-executed, the base table cannot be released from non-updatable status. At this time, the KFAA50243-E message is output. Take action as explained in the KFAA50243-E message.

Note that if an index is defined for a base table that entered non-updatable status with the following commands interrupted, and you take the action described in message KFAA50243-E, all indexes defined for the base table being released from non-updatable status are rebuilt. This means that depending on the amount of index data, removing the base table from non-updatable status might take a long time.

  • adbimport command

  • adbidxrebuild command

(11) Disabling the updated-row columnizing facility

If only system data will be backed up in (14) Acquiring a database backup, disable the updated-row columnizing facility now.

The following shows the procedure for disabling the updated-row columnizing facility.

  1. Check the status of the updated-row columnizing facility.

    Execute the adbcolumnize command with the -d option specified.

    If ACTIVE (enabled) has been output in the STATUS column of the output result, go to step 2.

  2. Disable the updated-row columnizing facility.

    Execute the adbcolumnize command with the --stop option specified.

For details about the updated-row columnizing facility, see 11.18 Using the updated-row columnizing facility (maintaining the retrieval performance for column store tables).

Note

For details about the adbcolumnize command, see adbcolumnize (Manage the Updated-Row Columnizing Facility) in the manual HADB Command Reference.

(12) Terminating the HADB server normally

Before upgrading 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 status, which is output to the output item STATUS, 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, output in the KFAA91154-I message, is normally.

    #

    XX is a sequential number between 01 and 04.

  3. Check syslog.

    Open syslog and confirm that the termination mode, output in the KFAA91154-I message, is 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 a multi-node configuration has not terminated normally, start the HADB servers on all nodes and then terminate normally 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 a 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.

(13) Acquiring a server directory backup

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

If you inadvertently upgrade the HADB server version after an abnormal termination, you will not be able to start the HADB server. Therefore, make a backup of the server directory.

Delete the backup that was made after you finish upgrading the HADB server version.

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

Multi-node function

If you are using the multi-node function, make a backup of the server directory on the HADB servers on all nodes.

(14) Acquiring a database backup

Before you upgrade the HADB server, make a full backup of the database. For details about the procedure for acquiring a full backup, see (2) Backup procedure in 10.3.1 Backup acquisition method.

Delete the backup that was made after you finish upgrading the HADB server version, if it is no longer needed.

Multi-node function

If you are using the multi-node function, make a backup as described in 16.8.1 Backup acquisition method.

In some cases, a backup of system data only rather than a full backup will suffice. A backup of system data only backs up the minimum files necessary, such as the files containing management information for the HADB server. It does not back up the data DB area files.

■ Cases in which a backup of system data only suffices

If you are restoring the HADB server to the previous version immediately after a version upgrade, a backup of system data only will suffice. For example, one such situation is when you intend to restore the HADB server to its previous version immediately after it was upgraded to a later version for the purpose of a version-upgrade test.

Note that if you perform an operation that updates the database after the upgrade, you will be unable to restore the HADB server to its previous version. For this reason, do not perform any operations other than the following after an upgrade:

  • Execution of a SELECT statement, COMMIT statement, or ROLLBACK statement

  • Execution of the adbls command

    Some commands other than the adbls command can also be executed. For details about the commands that can be executed, see the table List of commands (database recovery by using a backup of system data only) in List of commands in the manual HADB Command Reference.

If you perform an operation other than the preceding operations after an upgrade, database consistency will not be maintained if you use the backup of system data only to restore the HADB server to the previous version. This might prevent the HADB server from starting or cause the database to become corrupted.

To back up the system data only, back up the files numbered 1 to 6 in Table 10‒6: List of files that needed to be backed up.

Multi-node function

To back up the system data only, back up the files numbered 1 to 6 in Table 16‒9: List of files and directories that need to be backed up.

Note
  • The backup procedure is the same for a full backup and a backup of system data only. The only difference is what is backed up.

  • The procedure for restoring the database from a full backup and the procedure for restoring the database from a backup of system data only are the same.