1 2 Previous Next 15 Replies Latest reply: Nov 18, 2009 4:15 AM by 550205 RSS

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

    512866
      Need some help to resolve this error message....

      ORA-00604: error occurred at recursive SQL level 1
      ORA-12705: Cannot access NLS data files or invalid environment specified


      How can I resolve this error?

      I am attempting a connection between Oracle 10g XE and SQL-Developer.

      Details are as follows:

      SQL-Developer
      Version 1.0.0.15.57
      Build Main 15.57 and

      10g XE Database
      Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
      PL/SQL Release 10.2.0.1.0 - Production
      CORE 10.2.0.1.0 Production
      TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
      NLSRTL Version 10.2.0.1.0 - Production

      OS: Windows XP SP2
        • 1. Re: ORA-12705: Cannot access NLS data files or invalid environment specified
          530897
          12705, 00000, "Cannot access NLS data files or invalid environment specified"
          // *Cause: Either an attempt was made to issue an ALTER SESSION command
          // with an invalid NLS parameter or value; or the environment
          // variable(s) NLS_LANG, ORA_NLSxx, or ORACLE_HOME was incorrectly
          // specified, therefore the NLS data files cannot be located.
          // *Action: Check the syntax of the ALTER SESSION command and the NLS
          // parameter, correct the syntax and retry the statement, or
          // specify the correct directory path/values in the environment
          // variables.

          Where just attempting to connect, or were you running SQL?
          • 2. Re: ORA-12705: Cannot access NLS data files or invalid environment specifie
            512866
            Just attempting to make a connection....

            Not running any SQL commands on the db.
            • 3. Re: ORA-12705: Cannot access NLS data files or invalid environment specified
              536805
              NLS Lang version mismatch at the time of installation Oracle 10g XE and SQL-Developer
              • 4. Re: ORA-12705: Cannot access NLS data files or invalid environment specifie
                512866
                NLS Lang version mismatch at the time of installation
                Oracle 10g XE and SQL-Developer
                .......what?

                Please explain what you mean, since both have been installed concurrently, and you don't run an exe for the SQL-Developer installation just an zip extraction into a folder.

                Thanks
                • 5. Re: ORA-12705: Cannot access NLS data files or invalid environment specifie
                  Paul M.
                  Are you able to connect from Sql*Plus ?
                  • 6. Re: ORA-12705: Cannot access NLS data files or invalid environment specifie
                    536805
                    check language installed on 10g
                    for checking enter following sql

                    select userenv('LANGUAGE') from dual;
                    • 7. Re: ORA-12705: Cannot access NLS data files or invalid environment specifie
                      512866
                      Thanks all.

                      Got it to work by uninstalling XE, deleting all reference to ORACLE in windows registry and doing a complete re-installation of XE.
                      • 8. Re: ORA-12705: Cannot access NLS data files or invalid environment specifie
                        568267
                        The problem occurs when you had a previous install of Oracle.
                        To solve the issue, clean up windows regisrty entries for Oracle.
                        • 9. Re: ORA-12705: Cannot access NLS data files or invalid environment specified
                          637024
                          you can solve this problem changing your regional configuration under windows as same as your oracle installation, probably (English) United States.
                          • 10. Re: ORA-12705: Cannot access NLS data files or invalid environment specifie
                            642158
                            i also got this kind of problem..
                            i want 2 uninstall Oracle in my pc,
                            but i dont know what to delete or how to clean the Windows registry entries for Oracle...
                            • 11. Re: ORA-12705: Cannot access NLS data files or invalid environment specifie
                              684610
                              I have the same issue but I am using a different environment, I am using Ubuntu. What I would like to do is to connect to Oracle database when compiling a maven application.

                              My question is how do I set the NLS environment in Ubuntu?
                              • 12. Re: ORA-12705: Cannot access NLS data files or invalid environment specifie
                                712267
                                HI All,

                                I am getting the similar error. What i am trying to do is, connect to Oracle 9i database using the OCI driver.

                                Following is my java code which is throwing this exception.

                                import java.sql.CallableStatement;
                                import java.sql.Connection;
                                import java.sql.DriverManager;

                                import java.sql.CallableStatement;
                                import java.sql.Connection;
                                import java.sql.DriverManager;

                                /**
                                *
                                */

                                /**
                                * @author administrator
                                *
                                */
                                public class OCITest {

                                     /**
                                     * @param args
                                     */
                                     public static void main(String[] args) {
                                          
                                          Connection con = null;
                                          CallableStatement cstmt = null;
                                     
                                String url = "jdbc:oracle:oci8:@GPSD1.IN.IBM.COM";
                                          String userName = "swbapps";     
                                          String password = "swab";

                                try
                                {
                                     System.out.println("Registering Driver ...");
                                     DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());

                                     System.out.println("Creating Connection ...");
                                     con = DriverManager.getConnection(url, userName, password);
                                     
                                     System.out.println("Success.");

                                } catch(Exception ex) {
                                ex.printStackTrace(System.err);
                                } finally {
                                if(cstmt != null) try{cstmt.close();}catch(Exception _ex){}
                                if(con != null) try{con.close();}catch(Exception _ex){}
                                }
                                }

                                }

                                The exception stack trace is as belows:

                                java.sql.SQLException: ORA-12705: Cannot access NLS data files or invalid environment specified

                                     at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
                                     at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
                                     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
                                     at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:686)
                                     at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:338)
                                     at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:490)
                                     at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:133)
                                     at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53)
                                     at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:465)
                                     at java.sql.DriverManager.getConnection(Unknown Source)
                                     at java.sql.DriverManager.getConnection(Unknown Source)
                                     at OCITest.main(OCITest.java:33)

                                I am using WAS 7.0 and in my lib folder I have ojdbc6.jar. I have also set native library location to my oracle installation path where all the dll files are present.

                                Can anyone please help me out in this? I am not sure where the SID GPSD1.IN.IBM.COM should be present.
                                • 13. Re: ORA-12705: Cannot access NLS data files or invalid environment specified
                                  718007
                                  Hello

                                  Months ago, I had the same problem when I tried to connect my Java Application with an Oracle database (I live in Ecuador, and seems my country isn't recognized :(), but I could resolve it without changing the database settings or the cliente pc settings. Here is the code (Attention with the line Locale.setDefault(new Locale(”es”,”ES”)); <-- If you are working with English, you can change for Locale.setDefault(new Locale(”us”,”EN”));).

                                  you must import java.util.Locale

                                  public conection()
                                  {
                                  this.driver=”oracle.jdbc.driver.OracleDriver”;
                                  this.url=”jdbc:oracle:thin:@+SERVERIP+:+ServerSID+“;
                                  this.user=”+USSER+“;
                                  this.password=”+PASS+“;

                                  try
                                  {
                                  Class.forName(driver).newInstance();

                                  Properties connAttr = new Properties();

                                  Properties props = new Properties();

                                  connAttr.put(”USER”,this.user);
                                  connAttr.put(”PASSWORD”,this.password);
                                  connAttr.put(”charSet”, “UTF-8″);

                                  Locale.setDefault(new Locale(”es”,”ES”));_

                                  DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
                                  conexion=DriverManager.getConnection(url,this.user,this.password);
                                  }
                                  catch (Exception exc)
                                  {
                                  System.out.println(”We have encountered an error”+” : “+exc);
                                  exc.printStackTrace();
                                  }
                                  }

                                  I hope that this code can help you
                                  • 14. Re: ORA-12705: Cannot access NLS data files or invalid environment specified
                                    721004
                                    I had the same problem on windows xp, and I just solved it:

                                    -check your oracle xe database settings by executing this in sqlplus: select userenv('LANGUAGE') from dual; (one of the above users offered this query, I checked and found my settings were ENGLISH_AMERICA.WE8MSWIN1252)

                                    -change your regional settings in control panel according to your database (I changed it to English (United States))

                                    -change NLS parameters in sql developer according to your database and regional settings (in sql developer tools/preferences/database/NLS Parameters, I selected english language, american teritory and pressed default values for the rest of the fields)

                                    -don't forget to restart your computer for this to take effect
                                    1 2 Previous Next