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>

时间: 2024-12-06 07:57:09

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

让你提前认识软件开发(20):如何在C语言里面执行SQL语句?

[文章摘要] 在通信类软件中,程序经常需要与数据库打交道.为了实现诸如从数据库中获取数据.更新数据库表某字段.插入或删除某条数据等功能,就需要在C语言程序中构造一些SQL语句,并用函数来执行这些SQL语句. 本文介绍如何在C语言程序中构造并执行SQL语句,为相关软件开发工作的开展提供了参考. [关键词] SQL语句  C语言  程序  流程  开发 一.为什么要在C语言程序中执行SQL语句? 在C语言程序中执行SQL语句的原因有以下几个: (1) 程序需要获取数据库中某数据表的字段值,并对这些字

在phpmyadmin中执行sql语句出现的错误:Unknown storage engine 'InnoDB'

在phpmyadmin中执行sql语句出现的错误:Unknown storage engine 'InnoDB' 解决方法:解决方法:             1.关闭MySQL数据库       2.修改my.ini文件,把skip-innodb这行注释掉       3.打开MySQL数据库 原因:没有开启MySQL InnoDB存储引擎. 在phpmyadmin中执行sql语句出现的错误:Unknown storage engine 'InnoDB'

JDBC系列:(3)使用PreparedStatement执行sql语句

执行sql语句的接口 接口 作用 Statement接口 用于执行静态的sql语句 PreparedStatement接口 用于执行预编译sql语句 CallableStatement接口 用于执行存储过程的sql语句(call xxx) PreparedStatement Vs Statement 序号 不同 描述 1 语法不同 PreparedStatement可以使用预编译的sql,而Statment只能使用静态的sql 2 效率不同 PreparedStatement可以使用sql缓存区

循环执行sql语句

DECLARE--声明变量SQL_ALLTABLES LONG; SQL_INSERT LONG; TYPE THE_CURSOR_TYPE IS REF CURSOR; --定义引用游标的数据类型CURSOR_D THE_CURSOR_TYPE; --定义游标 DATAUP VARCHAR2(200);BEGIN--井筒文档SQL_ALLTABLES := 'SELECT DISTINCT (TABLE_NAME) FROM USER_TAB_COLUMNS WHERE COLUMN_NAME

EF中执行sql语句

EF原理 EF 会自动把 Where().OrderBy().Select()等这些编译成"表达式树(Expression Tree)",然后会把表达式树翻译成 SQL 语句去执行.(编译原理,AST)因此不是"把数据都取到内存中,然后使用集合的方法进行数据过滤",因此性能不会低.但是如果这个操作不能被翻译成 SQL 语句,则或者报错,或者被放到内存中操作,性能就会非常低 跟踪EF的查询Sql语句: DbContext 有一个 Database 属性,其中的 Log

EntityFramework执行SQL语句

在EF中执行Sql语句. using (var context = new EFRecipesEntities()) { string sql = @"insert into Chapter3.Payment(Amount, Vendor) values (@Amount, @Vendor)"; var args = new DbParameter[] { new SqlParameter { ParameterName = "Amount", Value = 99

linux程序设计——执行SQL语句(第八章)

8.3    使用C语言访问MySQL数据 8.3.3 执行SQL语句 执行SQL语句的主要API函数被恰当的命名为: int mysql_query(MYSQL *connection, const char *query); 这个例程接受连接结构指针和文本字符串形式的有效SQL语句,如果成功,它返回0. 1.不返回数据的SQL语句 为简单起见,先看一些不返回任何数据的SQL语句:UPDATE,DELETE和INSERT. 下面的函数用于检查受查询影响的行数: my_ulonglong mys

怎样在dos里进入mysql,执行sql语句

1.进入mysql bin目录下,执行mysql.exe 2.用mysql -uroot -p登陆mysql之后就可以使用 怎样在dos里进入mysql,执行sql语句,布布扣,bubuko.com

.net core下直接执行SQL语句并生成DataTable

.net core可以执行SQL语句,但是只能生成强类型的返回结果.例如var blogs = context.Blogs.FromSql("SELECT * FROM dbo.Blogs").ToList().而不允许返回DataSet.DataTable等弱类型.可能由于这个原因没有实现在.net core中DataTable,然而DataTable还是可能会用到的.我们这里就有一个数据仓库的需求,允许用户自行编写类似SQL语句,然后执行,以表格展示.因为语句是千变万化的,因此我也