标签:
1、查看队列情况
如果出现了资源占用大于1.1 e+11SQL,则可能存在不合理执行计划的SQL, 基本跑不出来, 库也会很卡。
2、查看用户归属的队列
a. 删除并重建err表。
drop table if exists masadw .err_ext_表名;
CREATE TABLE masadw.err_ext_表名 ( cmdtime timestamp with time zone, relname text, filename text, linenum integer, bytenum integer, errmsg text, rawdata text, rawbytes bytea) DISTRIBUTED RANDOMLY;
b.把err表修改owner为etl_user
ALTER TABLE masadw.err_ext_表名 OWNER TO etl_user;
c. 创建外部表:
drop EXTERNAL TABLE if exists masadw.ext_表名;
CREATE EXTERNAL TABLE masadw.ext_表名 ( time_id integer, area_id integer, grp_code character varying(50), cust_id bigint, usr_id bigint, svc_code character varying(50)) LOCATION ( ‘gphdfs://hacluster/tmp/zht/NEW_表名.TXT‘) FORMAT ‘text‘ (delimiter E‘‘ null E‘‘ escape E‘OFF‘)ENCODING ‘UTF8‘LOG ERRORS INTO masadw.err_ext_表名 SEGMENT REJECT LIMIT 10 PERCENT;
d.把外部表修改owner为etl_user:
ALTER EXTERNAL TABLE masadw.ext_表名 OWNER TO etl_user;
标签:
原文地址:http://www.cnblogs.com/tychyg/p/5000247.html