martes, 23 de agosto de 2011

Error ORA-01843: Not a Valid Month

Al tratar de realizar un import de un esquema

c:\>  imp system/prueba@prueba  file=prueba.dmp  log=prueba.log fromuser=scott touser=tiger
Recibimos el error
IMP-00017: following statement failed with ORACLE error 1843:
" ALTER TABLE "TABLA1" MODIFY ("FECHA" DEFAULT '01-01-2009' )"

IMP-00003: ORACLE error 1843 encountered
ORA-01843: not a valid month

Este error ocurre generalmente por que tenemos configurado el NLS_DATE_FORMAT diferente a como esta la tabla.

Para solucionarlo simplemente configuramos las variables (para sistemas unix)
export NLS_DATE_FORMAT=DD-MM-RRRR
export NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252

Si estamos en un sistema operativo windows debemos modificar estas entradas en el regedit :)