select gp_execution_dbid() dbid,procpid,current_query
from gp_dist_random('pg_stat_activity')
where procpid in
(select pid from gp_dist_random('pg_locks') where and mode='ExclusiveLock')
and lower(current_query) like '%xxx%' ;
1.在navicat执行 查看dbid 3 的服务器及端口
select * from gp_segment_configuration where dbid = 3;
2.登录gp主节点
su - gpadmin
3.根据第一步获取的ip和端口修改命令
PGOPTIONS="-c gp_session_role=utility" psql -h xxxxxxxxx -p xxxx -d idap_zl
4.procpid修改为上午查询对应的procpid
select pg_terminate_backend('procpid');