I believe many of my friends have encountered this problem. I searched for a large film on the Internet, but there are not many people replying to the post. Here I provide my solution, hoping to help you.
I. Fault Reproduction
First, connect to the Oracle database under the Linux shell
$ Sqlplus/nolog
SQL> conn/as sysdba
SQL> startup (the database starts automatically after the environment variables are set)
SQL> if there is a problem, it is almost displayed here, it is one by one ?????, If you use remote software to connect, there may be blocks.
Ii. Solution
Exit sqlplus and view the environment variable file in the Oracle Home Directory
Ls-la
Mine is. bash_profile
Vim. bash_profile
Add
NLS_LANG = AMERICAN_AMERICA.ZHS16GBK
Export NLS_LANG
Exit vim
Iii. $ ../. bash_profile (reload environment variables)
Try again to connect to the database. It should be okay. Here, we have a premise that the selected character set is AMERICAN_AMERICA.ZHS16GBK when installing oracle.
If it is another character set, use a similar method. Similarly, set compatible languages and fonts in/etc/sysconfig/i18n.
Select userenv ('language') from dual
The result is as follows:
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
Then rewrite the character set to the Chinese NLS_LANG = "SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
========================================
2011, 7, 11 the latest summary, the recent situation gave me a new view of the above conclusions, the installation of oracle Database experience less than 20 times, from 11gR 1 32-bit and 64-bit to 11gR2 64-bit. Different problems may occur when installed several times. The 64-bit version of R2 seems to have high requirements on the system, and the requirements for the shared zone of the memory resource pool seem to be small.
In short, I have come to a conclusion today.
None of the above is completely correct. You need to try it yourself before learning it. After the installation, select userenv ('language ') from dual; the result is simplified Chinese. It is true that I chose Simplified Chinese when installing it, so that I can understand it after an error is reported.
However, no matter how I change the language in shell, garbled characters are displayed. When I am so depressed, I will get the result of NLS_LANG = AMERICAN_AMERICA.ZHS16GBK.
I'm so convinced, but it only displays English.
English is also good. It is better than Garbled text.
I thought about the reason. Maybe the local language is not fully installed.
Continue ....
Let all kinds of errors happen!
This article is from the "yongpan peak" blog