Home  >  Article  >  Operation and Maintenance  >  What to do if linux sqlplus is garbled

What to do if linux sqlplus is garbled

藏色散人
藏色散人Original
2020-05-30 10:53:133486browse

What to do if linux sqlplus is garbled

What should I do if linux sqlplus is garbled? SQLPlus Chinese garbled processing under Linux

1. First query the database character set

SQL> select userenv('language') from dual;
 
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.AL32UTF8
 
SQL> exit

It is known from the above that the database character set is AMERICAN_AMERICA.AL32UTF8

2. Configure the environment Variable

Set to automatically load after booting and restart and put it in

/home/oracle/.bash_profile

or /etc/profile

echo 'export NLS_LANG="AMERICAN_AMERICA.UTF8"'>>/etc/profile
source /etc/profile

3. Query again to recognize Chinese

Cause analysis:

sqlplus garbled characters are related to the NLS_LANG variable of the operating system. When the database character set is inconsistent with the NLS_LANG variable, garbled characters will be generated.

Recommended study: "linux tutorial"

The above is the detailed content of What to do if linux sqlplus is garbled. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn