返回首页

gbase数据、南大通用产品文档:GBase8aHEX(N_or_S)

更新日期:2024年09月11日

函数说明
返回参数对应的十六进制值。如果N_or_S 是一个数字,则返回它的十六进制字
符串形式,在这里,N 是一个BIGINT 数,相当于CONV(N,10,16);如果N_or_S
是一个字符串,则返回每个字符对应的十六进制形式,其中每个字符被转化为两
个十六进制数字。以0xff 形式出现的字符串是此函数的反转操作,此时,将每两
位十六进制转换成其ASCII 码输出一个字符。
示例
示例1:N_or_S 值为数字。
gbase> SELECT HEX(255) FROM dual;
+----------+
| HEX(255) |
+----------+
| FF
|
+----------+
1 row in set
示例2:N_or_S 值为字符串。
gbase> SELECT HEX('abc') FROM dual;
+------------+
| HEX('abc') |
+------------+

GBase 8a MPP Cluster 产品手册
5 数据库管理指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
692
| 616263
|
+------------+
1 row in set
示例3:以0xff 形式出现的字符串是HEX(N_or_S)函数的反转操作。
gbase> SELECT 0x616263 FROM dual;
+----------+
| 0x616263 |
+----------+
| abc
|
+----------+
1 row in set

参数说明:控制是否启动job 线程。
该参数属于SIGHUP 类型参数,请参考表15-1 中对应设置方法进行设置。
取值范围:布尔型

on 表示不能启动job 线程。

off 表示可以启动job 线程。
默认值:off

功能说明
在批量执行rebalance 操作时,可以通过修改gclusterdb.rebalancing_status 表调整单
个rebalance 任务的优先级。priority 值最小的任务先做。
语法格式
update gclusterdb.rebalancing_status set priority = where
index_name='database_name.table_name';
表4- 46 参数说明
参数名称


priority_value
Priority_value 指定的值最小的任务先做,
默认该值为5。
database_name.table_name
指定要调整优先级的表的名称,可以通

select
index_name,
status,
priority
from
gclusterdb.rebalancing_status 命令查看,
即为查询结果中index_name 列对应的
值。
操作步骤
1)设置gcluster_rebalancing_concurrent_count 值为0。
gbase> set global gcluster_rebalancing_concurrent_count = 0;
Query OK, 0 rows affected
2)执行rebalance database 命令增加rebalance 任务。
此时所有rebalance 任务都不会
开始。
gbase> rebalance database test;
Query OK, 3 rows affected
3)调整rebalance 任务的优先级。
gbase> select index_name, status, priority
from
gclusterdb.rebalancing_status;
+------------+----------+----------+
| index_name | status
| priority |

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
362
+------------+----------+----------+
| test.t3
| STARTING |
5 |
| test.t1
| STARTING |
5 |
| test.t2
| STARTING |
5 |
+------------+----------+----------+
3 rows in set
gbase>
update
gclusterdb.rebalancing_status
set
priority
=
6
where
index_name='test.t3';
Query OK, 1 row affected
Rows matched: 1
Changed: 1
Warnings: 0
gbase>
update
gclusterdb.rebalancing_status
set
priority
=
4
where
index_name='test.t2';
Query OK, 1 row affected
Rows matched: 1
Changed: 1
Warnings: 0
gbase> select index_name, status, priority
from
gclusterdb.rebalancing_status;
+------------+----------+----------+
| index_name | status
| priority |
+------------+----------+----------+
| test.t3
| STARTING |
6 |
| test.t1
| STARTING |
5 |
| test.t2
| STARTING |
4 |
+------------+----------+----------+
3 rows in set
gbase> set global gcluster_rebalancing_concurrent_count = 1;
Query OK, 0 rows affected
gbase>
select
index_name,
status,
priority
from
gclusterdb.rebalancing_status;
+------------+----------+----------+
| index_name | status
| priority |
+------------+----------+----------+
| test.t3
| STARTING |
6 |
| test.t1
| STARTING |
5 |
| test.t2
| RUNNING
|
4 |
+------------+----------+----------+
3 rows in set
4)调整完之后设置gcluster_rebalancing_concurrent_count 为需要的并发数
gbase> set global gcluster_rebalancing_concurrent_count = 1;
Query OK, 0 rows affected
gbase>
select
index_name,
status,
priority
from
gclusterdb.rebalancing_status;
+------------+----------+----------+
| index_name | status
| priority |

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
363
+------------+----------+----------+
| test.t3
| STARTING |
6 |
| test.t1
| STARTING |
5 |
| test.t2
| RUNNING
|
4 |
+------------+----------+----------+
3 rows in set