Oracle UNDO Management
Oracle UNDO Management
Objetivo Procedimiento Server files Oracle managed files ASM files Problemas
Objetivo
Queremos reducir el tamao del tablespace de UNDO pues hemos visto que estamos sin espacio fsico en el servidor y hemos notado que el tamao del UNDO supera lo esperado/deseado.
Procedimiento
El procedumiento a seguir es el mismo que para el tablespace temporal. Se trata de crear un nuevo tablespace de Undo de pequeo tamao que nos permita borrar el tablespace original cuyo tamao es excesivo. En general tendremos que los pasos son: CREATE UNDO TABLESPACE NEW_UNDO_TS; ALTER SYSTEM SET UNDO_TABLESPACE; DROP OLD_UNDO_TS;
Server files
CREATE UNDO TABLESPACE UNDOTBS1 DATAFILE '/export2/oracle/oradata/datawh/undotbs01.dbf' SIZE 512M AUTOEXTEND ON; ALTER SYSTEM SET UNDO_TABLESPACE=UNDOTBS1; DROP TABLESPACE UNDOTBS2 INCLUDING CONTENTS AND DATAFILES;
ASM files
CREATE UNDO TABLESPACE undotbs2 DATAFILE +DGRIDDES_DATA SIZE 2000M autoextend oN; ALTER SYSTEM SET UNDO_TABLESPACE=UNDOTBS2; DROP TABLESPACE UNDOTBS1 INCLUDING CONTENTS AND DATAFILES;
Problemas
Tablespace in use ORA-30013: el tablespace de deshacer 'RBS' esta en uso actualmente
Lo normal ser esperar a que las transacciones en curso que mantienen datos en el Undo que queremos borrar terminen. Podemos monitorizar el uso de undo con las siguientes vistas: view V$UNDOSTAT description Contains statistics for monitoring and tuning undo space. Use this view to help estimate the amount of undo space required for the current workload. Oracle also uses this information to help tune undo usage in the system. This view is available in both the automatic undo management and the manual undo management modes. For automatic undo management mode, information reflects behavior of the undo segments in the undo tablespace Contains undo segment information Shows the commit time for each extent in the undo tablespace.
select a.process, a.program, a.module, a.machine, b.USED_UREC, c.sql_text from v$sql c, v$session a, v$transaction b where b.addr = a.taddr and a.sql_address = c.address and a.sql_hash_value = c.hash_value order by b.USED_UREC;