centos oracle sqlplus,centos 下oracle sqlplus乱码问题解决

刚刚上班,师父叫在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

已经不会是乱码。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值