The following diagram illustrates the CUBRID database volume structure. As you can see, the database is divided into three volumes: permanent, temporary and backup. This chapter will examine each volume and its characteristics.
Permanent volume is a database volume that exists permanently once it is created. Its types include generic, data, temp, index, control, active log and archive log.
For efficient management, the volume type to be added to the database can be specified as one of the followings: data, temp or index. If data usage is not specified, it is specified as a generic volume.
Data volume is a volume for storing data such as instances, tables and multimedia data.
Temporary volume is a volume used temporarily for query processing and sorting. However, the temporary volume is not a volume where the storage is created and destroyed temporarily, but one of the permanent volumes with permanent spaces where the data is stored and destroyed temporarily. Therefore, the data in the temporary volume space gets initialized when CUBRID restarts without leaving any log info.
Index volume is a volume that holds the index information for fast query processing or integrity constraint checks.
The control file contains the volume, backup and log information in the database.
Control files include the information about locations of database volumes, backups and logs. Since these files will be read when the database restarts, users must not modify them arbitrarily.
Active log is a log that contains recent changes to the database. If a problem occurs, you can use active and archive logs to restore the database completely up to the point of the last commit before the occurrence of the fault.
Archive log is a volume to store logs continuously created after exhausting available active log space that contains recent changes. The archive log volume will be generated only after exhausting available active log volume space, just as the temporary temp volume will be generated after exhausting available permanent temp volume space. However, unlike the temporary temp volume, the archive log volume is not destroyed automatically when the server process terminates. Therefore, a DBA needs to manually delete necessary archive logs. The archive log volume can be deleted anytime by DBA.
Temporary volume has the opposite meaning to the permanent volume. That is, the temporary volume is a storage created only when the accumulated data exceeds the space specified by the user as the permanent volume. The temporary volume is destroyed when the server process terminates. One of such volumes created or destroyed temporarily is the temporary temp volume.
Temporary Temp Volume
Temporary temp volume is a temporary volume created temporarily by the system after exhausting the space specified as the permanent temp volume, whereas the temporary volume belongs to the permanent volume with the permanent space specified. Therefore, the DBA should consider the database operations first to free up the permanent temp volume with an appropriate size.
The temporary temp volume is created to free up disk space needed for joining/sorting or index creation. Examples of such large-scale queries of creating temporary volumn are: 1) SQL statements with a GROUP BY or ORDER BY, 2) SQL statements that contain coordinated subqueries, 3) join queries that perform sort-merge joins, and 4) a CREATE INDEX statement.
Backup volume is a database snapshot; based on such backup and log volumes, you can restore transactions to a certain point of time.
You can use the cubrid backupdb utility to copy all the data needed for database restore, or configure the backup_volume_max_size_bytes parameter value in the database configuration file (cubrid.conf) to adjust the backup volume partitioning size.