将 Oracle Database 转换为支持多字节语言
如果支持多字节语言,请在开始升级之前备份数据库。 如果由于任何原因导致数据库转换失败,那么可以从备份复原,解决问题,然后重试。 请咨询 Oracle Database 管理员,查看必须进行的更改并查看日志以确保数据库正确转换。
开始之前
阅读 IBM TRIRIGA 发行说明。
过程
- 验证是否没有 IBM® TRIRIGA® 应用程序实例连接到数据库。
- 使用以下脚本将 VARCHAR2 字段从 BYTE 转换为 CHAR :
- 在使用脚本之前,请仔细查看脚本以验证它是否符合您的特定情况。
-- This alters the recurrence id and status columns in the scheduled -- events table to allow an index to continue to be used -- makes t table consistent to the metadata, do not change other t -- tables this way; use the data modeler!!! alter table t_scheduledevents modify (RECURRENCEID VARCHAR2(700 CHAR), EVENTSTATUS VARCHAR2(700 CHAR)) ; -- This alters the section_name and field_name columns, reducing the -- size to allow for an index to continue to be used alter table rep_template_columns modify (section_name VARCHAR2(100 CHAR), field_name VARCHAR2(100 CHAR)); -- This loops through every varchar2 column in the user's tables and -- changes the length semantics from byte to char DECLARE TYPE RefCurTyp IS REF CURSOR; alter_tbl VARCHAR2(200); tbl VARCHAR2(200); clmn VARCHAR2(200); dtyp VARCHAR2(200) ; dlth VARCHAR2(200); c RefCurTyp; BEGIN open c for 'select utc.table_name, utc.column_name, utc.data_type, utc.data_length FROM user_tab_columns utc, user_tables ut WHERE utc.data_type = ''VARCHAR2'' AND utc.char_used = ''B'' AND ut.table_name = utc.table_name' ; loop FETCH c INTO tbl, clmn, dtyp, dlth; EXIT WHEN c%NOTFOUND; EXECUTE IMMEDIATE 'alter table '||tbl||' modify ('||clmn||' '||dtyp||'('||dlth||' CHAR))' ; END LOOP; CLOSE c ; END ; - 如果添加了定制索引,那么脚本可能失败。 如果脚本失败,那么必须从备份数据库复原。 在重新启动脚本之前,请除去失败的索引。 之后,添加并调整索引。 请考虑使用 数据建模器更改 T_table 字段大小。
- 在使用脚本之前,请仔细查看脚本以验证它是否符合您的特定情况。
- 导出已转换的数据库。
- 使用 UTF-8 或 UTF-16 字符集创建数据库。 将 NLS_LENGTH_SEMANTICS 参数设置为 CHAR。
- 导入已转换的数据库。 请查看导入日志以验证是否未发生数据截断或其他问题。 此复审对于验证数据库的正确升级很重要。
- 升级 IBM TRIRIGA Application Platform。