At the top of the list of character sets Oracle recommends for all new system deployment is the Unicode character set AL32UTF8.Depending on what characters you actually have in your database you have three options on how to do this:
- Changing the character set with the package CSALTER. Only data dictionary is migrated.
- Using CSALTER and convert application data using export/import for all users
- Using CSALTER and convert a subset of application data.
Character expansion happens when a symbol changes from one character set to another with more bytes being used for storage in the latter. This is the case for the euro sign (€) in WE8MSWIN, where it requires one byte, in AL32UTF8 it takes three bytes. This requires a conversion of application data using export/import.
Oracle has made an utility for this, csscan. It checks the data dictionary and application data and gives you an analysis telling you what to do. The following procedure was executed on Oracle 10.2.0.4.
First create these two directories are defined in the database:
create directory log_file_dir as '/tmp/csscan';
create directory data_file_dir as '/tmp/csscan';
Run the following script as SYS in sqlplus to install the tool:
It will ask for a password which you'll use later (on 9iR2 it uses standard password CSMIG). Then start the scanning with:
csscan csmig/your_password full=y tochar=al32utf8 process=3 array=1024000
The csscan command is documented in chapter 12 in the Globalization Guide. The above analyzes the entire database. Otherwise owner, tables or columns may be specified. The process parameter selects the number of simultaneous scanning processes.
When scanning is completed csscan create a database scan report and individual exception reports as scan.txt and scan.err respectively. The file scan.out contains the output from the command above. These files are created in the directory that was current when the command was executed.