GoldenGate 中文表/中文欄位處理

來源:互聯網
上載者:User

比如有個如下的中文表:

樣本40:

create table 測試表

ID NUMBER,

姓名 VARCHAR230),

FLAG CHAR1),

CONSTRAINT PK_TESTD PRIMARY KEY ID) USING INDEX);

--源端建立MV LOG和MV:

drop materialized view log on "測試表";

create materialized view log on "測試表" with primary key;

drop materialized view mv_cn_table;

create materialized view mv_cn_table refresh fast on commit as select id,姓名 as en_name,flag from "測試表";


在目標端建立表及view:

樣本41:

create or replace view v_cn_table as select id,姓名 as en_name,flag  from 測試表;

這裡NLS_LANG在GG中,抽取和複製必須設定為和目標字元集一致:

樣本42:

SETENV NLS_LANG = "AMERICAN_AMERICA.AL32UTF8")


Extract相關:

樣本43:

extract ODISC

SETENV NLS_LANG = "AMERICAN_AMERICA.AL32UTF8")

userid custom_src, password custom_src

exttrail D:/GoldenGate/dirdat/ODISoc/oc

TABLE CUSTOM_SRC.MV_CN_TABLE;


Pump相關:

樣本44:

extract ODIT1P

SETENV NLS_LANG = "AMERICAN_AMERICA.AL32UTF8")

PASSTHRU

rmthost localhost, mgrport 7909

rmttrail D:/gg_stg/dirdat/ODIT1op/op

TABLE CUSTOM_SRC.MV_CN_TABLE;


Replicat相關:

樣本45:

replicat ODIT1A1

SETENV NLS_LANG = "AMERICAN_AMERICA.AL32UTF8")

userid odi_staging,  password odi_staging

discardfile D:/gg_stg/dirrpt/ODIT1.dsc, purge

ASSUMETARGETDEFS


這裡必須指定APPLYNOOPUPDATES參數,否則UPDATE有問題,另外,也要指定KEYCOLS,否則刪除和更新有問題:

樣本46:

map CUSTOM_SRC.MV_CN_TABLE, TARGET ODI_STAGING.V_CN_TABLE, KEYCOLS ID);


oracle視頻教程請關注:http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.