返回首页

gbase数据、南大通用产品文档:GBase8aUPDATE

更新日期:2024年09月11日

功能说明
UPDATE 时,不能更新自增列。
示例
create table t2(a int auto_increment primary key,b varchar(100), c int)
distributed by ('b');

GBase 8a MPP Cluster 产品手册
5 数据库管理指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
1027
insert into t2(b,c) values('a1',1),('a2',2),('a3',3),('a4',4),('a5',5);
gbase> SELECT * FROM t2;
+---+------+------+
| a | b
| c
|
+---+------+------+
| 3 | a2
|
2 |
| 1 | a3
|
3 |
| 2 | a1
|
1 |
| 6 | a5
|
5 |
| 4 | a4
|
4 |
+---+------+------+
5 rows in set (Elapsed: 00:00:00.02)
gbase> update t2 set c = 144 where b = 'a2';
Query OK, 1 row affected (Elapsed: 00:00:00.08)
Rows matched: 1
Changed: 1
Warnings: 0
gbase> update t2 set a = 441 where b = 'a2';
ERROR 1235 (42000): This version of GBase doesn't yet support 'update/merge on
auto_increment column'
gbase> SELECT * from t2;
+---+------+------+
| a | b
| c
|
+---+------+------+
| 1 | a3
|
3 |
| 3 | a2
|
144 |

GBase 8a MPP Cluster 产品手册
5 数据库管理指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
1028
| 2 | a1
|
1 |
| 6 | a5
|
5 |
| 4 | a4
|
4 |
+---+------+------+
5 rows in set (Elapsed: 00:00:00.02)

扩容coordinator 节点报错“fail to execute
gcadmin cpcorditbl coorHosts.xml”
问题现象
扩容安装coordinator 节点时,
gcinstall.py 脚本安装新coordinator 节点后需要将原有
coordinator 节点上的元数据同步到新的coordinator 节点上,
此时gcinstall.py 脚本将
会执行gcadmin cpcorditbl coorHosts.xml 命令,在同步元数据时失败会打印该报错
信息“fail to execute gcadmin cpcorditbl coorHosts.xml”。
原因分析
gcadmin在同步coordinator节点元数据时需要将原有coordinator节点的元数据打包、
拷贝到新节点上,然后解压到新coordinator 节点上,最后将新coordinator 节点的
gclusterd 进程杀掉重启。出现该问题的原因是可能是由于元数据过多,在打包拷贝
的过程中超时造成的。此时可查看gcintall.log 中是否有“Error cause timeout”确定。
解决办法
同步元数据超时导致扩容coordinator 节点失败时,可在执行扩容安装时使用
“--timeout”参数设定更大的超时时间,gcadmin 默认的超时时间为5 分钟。
gcinstall.py 设定timeout 的时间单位为分钟(minute),help 信息如下所示:
Usage: gcinstall.py [options]
Options:
-h, --help
show this help message and exit
-U, --upgrade
upgrade install
--silent=SILENTCONFIG
use the supplied properties file for a 'silent'
install
--timeout=TIMEOUT
sync coordinator node metadata
timeout,unit(minute),default 15mins.
--backup_dir=BACKUP_DIR
The package path of backup file,default
/home/$dbaUser.

GBase 8a MPP Cluster 最佳实践
5 FAQ
文档版本(2022-02-11)
南大通用数据技术股份有限公司
156

Invalid qualifier
从原子元素构造 Interval 限定符时发出长度、起始值或结束值错误。
检查长度、起始值和结束来验证它们是否正确。请参阅 INTERVAL 数据类型 以获取正确
的值。