Wednesday 8 February 2012

ORA-12705: Cannot access NLS data files or invalid environment specified

ORA-12705: Cannot access NLS data files or invalid environment specified:

Question: I an getting the error "Resolving ORA-12705: Cannot access NLS data files or invalid environment specified" when I change my NLS_LANG setting.

The developers need to experiment with different character sets but when they issue export NLS_LANG and try to start SQLPLUS after that they get the ORA-12705 error.

Answer: First, The ORA-12705 error is indeed controlled by NLS_LANG, and the ORA-12705 commonly happens when Oracle does an automatic "alter session" at login time and discovers an invalid NLS_LANG setting. The Oracle documentation notes are not very helpful:

ORA-12705: "invalid or unknown NLS parameter value specified"

Cause: 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.

Action: Check the syntax of the ALTER SESSION command and the NLS parameter, correct the syntax and retry the statement, or specify correct values in the NLS_LANG environment variable.

Oracle also says that the ORA-12705 can happen under these conditions and MOSC has resolutions for these ORA-12705 conditions:

1. ORA-12705 with incorrect NLS_LANG parameter
2. ORA-12705 with incorrectly specified ORA_NLSx
3. ORA-12705 from incorrect Oracle install or configuration
4. ORA-12705 when using Special Character sets
5. ORA-12705 when connecting with SQL*Net
6. ORA-12705 during migrations
7. ORA-12705 when connecting with SQL*Plus
8. ORA-12705 when connecting with language pre-compilers
9. ORA-12705 during Export/Import

For ORA-12705 errors caused by invalid NLS_LANG settings, you need to verify that it is "unset" at the system-level:


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"

No comments:

Post a Comment