Consultor Eletrônico



Kbase 19912: How to convert an existing database to Unicode UTF-8?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   27/04/2009
Status: Verified

GOAL:

How to convert an existing database to Unicode UTF-8?

GOAL:

Ways to convert an existing Database to Unicode

GOAL:

Ways to convert an existing Database to UTF

FACT(s) (Environment):

Progress 9.x
OpenEdge 10.x

FIX:

You can take one of two approaches, either with or without a dump and load.

WARNING: Before you start either process, have a good backup of your database.

To convert without dump and load, follow these steps:

1) Compile a new version of word break table for UTF-8 to a rule number <N>. (In OpenEdge 10.1A and later, if word rules have not been customized then this is not necessary, there is a default UTF-8 word rule file named proword.254 in the installation directory that can be used instead):

proutil <database> -C wbreak-compiler %DLC%\prolang\convmap\utf8-bas.wbt <N>
Use an absolute path to DLC instead of the environment variable in the command line.

and where <N> is number between 1 and 255.

2) Place the new created file proword.<N> in %DLC% or define the environment variable PROWD<N>=<file-directory>\proword.<N> (in Progress Version 9.0A you must set PROWD<N>).

3) Convert your database:

proutil <database> -C convchar convert UTF-8

4) Apply the new word-rules to the database:

proutil <database> -C word-rules <N>
For example: proutil sports -C word-rules 10

5) Use the Data Administration tool to load the file %DLC%\prolang\utf\_tran.df in order to change the database collation.
Note: If your DataBase was created before 10.1A (in example 10.0B) and you are going to load the _tran.df in 10.1A you need to do the following before being able to load the _tran.df.
proutil <database> -C updateschema
This will bring the DataBase Schema to 10.1A and you will able to load the _tran.df for database collation.

6) Rebuild the indexes:

proutil <database> -C idxbuild ALL -cpinternal UTF-8


To convert using dump and load follow the steps below.

Please note that once you have completed steps 3 and 4, they do not need to be repeated for subsequent databases on the same system.

WARNING: Prior to OpenEdge 10.0A Binary dump does not record the code page of the text being written to the dump file. You must use the Data Dictionary Dump Table Contents plus either the Data Dictionary Load Table Contents or the bulkload utility. In OpenEdge 10 Binary Dump does record the code page of the text being written to the dump file, and this can only be loaded into a database that uses the same code page. This ensures that there is no possibility of data corruption when loading the data. Failure to load into a database with exactly the same code page will result in error 10855:

Code page of .bd file (<namne>) does not match code page of database(<name>). (10855)

1) Dump the existing database.

2) Create a new empty UTF-8 database:

prodb <new_database> %DLC%\prolang\utf\empty.db

3) Compile a new version of word break table for UTF-8 to a rule number <N>. (In OpenEdge 10.1A and later, if word rules have not been customized then this is not necessary, there is a default UTF-8 word rule file named proword.254 in the installation directory that can be used instead):

proutil <database> -C wbreak-compiler %DLC%\prolang\convmap\utf8-bas.wbt <N>

where <N> is number between 1 and 255.

4) Place the newly created file proword.<N> in %DLC% or define the environment variable PROWD<N>=<file-directory>\proword.<N> (in Version 9.0A you have to set PROWD<N>).

5) Apply the new word rules to the database:

proutil <database> -C word-rules <N>

6)ONG> Load the database..