0

I recently installed a new Oracle database on Ubuntu using this tutorial.

I got an error

oracle@ubuntu:/home/bruno$ echo $NLS_LANG
/u01/app/oracle/product/11.2.0/xe/bin/nls_lang.sh
oracle@ubuntu:/home/bruno$ /u01/app/oracle/product/11.2.0/xe/bin/nls_lang.sh
AMERICAN_AMERICA.AL32UTF8
oracle@ubuntu:/home/bruno$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Thu Mar 17 11:00:45 2016
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
ERROR:
ORA-12705: Cannot access NLS data files or invalid environment specified
Enter user-name: 

After searching, I found a possible solution:

oracle@ubuntu:/home/bruno$ export NLS_LANG=AMERICAN_AMERICA.UTF8
oracle@ubuntu:/home/bruno$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Thu Mar 17 11:03:15 2016
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL>  

What is the most elegant way to correct this error?


Answer

export NLS_LANG = $($ORACLE_HOME/bin/nls_lang.sh)

2
  • but did you run . oraenv before doing that?
    – Sebas
    Mar 17, 2016 at 15:52
  • No, I did source /etc/bash.bashrc Mar 17, 2016 at 16:10

1 Answer 1

1

In the original tutorial:

export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`

Notice the backticks. The value of NLS_LANG variable should be the output of the above command, not the file name with absolute path. Just set the value of NLS_LANG, as you already did:

export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

1
  • Thank you, with your answer got the following response export NLS_LANG=$($ORACLE_HOME/bin/nls_lang.sh) Mar 17, 2016 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.