How can I tell if my Oracle system is set to support Unicode or multibyte characters?

一世执手 提交于 2019-12-29 07:30:51

问题


I understand that Oracle supports multiple character sets, but how can determine if the current 11g system where I work has that functionality enabled?


回答1:


SELECT *
  FROM v$nls_parameters
 WHERE parameter LIKE '%CHARACTERSET';

will show you the database and national character set. The database character set controls the encoding of data in CHAR and VARCHAR2 columns. If the database supports Unicode in those columns, the database character set should be AL32UTF8 (or UTF8 in some rare cases). The national character set controls the encoding of data in NCHAR and NVARCHAR2 columns. If the database character set does not support Unicode, you may be able to store Unicode data in columns with these data types but that generally adds complexity to the system-- applications may have to change to support the national character set.




回答2:


Unicode is a character encoding system that defines every character in most of the spoken languages in the world, Support for Unicode in Oracle Database:

Character Set   Supported in RDBMS Release  Unicode Encoding
AL24UTFFSS      7.2 - 8i                    UTF-8
UTF8            8.0 - 11g                   UTF-8
UTFE            8.0 - 11g                   UTF-EBCDIC
AL32UTF8        9i - 11g                    UTF-8
AL16UTF16       9i - 11g                    UTF-16

To Make sure your database is Unicode, please check the value of "NLS_CHARACTERSET" Parameter and it should be AL32UTF8 or AL16UTF16 from above list.

SQL>
SQL> SELECT * FROM v$nls_parameters WHERE parameter='NLS_CHARACTERSET';

PARAMETER                   VALUE               CON_ID
--------------------------- ------------------- ----------
NLS_CHARACTERSET            AL32UTF8            0

To Change the value of Parameter, Please Take the Fullback up because ALTER DATABASE statement cannot be rolled back and the Use following statements:

SHUTDOWN IMMEDIATE
STARTUP MOUNT;
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
ALTER SYSTEM SET AQ_TM_PROCESSES=0;
ALTER DATABASE OPEN;
ALTER DATABASE CHARACTER SET AL32UTF8;
SHUTDOWN IMMEDIATE;
STARTUP;


来源:https://stackoverflow.com/questions/9703421/how-can-i-tell-if-my-oracle-system-is-set-to-support-unicode-or-multibyte-charac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!