日期:2014-05-16  浏览次数:20394 次

[转]更改Oracle字符集:把字符集ZHS16GBK换成UTF8

SQL> select name,value$ from props$ where name like '%NLS%';

NAME?????????????????????????? VALUE$

------------------------------ ------------------------------

NLS_LANGUAGE?????????????????? AMERICAN

NLS_TERRITORY????????????????? AMERICA

NLS_CURRENCY?????????????????? $

NLS_ISO_CURRENCY?????????????? AMERICA

NLS_NUMERIC_CHARACTERS???????? .,

NLS_CHARACTERSET?????????????? ZHS16GBK

NLS_CALENDAR?????????????????? GREGORIAN

NLS_DATE_FORMAT??????????????? DD-MON-RR

NLS_DATE_LANGUAGE????????????? AMERICAN

NLS_SORT?????????????????????? BINARY

NLS_TIME_FORMAT??????????????? HH.MI.SSXFF AM

NAME?????????????????????????? VALUE$

------------------------------ ------------------------------

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????????????? 10.2.0.1.0

20 rows selected.

NLS_CHARACTERSET是数据库字符集,NLS_NCHAR_CHARACTERSET是国家字符集

ORACLE中有两大类字符型数据,VARCHAR2是按照数据库字符集来存储数据。

而NVARCHAR2是按照国家字符集存储数据的。同样,CHAR和NCHAR也一样,一是数据库字符符,一是国家字符集。