solidDB Help : Programming : Working with Unicode : Compatibility between Unicode and partial Unicode databases : Converting partial Unicode databases to Unicode
  
Converting partial Unicode databases to Unicode
To convert a partial Unicode database to a Unicode database, use the solidDB tools to export and reload your database.
Before you start, create a backup of your database, and verify the locale/codepage that is used in the application side for encoding data in CHAR data type columns in the partial Unicode database.
During the export phase, the data in CHAR data type columns is not converted by solidDB tools. This means that the underlying locale/codepage for CHAR data types becomes the locale/codepage format for the output file. To enable the output files to contain data in a single locale/codepage, solidDB must be able to convert the data in the WCHAR data type columns from UTF-16 to the exact same locale/codepage format as the CHAR data.
In the import phase, the solidDB tools convert the data from the locale/codepage format of the output file to the UTF encoding that is used in Unicode databases.
Note If you have your database creation scripts available, you can use the scripts to create the new database table definitions instead of using solidDB Data Dictionary (soldd) and solidDB SQL Editor (solsql).
Complete the following steps to convert a partial Unicode database to a Unicode database:
1 Extract data definitions by using solidDB Data Dictionary (soldd), see solidDB Data Dictionary (soldd).
For example, if your locale is zh_CN.gb18030, the database network name is "tcp 1964", and the database was created with a user name and password of dba, use the following command to extract an SQL script that contains definitions for all tables, views, triggers, indexes, procedures, sequences, and events.
soldd -Mzh_CN.gb18030 "tcp 1964" dba dba
Important To preserve referential integrity, you might need to reorganize the table definition statements to ensure that, when the data is imported, any referenced tables are created before the referencing tables.
2 Extract control and data files for all tables from your database by using solidDB Export (solexp), see solidDB Export (solexp). For example:
solexp -Mzh_CN.gb18030 "tcp 1964" dba dba *
3 Create a new Unicode database.
a Set the General.InternalCharEncoding parameter to UTF8 in the server-side solid.ini.
b Create a new database by starting solidDB in the working directory for the new Unicode database.
4 Import data definitions into the new database by using solidDB SQL Editor (solsql), see solidDB SQL Editor (solsql). For example:
solsql -fsoldd.sql -Mzh_CN.gb18030 "tcp 1964" dba dba
5 For each table, load the data into the new database by using the solidDB Speed Loader (solloado), see solidDB Speed Loader (solloado and solload). For example:
solloado -Mzh_CN.gb18030 "tcp 1964" dba dba table1.ctr
Go up to
Compatibility between Unicode and partial Unicode databases