GBase 8s
运维管理
问答

建表时,添加主键失败

发表于2025-07-24 15:37:51209次浏览12个评论

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

【GBase版本】:8s 8.8

【操作系统】:ubuntu

【CPU】:

【问题描述】*: ALTER TABLE master.newtable ADD CONSTRAINT newtable_pk PRIMARY KEY (column1);

提示:SQL 错误 [IX000]: 不能增加索引。
SQL 错误 [IX000]: 不能增加索引。
 不能增加索引。
 不能增加索引。
   ISAM 错误:没有可用磁盘空间
   ISAM 错误:没有可用磁盘空间
   ISAM 错误:没有可用磁盘空间
 ISAM 错误:没有可用磁盘空间
 

评论

登录后才可以发表评论
用户头像
路路路发表于 1年前
稍等
hugolin发表于 1年前
到服务端su - gbasedbt后执行
onstat -d看下数据表空间信息
GBase用户19730发表于 1年前
@hugolin:Dbspaces
address number flags fchunk nchunks pgsize flags owner name
472f8028 1 0x70001 1 1 2048 N BA gbasedbt rootdbs
498f4d98 2 0x70001 2 1 2048 N BA gbasedbt plogdbs
49a86028 3 0x60001 3 1 2048 N BA gbasedbt llogdbs
49a86258 4 0x68001 4 1 2048 N SBA gbasedbt sbspace01
49a86488 5 0x42001 5 1 16384 N TBA gbasedbt tempdbs01
49a866b8 6 0x60001 6 1 16384 N BA gbasedbt datadbs01
6 active, 2047 maximum

Chunks
address chunk/dbs offset size free bpages flags pathname
472f8258 1 1 0 256000 1 PO-B-- /opt/gbase/data/rootchk
49a87028 2 2 0 256000 5947 PO-B-- /opt/gbase/data/plogchk
49a88028 3 3 0 512000 11947 PO-B-- /opt/gbase/data/llogchk
49a89028 4 4 0 102400 95431 95432 POSB-- /opt/gbase/data/sbspace01
Metadata 6915 5146 6915
49a8a028 5 5 0 32000 31947 PO-B-- /opt/gbase/data/tempchk01
49a8b028 6 6 0 32000 31413 PO-BE- /opt/gbase/data/datachk01
6 active, 32766 maximum

NOTE: The values in the "size" and "free" columns for DBspace chunks are
displayed in terms of "pgsize" of the DBspace to which they belong.


Expanded chunk capacity mode: always
hugolin发表于 1年前
@GBase用户19730:是不是把库建到rootdbs下了
oncheck -pe rootdbs看下
GBase用户19730发表于 1年前
@hugolin:内容太多,粘贴了部分。
DBspace Usage Report: rootdbs Owner: gbasedbt Created: 03/14/2025


Chunk Pathname Pagesize(k) Size(p) Used(p) Free(p)
1 /opt/gbase/data/rootchk 2 256000 255999 1

Description Offset(p) Size(p)
------------------------------------------------------------- -------- --------
RESERVED PAGES 0 12
CHUNK FREELIST PAGE 12 1
rootdbs:'gbasedbt'.TBLSpace 13 250
master:'gbasedbt'.systables 263 8
master:'gbasedbt'.syscolumns 271 32
master:'gbasedbt'.sysindices 303 32
master:'gbasedbt'.systabauth 335 16
master:'gbasedbt'.syscolauth 351 8
master:'gbasedbt'.sysviews 359 8
hugolin发表于 1年前
@GBase用户19730:master这部分有没有表newtable?
hugolin发表于 1年前
@GBase用户19730:重建下库吧:
dbaccess - -
create database gbasedb in datadbs01 with log;
最佳回答
GBase用户19730发表于 1年前
@hugolin:再把master库中的表拷贝过去?
hugolin发表于 1年前
@GBase用户19730:dbexport master -l这是导出
dbaccess - -
drop database master;
dbimport master -d datadbs01 -l这是导入
GBase用户19730发表于 1年前
@hugolin:表空间在datadbs01 下可以添加主键
用户头像
levvel发表于 9个月前
听说评论可以拿积分,我试一下子
GBase用户51885发表于 2个月前
等答案了啊。