Documente Academic
Documente Profesional
Documente Cultură
Here my goal is to change the default character set from WE8ISO8859P1 to AL32UTF8 on
LINUX
Remember, this was tested on my DEVELOPMENT standalone database (refer
Oracle Doc before doing on PROD).
BANNER
-------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0
Production
SQL>
Total_DB_Size (G)
----------------11.29
Do a full backup of the database because the ALTER DATABASE CHARACTER SET
statement cannot be rolled back.
NAME
--------TEST
VALUE
---------------------------------------WE8ISO8859P1
VALUE
---------------------------------------AL16UTF16
PARAMETER
---------------------------------------------------------------VALUE
---------------------------------------------------------------NLS_CHARACTERSET
WE8ISO8859P1
NLS_NCHAR_CHARACTERSET
AL16UTF16
16UTF16
USERENV('LANGUAGE')
---------------------------------------------------AMERICAN_AMERICA.WE8ISO8859P1
SQL> exit
$
$ expdp directory=TEST dumpfile=FULL_TEST_10112012.dmp
logfile=FULL_TEST_10112012.log full=y
CHARACTERSET
TYPES_USED_IN
---------------------------------------- ------------AL16UTF16
NCHAR
AL16UTF16
NCLOB
AL16UTF16
NVARCHAR2
WE8ISO8859P1
CHAR
WE8ISO8859P1
CLOB
WE8ISO8859P1
VARCHAR2
6 rows selected.
Oracle note suggests that if the character set conversion has happened between a 7/8 bit
character set like WE8ISO8859P1, US7ASCII etc to a mutibyte character set like UTF8,
AL32UTF8 etc,
then there will be data loss for clob columns which display the old character set.
So it is best to take a full back of the database, preferably using the tradional export utility.
CHARACTERSET
TYPES_USED_IN
---------------------------------------- ------------AL16UTF16
NCHAR
AL16UTF16
NCLOB
AL16UTF16
NVARCHAR2
AL32UTF8
CHAR
AL32UTF8
CLOB
AL32UTF8
VARCHAR2
6 rows selected.
VALUE
-------------------------------------------------------------------------------AL32UTF8
USERENV('LANGUAGE')
---------------------------------------------------AMERICAN_AMERICA.AL32UTF8
VALUE
-------------------------------------------------------------------------------AL16UTF16
PARAMETER
---------------------------------------------------------------VALUE
---------------------------------------------------------------NLS_CHARACTERSET
AL32UTF8
NLS_NCHAR_CHARACTERSET
AL16UTF16
NOTE: we can use new GUI based DMU (Database Migration Assistant for Unicode)
tool to convert the NLS_CHARACTERSET of an existing database to AL32UTF8 or UTF8