ORA-04031: unable to allocate 4176 bytes of shared memory ("shared pool","unknown object","sga heap(1,0)","object queue ")
Autor: Sarah Luz | Publicado: 2013-04-12T05:34:00-07:00

O post de hoje é referente ao&nbsp; problema que tive ao realizar um expdp:

Ao executar o expdp:

export ORACLE_SID=desenv

[oracle@servidor dump]$ expdp system/senha
directory=dump dumpfile=teste.dmp logfile=teste.log schemas=teste
Foram retornardos os seguintes erros:


Export:
Release 10.2.0.4.0 - 64bit Production on Thursday, 11 April, 2013 17:26:49&nbsp;

Copyright
(c) 2003, 2007, Oracle.&nbsp; All rights
reserved.&nbsp;


Connected
to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit
Production


With the
Partitioning, OLAP, Data Mining and Real Application Testing options


ORA-39006:
internal error


ORA-39065:
unexpected master process exception in DISPATCH


ORA-00607:
Internal error occurred while making a change to a data block


ORA-00600: internal error code, arguments: [2024],
[4279153], [4279158], [8192], [6], [2], [1893406378], [380241410]

ORA-39097:
Data Pump job encountered unexpected error -607

2ª Tentativa:&nbsp;


Connected
to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit
Production


With the
Partitioning, OLAP, Data Mining and Real Application Testing options


Estimate in
progress using BLOCKS method...


Processing
object type SCHEMA_EXPORT/TABLE/TABLE_DATA


ORA-39125:
Worker unexpected fatal error in KUPW$WORKER.GET_TABLE_DATA_OBJECTS while
calling DBMS_METADATA.FETCH_XML_CLOB []


&nbsp;


&nbsp;ORA-06512:
at "SYS.DBMS_SYS_ERROR", line 95


ORA-06512:
at "SYS.KUPW$WORKER", line 6307


&nbsp;-----
PL/SQL Call Stack -----


&nbsp; object&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
line&nbsp; object


&nbsp; handle&nbsp;&nbsp;&nbsp;
number&nbsp; name


0x65eb04e8&nbsp;&nbsp;&nbsp;&nbsp; 15032&nbsp;
package body SYS.KUPW$WORKER


0x65eb04e8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6372&nbsp;
package body SYS.KUPW$WORKER


0x65eb04e8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9206&nbsp;
package body SYS.KUPW$WORKER


0x65eb04e8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1936&nbsp;
package body SYS.KUPW$WORKER


0x65eb04e8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6944&nbsp;
package body SYS.KUPW$WORKER


0x65eb04e8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1314&nbsp;
package body SYS.KUPW$WORKER


0x68a69688&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;
anonymous block

&nbsp;

O erro que mais me chamou atenção foi :
ORA-04031: unable to allocate 4176 bytes of shared memory ("shared pool","unknown object","sga heap(1,0)","object queue "):

O SGDB&nbsp;tenta alocar memória, porém não consegue impossiblitando de realizar qualquer procedimento, desde um exp ou expdp no servidor de banco de dados.

Após muita pesquisa, um expert dba&nbsp; chamado Rosivaldo Ramalho me ajudou a encontrar a solução:
Aumentar a memoria SGA do banco, o problema é que não tinhamos mais memoria disponivel, tive que dar shutdown immediate em instâncias que nao estavam sendo utlizadas, liberando memória, após a liberação foi necessário alterar o SGA_TARGET da instância que esta com problema de alocação de memória.



Antes de qualquer alteração é necessário logar com&nbsp; sys / as sysdba na instância&nbsp;&nbsp;com problema e consultar os seguintes parâmetros:







SQL&gt; show parameter pga

NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VALUE
---------------------------------SGA_TARGET--- ----------- ------------------------------
pga_aggregate_target&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; big integer 200M


SGA_TARGET
SQL&gt; show parameter SGA_TARGET

NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VALUE
------------------------------------ ----------- ------------------------------
sga_target&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; big integer 300M



Detalhe importante:

SGA_TARGET especifica o tamanho total de todos os componentes da PGA. Se SGA_TARGET for especificado, os pools de memória seguintes são automaticamente dimensionados:


Buffer cache (DB_CACHE_SIZE)&nbsp;


Shared pool (SHARED_POOL_SIZE)&nbsp; - Erro apresentado no log do expdp da instãncia desenb


Large pool (LARGE_POOL_SIZE)


Java pool (JAVA_POOL_SIZE)


Streams pool (STREAMS_POOL_SIZE)



&nbsp;Foi realizado o seguinte procedimento para aumentar a mémoria para 500M:

ALTER
SYSTEM SET sga_target =500M SCOPE=SPFILE



Obs:&nbsp;&nbsp;O valor scope=SPFILE necessita&nbsp;&nbsp;de shutdown do banco para a alteração ser aplicada.

export ORACLE_SID=desenv

sqlplus / as sysdba

shutdown immediate;

Depois o banco desenv&nbsp;foi iniciado:

export ORACLE_SID=desenv

sqlplus / as sysdba

startup;

&nbsp;Após aumento de memória o exp foi realizado com sucesso:

&nbsp;
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_10 is:


&nbsp;Job "SYSTEM"."SYS_EXPORT_SCHEMA_10" successfully completed at 08:27:14
&nbsp;

&nbsp;

FIM DO POST!

&nbsp;

DEDICO O POST ao Rosivaldo Ramalho: rosivaldo@gmail.com


&nbsp;

&nbsp;






&nbsp;