查看当前会话的语言环境:
SQL> select userenv(‘language’) from dual;
USERENV(‘LANGUAGE’)
—————————————————-
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
查看语言设置情况:
SQL> SET PAGESIZE 80
SQL> col PARAMETER format a35
SQL> col VALUE format a35
SQL> select * from v$NLS_PARAMETERS;
PARAMETER VALUE
———————————– ———————————–
NLS_LANGUAGE SIMPLIFIED CHINESE
NLS_TERRITORY CHINA
NLS_CURRENCY RMB
NLS_ISO_CURRENCY CHINA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE SIMPLIFIED CHINESE
NLS_CHARACTERSET ZHS16GBK
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 TZH:TZM
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZH:TZM
NLS_DUAL_CURRENCY RMB
NLS_NCHAR_CHARACTERSET US7ASCII
NLS_COMP BINARY
已选择17行。
SQL>
修改当前会话的语言环境变量参数:
ALTER SESSION SET
将语言改为英语:
SQL> ALTER SESSION SET NLS_LANGUAGE=american;
Session altered.
将语言改回中文:
SQL> ALTER SESSION SET NLS_LANGUAGE=’SIMPLIFIED CHINESE’;
会话已更改。
将地域改为英文:
SQL> ALTER SESSION SET NLS_TERRITORY=america;
会话已更改。
将地域改为中文:
SQL> ALTER SESSION SET NLS_TERRITORY=CHINA;
会话已更改
USERENV(‘LANGUAGE’)
—————————————————-
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
SQL> set pagesize 80
SQL> col parameter format a35;
SQL> col value format a35;
SQL> select * from V$NLS_PARAMETERS;
PARAMETER VALUE
———————————– ———————————–
NLS_LANGUAGE SIMPLIFIED CHINESE
NLS_TERRITORY CHINA
NLS_CURRENCY ¥
NLS_ISO_CURRENCY CHINA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE SIMPLIFIED CHINESE
NLS_CHARACTERSET ZHS16GBK
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_NCHAR_CHARACTERSET AL16UTF16
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
19 rows selected.