# NLS_LANG 的构成为:NLS_LANG=<NLS_LANGUAGE>_<NLS_TERRITORY>.<clients characterset> # 从 nls_database_parameters 获取 <NLS_LANGUAGE> 和 <NLS_TERRITORY> 的值 # linux 设置 export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 # windows 设置 set NLS_LANG=American_America.AL32UTF8实验
[oracle@localhost ~]$ sqlplus ‘/as sysdba‘ SQL*Plus: Release 11.2.0.4.0 Production on Fri Oct 30 08:15:23 2015 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> drop table t3; Table dropped. SQL> SQL> create table t3 ( a char ( 4 char)); Table created. SQL> insert into t3 values(‘中国航天‘); insert into t3 values(‘中国航天‘) * ERROR at line 1: ORA-12899: value too large for column "SYS"."T3"."A" (actual: 12, maximum: 4) SQL> set lin 80 pages 200 SQL> col parameter for a35 SQL> col value for a35 SQL> select * from nls_database_parameters; PARAMETER VALUE ----------------------------------- ----------------------------------- NLS_LANGUAGE AMERICAN NLS_TERRITORY AMERICA NLS_CURRENCY $ NLS_ISO_CURRENCY AMERICA NLS_NUMERIC_CHARACTERS ., NLS_CHARACTERSET AL32UTF8 NLS_CALENDAR GREGORIAN NLS_DATE_FORMAT DD-MON-RR NLS_DATE_LANGUAGE AMERICAN NLS_SORT BINARY NLS_TIME_FORMAT HH.MI.SSXFF AM NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR NLS_DUAL_CURRENCY $ NLS_COMP BINARY NLS_LENGTH_SEMANTICS BYTE NLS_NCHAR_CONV_EXCP FALSE NLS_NCHAR_CHARACTERSET AL16UTF16 NLS_RDBMS_VERSION 11.2.0.4.0 20 rows selected. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options [oracle@localhost ~]$ [oracle@localhost ~]$ export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 [oracle@localhost ~]$ sqlplus ‘/as sysdba‘ SQL*Plus: Release 11.2.0.4.0 Production on Fri Oct 30 08:20:26 2015 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> insert into t3 values(‘中国航天‘); 1 row created. SQL> select * from t3; A ---------------- 中国航天 SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options [oracle@localhost ~]$ [oracle@localhost ~]$ echo $NLS_LANG AMERICAN_AMERICA.AL32UTF8 [oracle@localhost ~]$
原文:http://my.oschina.net/payun/blog/524216