oracle ORA-12705: 无法访问 NLS 数据文件或无效环境
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7700330/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ORA-12705: Cannot access NLS data files or invalid environment
提问by Doug Flower
The other day I got this annoying oracle error: ORA-12705: Cannot access NLS data files or invalid environment specified. Funny thing I wasn't trying to access NLS data files
前几天我收到了这个烦人的 oracle 错误:ORA-12705:无法访问 NLS 数据文件或指定的环境无效。有趣的是我没有尝试访问 NLS 数据文件
回答by Shawn Bower
There are two possible causes:
有两种可能的原因:
An attempt was made to issue an ALTER SESSION statement with an invalid NLS parameter or value.
试图发出带有无效 NLS 参数或值的 ALTER SESSION 语句。
The NLS_LANG environment variable contains an invalid language, territory, or character set.
NLS_LANG 环境变量包含无效的语言、地区或字符集。
Fix:
使固定:
Unset the NLS_LANG environment variable
取消设置 NLS_LANG 环境变量
Windows - The NLS_LANG must be unset in the Windows registry (re-named is best). Look for the NLS_LANG subkey in the registry at \HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE, and rename it.
Windows - 必须在 Windows 注册表中取消设置 NLS_LANG(最好重命名)。在注册表中的 \HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE 中查找 NLS_LANG 子项,并将其重命名。
Linux/UNIX - Here you simply issue the Linux command "unset NLS_LANG"
Linux/UNIX - 在这里您只需发出 Linux 命令“unset NLS_LANG”
回答by Enrique Amador Samaniego
I have Oracle 10g XE and Windows 7. I resolved this as follows:
我有 Oracle 10g XE 和 Windows 7。我如下解决了这个问题:
Go to Control panel > Regional and language options > Format and set your language.
转到控制面板 > 区域和语言选项 > 格式并设置您的语言。
回答by ?????
Follow this procedure to set the NLS_LANG environment variable for Oracle databases. To set the NLS_LANG environment variable for Oracle databases Determine the NLS_LANG value. In the data warehouse database, run the command SELECT * FROM V$NLS_PARAMETERS
按照此过程为 Oracle 数据库设置 NLS_LANG 环境变量。为 Oracle 数据库设置 NLS_LANG 环境变量 确定 NLS_LANG 值。在数据仓库数据库中,运行命令 SELECT * FROM V$NLS_PARAMETERS
Make a note of the NLS_LANG value, which is in the format [NLS_LANGUAGE]_[NLS_TERRITORY].[NLS_CHARACTERSET]. For example: American_America.UTF8 For Windows: Navigate to Control Panel > System and click the Advanced tab. Click Environment Variables. In System variables section, click New. In the Variable Name field, enter NLS_LANG. In the Variable Value field, enter the NLS_LANG value that was returned in Step 1. The format for the NLS_LANG value should be [NLS_LANGUAGE]_[NLS_TERRITORY].[NLS_CHARACTERSET]. For example: American_America.UTF8. For UNIX, set the variable as shown below: setenv NLS_LANG
记下 NLS_LANG 值,其格式为 [NLS_LANGUAGE]_[NLS_TERRITORY].[NLS_CHARACTERSET]。例如: American_America.UTF8 对于 Windows:导航到控制面板 > 系统并单击高级选项卡。单击环境变量。在系统变量部分,单击新建。在变量名称字段中,输入 NLS_LANG。在变量值字段中,输入在步骤 1 中返回的 NLS_LANG 值。NLS_LANG 值的格式应为 [NLS_LANGUAGE]_[NLS_TERRITORY].[NLS_CHARACTERSET]。例如:American_America.UTF8。对于 UNIX,设置如下所示的变量: setenv NLS_LANG
For example: setenv NLS_LANG American_America.UTF8. If your data is 7-bit or 8-bit ASCII and the Informatica Server is running on UNIX, then set NLS_LANG _.WE8ISO8859P1 CAUTION: Make sure you set the NLS_LANG variable correctly, as stated in this procedure, or your data will not display correctly.
例如:setenv NLS_LANG American_America.UTF8。如果您的数据是 7 位或 8 位 ASCII 并且 Informatica Server 在 UNIX 上运行,则设置 NLS_LANG _.WE8ISO8859P1 注意:确保按照此过程中所述正确设置 NLS_LANG 变量,否则您的数据将不会显示正确。
Reboot the machine after creating the variable.
创建变量后重新启动机器。
回答by ?????
After addition of path in Environment variable of Oracle Instant clientthe Oracle SQLPLUSWgoes to Oracle Instant client and for that client it required to set NLS LANG AS American_America.UTF8
在Oracle Instant 客户端的环境变量中添加路径后,Oracle SQLPLUSW转到 Oracle Instant 客户端,并且对于该客户端,它需要设置NLS LANG AS American_America.UTF8
回答by Dario Alberto Castro Martinez
In my case, I was creating a database adapter in the oracle weblogic console, solve the problem by doing the following configuration. Windows -> control panel -> region: 1. Change the format to English (United States) date format M / d / yy and 2. Change my address to the United States. Perform this configuration because my machine was configured with the Spanish language, then restart the computer and I worked without problems.
就我而言,我在 oracle weblogic 控制台中创建了一个数据库适配器,通过执行以下配置来解决问题。Windows -> 控制面板 -> 区域: 1. 将格式更改为英语(美国)日期格式 M / d / yy 和 2. 将我的地址更改为美国。执行这个配置,因为我的机器是用西班牙语配置的,然后重新启动计算机,我就没有问题了。
回答by user1009668
You can also just set the NLS config in your oracle settings
您也可以在 oracle 设置中设置 NLS 配置
回答by Yithirash
In case if above solutions not helped, can try my solution. I just replaced my latest version of Ojdbc14.jar
to an older version Ojdbc5.jar
. It helped me to solve my issue.
如果上述解决方案没有帮助,可以尝试我的解决方案。我只是将我的最新版本替换Ojdbc14.jar
为旧版本Ojdbc5.jar
。它帮助我解决了我的问题。