Hitachi

Hitachi Advanced Database Setup and Operation Guide


16.24.1 Preparing for synonym search operations

This subsection describes the preparatory tasks required before performing synonym searches. The information in this subsection assumes that the multi-node function is enabled.

Organization of this subsection

(1) Considering defining text indexes

When you perform synonym search operations, performance improvement is expected if you use text indexes. Therefore, we recommend that you define text indexes for the columns in which text data (document data) is stored. For details, see (1) Considering defining text indexes under 11.16.1 Preparing for synonym search operations.

(2) Estimating the size required for the directory for storing synonym dictionary files

If you intend to perform synonym searches in environments that use the multi-node function, you need to create the directory for storing synonym dictionary files on a file system that must be inherited when node switchover occurs. Before preparing the file system, you need to perform the following tasks:

Estimate the size of the directory for storing synonym dictionary files

Estimate the size of the directory for storing synonym dictionary files, and keep the results of this estimation in mind when preparing the file system. For details about how to estimate the size of the storage directory for synonym dictionary files, see (3) Estimating the size required for the directory for storing synonym dictionary files in 11.16.1 Preparing for synonym search operations.

Important

If there is insufficient free space for the directory for storing synonym dictionary files, you need to change to a new directory for storing synonym dictionary files. If you change the storage directory for synonym dictionary files, you will need to re-register the contents of all synonym dictionaries. Therefore, take care to estimate the size of the directory so that the disk on which the directory is created will have sufficient free space.

Note

The directory for storing synonym dictionary files is the directory specified for the adb_syndict_storage_path operand in the server definition.

(3) Preparing the file system where the directory that stores synonym dictionary files is to be created

You must create the directory for storing synonym dictionary files on a file system that must be inherited when node switchover occurs. Create file systems that must be inherited when node switchover occurs on an LV in a VG that consists of disks that can be referenced from all nodes. For details about shared disks, see Shared disk configuration in the manual HA Monitor for Linux(R) (x86).

(4) Initializing the file system where the directory that stores synonym dictionary files is to be created

Initialize the file system where the directory that stores synonym dictionary files is to be created. The following execution example initializes /dev/vg_hadb02/hadb_syndict, which was created as the LV where the directory for storing synonym dictionary files is to be created, as an ext4 file system.

mkfs -t ext4 /dev/vg_hadb02/hadb_syndict

(5) Creating the directory for storing synonym dictionary files

After you have finished preparing the file system, create the directory for storing synonym dictionary files and assign the appropriate permissions to the directory you created. For details, see (4) Creating the directory for storing synonym dictionary files to (5) Assigning permissions to the directory for storing synonym dictionary files in 11.16.1 Preparing for synonym search operations.

Important
  • Do not delete the storage directory for synonym dictionary files. Also, do not use any method other than the adbsyndict command to delete files under the storage directory for synonym dictionary files. If you delete the directory or use another method to delete files, an error will occur when you execute a synonym search.

  • Do not use any method other than the adbsyndict command to update files under the storage directory for synonym dictionary files. If you use another method to update files, the results of subsequent synonym searches might be invalid, or an error might occur when you execute a synonym search.

Note

Include the directory for storing synonym dictionary files when taking a full backup. For details, see (2) Backup procedure under 10.3.1 Backup acquisition method.

(6) Creating the multi-node synonym dictionary storage directory

If you will perform synonym searches in an environment that uses the multi-node function, create the multi-node synonym dictionary storage directory on a node-local file system. You must create the multi-node synonym dictionary storage directory on all nodes.

Note

The multi-node synonym dictionary storage directory is the directory specified for the adb_syndict_node_storage_path operand in the server definition.

When SQL statements that perform synonym searches are executed on the slave node, these SQL statements use the synonym dictionary files in the directory you create. When you use the adbsyndict command to register, modify, or delete a synonym dictionary file, the synonym dictionary file on the master node is automatically copied to the slave node and stored in the directory you create.

Important

You can still perform synonym searches when there are no synonym dictionary files stored on the slave node or the synonym dictionary files on the slave node are not the latest files. However, in this case, when execution processing for SQL statements that perform synonym searches is assigned to such a slave node, that slave node will not execute the SQL statements. Execution of the SQL statements will take place on the master node. If this state continues, it can lead to an increased load on the master node. Ensure that you synchronize the synonym dictionary files so that the latest synonym dictionary files are always stored on the slave node. For details about how to synchronize synonym dictionary files, see 16.24.5 Synchronizing synonym dictionary files.

The following shows the procedure for creating the multi-node synonym dictionary storage directory.

Procedure:

1. Estimate the size of the multi-node synonym dictionary storage directory.

Estimate the size of the multi-node synonym dictionary storage directory, and consider the results of this estimation when creating the directory. For details about the how to estimate the size of the multi-node synonym dictionary storage directory, see 6.17 Estimating the size of the multi-node synonym dictionary storage directory.

Important

If there is insufficient free space available for the multi-node synonym dictionary storage directory, you need to change to a new directory for storing synonym dictionary files. If you change the multi-node synonym dictionary storage directory, you will need to synchronize the synonym dictionary files. Therefore, take care to estimate the size of the directory so that the disk on which the directory is created will have sufficient free space.

2. Create the multi-node synonym dictionary storage directory.

Create the multi-node synonym dictionary storage directory. Note the following when creating this directory:

  • You cannot use the following directories as the multi-node synonym dictionary storage directory:

    • Server directory

    • Subdirectories of the server directory

    • Directories of which the server directory is subordinate

    • DB directory

    • Subdirectories of the DB directory

    • Directories of which the DB directory is subordinate

    • Root directory

    • Directory specified in the adb_syndict_storage_path operand

    • Subordinate directory of the directory specified in the adb_syndict_storage_path operand

    • Directory to which the directory specified in the adb_syndict_storage_path operand is subordinate

    The following table shows examples of directories that can and cannot be used as the multi-node synonym dictionary storage directory when the DB directory is /HADB/db.

    Examples of multi-node synonym dictionary storage directories

    Reason

    Example of directory that can be used as multi-node synonym dictionary storage directory

    /HADB/syndict

    None.

    Examples of directories that cannot be used as multi-node synonym dictionary storage directory

    /HADB/db

    This directory cannot serve as the multi-node synonym dictionary storage directory because it is also the DB directory.

    /HADB/db/synonym

    This directory cannot serve as the multi-node synonym dictionary storage directory because it is a subordinate directory of the DB directory.

    /HADB

    This directory cannot serve as the multi-node synonym dictionary storage directory because the DB directory is one of its subordinate directories.

  • Do not specify the directory in which you stored the installation data when installing the HADB server as the multi-node synonym dictionary storage directory.

3. Assign permissions for the multi-node synonym dictionary storage directory.

The following shows the procedure for assigning the necessary permissions in relation to the multi-node synonym dictionary storage directory.

Procedure:

  1. Assign read, write, and execution permissions to the HADB administrator for the multi-node synonym dictionary storage directory.

  2. Assign execution permission to the HADB administrator for all directories that are included in the path of the multi-node synonym dictionary storage directory.

Example: When the multi-node synonym dictionary storage directory is /HADB/syndict

  • Read, write, and execution permissions must be assigned to /HADB/syndict.

  • Execution permission must be assigned to / and /HADB.

Important
  • If you change the multi-node synonym dictionary storage directory, you must execute the adbsyndict command to synchronize the synonym dictionary files. If you do not synchronize the files, the node on which SQL statements that perform synonym searches are executed will change from the slave node to the master node. This can increase the load on the master node and introduce overhead associated with switching the execution nodes, potentially leading to a drop in performance.

  • Do not delete the multi-node synonym dictionary storage directory. Also, do not use any method other than the adbsyndict command to delete files under the multi-node synonym dictionary storage directory. If you delete the directory, the node on which SQL statements that perform synonym searches are executed will change from the slave node to the master node. This can increase the load on the master node and introduce overhead associated with switching the execution nodes, potentially leading to a drop in performance.

  • Do not use any method other than the adbsyndict command to update files under the multi-node synonym dictionary storage directory. If you use another method to update files, the results of subsequent synonym searches might be invalid, or an error might occur when you execute a synonym search.

(7) Changing the specification of the HA Monitor servers file

Terminate the HADB servers in the multi-node configuration before changing the specification of the HA Monitor servers file.

In the example in Figure 16‒1: Example of a system configuration using the multi-node function, FS002 is the file system in which the storage directory for synonym dictionary files is to be created. The name of the VG is vg_hadb02, and the name of the LV is hadb_syndict.

Change the values specified for the following operands:

For examples of specifying the servers file, see the following sections:

For details about the operands in the servers file, see Server environment definition (servers) in the manual HA Monitor for Linux(R) (x86).

(8) Amending the server definition

Specify the following operands in the server definition:

Note

For details about the procedure for changing the server definition, see 8.5.2 Modifying the server definition.

(9) Starting the HADB servers in the multi-node configuration

Start the HADB servers in the multi-node configuration.

For details about how to start the HADB servers in the multi-node configuration, see 16.4.1 Starting the HADB servers in the multi-node configuration.

(10) Defining text indexes

If you decide to define text indexes after reading (1) Considering defining text indexes, use the following procedure to define the text indexes:

Procedure:

  1. Define text indexes by executing CREATE INDEX statements.

  2. Create the index data for the text indexes by executing the adbidxrebuild command.

(11) Registering synonym dictionaries

To register synonym dictionaries, perform the tasks in (7) Creating a synonym list definition file to (10) Making a backup of the directory for storing synonym dictionary files in 11.16.1 Preparing for synonym search operations.

Important

We recommend that you create synonym list definition files, dictionary creation files, and dictionary deletion files on a file system that is accessible from the master node. You could create these files on a file system that is inherited when node switchover occurs, like the storage directory for synonym dictionary files. Alternatively, you might create the files on a disk that is accessible from all nodes and whose mount directory is the same on all nodes.

When you register synonym dictionaries by executing the adbsyndict command on the master node, the synonym dictionary files are automatically synchronized. This means that you do not need to specify the -s option when executing the adbsyndict command.