1

I have inherited an Oracle 11g database that has a number of tables with NVARCHAR2 columns.

Is the NVARCHAR2 data type necessary to store Unicode if the database already has the AL32UTF8 character set, and if not, can these columns be converted to VARCHAR2?

Thanks.

1 Answer 1

2

If the database character set is AL32UTF8, a VARCHAR2 column will store Unicode data. Most likely, the columns should be converted to VARCHAR2.

Assuming that the national character set is AL16UTF16, which is the default and the only sensible national character set when the database character set already supports Unicode, it is possible that the choice to use NVARCHAR2 was intentional because there is some benefit to the UTF-16 encoding. For example, if those columns are storing primarily Japanese or Chinese data, UTF-16 would generally use 2 bytes of storage per character rather than 3 bytes in UTF-8. There may be other reasons that one would prefer one Unicode encoding to another that might come into play here as well. Most of the time, though, people creating NVARCHAR2 columns in a database that supports Unicode are doing so unintentionally, not because they did a thorough analysis of the benefits of different Unicode encodings.

1
  • a very nice, timely, and comprehensive answer. Thanks.
    – Steven
    Jan 14, 2015 at 0:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.