select parameter, value from nls_database_parameters;
查询以下三个参数值:
NLS_LANGUAGE SIMPLIFIED CHINESE
NLS_TERRITORY CHINA
NLS_CHARACTERSET AL32UTF8
查询NLS_LANG的组成规则为NLS_LANGUAGE_NLS_TERRITORY.NLS_CHARACTERSET
export NLS_LANG='SIMPLIFIED CHINESE_CHINA.AL32UTF8'
重新登录sqlplus,显示正常,不乱码。
[oracle@localhost ~]$ export NLS_LANG='SIMPLIFIED CHINESE_CHINA.AL32UTF8'
[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on 星期一 11月 13 22:34:04 2017
Copyright (c) 1982, 2016, Oracle. All rights reserved.
连接到:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL>