GBase 8s数据库安装手册 南大通用数据技术股份有限公司 20 指定要从表中开始捕获的数据。 如果捕获会话处于打开状态且处于活动状态(您已经运行了 cdc_activatesess() 函数),则数据捕获将立即在指定表中的指定列上开始。 否则,数据捕获将在激活打开捕获会话时开始。 运行此函数时, DB_LOCALE 环境变量必须设置为与数据库区域设置相同的区 域设置。 将在与指定会话ID 和表关联的syscdctab 表中添加一行。 语法: cdc_startcapture ( session_ID , MBZ , “database:owner.table_name" , " column_name[, column_name] " , user_data ) 参数: 表2-9.cdc_startcapture() 参数 参数 数据类型 描述 session_ID INTEGER The session ID of an open capture session. MBZ BIGNIT Must be 0. Reserved. database:owner.table_name LVARCHAR The qualified name of the table from which to capture data. The qualified name includes the following elements: database The name of the database in which the table exists. owner The name of the owner of the table. table The name of the table. column_name LVARCHAR A comma-separated list of column names in the specified
GBase 8s数据库安装手册 南大通用数据技术股份有限公司 21 table, from which to capture data. user_data INTEGER The table identifier. 用法: 使用cdc_startcapture() 函数指定一个表和该表中的列, 从中开始捕获数 据。不能包含具有简单大型对象、用户定义数据类型或集合数据类型的列。 表标识符是应用程序中用于唯一标识将参与数据捕获的每个表的数字。 必须从客户端应用程序调用此函数。不能从数据库服务器中运行的用户定 义例程调用此函数。 返回值: 如果成功,则返回0。 如果不成功,则返回与错误代码相对应的整数,并使用错误信息更新 syscdcess 表。 3 更改数据捕获记录 本章节描述从打开的捕获会话读取函数的调用返回的CDC 记录。 CDC 记录格式 变更数据捕获(CDC)记录包含所有记录共有的标题,之后是CDC 记录类型 的特定标题。 CDC_REC_INSERT、CDC_REC_DELETE、CDC_REC_UPDBEF 和CDC_REC_UPDAFT 记录也包含列数据。 所有CDC 记录共用的标题描述了CDC 记录的大小和类型。 表3-1.所有CDC 记录公共消息头信息 区分 长度 描述 Header size 4 bytes The number of bytes in the common and CDC record-specific headers.
GBase 8s数据库安装手册 南大通用数据技术股份有限公司 22 Payload size 4 bytes The number of bytes of data in the record after the common and CDC record-specific headers. Packet scheme 4 bytes The packetization scheme number of one of the packetization schemes contained in the syscdcpacketschemes table. The only packetization scheme is 66, CDC_PKTSCHEME_LRECBINARY. Record number 4 bytes The record number of one of the CDC records contained in the syscdcrectypes table.
通过执行分析全文命令提高查询性能 全文索引数据采用block 存储,当多次更新索引后会导致倒排数据不连续,导致 读写跳跃增大,从而影响查询性能。更新索引时加入分析指令会及时对不连续数 据重整,提升IO 速度,从而提升性能。该命令的语法格式如下: UPDATE INDEX index_name ON table_name WITH ANALYZE;