Globalization

Can I Change Current Character Set into AL32UTF8 without Converting Data

The direct answer is: If they are in subset-superset relationship, you can change the character set without change it. So maybe your next question is: Where do we find the relationship?

According to the official supeset-subset relationship table. Table A-11 Binary Subset-Superset Pairs. You can see that very limited pairs in this table and there’s only UTF-8 is a subset of AL32UTF8.

If you’re confused about or in doubt with the relationship, you can try it by explicitly altering the database. For example, I guess ZHT16MSWIN950 is a sibling of AL32UTF8, but I hope they are child-parent because I tend to avoid touching the data intuitively. I can do it like this:
SQL> startup restrict
...
SQL> column parameter format a25;
SQL> column value format a25;
SQL> select parameter, value from v$nls_parameters where parameter like '%CHARACTERSET%';

PARAMETER                 VALUE
------------------------- -------------------------
NLS_CHARACTERSET          ZHT16MSWIN950
NLS_NCHAR_CHARACTERSET    AL16UTF16

SQL> alter database character set AL32UTF8;
alter database character set AL32UTF8
*
ERROR at line 1:
ORA-12712: new character set must be a superset of old character set

Oh, this error indicates that they are siblings. Now, you should use a special option to change the character set of database.

Leave a Reply

Your email address will not be published. Required fields are marked *