centos 下oracle sqlplus乱码问题解决
2012-08-06 17:18
537 查看
刚刚上班,师父叫在centos上装个oracle11gr2,搞了三四天,总算装好了,却遗留一个sqlplus乱码的问题。初步原定定位在选择字符集的时候,我当时选的是UTF8。
我把数据库删除了,重新建立,到那一步选择了系统默认,结果还是出现乱码。
我再来一次 直接选择了ZHS16GBK,结果还是一样。
其实一直搞错了,刚开始我选择了utf-8,由于Centos默认应该是GBK,所以显示的问号。
现在只需要一个方法
编辑并运行.bash_profile
从oracle官方文档了解到NLS_LANG变量的功能是
Specifies the language, territory, and character set of the client
environment. The client character set specified by NLS_LANG must match
the character set of the terminal or terminal emulator. If required, NLS_
LANG can be temporarily reset to another character set before starting a
non-interactive batch program to match the character set of files and
scripts processed by this program. The character set specified by NLS_LANG
can be different from the database character set, in which case the
character set is automatically converted.export
根据创建数据库时选择的字符集修改NLS_LANG变量
如果是UTF-8:exiport NLS_LANG=AMERICAN_AMERICA.UTF8
如果是 GBK: export NLS_LANG=american_america.ZHS16GBK)
注销后生效
这样再重新进入sqlplus
已经不会是乱码。
本文出自 “战斗吧,少年” 博客,请务必保留此出处http://yangzhenggong.blog.51cto.com/3485795/956202
我把数据库删除了,重新建立,到那一步选择了系统默认,结果还是出现乱码。
我再来一次 直接选择了ZHS16GBK,结果还是一样。
其实一直搞错了,刚开始我选择了utf-8,由于Centos默认应该是GBK,所以显示的问号。
现在只需要一个方法
编辑并运行.bash_profile
从oracle官方文档了解到NLS_LANG变量的功能是
Specifies the language, territory, and character set of the client
environment. The client character set specified by NLS_LANG must match
the character set of the terminal or terminal emulator. If required, NLS_
LANG can be temporarily reset to another character set before starting a
non-interactive batch program to match the character set of files and
scripts processed by this program. The character set specified by NLS_LANG
can be different from the database character set, in which case the
character set is automatically converted.export
根据创建数据库时选择的字符集修改NLS_LANG变量
如果是UTF-8:exiport NLS_LANG=AMERICAN_AMERICA.UTF8
如果是 GBK: export NLS_LANG=american_america.ZHS16GBK)
注销后生效
这样再重新进入sqlplus
已经不会是乱码。
本文出自 “战斗吧,少年” 博客,请务必保留此出处http://yangzhenggong.blog.51cto.com/3485795/956202
相关文章推荐
- rlwrap解决 Oracle sqlplus 在linux 上下文切换乱码问题
- Oracle技术之sqlplus汉字乱码问题的解决
- Oracle:sqlplus查询出的中文是乱码问题的解决
- Oracle Sql Plus乱码问题解决
- Oracle:sqlplus查询出的中文是乱码问题的解决
- Oracle:sqlplus查询出的中文是乱码问题的解决(转)
- Oracle:sqlplus查询出的中文是乱码问题的解决(转)
- Sqlplus连接Oracle出现中文乱码问题以及字符集的选择
- 解决oracle sqlplus 不能修改,退格问题
- sqlplus 乱码问题的解决
- 64位win 8系统装64位oracle遇到的sqlplus和sqldeveloper乱码解决
- 关于Oracle for Linux sqlplus 的乱码问题
- oracle终端sqlplus显示乱码问题
- oracle sqlplus中文显示乱码的问题
- 解决Linux下sqlplus中文乱码问题
- [oracle]解决centos 7下oracle的中文乱码问题
- sqlplus 汉字乱码问题的解决
- 解决oracle 10g sql *plus 用dbms_output.put_line()输出时的长度限制问题 ORA-20000: ORU-10028: line le
- centos下sqlplus环境中按方向键乱码解决方法
- Linux中Oracle的sqlplus下退格和Del键无效的问题解决