ora - 04031 [message #545152] |
Mon, 27 February 2012 10:17 |
|
savugar
Messages: 33 Registered: February 2012
|
Member |
|
|
I am executing the attached procedure to drop the empty subpartitions from 10 partitioned tables.each partitioned table has more than 15000 subpartitions
While dropping the sub partitions, I got the below error.
ORA-04031: unable to allocate 4128 bytes of shared memory
(shared pool","NK_ERPRFX_CHARGETYPEKEY_XOLAP","mvobj part des","Allocate kctph[]/ckyph[]/ckyprt[] array")
EDX_RPT_PYMNT_REFUND_FACT_X"
I think I am getting this error because of high number of parsing because it needs to fetch the count of each partitions.Since each subpartition name differs, every time the select count(1) will be getting parsed. I think this is the reason for the error. Pls correct me if I am wrong.
pls tell me the way to drop the subpartitions without getting this error except increasing the shared pool size.
-- Loop For all subpartitions for each part_table
FOR j IN lc_subpart_arr.FIRST .. lc_subpart_arr.LAST
LOOP
v_count := 999;
v_sql1 :=
'SELECT COUNT(1) FROM '
|| v_part_tab
|| ' SUBPARTITION ('
|| lc_subpart_arr (j)
|| ')';
EXECUTE IMMEDIATE (v_sql1)
INTO v_count;
-- DBMS_OUTPUT.put_line ('Vcount- ' || v_count);
IF v_count = 0
THEN
v_sql :=
'ALTER TABLE '
|| v_part_tab
|| ' DROP SUBPARTITION '
|| lc_subpart_arr (j);
BEGIN
EXECUTE IMMEDIATE (v_sql);
--DBMS_OUTPUT.put_line (v_sql);
v_subpart_cnt := v_subpart_cnt +1;
SQL> select * from GV$SGAINFO order by inst_id;
INST_ID NAME BYTES RES
---------- -------------------------------- ---------- ---
1 Free SGA Memory Available 0
1 Startup overhead in Shared Pool 721420288 No
1 Maximum SGA Size 2.2263E+10 No
1 Granule Size 16777216 No
1 Streams Pool Size 16777216 Yes
1 Fixed SGA Size 2123872 No
1 Large Pool Size 268435456 Yes
1 Shared Pool Size 7868514304 Yes
1 Buffer Cache Size 1.3959E+10 Yes
1 Redo Buffers 14651392 No
1 Java Pool Size 134217728 Yes
2 Startup overhead in Shared Pool 721420288 No
2 Free SGA Memory Available 0
2 Maximum SGA Size 2.2263E+10 No
2 Granule Size 16777216 No
2 Streams Pool Size 16777216 Yes
2 Java Pool Size 134217728 Yes
2 Large Pool Size 268435456 Yes
2 Shared Pool Size 7868514304 Yes
2 Buffer Cache Size 1.3959E+10 Yes
2 Redo Buffers 14651392 No
2 Fixed SGA Size 2123872 No
3 Fixed SGA Size 2123872 No
3 Redo Buffers 14651392 No
3 Buffer Cache Size 1.3959E+10 Yes
3 Shared Pool Size 7868514304 Yes
3 Large Pool Size 268435456 Yes
3 Free SGA Memory Available 0
3 Streams Pool Size 16777216 Yes
3 Granule Size 16777216 No
3 Maximum SGA Size 2.2263E+10 No
3 Startup overhead in Shared Pool 721420288 No
3 Java Pool Size 134217728 Yes
SQL> show parameter sga
NAME TYPE VALUE
------------------------------------ ----------- ---------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 21232M
sga_target big integer 0
[Updated on: Mon, 27 February 2012 11:53] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
Re: ora - 04031 [message #550027 is a reply to message #545152] |
Thu, 05 April 2012 05:59 |
|
LNossov
Messages: 318 Registered: July 2011 Location: Germany
|
Senior Member |
|
|
It looks like the bug 9578670. Try the workaround "_kghdsidx_count"=1 (i.e. with only one subpool of shared pool).
|
|
|