ORA-01843: 无效的月份,执行sql语句更改为美国语言后仍然失败的解决办法

 ORA-01843: 无效的月份
失败的 sql 为:XXXXXXXXXXXXXXXX

执行sql语句更改为美国语言后仍然失败,

ALTER SESSION SET NLS_DATE_LANGUAGE='AMERICAN';

 结果是注册表的问题,优化后多余的语言被清理掉了,所以,要修复注册表

将下面的文件复制保存为注册表文件.reg双击导入注册表。

 windows server 2005 系统时区文件 Time Zones.reg的文件内容,适用于windows server 2008 r2

我是从2005中导出来的,然后导入2008 结果正常,希望对大家有用

注册信息存在系统的三个不同的地方,现整合为一个文件,省掉一些麻烦。

Windows Registry Editor Version 5.00



[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones]

"TzVersion"=dword:07d90100

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time]

"MUI_Display"="@tzres.dll,-160"

"MUI_Dlt"="@tzres.dll,-161"

"MUI_Std"="@tzres.dll,-162"

"Display"="(UTC-06:00)中部时间(美国和加拿大)"

"Dlt"="中部夏令时"

"Std"="中部标准时间"

"TZI"=hex:68,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\

  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00





[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Time Zones\Eastern Standard Time]

"MUI_Display"="@tzres.dll,-110"

"MUI_Dlt"="@tzres.dll,-111"

"MUI_Std"="@tzres.dll,-112"

"Display"="(UTC-05:00)东部时间(美国和加拿大)"

"Dlt"="东部夏令时"

"Std"="东部标准时间"

"TZI"=hex:2c,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\

  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00





[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time]

"MUI_Display"="@tzres.dll,-190"

"MUI_Dlt"="@tzres.dll,-191"

"MUI_Std"="@tzres.dll,-192"

"Display"="(UTC-07:00)山地时间(美国和加拿大)"

"Dlt"="山地夏令时"

"Std"="山地标准时间"

"TZI"=hex:a4,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\

  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00







[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific Standard Time]

"MUI_Display"="@tzres.dll,-210"

"MUI_Dlt"="@tzres.dll,-211"

"MUI_Std"="@tzres.dll,-212"

"Display"="(UTC-08:00)太平洋时间(美国和加拿大)"

"Dlt"="太平洋夏令时"

"Std"="太平洋标准时间"

"TZI"=hex:e0,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\

  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00







[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Time Zones\US Eastern Standard Time]

"MUI_Display"="@tzres.dll,-130"

"MUI_Dlt"="@tzres.dll,-131"

"MUI_Std"="@tzres.dll,-132"

"Display"="(UTC-05:00)印地安那州(东部)"

"Dlt"="美国东部夏令时"

"Std"="美国东部标准时间"

"TZI"=hex:2c,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\

  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00



[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Time Zones\US Mountain Standard Time]

"MUI_Display"="@tzres.dll,-200"

"MUI_Dlt"="@tzres.dll,-201"

"MUI_Std"="@tzres.dll,-202"

"Display"="(UTC-07:00)亚利桑那"

"Dlt"="美国山地夏令时"

"Std"="美国山地标准时间"

"TZI"=hex:a4,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\

  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00



[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Time Zones\UTC]

"MUI_Display"="@tzres.dll,-930"

"MUI_Dlt"="@tzres.dll,-931"

"MUI_Std"="@tzres.dll,-932"

"Display"="(UTC)协调世界时"

"Dlt"="协调世界时"

"Std"="协调世界时"

"TZI"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00





[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Time Zones\China Standard Time]

"MUI_Display"="@tzres.dll,-570"

"MUI_Dlt"="@tzres.dll,-571"

"MUI_Std"="@tzres.dll,-572"

"Display"="(UTC+08:00)北京,重庆,香港特别行政区,乌鲁木齐"

"Dlt"="中国夏令时"

"Std"="中国标准时间"

"TZI"=hex:20,fe,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\

  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00





[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Time Zones\China Standard Time]

"MUI_Display"="@tzres.dll,-570"

"MUI_Dlt"="@tzres.dll,-571"

"MUI_Std"="@tzres.dll,-572"

"Display"="(UTC+08:00)北京,重庆,香港特别行政区,乌鲁木齐"

"Dlt"="中国夏令时"

"Std"="中国标准时间"

"TZI"=hex:20,fe,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\

  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00





[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time]

"MUI_Display"="@tzres.dll,-160"

"MUI_Dlt"="@tzres.dll,-161"

"MUI_Std"="@tzres.dll,-162"

"Display"="(UTC-06:00)中部时间(美国和加拿大)"

"Dlt"="中部夏令时"

"Std"="中部标准时间"

"TZI"=hex:68,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\

  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00





[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Time Zones\Eastern Standard Time]

"MUI_Display"="@tzres.dll,-110"

"MUI_Dlt"="@tzres.dll,-111"

"MUI_Std"="@tzres.dll,-112"

"Display"="(UTC-05:00)东部时间(美国和加拿大)"

"Dlt"="东部夏令时"

"Std"="东部标准时间"

"TZI"=hex:2c,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\

  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00





[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time]

"MUI_Display"="@tzres.dll,-190"

"MUI_Dlt"="@tzres.dll,-191"

"MUI_Std"="@tzres.dll,-192"

"Display"="(UTC-07:00)山地时间(美国和加拿大)"

"Dlt"="山地夏令时"

"Std"="山地标准时间"

"TZI"=hex:a4,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\

  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00





[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific Standard Time]

"MUI_Display"="@tzres.dll,-210"

"MUI_Dlt"="@tzres.dll,-211"

"MUI_Std"="@tzres.dll,-212"

"Display"="(UTC-08:00)太平洋时间(美国和加拿大)"

"Dlt"="太平洋夏令时"

"Std"="太平洋标准时间"

"TZI"=hex:e0,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\

  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00





[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Time Zones\US Eastern Standard Time]

"MUI_Display"="@tzres.dll,-130"

"MUI_Dlt"="@tzres.dll,-131"

"MUI_Std"="@tzres.dll,-132"

"Display"="(UTC-05:00)印地安那州(东部)"

"Dlt"="美国东部夏令时"

"Std"="美国东部标准时间"

"TZI"=hex:2c,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\

  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00





[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Time Zones\US Mountain Standard Time]

"MUI_Display"="@tzres.dll,-200"

"MUI_Dlt"="@tzres.dll,-201"

"MUI_Std"="@tzres.dll,-202"

"Display"="(UTC-07:00)亚利桑那"

"Dlt"="美国山地夏令时"

"Std"="美国山地标准时间"

"TZI"=hex:a4,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\

  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00







[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\China Standard Time]

"MUI_Display"="@tzres.dll,-570"

"MUI_Dlt"="@tzres.dll,-571"

"MUI_Std"="@tzres.dll,-572"

"Display"="(UTC+08:00)北京,重庆,香港特别行政区,乌鲁木齐"

"Dlt"="中国夏令时"

"Std"="中国标准时间"

"TZI"=hex:20,fe,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\

  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00



[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time]

"MUI_Display"="@tzres.dll,-160"

"MUI_Dlt"="@tzres.dll,-161"

"MUI_Std"="@tzres.dll,-162"

"Display"="(UTC-06:00)中部时间(美国和加拿大)"

"Dlt"="中部夏令时"

"Std"="中部标准时间"

"TZI"=hex:68,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\

  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00





[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Eastern Standard Time]

"MUI_Display"="@tzres.dll,-110"

"MUI_Dlt"="@tzres.dll,-111"

"MUI_Std"="@tzres.dll,-112"

"Display"="(UTC-05:00)东部时间(美国和加拿大)"

"Dlt"="东部夏令时"

"Std"="东部标准时间"

"TZI"=hex:2c,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\

  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00





[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time]

"MUI_Display"="@tzres.dll,-190"

"MUI_Dlt"="@tzres.dll,-191"

"MUI_Std"="@tzres.dll,-192"

"Display"="(UTC-07:00)山地时间(美国和加拿大)"

"Dlt"="山地夏令时"

"Std"="山地标准时间"

"TZI"=hex:a4,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\

  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00





[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific Standard Time]

"MUI_Display"="@tzres.dll,-210"

"MUI_Dlt"="@tzres.dll,-211"

"MUI_Std"="@tzres.dll,-212"

"Display"="(UTC-08:00)太平洋时间(美国和加拿大)"

"Dlt"="太平洋夏令时"

"Std"="太平洋标准时间"

"TZI"=hex:e0,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\

  00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00







[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\US Eastern Standard Time]

"MUI_Display"="@tzres.dll,-130"

"MUI_Dlt"="@tzres.dll,-131"

"MUI_Std"="@tzres.dll,-132"

"Display"="(UTC-05:00)印地安那州(东部)"

"Dlt"="美国东部夏令时"

"Std"="美国东部标准时间"

"TZI"=hex:2c,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\

  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00





[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\US Mountain Standard Time]

"MUI_Display"="@tzres.dll,-200"

"MUI_Dlt"="@tzres.dll,-201"

"MUI_Std"="@tzres.dll,-202"

"Display"="(UTC-07:00)亚利桑那"

"Dlt"="美国山地夏令时"

"Std"="美国山地标准时间"

"TZI"=hex:a4,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\

  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

 

 

客户端系统里环境
 select sysdate from dual;
返回的结果是2014/11/24 20:28:13

进入注册表

Regedit.exe-- windows server 2008

 HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb11g_home1/NLS_LANGUAGE

如果是默认安装oracle的话,NLS_LANGUAGE
这一项的值应该是SIMPLIFIED CHINESE_CHINA.ZHS16GBK(属于中文环境)
双击修改其值为:AMERICAN_ AMERICA.ZHS16GBK (英文环境)
重启数据库

SQL> select sysdate from dual;

SYSDATE
--------------
24-11月-14

SQL>
 

 

你可能感兴趣的:(sql语句)