oracle guide

Page 263

Changing the Database Character Set of an Existing Database

data dictionary and sample schemas are stored in CLOB columns. Customers may also store data in CLOB fields. When the database character set is multibyte, then CLOB data is stored in a format that is compatible with UCS-2 data. When the database character set is single-byte, then CLOB data is stored using the database character set. Because the CSALTER script converts data only in CLOB columns in the data dictionary and sample schemas that were created by Oracle, any other CLOB columns that are created must be first exported and then dropped from the schema before the CSALTER script can be run. To change the database character set, perform the following steps: 1.

Shut down the database, using either a SHUTDOWN IMMEDIATE or a SHUTDOWN NORMAL statement.

2.

Do a full backup of the database, because the CSALTER script cannot be rolled back.

3.

Start up the database.

4.

Run the Database Character Set Scanner utility. CSSCAN /AS SYSDBA FULL=Y...

5.

Run the CSALTER script. @@CSALTER.PLB SHUTDOWN IMMEDIATE; -- or SHUTDOWN NORMAL; STARTUP;

Note that the CSALTER script does not perform any user data conversion. It only changes the character set metadata in the data dictionary.Thus, after the CSALTER operation, Oracle will behave as if the database was created using the new character set. See Also: â–

â–

"Migrating Character Data Using the CSALTER Script and Selective Imports" on page 11-7 "Database Character Set Scanner CSALTER Script" on page 12-33

Using the CSALTER Script in an Oracle Real Application Clusters Environment In an Oracle Real Application Clusters environment, ensure that no other Oracle background processes are running, with the exception of the background processes associated with the instance through which a user is connected, before attempting to issue the CSALTER script. With DBA privileges, use the following SQL statement to verify that no other Oracle background processes are running: SELECT SID, SERIAL#, PROGRAM FROM V$SESSION;

Set the CLUSTER_DATABASE initialization parameter to FALSE to allow the character set change to be completed. Reset it to TRUE after the character set has been changed.

Migrating Character Data Using the CSALTER Script and Selective Imports Another approach to migrating character data is to perform selective exports followed by rescanning and running the CSALTER script. This approach is most common when the subset character set is single-byte and the migration is to a multibyte character set. In this scenario, user-created CLOBs must be converted because the encoding changes from the single- byte character set to a UCS-2-compatible format which Oracle uses for Character Set Migration

11-7


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.