华为云用户手册

  • temp_tablespaces 参数说明:当一个CREATE命令没有明确指定一个表空间时,temp_tablespaces指定了创建临时对象(临时表和临时表的索引)所在的表空间。在这些表空间中创建临时文件用来做大型数据的排序工作。 其值是一系列表空间名的列表。如果列表中有多个表空间时,每次临时对象的创建, GaussDB 会在列表中随机选择一个表空间;如果在事务中,连续创建的临时对象被放置在列表里连续的表空间中。如果选择的列表中的元素是一个空串,GaussDB将自动将当前的数据库设为默认的表空间。 该参数属于USERSET类型参数,请参考表1中对应设置方法进行设置。 取值范围:字符串。空字符串表示所有的临时对象仅在当前数据库默认的表空间中创建,请参见default_tablespace。 默认值:空
  • search_path 参数说明:当一个被引用对象没有指定模式时,此参数设置模式搜索顺序。它的值由一个或多个模式名构成,不同的模式名用逗号隔开。 该参数属于USERSET类型参数,请参考表1中对应设置方法进行设置。 当前会话如果存放临时表的模式时,可以使用别名pg_temp将它列在搜索路径中,如'pg_temp,public' 。 存放临时表的模式始终会作为第一个被搜索的对象,排在pg_catalog和search_path中所有模式的前面,即具有第一搜索优先级。建议用户不要在search_path中显示设置pg_temp。如果在search_path中指定了pg_temp,但不是在最前面,系统会提示设置无效,pg_temp仍被优先搜索。通过使用别名pg_temp,系统只会在存放临时表的模式中搜索表、视图和数据类型这样的数据库对象,不会在里面搜索函数或运算符这样的数据库对象。 系统表所在的模式pg_catalog,总是排在search_path中指定的所有模式前面被搜索,即具有第二搜索优先级(pg_temp具有第一搜索优先级)。建议用户不要在search_path中显式设置pg_catalog。如果在search_path中指定了pg_catalog,但不是在最前面,系统会提示设置无效,pg_catalog仍被第二优先搜索。 当没有指定一个特定模式而创建一个对象时,它们被放置到以search_path为命名的第一个有效模式中。当搜索路径为空时,会报错误。 通过SQL函数current_schema可以检测当前搜索路径的有效值。这和检测search_path的值不尽相同,因为current_schema显示search_path中首位有效的模式名称。 取值范围:字符串 设置为"$user",public时,支持共享数据库(没有用户具有私有模式和所有共享使用public),用户私有模式和这些功能的组合使用。可以通过改变默认搜索路径来获得其他效果,无论是全局化的还是私有化的。 设置为空串('')的时候,系统会自动转换成一对双引号。 设置的内容中包含双引号,系统会认为是不安全字符,会将每个双引号转换成一对双引号。 默认值:"$user",public $user表示与当前会话用户名同名的模式名,如果这样的模式不存在,$user将被忽略。
  • PGXC_VARIABLE_INFO PGXC_VARIABLE_INFO视图用于查询集群中所有节点的xid、oid的状态。该视图只有monitor admin和sysadmin权限可以查看。只能在CN上查询,不支持execute direct on (dn) 'select * from PGXC_VARIABLE_INFO';语句。 表1 PGXC_VARIABLE_INFO字段 名称 类型 描述 node_name text 节点名称。 next_oid oid 该节点下一次生成的oid。 next_xid xid 该节点下一次生成的事务号。 oldest_xid xid 该节点最老的事务号。 xid_vac_limit xid 强制autovacuum的临界点。 oldest_xid_db oid 该节点datafrozenxid最小的数据库oid。 last_extend_csn_logpage xid 最后一次扩展csnlog的页面号。 start_extend_csn_logpage xid csnlog扩展的起始页面号。 next_commit_seqno xid 该节点下次生成的csn号。 latest_completed_xid xid 该节点提交或者回滚后节点上的最新事务号。 startup_max_xid xid 该节点关机前的最后一个事务号。 父主题: 系统视图
  • ADM_PART_TABLES ADM_PART_TABLES视图显示数据中所有分区表的信息。默认只有系统管理员权限才可以访问此系统视图,普通用户需要授权才可以访问。该视图同时存在于PG_CATA LOG 和SYS Schema下。 表1 ADM_PART_TABLES字段 名称 类型 描述 table_owner character varying(64) 分区表的所有者名称。 table_name character varying(64) 分区表的名称。 partitioning_type text 分区表的分区策略。 说明: 当前分区表策略仅支持范围分区(Range Partitioning)。 partition_count bigint 分区表的分区个数。 partitioning_key_count integer 分区表的分区键个数。 def_tablespace_name name 分区表的表空间名称。 schema character varying(64) 分区表的模式。 父主题: 系统视图
  • GLOBAL_STAT_DB_CU GLOBAL_STAT_DB_CU视图用于查询集群各个节点中每个数据库的CU命中情况。可以通过gs_stat_reset()进行清零。 表1 GLOBAL_STAT_DB_CU字段 名称 类型 描述 node_name1 text 节点名称。 db_name text 数据库名。 mem_hit bigint 内存命中次数。 hdd_sync_read bigint 硬盘同步读次数。 hdd_asyn_read bigint 硬盘异步读次数。 父主题: Cache/IO
  • 注意事项 游标命令只能在事务块里使用。 通常游标和SELECT一样返回文本格式。因为数据在系统内部是用二进制格式存储的,系统必须对数据做一定转换以生成文本格式。一旦数据是以文本形式返回,客户端应用需要把它们转换成二进制进行操作。使用FETCH语句,游标可以返回文本或二进制格式。 应该小心使用二进制游标。文本格式一般都比对应的二进制格式占用的存储空间大。二进制游标返回内部二进制形态的数据,可能更易于操作。如果想以文本方式显示数据,则以文本方式检索会为用户节约很多客户端的工作。比如,如果查询从某个整数列返回1,在缺省的游标里将获得一个字符串1,但在二进制游标里将得到一个4字节的包含该数值内部形式的数值(大端顺序)。
  • 参数说明 cursor_name 将要创建的游标名。 取值范围:遵循数据库对象命名规范。 BINARY 指明游标以二进制而不是文本格式返回数据。 NO SCROLL 声明游标检索数据行的方式。 NO SCROLL:声明该游标不能用于以倒序的方式检索数据行。 未声明:根据执行计划的不同,自动判断该游标是否可以用于以倒序的方式检索数据行。 WITH HOLD | WITHOUT HOLD 声明当创建游标的事务结束后,游标是否能继续使用。 WITH HOLD:声明该游标在创建它的事务结束后仍可继续使用。 WITHOUT HOLD:声明该游标在创建它的事务之外不能再继续使用,此游标将在事务结束时被自动关闭。 如果不指定WITH HOLD或WITHOUT HOLD,默认行为是WITHOUT HOLD。 跨节点事务不支持WITH HOLD(例如在多Coordinator部署集群中所创建的含有DDL的事务属于跨节点事务)。 query 使用SELECT或VALUES子句指定游标返回的行。 取值范围:SELECT或VALUES子句。
  • 什么是SQL SQL是用于访问和处理数据库的标准计算机语言。 SQL提供了各种任务的语句,包括: 查询数据。 在表中插入、更新和删除行。 创建、替换、更改和删除对象。 控制对数据库及其对象的访问。 保证数据库的一致性和完整性。 SQL语言由用于处理数据库和数据库对象的命令和函数组成。该语言还会强制实施有关数据类型、表达式和文本使用的规则。因此在SQL参考章节,除了SQL语法参考外,还会看到有关数据类型、表达式、函数和操作符等信息。
  • SQL发展简史 SQL发展简史如下: 1986年,ANSI X3.135-1986,ISO/IEC 9075:1986,SQL-86 1989年,ANSI X3.135-1989,ISO/IEC 9075:1989,SQL-89 1992年,ANSI X3.135-1992,ISO/IEC 9075:1992,SQL-92(SQL2) 1999年,ISO/IEC 9075:1999,SQL:1999 2003年,ISO/IEC 9075:2003,SQL:2003 2011年,ISO/IEC 9075:2011,SQL:2011 2016年,ISO/IEC 9075:2016,SQL:2016 2019年,ISO/IEC 9075:2019,SQL:2019
  • 优化建议 VALUES 通过INSERT语句批量插入数据时,建议将多条记录合并入一条语句中执行插入,以提高数据加载性能。例如,INSERT INTO sections VALUES (30, 'Administration', 31, 1900),(40, 'Development', 35, 2000), (50, 'Development' , 60 , 2001); 如果INSERT多VALUES语句中VALUES的值分布在一个DN上,GaussDB可以把语句下推到对应DN执行。目前只支持VALUES中值为常量,简单表达式和可下推函数(pg_proc中字段provolatile为'i')。如果表中列带有DEFAULT值,只支持DEFAULT值为常量,简单表达式。单VALUES不能下推单DN的语句,多VALUES同样不支持下推。
  • 参数说明 WITH [ RECURSIVE ] with_query [, ...] 用于声明一个或多个可以在主查询中通过名称引用的子查询,相当于临时表。 如果声明了RECURSIVE,那么允许SELECT子查询通过名称引用它自己。 其中with_query的详细格式为: with_query_name [ ( column_name [, ...] ) ] AS [ [ NOT ] MATERIALIZED ] ( {SELECT | VALUES | INSERT | UPDATE | DELETE} ) – with_query_name指定子查询生成的结果集名称,在查询中可使用该名称访问子查询的结果集。 – column_name指定子查询结果集中显示的列名。 – 每个子查询可以是SELECT,VALUES,INSERT,UPDATE或DELETE语句。 – 用户可以使用MATERIALIZED / NOT MATERIALIZED对CTE进行修饰。 如果声明为MATERIALIZED,WITH查询将被物化,生成一个子查询结果集的拷贝,在引用处直接查询该拷贝,因此WITH子查询无法和主干SELECT语句进行联合优化(如谓词下推、等价类传递等),对于此类场景可以使用NOT MATERIALIZED进行修饰,如果WITH查询语义上可以作为子查询内联执行,则可以进行上述优化。 如果用户没有显示声明物化属性则遵守以下规则:如果CTE只在所属主干语句中被引用一次,且语义上支持内联执行,则会被改写为子查询内联执行,否则以CTE Scan的方式物化执行。 INSERT ON DUPLICATE KEY UPDATE不支持WITH及WITH RECURSIVE子句。 plan_hint子句 以/*+ */的形式在INSERT关键字后,用于对INSERT对应的语句块生成的计划进行hint调优,详细用法请参见章节使用Plan Hint进行调优。每条语句中只有第一个/*+ plan_hint */注释块会作为hint生效,里面可以写多条hint。 table_name 要插入数据的目标表名。 取值范围:已存在的表名。 column_name 目标表中的字段名: 字段名可以使用子字段名或者数组下标修饰。 没有在字段列表中出现的每个字段,将由系统默认值,或者声明时的默认值填充,若都没有则用NULL填充。例如,向一个复合类型中的某些字段插入数据的话,其他字段将是NULL。 目标字段(column_name)可以按顺序排列。如果没有列出任何字段,则默认全部字段,且顺序为表声明时的顺序。 如果value子句和query中只提供了N个字段,则目标字段为前N个字段。 value子句和query提供的值在表中从左到右关联到对应列。 取值范围:已存在的字段名。 expression 赋予对应column的一个有效表达式或值: 如果是INSERT ON DUPLICATE KEY UPDATE语句下,expression可以为VALUES(column_name)或EXCLUDED.column_name用来表示引用冲突行对应的column_name字段的值。需注意,其中VALUES(column_name)不支持嵌套在表达式中(例如VALUES(column_name)+1),但EXCLUDED不受此限制。 向表中字段插入单引号 " ' "时需要使用单引号自身进行转义。 如果插入行的表达式不是正确的数据类型,系统试图进行类型转换,若转换不成功,则插入数据失败,系统返回错误信息。 DEFAULT 对应字段名的缺省值。如果没有缺省值,则为NULL。 query 一个查询语句(SELECT语句),将查询结果作为插入的数据。 RETURNING 返回实际插入的行,RETURNING列表的语法与SELECT的输出列表一致。注意:INSERT ON DUPLICATE KEY UPDATE不支持RETURNING子句。 output_expression INSERT命令在每一行都被插入之后用于计算输出结果的表达式。 取值范围:该表达式可以使用table的任意字段。可以使用*返回被插入行的所有字段。 output_name 字段的输出名称。 取值范围:字符串,符合标识符命名规范。 ON DUPLICATE KEY UPDATE 对于带有唯一约束(UNIQUE INDEX或PRIMARY KEY)的表,如果插入数据违反唯一约束,则对冲突行执行UPDATE子句完成更新。如果UPDATE子句为NOTHING,则不做任何操作。 对于不带唯一约束的表,则仅执行插入。 不支持触发器,不会触发目标表的INSERT或UPDATE触发器。 不支持延迟生效(DEFERRABLE)的唯一约束或主键。 如果表中存在多个唯一约束,如果所插入数据违反多个唯一约束,对于检测到冲突的第一行进行更新,其他冲突行不更新(检查顺序与索引维护具有强相关性,一般先创建的索引先进行冲突检查)。 分布列、唯一索引列不允许UPDATE。 UPDATE的WHERE子句不支持包含子链接。
  • 注意事项 表的所有者、拥有表INSERT权限的用户或拥有INSERT ANY TABLE权限的用户,可向表中插入数据,系统管理员默认拥有此权限。 如果使用RETURNING子句,用户必须要有该表的SELECT权限。 如果使用ON DUPLICATE KEY UPDATE,用户必须要有该表的INSERT、UPDATE权限,UPDATE子句中列的SELECT权限。 如果使用QUERY子句插入来自查询里的数据行,用户还需要拥有在查询里使用的表的SELECT权限。 如果使用QUERY子句插入来自查询动态数据脱敏列的数据,插入的结果即为脱敏后的值,无法被还原。 当连接到TD兼容的数据库时,td_compatible_truncation参数设置为on时,将启用超长字符串自动截断功能,在后续的INSERT语句中(不包含外表的场景下),对目标表中char和varchar类型的列上插入超长字符串时,系统会自动按照目标表中相应列定义的最大长度对超长字符串进行截断。 如果向字符集为字节类型编码(SQL_ASCII,LATIN1等)的数据库中插入多字节字符数据(如汉字等),且字符数据跨越截断位置,这种情况下,按照字节长度自动截断,自动截断后会在尾部产生非预期结果。如果用户有对于截断结果正确性的要求,建议用户采用UTF8等能够按照字符截断的输入字符集作为数据库的编码集。
  • 语法格式 1 2 3 4 5 6 7 [ WITH [ RECURSIVE ] with_query [, ...] ] INSERT [/*+ plan_hint */] INTO table_name [ AS alias ] [ ( column_name [, ...] ) ] { DEFAULT VALUES | VALUES {( { expression | DEFAULT } [, ...] ) }[, ...] | query } [ ON DUPLICATE KEY UPDATE { NOTHING | { column_name = { expression | DEFAULT } } [, ...] [ WHERE condition ] } ] [ RETURNING {* | {output_expression [ [ AS ] output_name ] }[, ...]} ];
  • GS_POLICY_LABEL GS_POLICY_LABEL系统表记录资源标签配置信息,一个资源标签对应着一条或多条记录,每条记录标记了数据库资源所属的资源标签。需要有系统管理员或安全策略管理员权限才可以访问此系统表。 FQDN(Fully Qualified Domain Name)标识了数据库资源所属的绝对路径。 表1 GS_POLICY_LABEL表字段 名称 类型 描述 oid oid 行标识符(隐含属性,必须明确选择)。 labelname name 资源标签名称。 labeltype name 资源标签类型,目前仅为RESOURCE。 fqdnnamespace oid 被标识的数据库资源所属的namespace oid。 fqdnid oid 被标识的数据库资源的oid,若数据库资源为列,则该列为所属表的oid。 relcolumn name 列名,若被标识的数据库资源为列,该列指出列名,否则该列为空。 fqdntype name 被标识的数据库资源的类型名称,例如schema、table、column、view等。 父主题: 系统表
  • PG_TS_CONFIG PG_TS_CONFIG系统表包含表示文本搜索配置的记录。一个配置指定一个特定的文本搜索解析器和一个为了每个解析器的输出类型使用的字典的列表。 解析器在PG_TS_CONFIG记录中显示,但是字典映射的标记是由PG_TS_CONFIG_MAP里面的辅助记录定义的。 表1 PG_TS_CONFIG字段 名称 类型 引用 描述 oid oid - 行标识符(隐含字段,必须明确选择)。 cfgname name - 文本搜索配置名。 cfgnamespace oid PG_NAMESPACE.oid 包含这个配置的名称空间的OID。 cfgowner oid PG_AUTHID.oid 配置的所有者。 cfgparser oid PG_TS_PARSER.oid 这个配置的文本搜索解析器的OID。 cfoptions text[] - 分词相关配置选项。 父主题: 系统表
  • SUMMARY_STATIO_SYS_INDEXES SUMMARY_STATIO_SYS_INDEXES视图显示集群命名空间中所有系统表索引的I/O状态汇总信息。 表1 SUMMARY_STATIO_SYS_INDEXES字段 名称 类型 描述 schemaname name 该索引的模式名。 relname name 该索引的表名。 indexrelname name 索引名称。 idx_blks_read numeric 从索引中读取的磁盘块数。 idx_blks_hit numeric 索引命中缓存数。 父主题: Cache/IO
  • PG_OS_THREADS PG_OS_THREADS视图提供当前节点下所有线程的状态信息。 表1 PG_OS_THREADS字段 名称 类型 描述 node_name text 当前节点的名称。 pid bigint 当前节点进程中正在运行的线程号。 lwpid integer 与pid对应的轻量级线程号。 thread_name text 与pid对应的线程名称。 creation_time timestamp with time zone 与pid对应的线程创建的时间。 父主题: 系统视图
  • PGXC_GET_TABLE_SKEWNESS PGXC_GET_TABLE_SKEWNESS视图显示当前数据库中表的数据分布倾斜情况。只有系统管理员权限可以访问。 表1 PGXC_GET_TABLE_SKEWNESS字段 名称 类型 描述 schemaname name 表所在的模式名。 tablename name 表名。 totalsize numeric 表的总大小,单位Byte。 avgsize numeric(1000,0) 表大小平均值(totalsize/DN个数,该值为平均分布的理想情况下,表在各DN占用空间大小)。 maxratio numeric(4,3) 单DN表大小最大值占比(表在各DN占用空间的最大值/totalsize)。 minratio numeric(4,3) 单DN表大小最小值占比(表在各DN占用空间的最小值/totalsize)。 skewsize bigint 表分布倾斜值(单DN表大小最大值 - 单DN表大小最小值)。 skewratio numeric(4,3) 表分布倾斜率(skewsize/totalsize)。 skewstddev numeric(1000,0) 表分布标准方差(在表大小一定的情况下,该值越大表明表的整体分布情况越倾斜)。 父主题: 系统视图
  • MY_JOBS MY_JOBS视图显示当前用户拥有的定时任务的详细信息。该视图同时存在于PG_CATALOG和SYS schema下。 表1 MY_JOBS字段 名称 类型 描述 job bigint 作业ID。 log_user name 创建者的UserName。 priv_user name 作业执行者的UserName。 dbname name 创建作业的数据库名称。 start_date timestamp without time zone 作业的开始时间。 start_suc text 作业成功执行的开始时间。 last_date timestamp without time zone 上次运行开始时间。 last_suc text 上次成功运行的开始时间。 this_date timestamp without time zone 正在运行任务的开始时间。 this_suc text 正在运行任务成功的开始时间。 next_date timestamp without time zone 任务下次执行时间。 next_suc text 任务下次成功执行时间。 broken text 如果status字段取值为'd',则为'y',否则为'n'。 status "char" 本步骤的执行状态,取值范围:('r'、's'、'f'、'd'),默认为'r',取值含义: r:运行中。 s:执行成功。 f:执行失败。 d:取消执行。 interval text 用来计算下次运行时间的时间表达式,如果为null则表示定时任务只执行一次。 failures smallint 失败计数,若作业连续执行失败16次,则不再继续执行。 what text 可执行的作业。 父主题: 系统视图
  • CM错误信息 ER RMS G: "Fail to access the cluster static config file." SQLSTATE: c3000 CAUSE: "The cluster static config file is not generated or is manually deleted." ACTION: "Please check the cluster static config file." ERRMSG: "Fail to open the cluster static file." SQLSTATE: c3000 CAUSE: "The cluster static config file is not generated or is manually deleted." ACTION: "Please check the cluster static config file." ERRMSG: "Fail to read the cluster static file." SQLSTATE: c3001 CAUSE: "The cluster static file permission is insufficient." ACTION: "Please check the cluster static config file." ERRMSG: "Failed to read the static config file." SQLSTATE: c1000 CAUSE: "out of memeory." ACTION: "Please check the system memory and try again." ERRMSG: "Could not find the current node in the cluster by the node id %u." SQLSTATE: c3002 CAUSE: "The static config file probably contained content error." ACTION: "Please check static config file." ERRMSG: "Failed to open the logic config file." SQLSTATE: c3000 CAUSE: "The logic config file is not generated or is manually deleted." ACTION: "Please check the cluster static config file." ERRMSG: "Fail to read the logic static config file." SQLSTATE: c3001 CAUSE: "The logic static config file permission is insufficient." ACTION: "Please check the logic static config file." ERRMSG: "Failed to open or read the static config file." SQLSTATE: c1000 CAUSE: "out of memeory." ACTION: "Please check the system memory and try again." ERRMSG: "Failed to open the log file '%s'." SQLSTATE: c3000 CAUSE: "Log file not found." ACTION: "Please check the log file." ERRMSG: "Failed to open the log file '%s'." SQLSTATE: c3000 CAUSE: "The log file permission is insufficient." ACTION: "please check the log file." ERRMSG: "Failed to open the dynamic config file '%s'." SQLSTATE: c3000 CAUSE: "The dynamic config file permission is insufficient." ACTION: "Please check the dynamic config file." ERRMSG: "Failed to malloc memory, size = %lu." SQLSTATE: c1000 CAUSE: "out of memeory." ACTION: "Please check the system memory and try again." ERRMSG: "unrecognized AZ name '%s'." SQLSTATE: c3000 CAUSE: "The parameter(%s) entered by the user is incorrect." ACTION: "Please check the parameter entered by the user and try again." ERRMSG: "unrecognized minorityAz name '%s'." SQLSTATE: c3000 CAUSE: "The parameter(%s) entered by the user is incorrect." ACTION: "Please check the parameter entered by the user and try again." ERRMSG: "Get GAUSSHOME failed." SQLSTATE: c3000 CAUSE: "The environment variable('GAUSSHOME') is incorrectly configured." ACTION: "Please check the environment variable('GAUSSHOME')." ERRMSG: "Get current user name failed." SQLSTATE: c3000 CAUSE: "N/A" ACTION: "Please check the environment." ERRMSG: "-B option must be specified." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-T option must be specified.\n" SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "can't stop one node or instance with -m normal." SQLSTATE: c3000 CAUSE: "The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "can't stop one node or instance with -m resume." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "can't stop one availability zone with -m resume." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "log level or cm server arbitration mode must be specified." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "log level or cm server arbitration mode need not be specified." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-R is needed." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-D is needed." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-n and -R are needed." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-n and -D are needed." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "no operation specified." SQLSTATE: c3000 CAUSE: "The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "no cm directory specified." SQLSTATE: c3000 CAUSE: "The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "Please check the usage of switchover." SQLSTATE: c3000 CAUSE: "The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-n and -z cannot be specified at the same time." SQLSTATE: c3000 CAUSE: "The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-m cannot be specified at the same time with -n or -z." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-n node(%d) is invalid." SQLSTATE: c3000 CAUSE: "The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-n node is needed." SQLSTATE: c3000 CAUSE: "The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "%s: -C is needed." SQLSTATE: c3000 CAUSE: "The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-z value must be 'ALL' when query mppdb cluster." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-v is needed." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-C is needed." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-Cv is needed." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-L value must be 'ALL' when query logic cluster." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "unrecognized LC name '%s'." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-n is needed." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "There is no '%s' information in cluster." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-D path is too long.\n" SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-D path is invalid." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-n node(%s) is invalid." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-R only support when the cluster is single-inst." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-t time is invalid." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "-votenum is invalid." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "unrecognized build mode." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "unrecognized build mode '%s'." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "too many command-line arguments (first is '%s')." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "unrecognized operation mode '%s'." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "no cm directory specified." SQLSTATE: c3000 CAUSE: "%s: The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "Failed to malloc memory." SQLSTATE: c1000 CAUSE: "out of memeory." ACTION: "Please check the system memory and try again." ERRMSG: "Failed to open etcd: %s." SQLSTATE: c4000 CAUSE: "Etcd is abnormal." ACTION: "Please check the Cluster Status and try again." ERRMSG: "[PATCH-ERROR] hotpatch command or path set error." SQLSTATE: c3000 CAUSE: "The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "no standby datanode in single node cluster." SQLSTATE: c3000 CAUSE: "The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "restart logic cluster failed." SQLSTATE: c3000 CAUSE: "The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "restart logic cluster failed" SQLSTATE: c3000 CAUSE: "The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." ERRMSG: "The option parameter is not specified." SQLSTATE: c3000 CAUSE: "The cmdline entered by the user is incorrect." ACTION: "Please check the cmdline entered by the user(%s)." 父主题: 错误日志信息参考
  • PG_DIRECTORY PG_DIRECTORY系统表用于保存用户添加的directory对象可以通过CREATE DIRECTORY语句向该表中添加记录,当enable_access_server_directory=off时,只允许初始用户创建directory对象;当enable_access_server_directory=on时,具有SYSADMIN权限的用户和继承了内置角色gs_role_directory_create权限的用户可以创建directory对象。 表1 PG_DIRECTORY字段 名称 类型 描述 oid oid 行标识符(隐含字段,必须明确选择)。 dirname name 目录对象的名称。 owner oid 目录对象的所有者。 dirpath text 目录路径。 diracl aclitem[] 访问权限。 父主题: 系统表
  • log_min_error_statement 参数说明:控制在服务器日志中记录错误的SQL语句。 该参数属于SUSET类型参数,请参考表1中对应设置方法进行设置。 取值范围:枚举类型,有效值有debug、debug5、debug4、debug3、debug2、debug1、info、log、notice、warning、error、fatal、panic。参数的详细信息请参见表1。 设置为error ,表示导致错误、日志消息、致命错误、panic的语句都将被记录。 设置为panic,表示关闭此特性。 默认值:error
  • log_min_duration_statement 参数说明:当某条语句的持续时间大于或者等于特定的毫秒数时,log_min_duration_statement参数用于控制记录每条完成语句的持续时间。 设置log_min_duration_statement可以很方便地跟踪需要优化的查询语句。对于使用扩展查询协议的客户端,语法分析、绑定、执行每一步所花时间被独立记录。 该参数属于SUSET类型参数,请参考表1中对应设置方法进行设置。 当此选项与log_statement同时使用时,已经被log_statement记录的语句文本不会被重复记录。在没有使用syslog情况下,推荐使用log_line_prefix记录PID或会话ID,方便将当前语句消息连接到最后的持续时间消息。 取值范围:整型,-1 ~ 2147483647‬,单位为毫秒。 设置为250,所有运行时间不短于250ms的SQL语句都会被记录。 设置为0,输出所有语句的持续时间。 设置为-1,关闭此功能。 默认值:3s(即3000ms)
  • backtrace_min_messages 参数说明:控制当产生该设置参数级别相等或更高级别的信息时,会打印函数的堆栈信息到服务器日志文件中。 该参数属于SUSET类型参数,请参考表1中对应设置方法进行设置。 该参数作为客户现场问题定位手段使用,且由于频繁的打印函数栈会对系统的开销及稳定性有一定的影响,因此如果需要进行问题定位时,建议避免将backtrace_min_messages的值设置为fatal及panic以外的级别。 取值范围:枚举类型 有效值有debug、debug5、debug4、debug3、debug2、debug1、info、log、notice、warning、error、fatal、panic。参数的详细信息请参见表1。 默认值:panic
  • client_min_messages 参数说明:控制发送到客户端的消息级别。每个级别都包含排在它后面的所有级别中的信息。级别越低,发送给客户端的消息就越少。 该参数属于USERSET类型参数,请参考表1中对应设置方法进行设置。 当client_min_messages和log_min_messages取相同值时,其值所代表的级别不同。 取值范围:枚举类型,有效值有debug、debug5、debug4、debug3、debug2、debug1、info、log、notice、warning、error、fatal、panic,其中debug和debug2等效。参数的详细信息请参见表1。在实际设置过程中,如果设置的级别大于error,为fatal或panic,系统会默认将级别转为error。 默认值:notice
  • log_min_messages 参数说明:控制写到服务器日志文件中的消息级别。每个级别都包含排在它后面的所有级别中的信息。级别越低,服务器运行日志中记录的消息就越少。 该参数属于SUSET类型参数,请参考表1中对应设置方法进行设置。 当client_min_messages和log_min_messages取相同值log时所代表的消息级别不同。 取值范围:枚举类型,有效值有debug、debug5、debug4、debug3、debug2、debug1、info、log、notice、warning、error、fatal、panic,其中debug和debug2等效。参数的详细信息请参见表1。 默认值:warning
  • DV_SESSION_LONGOPS DV_SESSION_LONGOPS视图显示当前正在执行的操作的进度。该视图需要授权访问。 表1 DV_SESSION_LONGOPS字段 名称 类型 描述 sid bigint 当前正在执行的后台进程的OID。 serial# integer 当前正在执行的后台进程的序号,在GaussDB中为0。 sofar integer 目前完成的工作量,在GaussDB中为空。 totalwork integer 工作总量,在GaussDB中为空。 父主题: 系统视图
  • Psycopg接口参考 Psycopg接口是一套提供给用户的API方法,本节将对部分常用接口做具体描述。 psycopg2.connect() connection.cursor() cursor.execute(query,vars_list) cursor.executemany(query,vars_list) connection.commit() connection.rollback() cursor.fetchone() cursor.fetchall() cursor.close() connection.close() 父主题: 基于Psycopg开发
  • GLOBAL_MEMORY_NODE_DETAIL 显示当前集群中所有正常节点下的内存使用情况。 表1 GLOBAL_MEMORY_NODE_DETAIL字段 名称 类型 描述 nodename text 节点名称。 memorytype text 内存使用的名称。 max_process_memory:数据库节点可用内存的最大值。 process_used_memory:进程所使用的内存大小。 max_dynamic_memory:最大动态内存。 dynamic_used_memory:已使用的动态内存。 dynamic_peak_memory:内存的动态峰值。 dynamic_used_shrctx:已使用的动态共享内存上下文。 dynamic_peak_shrctx:共享内存上下文的动态峰值。 max_shared_memory:最大共享内存。 shared_used_memory:已使用的共享内存。 max_sctpcomm_memory:TCP代理通信所允许使用的最大内存。 sctpcomm_used_memory:TCP代理通信已使用的内存大小。 sctpcomm_peak_memory:TCP代理通信的内存峰值。 other_used_memory:其他已使用的内存大小。 gpu_max_dynamic_memory:GPU最大动态内存。 gpu_dynamic_used_memory:GPU已使用的动态内存。 gpu_dynamic_peak_memory:GPU内存的动态峰值。 pooler_conn_memory:连接池申请内存计数。 pooler_freeconn_memory:连接池空闲连接的内存计数。 storage_compress_memory:存储模块压缩使用的内存大小。 udf_reserved_memory:UDF预留的内存大小。 memorymbytes integer 内存使用的大小,单位为MB。 父主题: Memory
  • 选择存储模型 进行数据库设计时,表设计上的一些关键项将严重影响后续整库的查询性能。表设计对数据存储也有影响:好的表设计能够减少I/O操作及最小化内存使用,进而提升查询性能。 表的存储模型选择是表定义的第一步。客户业务属性是表的存储模型的决定性因素,依据下面表格选择适合当前业务的存储模型。 存储模型 适用场景 行存 点查询(返回记录少,基于索引的简单查询)。 增删改比较多的场景。 父主题: 表设计最佳实践
共100000条