Ora-12705:cannot Access NLS data files or invalid environment specified alternative solutions

Source: Internet
Author: User

Ant 1.8.2 is deployed on 241 machines, Oracle 11g is deployed on 242 machines, and today it is plugged into the Oracle 11g environment with an ant 1.8.2 via Oracle Drive the following error:

Builddb:build failed/home/build.xml:10:java.sql.sqlexception:ora-00604:error occurred at recursive SQL Level 1 ORA-1 2705:cannot Access NLS data files or invalid environment specified at oracle.jdbc.driver.DatabaseError.throwSqlExcept Ion (databaseerror.java:112) at Oracle.jdbc.driver.T4CTTIoer.processError (t4cttioer.java:331) at Oracle.jdbc.driver . T4cttioer.processerror (t4cttioer.java:28 at Oracle.jdbc.driver.T4CTTIoer.processError (t4cttioer.java:278) at Oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth (t4cttioauthenticate.java:785) at Oracle.jdbc.driver.T4CConnection.logon (t4cconnection.java:362) at Oracle.jdbc.driver.physicalconnection.<init > (physicalconnection.java:414) at oracle.jdbc.driver.t4cconnection.<init> (t4cconnection.java:165) at Oracle.jdbc.driver.T4CDriverExtension.getConnection (t4cdriverextension.java:35) at Oracle.jdbc.driver.OracleDriver.connect (oracledriver.java:801) at Org.apache.tools.ant.taskdefs.JDBCTask.getConnEction (jdbctask.java:370) at Org.apache.tools.ant.taskdefs.SQLExec.getConnection (sqlexec.java:942) at Org.apache.tools.ant.taskdefs.SQLExec.execute (sqlexec.java:614) at Org.apache.tools.ant.UnknownElement.execute ( unknownelement.java:291) at Java.lang.reflect.Method.invoke (LIBGCJ.SO.7RH) at Org.apache.tools.ant.dispatch.DispatchUtils.execute (dispatchutils.java:106) at Org.apache.tools.ant.Task.perform (task.java:348) at Org.apache.tools.ant.Target.execute (target.java:390) at Org.apache.tools.ant.Target.performTasks (target.java:411) at Org.apache.tools.ant.Project.executeSortedTargets ( project.java:1399) at Org.apache.tools.ant.Project.executeTarget (project.java:1368) at Org.apache.tools.ant.helper . Defaultexecutor.executetargets (defaultexecutor.java:41) at Org.apache.tools.ant.Project.executeTargets ( project.java:1251) at Org.apache.tools.ant.Main.runBuild (main.java:809) at Org.apache.tools.ant.Main.startAnt (Main . java:217) at Org.apache.tools.ant. Launch. Launcher.run (launcher.java:280) at Org.apache.tools.ant.launch.Launcher.main (launcher.java:109) Total Time:2 Seconds


According to the "ORA-12705" error number Baidu, found that a lot of people gave the following solution:

. Check that the following variables are set correctly (invalid environment specified)
Nls_lang, ora_nlsxx, or Oracle_home

2. Check $oracle_home/nls/ If the NLB file (NLS data files) in the data directory is corrupted, you can back up the files, and then copy the files in the same environment by 1. The
 
reason is that the environment variables have not been changed in the past.
Find $oracle_home directory with the astonishing discovery, let me be both pleasantly surprised and excited, surprise is finally found the NLS directory is lost, exciting is that they have a machine also installed with oracle11g.   It seems that the operating system is not near, let alone copy a copy.


Based on the above solution, check the ORACLE server (242) machine "Nls_lang, ora_nlsxx, or oracle_home" parameters, found that the first two parameters are not set, and then set the two parameters, after setting, The problem remains (still unresolved after restarting the machine).

So I found a third machine (243 machines), executed the same ant script on the 243 machine, and discovered that it could be executed correctly. Initial suspicion is 241 machines and 243 machine environment variables caused by the ENV command, comparing the environment variables of two machines, found that 243 machine set java_home, and 241 machine did not set java_home, and then quickly set Java_home value (Java _home Settings Reference: http://blog.csdn.net/wgw335363240/article/details/22079311). After that, break the previous connection, create a new connection, execute Ant command, and insert the data successfully.

Summary: here goes a detour, mainly is ORA-12705 error to give people too many error messages, during the attempt to read the JDBC driver, did not find any special problems. When critical information does not solve the problem, the stupid method (comparison method) is often very effective.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.