Converting non-Unicode databases to Unicode
There are some cases where you might need to convert an existing non-Unicode database to a Unicode database.
There are some cases where you might need to convert an existing non-Unicode database to a Unicode database.
cd <export-dir>
db2move sample export
where <export-dir> is the directory to which you want to export your data and SAMPLE is the existing database name. db2look -d sample -e -o unidb.ddl -l -x -f
where SAMPLE is the existing database name and unidb.ddl is the file name for the generated DDL script. The -l option
generates DDL for user defined table spaces, database partition groups and buffer pools, the -x option generates authorization DDL, and the -f option
generates an update command for database configuration parameters. CREATE DATABASE UNIDB COLLATE USING SYSTEM_codepage_territory
where UNIDB is the name of the Unicode database and SYSTEM_codepage_territory is
a language-aware collation based on the weight table used for collating your non-Unicode data. This ensures that the data in the new Unicode database will be sorted in the same order. CONNECT TO UNIDB
DROP DATABASE SAMPLE
db2 -tvf unidb.ddl
cd <export-dir>
db2move unidb import
where <export-dir> is the directory where you exported your data and UNIDB is the Unicode database name.