返回首页

gbase数据、南大通用产品文档:GBase8sSQLNumParams(仅限二级)

更新日期:2024年09月11日

SQLNumParams 返回 SQL 语句中参数的数量。

GBase 8s ODBC Driver 程序员指南
南大通用数据技术股份有限公司
- 232 -

下表描述了SQLNumParams 的 SQLSTATE 和错误值。
SQLSTATE
错误值
错误消息
01000
-11001
General warning
S1000
-11060
General error
S1001
-11061
Memory-allocation failure
S1008
-11065
Operation canceled
S1010
-11067
Function-sequence error
S1T00
-11094
Time-out expired

检查操作系统numactl 工具:
# numactl --hardware
available: 2 nodes (0-1)
node 0 cpus: 0 2 4 6 8 10 12 14
node 0 size: 32722 MB
node 0 free: 22537 MB
node 1 cpus: 1 3 5 7 9 11 13 15
node 1 size: 32768 MB
node 1 free: 23142 MB
node distances:
node
0
1
0:
10
20
1:
20
10
如硬件支持numa,操作系统未安装numa 工具,需单独安装numactl 工具:

GBase 8a MPP Cluster 产品手册
3 集群安装升级与卸载
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
105
yum install -y numactl
或者使用rpm 命令安装以下包(如果是arm 架构,注意替换x86):
numactl-2.0.9-7.el7.x86_64.rpm
numactl-devel-2.0.9-7.el7.x86_64.rpm
numactl-libs-2.0.9-7.el7.x86_64.rpm
numad-0.5-18.20150602git.el7.x86_64.rpm
安装后可以查看当前服务器numa 状态:
# numastat
node0
node1
numa_hit
52237686
241164821
numa_miss
0
0
numa_foreign
0
0
interleave_hit
22797
22887
local_node
52226319
241150686
other_node
11367
14135

绑定步骤
NUMA 绑定需修改gcluster_services 脚本两处后,
使用该gcluster_services 脚本重启
集群服务。
如指定服务器一的172.16.3.61 实例下gcluster_services 脚本进行numa 绑定
修改第一处如下:
$ cd /opt/172.16.3.61/gnode/server/bin
$ vi gcluster_services
410 行左右找到下面代码
$2 > /dev/null 2>&1 &
# waiting for start completely
修改如下,增加红色代码
$2 > /dev/null 2>&1 &
# echo "$prog_name ------------------------$2"
if [ $prog_name = '/opt/172.16.3.61/gnode/server/bin/gbased' ];then
#echo -e "\n------numactl${loop_count}------$3"
count_numa=$(($(($3))%2))
echo
"--cpunodebind=+$count_numa --membind=+$count_numa"
numactl --cpunodebind=+"${count_numa}"
--membind=+"${count_numa}" $2 > /dev/null 2>&1 &

GBase 8a MPP Cluster 产品手册
3 集群安装升级与卸载
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
106
#
$2 > /dev/null 2>&1 &
sleep 10
else
$2 > /dev/null 2>&1 &
fi
if [ $prog_name = '/opt/172.16.3.64/gnode/server/bin/gbased' ];then
#echo -e "\n------numactl${loop_count}------$3"
count_numa=$(($(($3))%2))
echo
"--cpunodebind=+$count_numa --membind=+$count_numa"
numactl --cpunodebind=+"${count_numa}"
--membind=+"${count_numa}" $2 > /dev/null 2>&1 &
#
$2 > /dev/null 2>&1 &
sleep 10
else
$2 > /dev/null 2>&1 &
fi
# waiting for start completely
注意,在NUMA 绑定时需要绑定进程的全路径,如绑定gbased 进程,则将其全路

/opt//gnode/server/bin/gbased






/opt//gnode/server/bin/gcluster_services 文件中,替换为真实IP 地址。
修改第二处如下:
500 行左右处增加红色代码:
# start data service
if [ $node_type == 2 -o $node_type == 3 ]; then
for ((count=0; count<${#DataServerName[@]}; count++))
do
instance_no=0
for inst in `echo $GBASE_INSTANCES|sed
's/:/\n/g'|sort|uniq`
do
if [ $inst != "" ];then
#echo $inst
. $inst
declare -a DataServerBin

GBase 8a MPP Cluster 产品手册
3 集群安装升级与卸载
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
107
DataServerBin[0]=$GBASE_HOME/bin/gbased
DataServerBin[1]=$GBASE_HOME/bin/gc_sync_server
#echo ${DataServerBin[count]}
#__start ${DataServerName[count]}
${DataServerBin[count]}
__start ${DataServerName[count]}
${DataServerBin[count]} ${instance_no}
if [ "$?" != "$RET_SUCCESS" ]; then
ret_start=$RET_START_ALL_ERROR
fi
((instance_no++))
fi
done
done
Fi
重启集群服务
$ cd /opt/GBase/172.16.3.61/gnode/server/bin
$ ./gcluster_services all start
$ numastat `pidof gbased`
Per-node process memory usage (in MBs)
PID
Node 0
Node 1
Total
----------------
--------------- --------------- ---------------
25788 (gbased)

语法

元素
用途
关键注意事项

GBase 8s 管理员参考
南大通用数据技术股份有限公司 - 353 -
元素
用途
关键注意事项
-a
seg_size
允许添加新的虚拟共享内
存段。以千字节为单位
限制: seg_size 的值必须是正整数。它不得超
过操作系统对共享内存段大小的限制

通常,您无需向共享内存的虚拟部分添加段,因为数据库服务器会在需要时自动添加段。
然而,随着段的添加,数据库服务器可能在获得其需要的内存之前达到段最大数量的操作
系统限制。这种情况通常在 SHMADD 配置参数设置得太小,以致数据库服务器在获得某
些操作所需内存之前耗尽可用段的数量时发生。
如果手工添加的段大于 SHMADD 所指定的段,那么可以避免耗尽这些段的操作系统限制
数,但仍满足数据库服务器对额外内存的需要。
该命令具有同等的 SQL 管理 API 命令。