Adds database volume.
cubrid addvoldb options database_name
options :
[--db-volume-size=size] [{-n |--volume_name=}name] [{-F |--file-path=}path] [--comment=comment] [-p|--purpose] [-S|--SA-mode|-C|--CS-mode]
The following table shows options available with the cubrid addvoldb utility.
Option |
Description |
---|---|
--db-volume-size |
Specifies the database volume size in bytes. |
-n |
Specifies the name of the database volume to be added. |
-F |
Specifies the directory path where the database volume to be added will be created. |
--comment |
Inserts a comment about the database volume to be added. |
-p |
Specifies the purpose of the database volume to be added. |
-S |
Adds the database volume in standalone mode. |
-C |
Adds the database volume in client/server mode. |
Size of the extended volume (--db-volume-size)
--db-volume-size is an option that specifies the size of the volume to be added to a specified database. If the --db-volume-size option is omitted, the value of the system parameter db_volume_size is used by default. You can set units as K, M, G and T, which stand for kilobytes (KB), megabytes (MB), gigabytes (GB), and terabytes (TB) respectively. If you omit the unit, bytes will be applied.
The following example shows how to add a volume for which 256 MB are assigned to the testdb database.
cubrid addvoldb -p data --db-volume-size=256M testdb
Name of the extended volume (-n)
-n is an option that specifies the name of the volume to be added to a specified database. The volume name must follow the file name protocol of the operating system and be a simple one without including the directory path or spaces. If the -n option is omitted, the name of the volume to be added is configured by the system automatically as "database name_volume identifier." For example, if the database name is testdb, the volume name testdb_x001 is automatically configured.
The following example shows how to add a volume for which 256 MB are assigned to the testdb database in standalone mode. The volume name testdb_v1 will be created.
cubrid addvoldb -S -n testdb_v1 --db-volume-size=256M testdb
Path of the extended volume (-F)
The -F option is used to specify the directory path where the volume to be added will be stored. If the -F option is omitted, the value of the system parameter volume_extension_path is used by default.
The following example shows how to add a volume for which 256 MB are assigned to the testdb database in standalone mode. The added volume is created in the /dbtemp/addvol directory. Because the -n option is not specified for the volume name, the volume name testdb_x001 will be created.
cubrid addvoldb -S -F /dbtemp/addvol/ --db-volume-size=256M testdb
Comment about the added volume (--comment)
The --comment option is used to facilitate to retrieve information on the added volume by adding such information in the form of comments. It is recommended that the contents of a comment include the name of DBA who adds the volume, or the purpose of adding the volume. The comment must be enclosed in double quotes.
The following example shows how to add a volume for which 256 MB are assigned to the testdb database in standalone mode and inserts a comment about the volume.
cubrid addvoldb -S --comment "data volume added_cheolsoo kim" --db-volume-size=256M testdb
Purpose of the volume (-p)
The -p option is used to specify the purpose of the volume to be added. The reason for specifying the purpose of the volume is to improve the I/O performance by storing volumes separately on different disk drives according to their purpose. Parameter values that can be used for the -p option are data, index, temp and generic. The default value is generic. For the purpose of each volume, see "Database Volume Structure."
The following example shows how to add a volume for which 256 MB are assigned to the testdb database in standalone mode.
cubrid addvoldb -S -p index --db-volume-size=256M testdb
Standalone mode (-S)
The -S option is used to access the database in standalone mode without running the server process. This option has no parameter. If the -S option is not specified, the system assumes to be in client/server mode.
cubrid addvoldb -S --db-volume-size=256M testdb
Client/server mode (-C)
The -C option is used to access the database in client/server mode by running the server and the client separately. There is no parameter. Even when the -C option is not specified, the system assumes to be in client/server mode by default.
cubrid addvoldb -C --db-volume-size=256M testdb
The following example shows how to create a database, classify volume usage, and add volumes such as data, index, and temp.
cubrid createdb --db-volume-size=512M --log-volume-size=256M cubriddb
cubrid addvoldb -p data -n cubriddb_DATA01 --db-volume-size=512M cubriddb
cubrid addvoldb -p data -n cubriddb_DATA02 --db-volume-size=512M cubriddb
cubrid addvoldb -p index -n cubriddb_INDEX01 cubriddb --db-volume-size=512M cubriddb
cubrid addvoldb -p temp -n cubriddb_TEMP01 cubriddb --db-volume-size=512M cubriddb