表和索引的并行度问题
执行sql 语句报错为
ORA-12853: insufficient memory for PX buffers: current 256816K, max needed 16879104K
ORA-04031: unable to allocate 65560 bytes of shared memory ("large pool","unknown object","large pool","PX msg pool")
【解决方法】
1. 根据数据库警告日志找到trace文件,在trace文件中找到执行sql语句的sql_id
2.根据sql_di获取sql的执行计划,根据执行计划获得跟该sql相关的表及索引,然后将表和索引的并行度设置为1
可使用@?/rdbms/admin/awrsqrpt 或 select * from table(dbms_xplan.display_awr('对应sql_id',NULL,NULL, 'ADVANCED ALLSTATS LAST PEEKED_BINDS') )
3.将表和索引的并行度设置为1
例如:
alter table HCKY.T_GL_VOUCHER parallel 1;
alter index HCKY.PK_GL_VCH parallel 1;
select 'alter index '||index_name|| ' PARALLEL 1; ' from dba_indexes where table_name in ('T_GL_ACCTCUSSENTHISTORY',
'tablename1',
'tablename2',
'tablename3',) and owner='大写用户名'
union
select 'alter table '||table_name|| ' PARALLEL 1; ' from dba_tables where table_name in ('T_GL_ACCTCUSSENTHISTORY',
'tablename1',
'tablename2',
'tablename3') and owner='大写用户名' ;
alter table 用户名.表名 parallel 1;
alter table 用户名.索引名 parallel 1;