GaussDB(DWS)数据重分布跳表方案
【摘要】 介绍了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_name的redis_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)