19

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

Doug Flower
  • 226
  • 1
  • 2
  • 7

8 Answers8

20

There are two possible causes:

An attempt was made to issue an ALTER SESSION statement with an invalid NLS parameter or value.

The NLS_LANG environment variable contains an invalid language, territory, or character set.

Fix:

Unset the NLS_LANG environment variable

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.

Linux/UNIX - Here you simply issue the Linux command "unset NLS_LANG"

Shawn Bower
  • 1,147
  • 1
  • 11
  • 18
15

I have Oracle 10g XE and Windows 7. I resolved this as follows:

Go to Control panel > Regional and language options > Format and set your language.

3

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

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

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.

Reboot the machine after creating the variable.

3

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.

Mirko Raimo
  • 1,469
  • 1
  • 12
  • 19
2

After addition of path in Environment variable of Oracle Instant client the Oracle SQLPLUSW goes to Oracle Instant client and for that client it required to set NLS LANG AS American_America.UTF8

1

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.

Yithirash
  • 377
  • 3
  • 6
  • 18
1

You can also just set the NLS config in your oracle settings

Malik Daud Ahmad Khokhar
  • 13,470
  • 24
  • 79
  • 81
0

I was trying to configure my Data Source on WebLogic 12c that was pointing to an 11g Database and I kept getting this error. I found out that WL 12c is not compatible with oracle 11g databases. I know it is not related but I am sure someone else will find this useful.