oracle本地语言变量设置

select userenv('language') from dual

察看当前会话的语言环境变量设置:
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
修改当前会话的语言环境变量设置:
SQL> ALTER SESSION SET <nls_parameter> = <value>
察看语言设置信息:
SET PAGESIZE 100
SQL> col PARAMETER format a30
SQL> col VALUE format a30
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行。

将语言改为英语:
SQL> ALTER SESSION SET NLS_LANGUAGE=american;
将语言改为中文:
SQL> ALTER SESSION SET NLS_LANGUAGE='SIMPLIFIED CHINESE';
将地域改为英文:
SQL> ALTER SESSION SET NLS_TERRITORY=america;
将地域改为中文:
SQL> ALTER SESSION SET NLS_TERRITORY=CHINA;
将字符集改为英文:
SQL> ALTER SESSION SET NLS_CHARSET=WE8ISO8859P1;
ALTER SESSION SET NLS_CHARSET=WE8ISO8859P1
*
ERROR at line 1:
ORA-00922: missing or invalid option
将字符集改为中文:
SQL> ALTER SESSION SET NLS_CHARSET=ZHS16GBK;
上面两句会出错:
因为 Oracle 不允许改变会话期间的字符集,可以用下面的语句改变数据库的字符集,但你要有权限。
将字符集改为英文:
SQL> ALTER DATABASE CHARACTER SET WE8ISO8859P1;
将字符集改为中文:
SQL> ALTER DATABASE CHARACTER SET ZHS16GBK;

你可能感兴趣的:(oracle本地语言变量设置)