目的
以下のような Oracle Golden Gate 環境をローカルに作っていきます。
STEP1.Oracle Database CUI インストール
STEP2.Oracle Golden Gate インストール (この記事)
STEP3.Oracle Golden Gate セットアップ
STEP4.Oracle Golden Gate を使ってみる
バージョンなど
対象 | バージョン |
---|---|
Host OS | Windows10 |
Client OS1 (name: myora1) | Centos-7.8 on virtual box |
Client OS2 (name: myora2) | Centos-7.8 on virtual box |
Virtual Box | Version 6.1.26 |
Vagrant | Version 2.2.5 |
Ansible (ansible_local) | Version 2.9 |
Oracle DB | 19c |
Oracle Golden Gate | 19.1.0.0 |
Oracle Golden Gate インストール手順
1.Ansible playbook ファイルを更新
2.Oracle Golden Gate をダウンロード
3.仮想環境を作成
1.Ansible playbook ファイルを更新
前回、STEP1.Oracle Database CUI インストール で作成したAnsible playbook ファイルを更新して、Oracle Golden Gate をインストールする手順を追加する。
大まかな流れとしては
- ダウンロードした Golden Gate zip ファイルを仮想環境にコピー
- zipを解凍。 CUI インストールするために、oggcore.rsp を編集
- Golden Gate Home ディレクトリ(/gg) に CUIインストール
## Golden Gate Installation
- name: Create work directory
file:
path: "/home/oracle/work/gg_inst"
state: directory
owner: "oracle"
group: "oinstall"
mode: 0755
- name: Copy file for Oracle Golden Gate installation
copy:
src: ./installer/191004_fbo_ggs_Linux_x64_shiphome.zip
dest: /home/oracle/work/gg_inst/191004_fbo_ggs_Linux_x64_shiphome.zip
mode: 0644
- name: Unzip Oracle Golden Gate installation file
shell:
cmd: unzip -u /home/oracle/work/gg_inst/191004_fbo_ggs_Linux_x64_shiphome.zip -d /home/oracle/work/gg_inst/
args:
warn: false
become: yes
become_user: oracle
- name: Create Golden Gate HOME directory
file:
path: "/gg"
state: directory
owner: "oracle"
group: "oinstall"
mode: 0755
- name: Modify file for Golden Gate CUI install1
replace:
path: /home/oracle/work/gg_inst/fbo_ggs_Linux_x64_shiphome/Disk1/response/oggcore.rsp
regexp: '^INSTALL_OPTION=$'
replace: 'INSTALL_OPTION=ORA19c'
become: yes
become_user: oracle
- name: Modify file for Golden Gate CUI install2
replace:
path: /home/oracle/work/gg_inst/fbo_ggs_Linux_x64_shiphome/Disk1/response/oggcore.rsp
regexp: '^SOFTWARE_LOCATION=$'
replace: 'SOFTWARE_LOCATION=/gg'
become: yes
become_user: oracle
- name: Modify file for Golden Gate CUI install3
replace:
path: /home/oracle/work/gg_inst/fbo_ggs_Linux_x64_shiphome/Disk1/response/oggcore.rsp
regexp: '^START_MANAGER=$'
replace: 'START_MANAGER=false'
become: yes
become_user: oracle
- name: bash_profile of oracle user
ansible.builtin.lineinfile:
path: /home/oracle/.bash_profile
state: present
line: "{{ item }}"
with_items:
- '# For GGSCI'
- 'export LD_LIBRARY_PATH=${ORACLE_HOME}/lib/'
- name: Install Golden Gate
shell:
cmd: /home/oracle/work/gg_inst/fbo_ggs_Linux_x64_shiphome/Disk1/runInstaller -silent -nowait -responseFile /home/oracle/work/gg_inst/fbo_ggs_Linux_x64_shiphome/Disk1/response/oggcore.rsp
become: yes
become_user: oracle
2.Oracle Golden Gate をダウンロード
Oracle のサイトからダウンロードする。
※日本語のページにもダウンロードリンクは存在するものの、ダウンロードが開始されないため、英語版のページからダウンロードしなければならなかった。
必ず Oracle Licence Agreement の内容をレビューし、承諾した上でダウンロードします。
ダウンロードしたファイル(191004_fbo_ggs_Linux_x64_shiphome.zip)は以下のように配置します。
|-- Vagrantfile
|-- ansible
| |-- hosts
| |-- installer
| | |-- 191004_fbo_ggs_Linux_x64_shiphome.zip ←これ
| | `-- oracle-database-ee-19c-1.0-1.x86_64.rpm
| |-- myora1.yml
| `-- myora2.yml
3.仮想環境を作成
それでは仮想環境をコマンドで作成(更新)していきます。
1.Vagrantfile があるディレクトリに移動
$ ls
Vagrantfile ansible/
2.vagrant up 実行
(手元の環境で約10分所要)
前回、STEP1.Oracle Database CUI インストール で作成した仮想環境に対して、差分(Golden Gateをインストール)を適用するだけなので、時間はかからない。
$ vagrant up --provision
Bringing machine 'myora1' up with 'virtualbox' provider...
Bringing machine 'myora2' up with 'virtualbox' provider...
==> myora1: Checking if box 'bento/centos-7.8' version '202010.22.0' is up to date...
==> myora1: Running provisioner: ansible_local...
(省略)
TASK [Install Golden Gate] *****************************************************
changed: [myora2]
PLAY RECAP *********************************************************************
myora2 : ok=19 changed=10 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
3.仮想環境にログイン & Golden Gate インストール先ディレクトリ(Golden Gate Home)を確認
※多くのファイルが入ってるはず
$ vagrant ssh myora1
[vagrant@myora1 ~]$ ls -l /gg | head -4
total 229056
-rw-rw-r--. 1 oracle oinstall 121 Oct 17 2019 archivelog.sql
-rwxr-xr-x. 1 oracle oinstall 426 Oct 15 2010 bcpfmt.tpl
-rwxr-xr-x. 1 oracle oinstall 1725 Oct 15 2010 bcrypt.txt
以上