Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Research on modifying character set to AL32UTF8 by Oracle 12C

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

There is a question: can the PDB character set be changed from ZHS16GBK to AL32UTF8?

Answer: because CDB is ZHS16GBK, PDB cannot be modified.

Make a study on this problem and write it down.

1. Method of migrating and converting character sets:

12C: DMU is the only tool

10g/11g: csscan/ csalter / partial exp/imp

8i/9i: Alter Database Character Set () / partial exp/imp

2. AL32UTF8 is a variable-width character set, and the code represented as 1 character can be 1-byte-long or 4-byte long.

This is very different from the fact that 1 character in the WE8ISO8859P1 or WE8MSWIN1252 character set is always 1 byte.

3. The use of AL32UTF8 databases will grow, and the largest expansion will occur on the CLOB type (or XMLtype-this type uses CLOB in the background)

If the source database is an 8 bit character set (WE8ISO8859P1,WE8MSWIN1252, etc.), the converted Clob column will double in size on disk.

4. CDB cannot convert character sets and can only recreate CDB. DMU is the only tool for PDB to convert character sets

5. As of September 8, 2019.8, the latest version of the Magi DMU is 19.1, and the graphical interface of the use process is stuck. The process used by DMU to convert data is:

Put the database in restricted mode.

Disable various job queue processes.

Delete or disable the selected index.

Disables selected triggers and constraints.

Converts the data in the user table and the selected data dictionary table to Unicode.

Convert columns in the CLOB data dictionary.

Issue an ALTER DATABASE CHARACTER SET statement.

Enable triggers and constraints; and recreate indexes and constraints.

Restore database instance parameters.

6. Use the 9i traditional method alter database character set INTERNAL_USE AL32UTF8; to modify the CDB test successfully, but oracle officially does not recommend it. This method does not perform two steps: converting the data in the user table and the selected data dictionary table to Unicode and converting the columns in the CLOB data dictionary. These two critical steps can only be implemented through DMU.

Test: using this method to switch the CDB character set from ZHS16GBK to AL32UTF8 is successful, and the PDB$SEED also changes automatically; but according to official statement, the switch is incomplete and is not approved.

7. NLS_NCHAR_CHARACTERSET ("National character set") defines the encoding of NCHAR,NVARCHAR2 and NCLOB columns and is already Unicode in 9i and above (see Note 276914.1 The National Character Set in Oracle 9i 10g and 11g).

8. NLS_CHARACTERSET ("character set") defines "normal" CHAR,VARCHAR2,LONG and CLOB column codes, which can also be used to store Unicode. An AL32UTF8 or UTF8 NLS_CHARACTERSET database is required in such cases.

Reference documentation:

AL32UTF8/UTF8 (Unicode) database character set meaning (document ID 1946289.1)

How to: select or change a database character set (NLS_CHARACTERSET) (document ID 1525394.1)

The Database Migration Assistant for Unicode (DMU) Tool (document ID 1272374.1)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report