9.4.6.1 組込みの正規表現ベースのデータ変換
Oracle GoldenGate for Distributed Applications and Analytics (GG for DAA)では、デフォルトで、マッチャとコンバータの両方について、正規表現ベースの実装が提供されます。
データ変換構成
# Transform name (To be referred in the subsequent configs)
gg.transforms=t1
# Configure the matcher implementation (using the built-in regex type in this ex)
gg.transform.t1.matcher=regex
# Configure the converter implementation (using the built-in regex type in this ex)
gg.transform.t1.converter=regex
# These matcher configs correspond to the buit-in regex matcher
# Target catalogs to match. Default value is *
gg.transform.t1.matcher.catalogRegex={}
# Target schema to match. Default value is *
gg.transform.t1.matcher.schemaRegex={}
# Target tables to match (*Required field)
gg.transform.t1.matcher.tableRegex={}
# Target columns to match (*Required field)
gg.transform.t1.matcher.columnRegex={}
# These converter configs correspond to the buit-in regex converter
# Content search regex (from the columns selected, filter only specific values matching this regex)
gg.transform.t1.converter.replaceRegex={}
# Content replacement value
gg.transform.t1.converter.replaceString={}
ノート:
tableRegexパラメータとcolumnRegexパラメータにはデフォルト値がありません。tableRegexもcolumnRegexも定義されていない場合は、表にも列にも一致しません。
組込みの正規表現ベースのデータ変換を使用する方法の例
次の構成では、次のようなターゲット・オブジェクトすべてを識別する、データ変換が作成されます:
マッチャ
tabで始まる表名。colで終わる列名。
コンバータ
- 前述の条件に一致した列の値を固定値(たとえば、
TestValue)に変換します。
gg.transforms=t1 gg.transform.t1.matcher=regex gg.transform.t1.converter=regex gg.transform.t1.matcher.catalogRegex=.* gg.transform.t1.matcher.schemaRegex=.* # Table name staring with 'tab' gg.transform.t1.matcher.tableRegex=^tab.* # Column name ending with 'col' gg.transform.t1.matcher.columnRegex=.*col$ gg.transform.t1.converter.replaceRegex=.* # Replacement value gg.transform.t1.converter.replaceString=TestVal
親トピック: データ変換の構成