GaussDB(DWS)数据重分布跳表方案

举报
召走小子 发表于 2021/01/28 15:03:58 2021/01/28
【摘要】 介绍了C80/6.5.1/8.0版本的重分布跳表方案

GaussDB(DWS)数据重分布跳表方案

数据重分布过程中由于有些用户表存在倾斜、数据文件损坏等各种原因,可能需要暂时跳过这些表,先完成其它表的重分布。跳过特定表的具体步骤如下:

8.0之前版本

1、设置append_mode = off

alter table pgxc_redistb set (append_mode = off);

2、跳过指定表nspname.tb_name

select * from pgxc_redistb where relname = 'tb_name' and nspname=’nspname’;

update pgxc_redistb set redis_order = 0 where relname = 'tb_name' and nspname=’nspname’ and redistributed = 'n';

3、恢复表为只读模式

alter table pgxc_redistb set (append_mode = read_only);

4、确认是否生效

select redis_order from pgxc_redistb where relname = 'tb_name';

tb_nameredis_order字段改为0,则说明已跳过该表。

注意:跳过操作是暂时的,最终在完成其它表之后仍然需要完成这些跳过表的重分布,否则集群仍然处于重分布状态。

8.0版本

1、找到老的nodegroup名称old_group_name

select group_name from pgxc_group where in_redistribution='y';

2、确认待跳过表的当前redis_order值为1024

select pc.pcrelid, n.nspname, c.relname, pc.redis_order from pg_class c, pg_namespace n, pgxc_class pc where c.oid=pc.pcrelid and c.relnamespace = n.oid and pc.pgroup='old_group_name' and n.nspname='schem_name' and c.relname='table_name';

3、修改待跳过表的redis_order值为0

update pgxc_class set redis_order=0 where pcrelid = pcrelid;

4、确认待跳过表的当前redis_order值已修改为0

select pc.pcrelid, n.nspname, c.relname, pc.redis_order from pg_class c, pg_namespace n, pgxc_class pc where c.oid=pc.pcrelid and c.relnamespace = n.oid and pc.pgroup='old_group_name' and n.nspname='schem_name' and c.relname='table_name';

待跳过表的redis_order字段改为0,则说明已跳过该表。

注意:跳过操作是暂时的,最终在完成其它表之后仍然需要完成这些跳过表的重分布,否则集群仍然处于重分布状态。

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

举报
请填写举报理由
0/200