Hitachi

Hitachi Advanced Database Command Reference


34.2.2 Format of DB area addition and modification options

Organization of this subsection

(1) Specification format

Specify one of the following operands to execute the desired operation:

To add a DB area
[set adb_mod_area_file_rthd_num = number-of-threads-used-to-create-DB-area-files]
 
  adbaddarea
    -n data-DB-area-name
  [-p {4|8|16|32}]
  [-v block-special-file-name[,block-special-file-name]...]
  [-q]
  [-i initial-allocation-size[,number-of-files-to-be-created]]
  [-f data-DB-area-file-storage-directory-name]
  [-g output-interval-for-progress-messages-for-DB-area-file-creation-processing]
 
To delete a DB area
  adbrmarea
    -n data-DB-area-name
 
To expand a DB area (adding DB area files)
[set adb_mod_area_file_rthd_num = number-of-threads-used-to-create-DB-area-files]
 
  adbexpandarea
    -n data-DB-area-name
  [-v block-special-file-name[,block-special-file-name]...]
  [-q]
  [-g output-interval-for-progress-messages-for-DB-area-file-creation-processing]
  [-i initial-allocation-size[,number-of-files-to-be-created]]

The specification rules for these DB area addition and modification options are the same as for the server definition. For details about the specification rules for the server definition, see Syntax rules for the server definition in the HADB Setup and Operation Guide.

(2) Explanation of specification format

(a) Set format

adb_mod_area_file_rthd_num = number-of-threads-used-to-create-DB-area-files

~<integer>((1 to 1,024))

Specifies the upper limit for the number of processing real threads to be used to create data DB area files concurrently.

If this option is omitted, the number of processing real threads is determined automatically. Normally, you omit this option.

If the following condition is satisfied, you might be able to reduce the overhead for CPU switchover by specifying this option to limit the number of processing real threads:

  • The number of processing real threads that are actually used exceeds the number of CPU cores in the server machine.

If you specify 1 in this option or if no more than one real thread can be used, data DB area files are created one at a time.

Note

You can determine the actual number of processing real threads used by checking the KFAA96207-I message output to a message log file. The actual number of real threads that are used is equal to or less than the number of DB area files that are created and the maximum number of processing real threads that can be used by the HADB server.

The maximum number of processing real threads that can be used by the HADB server varies depending on whether the client-group facility is applied.

  • If the client-group facility is not applied

    Value of the adb_sys_rthd_num operand in the server definition

  • If the client-group facility is applied

    Determine the maximum number of processing real threads that can be used by the HADB server based on the explanation in How to determine the numbers of processing real threads when the client-group facility is used in Points to consider when specifying the number of processing real threads for a group in Points to consider when using the client-group facility in Preparing Resources in the HADB Setup and Operation Guide.

(b) Command format

Specify the correct operand for the operation you will be performing.

  • To add a data DB area

    Specify the adbaddarea operand.

  • To delete a data DB area

    Specify the adbrmarea operand.

  • To expand a data DB area (add data DB area files)

    Specify the adbexpandarea operand.

adbaddarea

Specifies the definition of a data DB area to be added.

The options to be specified depend on the type of files to be allocated as DB area files for the data DB area that is to be added. The following table provides guidelines for specifying options.

Table 34‒1: Type of files to be allocated as data DB area files and guidelines for specifying options

No.

Option name

Type of files to be allocated as DB area files

Description of option

Block special files

Regular files

1

-n

R

R

Specifies the name for the data DB area.

2

-p

R

R

Specifies the page size for the data DB area.

3

-v

R

N

Specifies the names of the block special files that are to be allocated as data DB area files.

4

-q

R

N

Specifies that the data DB area files are to be created in quick mode.

5

-i

R

R

Specifies the initial allocation size for each data DB area file and the number of data DB area files to be created.

6

-f

O

O

Specifies that symbolic links to the data DB area files or block special files are to be stored in a subdirectory of the DB directory.

7

-g

O

O

Specifies the interval for output of progress messages for data DB area file creation processing.

Legend:

R: Required/Recommended. Specification of this option is required or is recommended.

O: Optional. Specification of this option is optional. Read its description and decide whether it needs to be specified.

N: This option is not specified.

-n data-DB-area-name

~<character string>((1 to 30 bytes))

Specifies a name for the data DB area that is to be added. The name specified in this option is used as the name of the data DB area files.

The following notes apply:

  • The characters permitted for a DB area name are single-byte alphanumeric characters, underscore (_), and hyphen (-). A DB area name must begin with an alphabetic character.

  • If the DB area name to be used is the same as a reserved word for SQL statements, enclose the DB area name in backslashes and double quotation marks (\"). For details about the reserved words for SQL statements, see Reserved words in SQL Basics in the manual HADB SQL Reference.

  • If the specified DB area name contains a lowercase letter, enclose the entire DB area name in backslashes and double quotation marks (\"). If the specified name is not enclosed in backslashes and double quotation marks, the specified character string will be treated as being in all uppercase letters.

    Example: \"DBarea01\"

  • This name must be unique from any existing DB area name. To check the existing DB area names, ask the HADB administrator to execute the command shown below to output summary information for DB areas. Check the DB area names (DBarea_name column) displayed in the summary information. For details about the items that are output as summary information for DB areas, see 13.3.2 List of items that are output as summary information for DB areas.

    adbdbstatus

  • This name must be unique from any directory name under the DB directory.

-p {4|8|16|32}

Specifies the page size (in kilobytes) for the data DB area that is to be added. Specify the page size you estimated when you designed the data DB area. For details about how to estimate the page size for the data DB area, see Points to consider when determining the page size in data DB areas in the HADB Setup and Operation Guide.

-v block-special-file-name[,block-special-file-name]...

~<path name>((2 to 255 bytes))

When (and only when) you allocate block special files as the data DB area files, specifies the absolute path names of the block special files to be used, expressed as file entities or symbolic links. These block special files must not already be allocated to DB area files.

The following notes apply:

  • Specify block special files that have been created by LVM or device names that begin with /dev/disk/ according to HADB's path naming rules.

  • Make sure that the same block special file name is not specified more than once.

  • A block special file that has already been allocated to a DB area file cannot be allocated as a new DB area file.

  • For guidelines for the number of block special files that can be specified in this option when an LVM is set up (number of LVs constituting one DB area), see Points to consider when setting up an LVM in the HADB Setup and Operation Guide.

  • Specify as many block special files as there are files to be created, as specified in the -i option. If fewer block special files are specified than the number of files to be created, the adbmodarea command will result in an error.

When you specify this option, the command creates symbolic links to the block special files under the DB directory.

Important

An improvement in performance can be expected when block special files are allocated instead of regular files.

However, note that when block special files are allocated, any existing data in the specified block special files will be deleted. If you are not sure that is it safe to delete existing data, do not allocate those block special files.

A block special file mounted on the OS cannot be allocated. A block special file to be allocated must be unmounted.

-q

Specifies that the data DB area files are to be created in quick mode. Specifying this option enables you to reduce the time required to create the data DB area files.

The -q option is applied if the files to be initialized are block special files.

Note

When the data DB area files are created in quick mode, only each file's management page (containing information such as the file size) is created. The pages for storing actual data are not created. This is why it takes less time to create the data DB area files.

-i initial-allocation-size[,number-of-files-to-be-created]

Specifies the initial allocation size for each data DB area file and the number of data DB area files to be created.

  • initial-allocation-size

    ~<alphabetic and numeric characters>((0K to 127P))<<0K>>

    Specifies the initial allocation size for each data DB area file, using one of the following letters to indicate the units: K for kilobytes, M for megabytes, G for gigabytes, T for terabytes, or P for petabytes. The size of a data DB area file is determined according to the specified initial allocation size. However, depending on the location of pages during initial allocation, the initial allocation size specified in this option might not be allocated for data DB area files.

    The guidelines for the initial allocation size depend on the type of the data DB area file. Therefore, do not create different types of data DB area files at the same time. The following table shows the guidelines for the initial allocation size according to the types of data DB area file.

    Table 34‒2: Types of data DB area file and guidelines for the initial allocation size

    No.

    Type of data DB area file

    Guidelines for the value of initial allocation size

    1

    Regular file

    The value of initial-allocation-size multiplied by the number-of-files-to-be-created must be less than the value of free-space-in-file-system-in-which-to-allocate-data-DB-area-files. You can specify any value that meets this condition. When you determine the specific value, consider the disk space consumption and the time required for executing the adbmodarea command.

    2

    Block special file

    Physical volume (normal block special file to which physical blocks are statically allocated)

    If all physical volumes to be allocated have the same size, specify the size of one volume for initial-allocation-size.

    We do not recommend that physical volumes of different sizes are allocated at the same time. If you need to allocate physical volumes of different sizes at the same time, specify the size of the smallest volume.

    3

    Virtual volume (block special file with storage virtualization technology called thin provisioning# applied)

    To use a virtual volume of less than 16 terabytes, specify 0K.

    If a virtual volume might use 16 or more terabytes, specify the size you are planning to use. However, we do not recommend allocation of virtual volumes if the use of 16 or more terabytes is expected. If a size of 16 or more terabytes is specified, a large number of physical blocks are required from the beginning, which lacks the advantage of using lower cost virtual volumes.

    #: For details about thin provisioning, see the manuals of storage products.

    Note

    The size of the data DB area file might not be allocated as specified in the -i option. The following describes the reason.

    A data DB area file consists of the following pages:

    • Directory pages

    • Segments (pages for storing table data and indexes)

    When the size of the data DB area file is specified in the -i option, pages are located so that the file is fit in the specified size. However, if the size specified in the -i option is reached in the middle of a directory page or segment, the number of pages is adjusted as follows.

    • Consecutive directory pages are always created at the beginning of the data DB area file. Therefore, if a value smaller than the minimum size of the data DB area file (approximately 5.4 megabytes) is specified, the value is rounded up.

    • Pages that make up segments are managed in units of a segment (that is, in units of the number of pages that make up a segment). Therefore, the number of pages is adjusted so that the specified file size is not exceeded in the middle of a segment. For example, if the file size is exceeded in the middle of the eighth segment, the eighth segment is not created (only seven segments are created).

    For details about directory pages and segments in data DB area files, see Existence of directory page groups and locations of directory pages in Page types in Pages in DB area structure (segments and pages) in the HADB Setup and Operation Guide.

  • number-of-files-to-be-created

    ~<integer>((1 to 1,024))<<1>> (count)

    Specifies the number of data DB area files to be created.

    If the -v option is specified, make sure that number-of-files-to-be-created is the same as the number of block special files specified in the -v option.

The initial allocation size, depending on the -i option value, is explained in the following by way of an example.

Example:

adbaddarea -n NEWAREA -i 2G,3

In this example, three data DB area files are to be created in the data DB area named NEWAREA, and two gigabytes of space are to be allocated as the initial allocation size for each data DB area file. The total initial allocation size for NEWAREA will be six gigabytes.

Furthermore, if you attempt to allocate an initial allocation size that exceeds the maximum according to the specification of the -i option, the adbmodarea command results in an error. Change the specification of the -i option according to the KFAA96228-E message that is output.

Important

If a large block special file exceeding the maximum value of automatic extension of the DB area file is allocated, an unusable area is generated in the block special file. As a result, the warning message KFAA96244-W is output when the adbmodarea command is executed. If you want to use areas in the block special file almost to the capacity limit, take the corrective action described for the KFAA96244-W message.

The maximum value of automatic extension of a DB area file is determined according to the specified initial allocation size. A multiple of 16 terabytes rounded up from the specified initial allocation size will be the maximum value of automatic extension of one DB area file. For example, if the specified initial allocation size is 20 terabytes, the maximum value of automatic extension of the DB area file is 32 terabytes.

Note that an unusable area cannot be made usable by any means.

To allocate small-capacity and large-capacity block special files to a single DB area, initialize the block special files by specifying a different initial allocation size for each of these files. The following shows an example.

Example: Allocate the following two block special files to DB area AREA1 to be added:

  • /dev/mapper/vg_10TB_1 (size: 10 terabytes)

  • /dev/mapper/vg_30TB_1 (size: 30 terabytes)

Procedure

  1. Add DB area AREA1 by using the adbmodarea command. At this time, initialize the /dev/mapper/vg_10TB_1 file with the DB area addition and modification option specified as follows:

    adbaddarea -n AREA1 ... -i 10T -v /dev/mapper/vg_10TB_1

  2. Expand DB area AREA1 by using the adbmodarea command. At this time, add the /dev/mapper/vg_30TB_1 file with the DB area addition and modification option specified as follows.

    adbexpandarea -n AREA1 ... -i 30T -v /dev/mapper/vg_30TB_1

When the two block special files are concurrently initialized in step 1 above, a value exceeding 10 terabytes cannot be specified for the initial allocation size. Therefore, the maximum value of automatic extension of the DB area file is 16 terabytes. In this case, the maximum available space in the 30-terabyte block special file is only 16 terabytes, which is the maximum value of automatic extension of the DB area file.

-f data-DB-area-file-storage-directory-name

~<path name>((1 to 70 bytes))

Specifies the subdirectory that stores the data DB area files or a symbolic link to the block special files, expressed as a path name relative to the DB directory. A data DB area file with the DB area name as its name or a symbolic link to a block special file is stored directly under this subdirectory.

If you omit this option, the data DB area file names or the symbolic links to the block special files are stored directly under the DB directory.

The following shows specification examples.

Example:

adbaddarea -n NEWAREA -f DB02/

This example creates a subdirectory named DB02 directly under the DB directory and then creates a data DB area file with file name NEWAREA or symbolic link to the block special file under that subdirectory.

The following notes apply when you specify this option:

  • There is no need to specify a forward slash (/) at the beginning of a relative path name.

  • Specify a path name that begins with a single-byte alphabetic character, ends with a forward slash (/), and consists of only single-byte alphanumeric characters, the underscore (_), and the hyphen (-). If the path name does not end with a forward slash, a forward slash is added automatically at the end of the path name. The permitted maximum length of a path name is 69 bytes.

  • If the name of the DB area file storage directory includes a lowercase letter, enclose the entire storage directory name in backslashes and double quotation marks (\"). If it is not enclosed in backslashes and double quotation marks, the character string specified as the DB area file storage directory name will be treated as being in all uppercase letters.

    Example: \"Db02/\"

  • No path under a directory that is created in the DB directory can be specified.

  • If the specified path contains an intermediate directory with the same name as the DB area name, directory or file creation might fail. For this reason, you must make sure that the directory in which each DB area file is created does not contain any intermediate directory with the same name as the DB area name.

-g output-interval-for-progress-messages-for-DB-area-file-creation-processing

~<integer>((0 to 100))<<0>> (%)

Specify this option when you wish to issue messages that report the progress of data DB area file creation processing.

This option specifies as a percentage the message output interval. For example, if 30 is specified, the command issues the KFAA96232-I message reporting the progress when completion of DB area creation processing reaches 30%, 60%, and 90%.

If you specify 0 or nothing in this option, no progress messages are output.

adbrmarea

Specifies the definition of a data DB area that is to be deleted.

-n data-DB-area-name

~<character string>((1 to 30 bytes))

Specifies the name of the data DB area that is to be deleted.

If the specified DB area name is for any of the following DB areas, the DB area cannot be deleted.

  • DB area that is not a data DB area

  • Last data DB area

  • Data DB area that contains tables or indexes

    For details about how to check for whether tables or indexes are stored in a DB area, see Searching a dictionary table in the HADB Setup and Operation Guide.

The following notes apply:

  • If the name of the DB area to be deleted is the same as a reserved word for SQL statements, enclose the DB area name in backslashes and double quotation marks (\"). For details about the reserved words for SQL statements, see Reserved words in SQL Basics in the manual HADB SQL Reference.

  • If the name of the DB area to be deleted contains a lowercase letter, enclose the entire DB area name in backslashes and double quotation marks (\"). If it is not enclosed in backslashes and double quotation marks, the character string used as the DB area name will be treated as being in all uppercase letters.

    Example: \"DBarea01\"

adbexpandarea

Specifies the definition of a data DB area that is to be expanded (to which data DB area files are to be added).

The options to be specified depend on the type of files that make up the data DB area that is to be expanded. The following table provides guidelines for specifying options.

Table 34‒3: Type of files that make up the data DB area to be expanded and guidelines for specifying options

No.

Option name

Type of files that make up the data DB area to be expanded

Description of option

Block special file

Regular file

1

-n

R

R

Specifies the name for the data DB area.

2

-v

R

N

Specifies the names of the block special files that are to be allocated as data DB area files.

3

-q

R

N

Specifies that the data DB area files are to be created in quick mode.

4

-i

R

R

Specifies the initial allocation size for each data DB area file and the number of data DB area files to be created.

5

-g

O

O

Specifies the interval for output of progress messages for data DB area file creation processing.

Legend:

R: Required/Recommended. Specification of this option is required or is recommended.

O: Optional. Specification of this option is optional. Read its description and decide whether it needs to be specified.

N: This option is not specified.

Important

Make sure that regular files are not intermixed with block special files in the DB area. If the data DB area to be expanded contains even one DB area file that is a block special file, you must specify the -v option. For a data DB area consisting of DB area files that are all regular files, the -v option cannot be specified.

-n data-DB-area-name

~<character string>((1 to 30 bytes))

Specifies the name of the data DB area that is to be expanded (to which DB area files are to be added).

The following notes apply:

  • If the name of the DB area that is to be expanded is the same as a reserved word for SQL statements, enclose the DB area name in backslashes and double quotation marks (\"). For details about the reserved words for SQL statements, see Reserved words in SQL Basics in the manual HADB SQL Reference.

  • If the name of the DB area to be expanded contains a lowercase letter, enclose the entire DB area name in backslashes and double quotation marks (\"). If it is not enclosed in backslashes and double quotation marks, the character string specified as the DB area name will be treated as being in all uppercase letters.

    Example: \"DBarea01\"

-v block-special-file-name[,block-special-file-name]...

~<path name>((2 to 255 bytes))

When (and only when) you allocate block special files as the data DB area files, specifies the absolute path names of the block special files to be used, expressed as file entities or symbolic links. These block special files must not already be allocated to DB area files.

The following notes apply:

  • If the data DB area to be expanded contains even one DB area file that is a block special file, you must specify this option. For a data DB area consisting of DB area files that are all regular files, this option cannot be specified.

  • Specify block special files that have been created by LVM or device names that begin with /dev/disk/ according to HADB's path naming rules.

  • Make sure that the same block special file name is not specified more than once.

  • A block special file that has already been allocated to a DB area file cannot be allocated as a new DB area file.

  • For guidelines for the number of block special files that can be specified in this option when an LVM is set up (number of LVs constituting one DB area), see Points to consider when setting up an LVM in the HADB Setup and Operation Guide.

  • Specify as many block special file names as there are DB area files to be created, as specified in the -i option. If fewer block special file are specified than the number of DB area files to be created, the adbmodarea command will result in an error.

When you specify this option, the command creates symbolic links to the block special files under the DB directory.

Important

An improvement in performance can be expected when block special files are allocated instead of regular files.

However, note that when block special files are allocated, any existing data in the specified block special files will be deleted. If you are not sure that it is safe to delete existing data, do not allocate those block special files

A block special file mounted on the OS cannot be allocated. A block special file to be allocated must be unmounted.

-q

Specifies that the data DB area files are to be created in quick mode. Specifying this option enables you to reduce the time required to create the data DB area files.

The -q option is applied if the files to be initialized are block special files.

Note

When the data DB area files are created in quick mode, only each file's management page (containing information such as the file size) is created. The pages for storing actual data are not created. This is why it takes less time to create the data DB area files.

-i initial-allocation-size[,number-of-files-to-be-created]

Specifies the initial allocation size for each data DB area file and the number of data DB area files to be created.

  • initial-allocation-size

    ~<alphabetic and numeric characters>((0K to 127P))<<0K>>

    Specifies the initial allocation size for each data DB area file, using one of the following letters to indicate the units: K for kilobytes, M for megabytes, G for gigabytes, T for terabytes, or P for petabytes. The size of a data DB area file is determined according to the specified initial allocation size. However, depending on the location of pages during initial allocation, the initial allocation size specified in this option might not be allocated for data DB area files.

    The guidelines for the initial allocation size depend on the type of the data DB area file. Therefore, do not create different types of data DB area files at the same time. The following table shows the guidelines for the initial allocation size according to the types of data DB area file.

    Table 34‒4: Types of data DB area file and guidelines for the initial allocation size

    No.

    Type of data DB area file

    Guidelines for the value of initial allocation size

    1

    Regular file

    The value of initial-allocation-size multiplied by the number-of-files-to-be-created must be less than the value of free-space-in-file-system-in-which-to-allocate-data-DB-area-files. You can specify any value that meets this condition. When you determine the specific value, consider the disk space consumption and the time required for executing the adbmodarea command.

    2

    Block special file

    Physical volume (normal block special file to which physical blocks are statically allocated)

    If all physical volumes to be allocated have the same size, specify the size of one volume for initial-allocation-size.

    We do not recommend that physical volumes of different sizes are allocated at the same time. If you need to allocate physical volumes of different sizes at the same time, specify the size of the smallest volume.

    3

    Virtual volume (block special file with storage virtualization technology called thin provisioning# applied)

    To use a virtual volume of less than 16 terabytes, specify 0K.

    If a virtual volume might use 16 or more terabytes, specify the size you are planning to use. However, we do not recommend allocation of virtual volumes if the use of 16 or more terabytes is expected. If a size of 16 or more terabytes is specified, a large number of physical blocks are required from the beginning, which lacks the advantage of using lower cost virtual volumes.

    #: For details about thin provisioning, see the manuals of storage products.

    Note

    The size of the data DB area file might not be allocated as specified in the -i option. The following describes the reason.

    A data DB area file consists of the following pages:

    • Directory pages

    • Segments (pages for storing table data and indexes)

    When the size of the data DB area file is specified in the -i option, pages are located so that the file is fit in the specified size. However, if the size specified in the -i option is reached in the middle of a directory page or segment, the number of pages is adjusted as follows.

    • Consecutive directory pages are always created at the beginning of the data DB area file. Therefore, if a value smaller than the minimum size of the data DB area file (approximately 5.4 megabytes) is specified, the value is rounded up.

    • Pages that make up segments are managed in units of a segment (that is, in units of the number of pages that make up a segment). Therefore, the number of pages is adjusted so that the specified file size is not exceeded in the middle of a segment. For example, if the file size is exceeded in the middle of the eighth segment, the eighth segment is not created (only seven segments are created).

    For details about directory pages and segments in data DB area files, see Existence of directory page groups and locations of directory pages in Page types in Pages in DB area structure (segments and pages) in the HADB Setup and Operation Guide.

  • number-of-files-to-be-created

    ~<integer>((1 to 1,023))<<1>> (count)

    Specifies the number of data DB area files to be created.

    If the -v option is specified, make sure that number-of-files-to-be-created is the same as the number of block special files specified in the -v option.

    A value exceeding the value obtained from the following formula cannot be specified:

    1,024 - current number of DB area files in the data DB area to be expanded

The initial allocation size, depending on the -i option value, is explained in the following by way of an example.

Example:

adbexpandarea -n OLDAREA -i 2G,3

In this example, three data DB area files are added to data DB area OLDAREA, and two gigabytes of space are allocated as the initial allocation size to each data DB area file. Therefore, a total of six gigabytes are allocated as the initial allocation size for the DB area files that will be added to OLDAREA.

Furthermore, if you attempt to allocate an initial allocation size that exceeds the maximum according to the specification of the -i option, the adbmodarea command results in an error. Change the specification of the -i option according to the KFAA96228-E message that is output.

Important

If a block special file larger than 16 terabytes is added by specifying a small value for the initial allocation size, the area exceeding the maximum value of automatic extension of the DB area file cannot be used. To allow use of this area, you need to initialize the added block special file again. Note, however, that if the DB area to be expanded contains data you do not want to delete, a more complicated procedure is required to initialize the added block special file.

If the whole area of the block special file will be unavailable due to the specification, the KFAA96246-Q message (confirming that you want to perform expansion of the DB area) is displayed when you execute the adbmodarea command. If this message is displayed, we recommend that you enter n or N to cancel expansion of the DB area, and then revise the specified initial allocation size.

-g output-interval-for-progress-messages-for-DB-area-file-creation-processing

~<integer>((0 to 100))<<0>> (%)

Specify this option when you wish to issue messages that report the progress of data DB area file creation processing.

This option specifies as a percentage the message output interval. For example, if 30 is specified, the command issues the KFAA96232-I message reporting the progress when completion of DB area expansion processing reaches 30%, 60%, and 90%.

If you specify 0 or nothing in this option, no progress messages are output.

(3) Model DB area addition and modification option

A model DB area addition and modification option is available ($ADBDIR/sample/conf/adbmodarea.opt). Use this model when you create DB area addition and modification options.