Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGate 12.2 セットアップガイド ver.1.0
2016年2月 日本オラクル株式会社 クラウド&テクノロジー事業統括
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
はじめに
•本資料では、Oracle GoldenGate R12.2.0.1.0 の環境構築から 動作確認までの一連の手順について説明します。
•本資料は製品マニュアルを補足する資料です。 手順の一例としてご活用ください。 – Fusion Middleware Installing and Configuring Oracle GoldenGate for Oracle
Database(12.2.0.1.0) • https://docs.oracle.com/goldengate/c1221/gg-winux/GIORA/toc.htm
3
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
本ドキュメントの流れ •本ドキュメントは下記の流れで、
Oracle GoldenGate のセットアップ方法を説明します。 – 1章:前提知識
– 2章:環境準備
– 3章:GoldenGateのインストール
– 4章:Oracle Databaseの構成
– 5章:GoldenGateの配置
– 6章:GoldenGateの動作確認
– 7章:GoldenGateのアンインストール
– 8章:参考情報
4
Oracle Database
12gR1 ( AL32UTF8)
SID: orcl
Oracle GoldenGate
12gR2
Oracle GoldenGate
12gR2
Oracle Database
12gR1 (AL32UTF8)
SID: orcl
Host: host-a OS:Oracle Linux Server 6.7
Host: host-b OS:Oracle Linux Server 6.7
ソース ターゲット
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Agenda
前提知識
事前の環境準備(メディアの用意)
Oracle GoldenGateのインストール
Oracle Databaseの構成
Oracle GoldenGateの配置
Oracle GoldenGateの動作確認
Oracle GoldenGateのアンインストール
参考情報
5
1
2
3
4
5
6
7
8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGate 概要
• Oracle GoldenGate概要
– データ・レプリケーション製品
– 2009年旧GoldenGate社を買収
• Oracle GoldenGateの特徴
– データベースに行われた変更を他データベースへ反映
– 既存のデータベースやネットワークへの負荷は最小限
– 稼働中のデータベース同士で双方向に連携が可能
– 異なるデータベースやOSの種類・バージョンで構成されたシステム間での連携が可能
– データベース全体だけではなく、表・列など必要な部分 に絞った柔軟な連携が可能
ソース・ データベース
ターゲット・ データベース
双方向同期
アプリ
GoldenGate
GoldenGate
アプリ
Active
Active
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGate 基本アーキテクチャ - 全体像 -
Oracle GoldenGate
Trail ファイル
差分ログ
Server A Server B
OS
Oracle GoldenGate
Trail ファイル
OS
ターゲット
データベース
ソース
データベース
チェックポイント ファイル
チェックポイント ファイル
チェックポイント ファイル
抽出プロセス Extract (Capture)
転送プロセス Extract
(Data Pump)
管理プロセス Manager
受信プロセス Collector
適用プロセス Replicat
管理プロセス Manager
チェック ポイント表
• データベースの差分ログをTrailファイルという汎用的なフォーマットに変換して転送 • 各プロセスの進行状況はチェックポイントファイル(バイナリファイルまたはDB上の表)に保存 • 上記の構成の他に、DBサーバと別のサーバにGoldenGateを切り出す構成などが可能
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGate 基本アーキテクチャ - プロセス -
8
Oracle GoldenGate
Trailファイル
Server A Server B
Oracle GoldenGate
抽出プロセス Extract (Capture)
転送プロセス Extract
(Data Pump)
管理プロセス Manager
受信プロセス Collector
適用プロセス Replicat
管理プロセス Manager
Trailファイル
• Captureプロセス:ソースDBから変更ログを抽出してTrailファイルに書き出すプロセス
• Data Pumpプロセス:Captureプロセスが書き出したTrailファイルからリモートのCollectorプロセスにデータを転送するプロセス
• Collectorプロセス:ソース側のDataPumpプロセスからデータを受信して、Trailファイルに書き込むプロセス(Managerが起動するためユーザによる操作は不要)
• Replicatプロセス:Trailファイルからデータを読み出し、ターゲットDBに反映するためのプロセス
• Managerプロセス:OGGインスタンス全体を管理するプロセス
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGate 基本アーキテクチャ - パラメータファイル -
9
Oracle GoldenGate
Trail ファイル
Server A Server B
Oracle GoldenGate
Manager
Collector Replicat
Manager
Trail ファイル
• GoldenGateのパラメータファイルは下記の2種類があります。プレーンテキスト形式です。
– GLOBALSパラメータファイル(ファイル名:GLOBALS):GoldenGateインスタンス全体を設定するためのパラメータファイル。ファイル名は大文字のGLOBALSで拡張子は不要。
– パラメータファイル(ファイル名:xxxx.prm):Capture等のプロセス実行時の設定をするためのファイル。Collector以外の全てのプロセスで設定が必要。
GLOBALS パラメータファイル
GLOBALS パラメータファイル
パラメータファイル パラメータファイル
Capture DataPump
パラメータファイル
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGate 基本アーキテクチャ - 主なファイル -
10
Oracle GoldenGate
Trail ファイル
Server A Server B
Oracle GoldenGate
Collector
Trail ファイル
• Trailファイル: OGG内で変更ログを格納するためのファイル。
• チェックポイントファイル:各プロセスがどこまで処理したかを記録するためのファイル。
• 破棄ファイル(Discardファイル):処理できなかったレコードを格納するためのファイル。
• ログファイル(ggserr.log):エラー等のメッセージが書き込まれるファイル。
チェックポイント ファイル
チェックポイント ファイル
チェックポイント ファイル
破棄 ファイル
Capture
破棄 ファイル
破棄 ファイル
Replicat DataPump
Manager Manager ログファイル ggserr.log
ログファイル ggserr.log
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGate 基本アーキテクチャ - 主なディレクトリ -
• GoldenGateホーム以下に作成される主なディレクトリと用途を説明します。 – dirprm:各プロセスのパラメータファイル用のディレクトリ。
– dirrpt:各プロセスから出力される破棄ファイル等のディレクトリ。編集不可。
– dirchk:チェックポイントファイル用のディレクトリ。編集不可。
– dirpcs:各プロセスのステータス情報を格納するディレクトリ。編集不可。
– dirsql:GoldenGateのSQLスクリプトを格納するディレクトリ。
– dirdat:Trailファイルを格納するディレクトリ。編集不可。
– dirtmp/dirdmp:一時ファイル、ダンプファイル用ディレクトリ。編集不可。
– dircrd/dirwlt:セキュリティ関連の情報を格納するディレクトリ。
*注:OGGバージョンによってディレクトリ構成が異なることがあります。
11
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
GoldenGateにおけるレプリケーション方式
ソース データベース
GoldenGate 抽出(Extract)
Classic Capture
ターゲット データベース
変更履歴 (REDOログ等)
Non-integrated Replicat
Coordinated Replicat (OGG12c~)
Integrated Replicat (OGG12c~)
Integrated Capture
(OGG11gR2~)
Oracle Databaseのみ構成可能
Database Logmining
Server (Outbound)
ソース オブジェクト
ターゲット オブジェクト
Database Logmining
Server (Inbound)
GoldenGate 適用(Apply)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
GoldenGateにおけるレプリケーション方式 - Capture -
ソース データベース
GoldenGate 抽出(Extract)
Classic Capture
変更履歴 (REDOログ等)
Integrated Capture
(OGG11gR2~)
Oracle Databaseのみ
Database Logmining
Server (Outbound)
ソース オブジェクト
• Classic Capture
–従来からの抽出方法
–全てのデータベースで利用可能
–変更ログ(REDOログ等)から抽出
•統合Capture(Integrated Capture) – OGG11gR2からの新しい抽出方法
– Oracle Databaseでのみ利用可能
– DBの機能(Database Logmining Server)を使用して変更情報を抽出
– Oracle Databaseへの高い親和性
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
GoldenGateにおけるレプリケーション方式 - Replicat -
• Non-integrated Replicat
–従来からの適用方法
–全てのデータベースで利用可能
– SQLを使用してターゲットに適用
• Coordinated Replicat
– Non-integrated をマルチスレッド化
•統合Replicat(Integrated Replicat) – Oracle Databaseでのみ利用可能
– DBの機能(Database Logmining Server)を使用して変更情報を適用
– Oracle Databaseへの高い親和性
ターゲット データベース
Non-integrated Replicat
Coordinated Replicat (OGG12c~)
Integrated Replicat (OGG12c~)
Oracle Databaseのみ
ターゲット オブジェクト
Database Logmining
Server (Inbound)
GoldenGate 適用(Apply)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateの管理 • コマンドラインによるGoldenGateの管理
– GGSCI(GoldenGate Software Command Interface)
• GUIによるGoldenGateの管理
15
GoldenGate Monitor
•GoldenGateの監視・管理をするスタンドアロン製品
•高度な監視機能やアラート機能を提供
GoldenGate Plug-in For EMCC12c
• Enterprise Manager Cloud Control 12cのプラグイン形式
•Oracle Databaseと同一のインタフェー
スやメトリックを使用して統合的な監視が可能
GoldenGate Director
•GoldenGateのレガシーバージョンを管理・監視するC/Sツール
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateの管理~GGSCIコマンドインターフェイス
• 全てのコマンドのヘルプ概要を表示します。 – GGSCI> HELP
– GGSCI> HELP ALL
• 特定のコマンドのヘルプ概要を表示します。 – GGSCI> HELP <コマンド名>
• 実行したコマンドの履歴を表示します。 – GGSCI> HISTORY
• 全てのプロセスの情報を表示します。 – GGSCI> INFO ALL
16
• GGSCI (Oracle GoldenGate Software Command Interface)は、GoldenGateのコマンドラインインタフェースです。GGSCIを使用して、GoldenGateを設定・制御・監視することができます。
• この資料では、GGSCIを使用して操作します。
利用例
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Agenda
前提知識
事前の環境準備(メディアの用意)
Oracle GoldenGateのインストール
Oracle Databaseの構成
Oracle GoldenGateの配置
Oracle GoldenGateの動作確認
Oracle GoldenGateのアンインストール
参考情報
17
1
2
3
4
5
6
7
8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
本資料の環境情報
•本資料で構成する環境は以下を使用しています。
–OS • Oracle Linux Server Release 6.7 (64bit)
–ソフトウェア • Oracle GoldenGate R12.2.0.1.0
–本資料では、抽出にIntegrated Capture、適用にIntegrated Replicatを使用します。
• Oracle Database 12.1.0.2.0
–既にソース用データベース、ターゲット用データベースとしてOracle Database が用意されているものとします。
18
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
本資料で構築するGoldenGateの構成イメージ
19
DB
GoldenGate GoldenGate
DB
ソース ターゲット
Manager Manager
同期 Collector Integrated
Replicat
Integrated Extract (Capture)
Extract (DataPump)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
2. 文章を読み、輸出規制に受諾する場合は「受諾」ボタンを押します。
メディアのダウンロード(1/3)
1. Oracle Software Delivery Cloudにサインインします。
20
http://edelivery.oracle.com
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
4. 使用可能なリリースで「Oracle GoldenGate 12.2.0.1.0 for Linux x86-64」を選択し「続行」を押します。
メディアのダウンロード(2/3)
3. 「製品」で、「Oracle GoldenGate」を選択し、プラットフォームも選択して、「続行」を押します。
21
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
メディアのダウンロード(3/3)
5. 「オラクル標準の条件及び規制」のライセンス契約を十分読み、受諾する場合はチェックして「続行」ボタンを押します。
22
6.ファイル名をクリックして、ファイルをダウンロードします。
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Agenda
前提知識
事前の環境準備(メディアの用意)
Oracle GoldenGateのインストール
Oracle Databaseの構成
Oracle GoldenGateの配置
Oracle GoldenGateの動作確認
Oracle GoldenGateのアンインストール
参考情報
23
1
2
3
4
5
6
7
8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateのインストール
•各システムにGoldenGateをインストールします。
• インストール時にManagerプロセスが設定され起動します。
24
DB
GoldenGate GoldenGate
DB
ソース ターゲット
Manager Manager
同期 Collector Integrated
Replicat
Integrated Extract (Capture)
Extract (DataPump)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateのインストール(1/4)
1. 事前にインストール用ディレクトリを作成おきます。また、メディア・パックを解凍し、インストーラを起動します。
–ソース: [oracle@host-a ~]$ mkdir -p /u01/app/ogg1
[oracle@host-a ~]$ unzip V97860-01.zip
[oracle@host-a ~]$ cd fbo_ggs_Linux_x64_shiphome/Disk1/
[oracle@host-a Disk1]$ sh runInstaller
–ターゲット: [oracle@host-b ~]$ mkdir -p /u01/app/ogg2
[oracle@host-b ~]$ unzip V97860-01.zip
[oracle@host-b~]$ cd fbo_ggs_Linux_x64_shiphome/Disk1/
[oracle@host-b Disk1]$ sh runInstaller
• システム要件の確認
– システム要件や利用するデータ型がGoldenGateに対応しているかを確認します。システム要件については、「 Fusion Middleware Installing and Configuring Oracle GoldenGate for Oracle Database 」をご参照下さい。
– http://www.oracle.com/technetwork/middleware/goldengate/documentation/index.html
25
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateのインストール(2/4)
26
2. インストール・オプション画面で「Oracle GoldenGate for Oracle Database 12c」を選択して「次へ」をクリックします。
3. Specify Installation Details画面で、ステップ1で作成したインストール先ディレクトリを指定します。。また、Managerプロセスが使用するポート番号を指定して、 「次へ」をクリックします。
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateのインストール(3/4)
27
4. サマリー画面で内容を確認の上、「インストール」ボタンをクリックします。
5. 終了画面で、「Oracle GoldenGateのインストールが成功しました」というメッセージが出ましたら、「閉じる」ボタンをクリックします。
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
6. 下記の環境変数を設定します。
• ORACLE_HOME
– Oracle Databaseがインストールされているディレクトリ
• ORACLE_SID
– Oracle Databaseを特定する名前(SID)
• OGG_HOME
– Oracle GoldenGateをインストールしたディレクトリ
(ステップ1で作成、ステップ3で指定)
* GG_HOMEの設定は必須ではありません。
7. 同じようにターゲットのOracle GoldenGateをインストールします。
– ※ここでは省略します。
28
Oracle GoldenGateのインストール(4/4)
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
export ORACLE_SID=orcl
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export OGG_HOME=/u01/app/ogg1
export LD_LIBRARY_PATH=$OGG_HOME:$LD_LIBRARY_PATH
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Agenda
前提知識
事前の環境準備(メディアの用意)
Oracle GoldenGateのインストール
Oracle Databaseの構成
Oracle GoldenGateの配置
Oracle GoldenGateの動作確認
Oracle GoldenGateのアンインストール
参考情報
29
1
2
3
4
5
6
7
8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle Databaseの構成
• ソースとターゲットのOracle Databaseは既に構成されているものとします。
• この章ではGoldenGateを使用するための事前設定を行います。
30
DB
GoldenGate GoldenGate
DB
ソース ターゲット
Manager Manager
同期 Collector Integrated
Replicat
Integrated Extract (Capture)
Extract (DataPump)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle Databaseの構成(1/5)
1. 各データベースのTNS名を設定します。
– ソース側とターゲット側の$ORACLE_HOME/network/admin/tnsnames.oraに右の内容を追加します。
– 既に構成されている場合は設定する必要はありません。
ソース側:
ターゲット側:
SRC = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =
host-a.oracle.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )
TGT = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =
host-b.oracle.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
3. Oracle GoldenGateを有効化(ソース側とターゲット側)
• ソース側とターゲット側両方で下記のコマンドを実行して、GoldenGateが使用するOracle Databaseを利用できるようになります。
Oracle Databaseの構成(2/5)
32
2. ロギング・プロパティの構成(ソース側)
• ソース・データベース側で、下記のコマンドを実行してサプリメンタル・ロギングの設定をします。
• サプリメンタル・ロギングは、通常REDOログに記録される情報だけでなく、GoldenGate等がレプリケーションを行うために必要な情報をREDOログに追加する機能です。
$ sqlplus / as sysdba SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; SQL> ALTER DATABASE FORCE LOGGING;
SQL> alter system set enable_goldengate_replication = true;
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle Databaseの構成(3/5)
4. Oracle Databaseサーバリソースの調整(ソース・ターゲット) – ソース側のOracle Databaseのlogminning server (Integrate Extractが利用)とターゲット側のOracle Databaseの
inbound server(Integrate Replicatが利用)を起動するために、 STREAMS_POOL_SIZE を設定します。
• 推奨値はマニュアルをご参照ください。
– http://docs.oracle.com/goldengate/c1221/gg-winux/GIORA/setup.htm#GIORA234
– 右のコマンドで、STREAMS_POOL_SIZEを設定します。ソースとターゲット両方で設定します。 • 本例では、ExtractとReplicatが一つずつの構成を想定した数値で設定しています。
33
SQL> alter system set streams_pool_size=1250M scope=spfile;
SQL> shutdown immediate
SQL> startup
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
5. ソース側OGG用ユーザの作成 – 下記のコマンドでソース側のユーザ作成
– 下記のコマンドでソース側のユーザの権限設定
• この資料ではDBA権限を付与していますが、より詳細な権限設定をしたい場合はマニュアルを参照して必要な権限のみを設定してください。
– https://docs.oracle.com/goldengate/1212/gg-winux/GIORA/user_assignment.htm#GIORA552
6. ターゲット側OGG用ユーザの作成 – 下記のコマンドでターゲット側のユーザ作成
– 下記のコマンドでターゲット側のユーザ権限設定
• この資料ではDBA権限を付与していますが、より詳細な権限設定をしたい場合はマニュアルを参照して必要な権限のみを設定してください。
– ソース側と同じURLをご参照下さい。
34
Oracle Databaseの構成(4/5)
SQL> create user ggs identified by Welcome1;
SQL> grant DBA to ggs;
SQL> exec dbms_goldengate_auth.grant_admin_privilege('ggs');
SQL> create user ggs identified by Welcome1;
SQL> grant DBA to ggs;
SQL> exec dbms_goldengate_auth.grant_admin_privilege('ggs');
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
5. 下記のコマンドでソース側のユーザ作成 – ソース側テスト用ユーザの作成
– ソース側テスト用ユーザの権限設定
• この資料ではDBA権限を付与していますが、より詳細な権限設
定をしたい場合は必要な権限のみを設定してください。
6. 下記のコマンドでターゲット側のユーザ作成
– ターゲット側テスト用ユーザの作成
– ターゲット側テスト用ユーザの権限設定
• この資料ではDBA権限を付与していますが、より詳細な権
限設定をしたい場合は必要な権限のみを設定してください。
35
Oracle Databaseの構成(5/5)
SQL> connect sys/Welcome1@src as sysdba
SQL> create user test identified by Welcome1;
SQL> grant dba to test;
SQL> connect sys/Welcome1@tgt as sysdba
SQL> create user test identified by Welcome1;
SQL> grant dba to test;
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Agenda
前提知識
事前の環境準備(メディアの用意)
Oracle GoldenGateのインストール
Oracle Databaseの構成
Oracle GoldenGateの配置
Oracle GoldenGateの動作確認
Oracle GoldenGateのアンインストール
参考情報
36
1
2
3
4
5
6
7
8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateの構成
• 3章でインストールしたGoldenGateを設定します。
37
DB
GoldenGate GoldenGate
DB
ソース ターゲット
Manager Manager
同期 Collector Integrated
Replicat
Integrated Extract (Capture)
Extract (DataPump)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
• ソース側とターゲット側の両方の設定が必要です。下記のマークに注意しながら作業して下さい。
– ソース側のマシンで作業
– ターゲット側のマシンで作業
38
Oracle GoldenGateの構成(1/4)
1. プロセス監視等を行うManagerプロセスはデフォルトでインストールする際に設定され、起動している状態です。
•下記のコマンドで起動しているか確認できます。
•下記のコマンドで起動します。
2. スキーマ・レベルのサプリメンタル・ログを有効化します。
GGSCI > INFO ALL
GGSCI > START MANAGER
Source
Target
Target
Source
GGSCI > ADD SCHEMATRANDATA test
Source
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateの構成(2/4)
39
3. Captureプロセスの構成をします。
• ソース側で起動するCaptureプロセスのパラメータを指定します。
• テキストエディタで、パラメータファイルを編集します。
GGSCI > EDIT PARAMS E1
EXTRACT E1
SETENV (ORACLE_HOME=/u01/app/oracle/
product/12.1.0/dbhome_1)
USERID ggs@orcl, PASSWORD Welcome1
DDL INCLUDE MAPPED
EXTTRAIL ./dirdat/aa
TABLE test.*;
Source
4. CaptureグループをDBに登録します。
5. Captureグループを追加します。
6. ローカルTrailを追加します。
GGSCI > dblogin userid ggs@orcl password Welcome1
GGSCI > REGISTER EXTRACT e1 DATABASE
GGSCI > ADD EXTRACT E1, INTEGRATED TRANLOG, BEGIN NOW
GGSCI > ADD EXTTRAIL ./dirdat/aa, EXTRACT e1
Source
Source
Source
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateの構成(3/4)
40
7. ソース側でPumpプロセスの構成
• ソース側で起動するPumpプロセスのパラメータを指定します。
• テキストエディタで、パラメータファイルを編集します。
GGSCI > EDIT PARAMS P1
EXTRACT P1
PASSTHRU
RMTHOST host-b.oracle.com, MGRPORT 7809
RMTTRAIL /u01/app/ogg2/dirdat/bb
TABLE test.*;
Source
8. DataPumpグループを追加します。
9. リモートTrailを追加します。
GGSCI > ADD EXTRACT P1, EXTTRAILSOURCE ./dirdat/aa
GGSCI > ADD RMTTRAIL /u01/app/ogg2/dirdat/bb, EXTRACT p1
Source
Source
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateの構成(4/4)
41
10. ターゲット側でReplicatプロセスの構成
• ターゲット側で起動するReplicatプロセスのパラメータを指定します。
• テキストエディタで、パラメータファイルを編集します。
GGSCI > EDIT PARAMS R1
REPLICAT R1
SETENV (ORACLE_HOME=/u01/app/oracle/
product/12.1.0/dbhome_1)
USERID ggs@tgt, PASSWORD Welcome1
MAP test.*, TARGET test.*;
Target
11. ターゲット側でReplicatグループを追加。 GGSCI > ADD REPLICAT R1,INTEGRATED, EXTTRAIL ./dirdat/bb
Target
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateの起動
42
11.ソース側でExtractを起動。
12.ソース側でDataPumpを起動。
• DataPumpを起動するタイミングでターゲット側のCollectorプロセスも起動します。
13.ソース側でプロセス状態を確認。
• すべてのプロセスの状態が「RUNNING」であれば、OK。
15. ターゲット側でReplicatを起動
16. ターゲット側でプロセス状態を確認。
•すべてのプロセス状態が「RUNNING」であれば、OK
GGSCI > START EXTRACT E1
GGSCI > START EXTRACT P1
GGSCI > INFO ALL
Target
GGSCI > START REPLICAT R1
Source
Source
Source
Target
GGSCI > INFO ALL
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Agenda
前提知識
事前の環境準備(メディアの用意)
Oracle GoldenGateのインストール
Oracle Databaseの構成
Oracle GoldenGateの配置
Oracle GoldenGateの動作確認
Oracle GoldenGateのアンインストール
参考情報
43
1
2
3
4
5
6
7
8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateの動作確認(1/4)
44
1. DDLの動作確認
• ソース側で、テーブルを作成
• ターゲット側で、テーブルを確認
SQL> connect sys/Welcome1@src as sysdba
SQL> CREATE TABLE test.test_tab
( id NUMBER NOT NULL PRIMARY KEY,
name CHAR(10) NOT NULL ,
upd_date date DEFAULT SYSDATE);
SQL> connect sys/Welcome1@tgt as sysdba
SQL> desc test.test_tab
名前 NULL? 型
----------------------------------------- -------- ----------------------------
ID NOT NULL NUMBER
NAME NOT NULL CHAR(10)
UPD_DATE DATE
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateの動作確認(2/4)
45
2. DMLの動作確認 (Insert)
• ソース側で、データをインサート
• ターゲット側で、データを確認 SQL> connect sys/Welcome1@src as sysdba
SQL> insert into test.test_tab values(1,'山本', sysdate);
1行が作成されました。
SQL> commit;
コミットが完了しました。
SQL> connect sys/Welcome1@tgt as sysdba
SQL> select * from test.test_tab;
ID NAME UPD_DATE
---------- ------------------------------ --------
1 山本 16-01-11
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateの動作確認(3/4)
46
3. DMLの動作確認 (Update)
• ソース側で、データを更新
• ターゲット側で、更新した内容を確認
SQL> conn sys/Welcome1@src as sysdba
SQL> update test.test_tab set name ='湯浅' where id=1;
1行が更新されました。
SQL> commit;
コミットが完了しました。
SQL> connect sys/Welcome1@tgt as sysdba
SQL> select * from test.test_tab;
ID NAME UPD_DATE
---------- ------------------------------ --------
1 湯浅 16-01-11
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateの動作確認(4/4)
47
4. DMLの動作確認 (Delete)
• ソース側で、データを削除
• ターゲット側で、削除した内容を確認 SQL> conn sys/Welcome1@src as sysdba
SQL> delete test.test_tab where id=1;
1行が削除されました。
SQL> commit;
コミットが完了しました。
SQL> conn sys/Welcome1@tgt as sysdba
SQL> select * from test.test_tab;
レコードが選択されませんでした。
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Agenda
前提知識
事前の環境準備(メディアの用意)
Oracle GoldenGateのインストール
Oracle Databaseの構成
Oracle GoldenGateの配置
Oracle GoldenGateの動作確認
Oracle GoldenGateのアンインストール
参考情報
48
1
2
3
4
5
6
7
8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateのアンインストール(1/2)
49
1. ソース側のアンインストール
• プロセスを停止して設定を解除
• 権限を削除
• OUIでOracle GoldenGateをアンインストール
• 「アンインストールに成功しました」が出ましたら、アンインストールは終了です。
GGSCI> DBLOGIN USERID ggs PASSWORD Welcome1
GGSCI> STOP ER *
GGSCI> STOP mgr
GGSCI> DELETE SCHEMATRANDATA test
GGSCI> DELETE EXTRACT E1
GGSCI> UNREGISTER EXTRACT E1 database
SQL> exec dbms_goldengate_auth.revoke_admin_privilege('ggs');
$ cd /u01/app/ogg1/deinstall/
$ sh ./deinstall.sh
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle GoldenGateのアンインストール(2/2)
50
2. ターゲット側のアンインストール
• プロセスを停止して設定を解除
• 権限を削除
• OUIでOracle GoldenGateをアンインストール
• 「アンインストールに成功しました」が出ましたら、アンインストールは終了です。
GGSCI> DBLOGIN USERID ggs@tgt PASSWORD Welcome1
GGSCI> STOP REPLICAT R1
GGSCI> STOP mgr
GGSCI> DELETE REPLICAT R1
SQL> exec dbms_goldengate_auth.revoke_admin_privilege('ggs');
$ cd /u01/app/ogg2/deinstall/
$ sh ./deinstall.sh
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Agenda
前提知識
事前の環境準備(メディアの用意)
Oracle GoldenGateのインストール
Oracle Databaseの構成
Oracle GoldenGateの配置
Oracle GoldenGateの動作確認
Oracle GoldenGateのアンインストール
参考情報
51
1
2
3
4
5
6
7
8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
参考情報
• Oracle GoldenGate 12c 全般情報(英語)
– https://docs.oracle.com/goldengate/c1221/gg-winux/index.html
– Oracle GoldenGate 12c リリースノート(英語)
– http://docs.oracle.com/goldengate/c1221/gg-winux/GRLWU/toc.htm#GRLWU101
• Oracle GoldenGate 12c インストールガイド(英語)
– https://docs.oracle.com/goldengate/c1221/gg-winux/GIORA/system_requirements.htm#GIORA110
52
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Document Control
Author
Oracle Asia Research & Development Center • 黄 明
• 梁 国賢
• 楊 帆
Reviewer
日本オラクル株式会社 • 谷川 信朗
• 後藤 陽介
• 舟橋 直美
53
変更履歴
Date Version
2016/2 1.0 Created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 55