介绍CUBRID
本章说明了CUBRID的体系结构和产品特点。 CUBRID是一种对象关系型数据库管理系统 (DBMS),由数据库服务器,代理(broker),CUBRID管理器组成。
它适合用于互联网数据服务,并提供各种用户友好的特性。
本章涵盖了以下主题:
- 系统结构:本页包含有关数据库结构,服务器进程,代理进程,接口模块等。
-
CUBRID特点:本页包含有关事务、备份和恢复、分区,索引,高可用性集群(HA:High Available),Java存储过程,点击计数器,关系数据模型扩展,等等。
系统结构
- 系统结构
- 数据库卷结构
- 数据库服务器
- 代理
- 接口模型
系统结构
CUBRID是一种对象关系型数据库管理系统 (DBMS),由数据库服务器,代理(broker),CUBRID管理器组成。
- 核心组件为CUBRID数据库管理系统,数据库服务器存储和多线程客户端/服务端中的数据管理体系结构。数据库服务器处理用户请求和管理数据库中的对象。当多用户同时访问时,CUBRID数据库服务器会使用锁定和日志方法提供无缝集成事务。它也提供数据库备份和恢复操作。
- 代理是CUBRID的一个特别中间件,在数据库服务器和外部应用之间进行通讯传递。提供的功能包括连接池,监控,日志追踪和分析。
- CUBRID管理器是一个用户图形界面(CUBRID)工具,允许用户通过远程控制管理数据库和代理。它也提供查询编辑器,是一款便捷的工具,允许用户在数据库服务器上执行SQL查询。关于CUBRID管理器的更多信息,请参阅:http://www.cubrid.org/wiki_tools/entry/cubrid-manager。
注意:CUBRID查询浏览器是一个轻量版本的CUBRID管理器,并且只提供应用开发者绝对需要的特性:数据库管理和查询编辑器特性。关于CUBRID查询浏览器的更多细节,请参阅:http://www.cubrid.org/wiki_tools/entry/cubrid-query-browser。

数据库卷结构
下面的图表阐述了CUBRID数据库卷结构。如你所见,数据库分为三卷:永久的,临时的和备份的。本章将检查每个卷及其特点。

永久卷
永久卷是一个一旦创建将永久存在的数据库卷。它的类型包括一般,数据,临时,索引,控制,活动日志和归档日志。
一般卷
为有效的管理,被添加到数据库中的卷可以指定为以下中的一种:数据,临时或索引。如果没有指定数据用法,则指定为一般卷。
数据卷
数据卷是存储如实例,表,多媒体数据等数据的空间。Data volume is a space for storing data such as instances, tables and multimedia data.
临时卷
临时卷是用来临时存储查询处理及排序的中间和最终结果的空间。它也被称为永久性临时卷区别于下面描述的临时性临时卷。临时卷是一个永久性占用空间,意味着数据在空间中临时存储,过后销毁。因此,当CUBRID重启,临时卷空间中的数据将被初始化,并且相关日志信息将被移除。
下面是使用永久性临时卷和临时性临时卷的查询的例子:
- 查询创建结果集如SELECT
- 查询包含GROUP BY或ORDER BY
- 查询包含子查询
- 查询执行排序合并(sort-merge)连接
- 查询包含CREATE INDEX语句
当执行上述查询时,在内存空间(空间大小由指定在cubrid.conf中的系统参数temp_file_memory_size_in_pages决定)耗尽后将使用临时卷来分配存储SELECT结果和排序数据。存储空间用来存储查询处理的结果的顺序如下:当前存储空间被耗尽时,使用下个存储空间。
temp_file_memory_size_in_pages memory secured by the system parameter
- Permanent temp volume
- Temporary temp volume (for details, see the below)
Index Volume
Index volume is a space that holds the index information for query processing or integrity constraint checks.
Control File
The control file contains the volume, backup and log information in the database.
- Volume Information: The information that includes names, locations and internal volume identifiers of all the volumes in the database. When the database restarts, the CUBRID reads the volume information control file. It records a new entry to that file when a new database volume is added.
- Backup Information: Locations of all the backups for data, index, and generic volumes are recorded to a backup information control file. This control file is maintained where the log files are managed.
- Log Information: This information contains names of all active and archive logs. With the log information control file, you can verify the archive log information. The log information control file is created and managed at the same location as the log files.
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
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
Archive log is a volume to store logs continuously created after exhausting available active log space that contains recent changes. If the value of system parameter log_max_archives is larger than 0, the archive log volume will be generated only after exhausting available active log volume space. The number of archive log files are kept on the storage by setting the value of log_max_archives. The unnecessary archive log files should be deleted for getting the free space by the configuration of log_max_archives, but this value should be set properly to use for restoring the database.
To get more information on the above, see Managing Archive Logs.
Note To get information on the conditions in which archive log can be deleted, see Managing Archive Log.
Background Archive Log
Background archive log is a volume used in the background with log archiving temporarily before creating archive logs. It is created as the same volume size as active log and stored.
Temporary Volume
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. Because cost to create a temporary temp volume is high, DBA should assign an appropriate size of volume depending on situation to enhance performance.
DBA should consider space where temporary temp volume can be created when creating a database. Once temporary temp volume is created, it is maintained until a database restarts and its size cannot be reduced. It is recommended to make temporary temp volume automatically delete by restarting a database if its size is too big.
- File name of the temporary temp volume: The file name of the temporary temp volume of CUBRID has the format of db_name_tnum, where db_name is the database name and num is the volume identifier. The volume identifier is decremented by 1 from 32766.
- Configuring the temporary temp volume size: The number of temporary temp volumes to be created is determined by the system depending on the space size needed for processing transactions. However, users can limit the temporary temp volume size by configuring the temp_file_max_size_in_pages parameter value in the system parameter configuration file (cubrid.conf). The default value is -1, which means it can be created as long as free space is available. If it is configured to 0, the temporary temp volume will not be created even after exhausting the permanent temp volume.
- Configuring storing location of the temporary temp volume: By default, the temporary temp volume is created where the first database volume was created. However, you can specify a different directory to store the temporary temp volume by configuring the temp_volume_path parameter value.
- Deleting the temporary temp volume: The temporary temp volume exists temporarily only while the database is running. Therefore, you must not delete the temporary temp volume when running servers. The temporary temp volume is deleted if database servers are normally terminated while it is deleted when the servers restart if database servers are abnormally terminated.
Backup Volume
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.
本文介绍了CUBRID数据库管理系统的核心组件,包括数据库服务器、代理和CUBRID管理器的功能。详细探讨了CUBRID的系统结构,如永久卷、临时卷、备份卷等组成部分及其各自的特点。
515

被折叠的 条评论
为什么被折叠?



