Oct 15, 2015

Caída de instancia en 11g ante un problema en escritura de archivo (_datafile_write_errors_crash_instance)


En oracle existe un parámetro oculto llamado _datafile_write_errors_crash_instance el cual permite la bajada automática de la base de datos ante algún problema en alguno de los datafiles o tempfiles. Esto Oracle lo creó para "garantizar" la consistencia de sus archivos ante alguna contingencia o problema con los file systems.  Desde oracle 11g en adelante este parámetro viene con el valor TRUE por defecto. En las versiones anteriores venia en FALSE.

Podría darse el caso de que no queremos que nuestra base de datos se venga abajo ante algún problema. Por ejemplo si tenemos un tempfile o datafile en autoextend ON  y si el disco o filesystem se encuentra al 100%, nuestra base de datos se encontrará con que no existe espacio suficiente para extender el archivo en cuestión y así de esa manera nuestra base de datos puede venirse abajo con en el ejemplo a continuación:

Thu Oct 15 16:26:01 2015
ORA-1652: unable to extend temp segment by 128 in tablespace                 TEMP
Thu Oct 15 16:28:37 2015
KCF: read, write or open error, block=0x198561 online=1
        file=1 '/u02/oradata/PROD/datafile/o1_mf_temp_9g2vcdbr_.tmp'
        error=27063 txt: 'IBM AIX RISC System/6000 Error: 28: No space left on device
Additional information: -1
Additional information: 131072'
Errors in file /u01/app/oracle/diag/rdbms/prod/PROD/trace/PROD_dbw1_12910650.trc:
Errors in file /u01/app/oracle/diag/rdbms/prod/PROD/trace/PROD_dbw1_12910650.trc:
ORA-63999: el archivo de datos ha sufrido un fallo del medio físico
ORA-01114: error de E/S al escribir el bloque en el archivo 201 (bloque número 1672545)
ORA-01110: archivo de datos 201: '/u02/oradata/PROD/datafile/o1_mf_temp_9g2vcdbr_.tmp'
ORA-27063: el número de bytes leídos/escritos es incorrecto
IBM AIX RISC System/6000 Error: 28: No space left on device
Additional information: -1
Additional information: 131072
DBW1 (ospid: 12910650): terminating the instance due to error 63999
Thu Oct 15 16:28:37 2015
System state dump requested by (instance=1, osid=12910650 (DBW1)), summary=[abnormal instance termination].
System State dumped to trace file /u01/app/oracle/diag/rdbms/prod/PROD/trace/PROD_diag_14811368.trc
Instance terminated by DBW1, pid = 12910650

Si alguien quiere evitar un comportamiento de este tipo se debe deshabitar ese parámetro oculto de la siguiente manera (además de eliminar el autoextend de los archivos):
ALTER SYSTEM SET "_datafile_write_errors_crash_instance" = FALSE SCOPE=BOTH;

El parámetro se puede modificar en caliente si es que se está trabajando con SPFILE.

Para más detalle se puede consultar la siguiente nota MOS:

Bug 7691270 - Crash the DB in case of write errors (rather than just offline files) (Doc ID 7691270.8)


Bug 7691270  Crash the DB in case of write errors (rather than just offline files)

 This note gives a brief overview of bug 7691270. 
 The content was last updated on: 15-JUL-2011
 Click here for details of each of the sections below.

Affects:

Product (Component)Oracle Server (Rdbms)
Range of versions believed to be affectedVersions BELOW 11.2.0.2
Versions confirmed as being affected
Platforms affectedGeneric (all / most platforms affected)

 The fix for this bug introduces a notable change in behaviour thus:
   Notable change of behaviour introduced in 11.2.0.2

Fixed:

This issue is fixed in

Symptoms:

Related To:

  • Recovery
  • _DATAFILE_WRITE_ERRORS_CRASH_INSTANCE

Description

This fix introduces a notable change in behaviour in that 
from 11.2.0.2 onwards an I/O write error to a datafile will
now crash the instance.

Before this fix I/O errors to datafiles not in the system tablespace 
offline the respective datafiles when the database is in archivelog mode. 
This behavior is not always desirable. Some customers would prefer 
that the instance crash due to a datafile write error.

This fix introduces a new hidden parameter to control if the instance
should crash on a write error or not:
  _datafile_write_errors_crash_instance 



With this fix:
 If _datafile_write_errors_crash_instance = TRUE (default) then
  any write to a datafile which fails due to an IO error causes 
  an instance crash. 

 If _datafile_write_errors_crash_instance = FALSE then the behaviour
  reverts to the previous behaviour (before this fix) such that
  a write error to a datafile offlines the file (provided the DB is
  in archivelog mode and the file is not in SYSTEM tablespace in 
  which case the instance is aborted)
 
Please note: The above is a summary description only. Actual symptoms can vary. Matching to any symptoms here does not confirm that you are encountering this problem. For questions about this bug please consult Oracle Support.

References

Bug:7691270 (This link will only work for PUBLISHED bugs)
Note:245840.1 Information on the sections in this article

Espero que sea de utilidad.
Saludos, Felipon.

No comments:

Post a Comment