miércoles, 9 de julio de 2014

AUMENTAR PARÁMETRO DE LA SGA | ORACLE PERFORMANCE

AUMENTAR PARÁMETRO DE LA SGA

Hoy vamos a enseñar a aumentar el parámetro SGA de la base de datos Oracle, esto surgido por un problema al momento de generar un export.

[localhost@oracle ~]$ expdp full=y dumpfile=fulldb.dmp logfile=fulldb.log directory=EXPORT system/pasword

Export: Release 10.2.0.1.0 - Production on Tuesday, 16 December, 2008 17:07:44

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
FLASHBACK automatically enabled to preserve database integrity.
Starting "SYSTEM"."SYS_EXPORT_FULL_02": full=y dumpfile=fulldb.dmp directory=d userid=system/********
Estimate in progress using BLOCKS method...
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
ORA-39125: Worker unexpected fatal error in KUPW$WORKER.GET_TABLE_DATA_OBJECTS while calling DBMS_METADATA.FETCH_XML_CLOB []
ORA-04031: unable to allocate 28 bytes of shared memory ("shared pool","SELECT /*+rule*/ SYS_XMLGEN(...","sql area","ub1[]: qkexrXformVal")

ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPW$WORKER", line 6235

----- PL/SQL Call Stack -----
object line object
handle number name
64E077B4 14916 package body SYS.KUPW$WORKER
64E077B4 6300 package body SYS.KUPW$WORKER
64E077B4 9120 package body SYS.KUPW$WORKER
64E077B4 1880 package body SYS.KUPW$WORKER
64E077B4 6861 package body SYS.KUPW$WORKER
64E077B4 1262 package body SYS.KUPW$WORKER
64CB4398 2 anonymous block

Job "SYSTEM"."SYS_EXPORT_FULL_02" stopped due to fatal error at 17:08:03


La causa del error

El error ORA-04031, Oracle hace un barrido del espacio de memoria de objetos que ya no están en uso , si aun así no existe suficiente espacio disponible para satisfacer la solicitud devuelve este error.

Solución

la solución es aumentar el parámetro SGA.

Nota: Para esto deben tomar en cuenta que su base debe estar in-disponible ya que se debe reiniciar.

SQL> show parameter sga_t

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
sga_target big integer 772M

SQL> show parameter sga_max

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
sga_max_size big integer 800M

En la configuracón la SGA_TARGET de pende de la SGA_MAX_SIZE asi que debemos cambiar ambas para que tenga el efecto esperado.


SQL> alter system set sga_max_size=900M scope=spfile;

System altered.

SQL> alter system set sga_target=950M scope=spfile;

System altered.

SQL> startup force
ORACLE instance started.

Total System Global Area 314572800 bytes
Fixed Size 1248768 bytes
Variable Size 96469504 bytes
Database Buffers 209715200 bytes
Redo Buffers 7139328 bytes
Database mounted.
Database opened.

SQL> show parameter sga_target

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
sga_target big integer 900M


Ahora Oracle ya tienen la memoria necesaria para ejecutar el export.