Skip to content

Commit df225f4

Browse files
ninadingoleNinad Ingole
and
Ninad Ingole
authored
59 vagrant box for golden gate (#60)
* Initial Working Setup * Final Working Install.sh For Golden Gate This is working sample of the final installation of Golden Gate For Oracle 12c * Add Vagrant Ip To Kafka Advertised Listeners * Update Download Location in Readme * Update GG for Bigdata zip pattern in script. Remove unused installgg.sh * Update Install Script, Use Apache Kafka, Externalise configurations - Setup Apache kafka by downloading zip from apache distribution, defaults to `2.12-2.6.0`. - Setup Zookeeper and Kafka as systemctl services - Extract Oracle DB, GoldenGate and GoldenGate for Big Data setup files name to configuration - Support Golden Gate `19.0.1.0` version - Rename virtual machine name to `oracle-goldengate-191001-vagrant` - Update Vagrantfile as per OracleDB Vagrantfile changes * Add Golden Gate for Oracle 19c Database * Fix epxort path $ escape, and README correction * Rename folder 19.1.0 to 19.3.0 Co-authored-by: Ninad Ingole <[email protected]>
1 parent 960d88d commit df225f4

28 files changed

+1476
-0
lines changed

OracleGoldenGate/12.2.0.1/.env

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Oracle Database 12.2.0.1 configuration file
2+
#
3+
# Requires vagrant-env plugin
4+
#
5+
# This file will be overwritten on updates, so it is recommended to make
6+
# a copy of this file called .env.local, then make changes in .env.local.
7+
#
8+
# To change a parameter, uncomment it and set it to the desired value.
9+
# All commented parameters will retain their default values.
10+
11+
# VM name
12+
# VM_NAME='oracle-12201-vagrant'
13+
14+
# Memory for the VM (in MB, 2048 MB = 2 GB)
15+
# VM_MEMORY=2048
16+
17+
# VM time zone
18+
# If not specified, will be set to match host time zone (if possible)
19+
# Can use time zone name (e.g., 'America/Los_Angeles')
20+
# or an offset from GMT (e.g., 'Etc/GMT-2')
21+
# VM_SYSTEM_TIMEZONE=
22+
23+
# Oracle base directory
24+
# VM_ORACLE_BASE='/opt/oracle'
25+
26+
# Oracle home directory
27+
# VM_ORACLE_HOME='/opt/oracle/product/12.2.0.1/dbhome_1'
28+
29+
# Oracle SID
30+
# VM_ORACLE_SID='ORCLCDB'
31+
32+
# PDB name
33+
# VM_ORACLE_PDB='ORCLPDB1'
34+
35+
# Database character set
36+
# VM_ORACLE_CHARACTERSET='AL32UTF8'
37+
38+
# Oracle Database edition
39+
# Valid values are 'EE' for Enterprise Edition or 'SE2' for Standard Edition 2
40+
# VM_ORACLE_EDITION='EE'
41+
42+
# Listener port
43+
# VM_LISTENER_PORT=1521
44+
45+
# EM Express port
46+
# VM_EM_EXPRESS_PORT=5500
47+
48+
# Java Version
49+
# VM_JAVA_VERSION='1.8.0'
50+
51+
# Scala Version
52+
# VM_SCALA_VERSION='2.12'
53+
54+
# Apache Kafka Version
55+
# VM_APACHE_KAFKA_VERSION='2.6.0'
56+
57+
# Apache Kafka port
58+
# VM_APACHE_KAFKA_PORT=9092
59+
60+
# Apache Zookeeper port
61+
# VM_APACHE_ZOOKEEPER_PORT=2181
62+
63+
# Oracle DB Installtion zip
64+
# VM_ORACLE_DB_SETUP_FILE = linux*122*.zip
65+
66+
# Oracle GolgenGate Installtion zip
67+
# VM_ORACLE_GG_SETUP_FILE = *ggs_Linux*.zip
68+
69+
# Oracle GolgenGate For BigData Installtion zip
70+
# VM_ORACLE_GG_BD_SETUP_FILE = *BigData_Linux*.zip
71+
72+
# Oracle Database password for SYS, SYSTEM and PDBADMIN accounts
73+
# If left blank, the password will be generated automatically
74+
# VM_ORACLE_PWD=

OracleGoldenGate/12.2.0.1/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.zip
2+
.vagrant

OracleGoldenGate/12.2.0.1/README.md

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# oracle12c-gg-vagrant
2+
3+
A vagrant box that provisions Oracle Database along with Golden Gate automatically, using Vagrant, an Oracle Linux 7.3 box and a shell script.
4+
5+
## Prerequisites
6+
7+
1. Install [Oracle VM VirtualBox](https://www.virtualbox.org/wiki/Downloads)
8+
2. Install [Vagrant](https://vagrantup.com/)
9+
10+
## Getting started
11+
12+
1. Clone this repository `git clone https://github.com/ninadingole/vagrant-boxes`
13+
2. Change into the desired version folder
14+
3. Download the Oracle 12.2.0.1 Database (linuxx64_12201_database.zip) installation zip files from oracle edelivery into this folder - first time only: [edelivery](https://www.oracle.com/database/technologies/oracle12c-linux-12201-downloads.html)
15+
4. Download the installation zip for golden gate (191004_fbo_ggs_Linux_x64_shiphome.zip) & golden gate for Big Data (OGG_BigData_Linux_x64_19.1.0.0.1) into this folder - first time only: [edelivery](https://www.oracle.com/middleware/technologies/goldengate-downloads.html)
16+
5. Run `vagrant up`
17+
1. The first time you run this it will provision everything and may take a while. Ensure you have (a good) internet connection as the scripts will update the virtual box to the latest via `yum`.
18+
2. The Vagrant file allows for customization, if desired (see [Customization](#customization))
19+
6. Connect to the database.
20+
7. You can shut down the box via the usual `vagrant halt` and the start it up again via `vagrant up`.
21+
22+
## Connecting to Oracle
23+
24+
- Hostname: `localhost`
25+
- Port: `1521`
26+
- SID: `ORCLCDB`
27+
- PDB: `ORCLPDB1`
28+
- OEM port: `5500`
29+
- All passwords are auto-generated and printed on install
30+
31+
## Resetting password
32+
33+
You can reset the password of the Oracle database accounts by executing `/home/oracle/setPassword.sh <Your new password>`.
34+
35+
## Connecting to Apache Kafka
36+
37+
- Hostname: `localhost`
38+
- Zookeeper: `2181`
39+
- Kafka-Broker: `9092`
40+
41+
## Other info
42+
43+
- If you need to, you can connect to the machine via `vagrant ssh`.
44+
- You can `sudo su - oracle` to switch to the oracle user.
45+
- The Oracle installation path is `/opt/oracle/` by default.
46+
- On the guest OS, the directory `/vagrant` is a shared folder and maps to wherever you have this file checked out.
47+
- Golden Gate is available at location `/u01/ogg` & `/u01/oggbd` console is accessible using `./ggsci` command inside the folder.
48+
- Apache Kafka is available at location `/usr/local/kafka/kafka-xxxx`
49+
50+
### Customization
51+
52+
You can customize your Oracle environment by amending the environment variables in the `Vagrantfile` file.
53+
The following can be customized:
54+
55+
- `ORACLE_BASE`: `/opt/oracle/`
56+
- `ORACLE_HOME`: `/opt/oracle/product/12.2.0.1/dbhome_1`
57+
- `ORACLE_SID`: `ORCLCDB`
58+
- `ORACLE_PDB`: `ORCLPDB1`
59+
- `ORACLE_CHARACTERSET`: `AL32UTF8`
60+
- `ORACLE_EDITION`: `EE` | `SE2`
61+
- `ORACLE_PWD`: `auto generated`
62+
- `JAVA_VERSION`: `1.8.0`
63+
- `SCALA_VERSION`: `2.12`
64+
- `KAFKA_VERSION`: `2.6.0`
65+
- `APACHE_ZOOKEEPER_PORT`: `2181`
66+
- `APACHE_KAFKA_PORT`: `9092`
67+
- `ORACLE_DB_SETUP_FIL`: `linux*122*.zip`
68+
- `ORACLE_GG_SETUP_FILE`: `*ggs_Linux*.zip`
69+
- `ORACLE_GG_BD_SETUP_FILE`: `*BigData_Linux*.zip`

OracleGoldenGate/12.2.0.1/Vagrantfile

+212
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
#
2+
# LICENSE UPL 1.0
3+
#
4+
# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved.
5+
#
6+
# Since: January, 2018
7+
8+
# Description: Creates an Oracle database Vagrant virtual machine.
9+
# Optional plugins:
10+
# vagrant-env (use .env files for configuration)
11+
# vagrant-proxyconf (if you don't have direct access to the Internet)
12+
# see https://github.com/tmatilai/vagrant-proxyconf for configuration
13+
#
14+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
15+
#
16+
17+
# -*- mode: ruby -*-
18+
# vi: set ft=ruby :
19+
20+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
21+
VAGRANTFILE_API_VERSION = "2"
22+
23+
# Box metadata location and box name
24+
BOX_URL = "https://oracle.github.io/vagrant-projects/boxes"
25+
BOX_NAME = "oraclelinux/7"
26+
27+
# UI object for printing information
28+
ui = Vagrant::UI::Prefixed.new(Vagrant::UI::Colored.new, "vagrant")
29+
30+
# Define constants
31+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
32+
# Use vagrant-env plugin if available
33+
if Vagrant.has_plugin?("vagrant-env")
34+
config.env.load(".env.local", ".env") # enable the plugin
35+
end
36+
37+
# VM name
38+
VM_NAME = default_s('VM_NAME', 'oracle-goldengate-123012-vagrant')
39+
40+
# Memory for the VM (in MB, 2048 MB = 2 GB)
41+
VM_MEMORY = default_i('VM_MEMORY', 2048)
42+
43+
# VM time zone
44+
# If not specified, will be set to match host time zone (if possible)
45+
VM_SYSTEM_TIMEZONE = default_s('VM_SYSTEM_TIMEZONE', host_tz)
46+
47+
# Oracle base directory
48+
VM_ORACLE_BASE = default_s('VM_ORACLE_BASE', '/opt/oracle')
49+
50+
# Oracle home directory
51+
VM_ORACLE_HOME = default_s('VM_ORACLE_HOME', '/opt/oracle/product/12.2.0.1/dbhome_1')
52+
53+
# Oracle SID
54+
VM_ORACLE_SID = default_s('VM_ORACLE_SID', 'ORCLCDB')
55+
56+
# PDB name
57+
VM_ORACLE_PDB = default_s('VM_ORACLE_PDB', 'ORCLPDB1')
58+
59+
# Database character set
60+
VM_ORACLE_CHARACTERSET = default_s('VM_ORACLE_CHARACTERSET', 'AL32UTF8')
61+
62+
# Oracle Database edition
63+
# Valid values are 'EE' for Enterprise Edition or 'SE2' for Standard Edition 2
64+
VM_ORACLE_EDITION = default_s('VM_ORACLE_EDITION', 'EE')
65+
66+
# Listener port
67+
VM_LISTENER_PORT = default_i('VM_LISTENER_PORT', 1521)
68+
69+
# EM Express port
70+
VM_EM_EXPRESS_PORT = default_i('VM_EM_EXPRESS_PORT', 5500)
71+
72+
# Java Version
73+
VM_JAVA_VERSION = default_s('VM_JAVA_VERSION', '1.8.0')
74+
75+
# ScaLa Version
76+
VM_SCALA_VERSION = default_s('VM_SCALA_VERSION', '2.12')
77+
78+
# Apache Kafka Version
79+
VM_APACHE_KAFKA_VERSION = default_s('VM_APACHE_KAFKA_VERSION', '2.6.0')
80+
81+
# Apache Zookeeper port
82+
VM_APACHE_ZOOKEEPER_PORT = default_i('VM_APACHE_ZOOKEEPER_PORT', 2181)
83+
84+
# Apache Kafka port
85+
VM_APACHE_KAFKA_PORT = default_i('VM_APACHE_KAFKA_PORT', 9092)
86+
87+
# Oracle DB Setup File
88+
VM_ORACLE_DB_SETUP_FILE = default_s('VM_ORACLE_DB_SETUP_FILE', 'linux*122*.zip')
89+
90+
# Oracle GoldenGate Setup File
91+
VM_ORACLE_GG_SETUP_FILE = default_s('VM_ORACLE_GG_SETUP_FILE', '*ggs_Linux*.zip')
92+
93+
# Oracle GoldenGate for BigData Setup File
94+
VM_ORACLE_GG_BD_SETUP_FILE = default_s('VM_ORACLE_GG_BD_SETUP_FILE', '*BigData_Linux*.zip')
95+
96+
# Oracle Database password for SYS, SYSTEM and PDBADMIN accounts
97+
# If left blank, the password will be generated automatically
98+
VM_ORACLE_PWD = default_s('VM_ORACLE_PWD', '')
99+
end
100+
101+
# Convenience methods
102+
def default_s(key, default)
103+
ENV[key] && ! ENV[key].empty? ? ENV[key] : default
104+
end
105+
106+
def default_i(key, default)
107+
default_s(key, default).to_i
108+
end
109+
110+
def host_tz
111+
# get host time zone for setting VM time zone
112+
# if host time zone isn't an integer hour offset from GMT, fall back to UTC
113+
offset_sec = Time.now.gmt_offset
114+
if (offset_sec % (60 * 60)) == 0
115+
offset_hr = ((offset_sec / 60) / 60)
116+
timezone_suffix = offset_hr >= 0 ? "-#{offset_hr.to_s}" : "+#{(-offset_hr).to_s}"
117+
'Etc/GMT' + timezone_suffix
118+
else
119+
'UTC'
120+
end
121+
end
122+
123+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
124+
config.vm.box = BOX_NAME
125+
config.vm.box_url = "#{BOX_URL}/#{BOX_NAME}.json"
126+
config.vm.define VM_NAME
127+
128+
# Provider-specific configuration
129+
config.vm.provider "virtualbox" do |v|
130+
v.memory = VM_MEMORY
131+
v.name = VM_NAME
132+
end
133+
config.vm.provider :libvirt do |v|
134+
v.memory = VM_MEMORY
135+
end
136+
137+
# add proxy configuration from host env - optional
138+
if Vagrant.has_plugin?("vagrant-proxyconf")
139+
ui.info "Getting Proxy Configuration from Host..."
140+
has_proxy = false
141+
["http_proxy", "HTTP_PROXY"].each do |proxy_var|
142+
if proxy = ENV[proxy_var]
143+
ui.info "HTTP proxy: " + proxy
144+
config.proxy.http = proxy
145+
has_proxy = true
146+
break
147+
end
148+
end
149+
150+
["https_proxy", "HTTPS_PROXY"].each do |proxy_var|
151+
if proxy = ENV[proxy_var]
152+
ui.info "HTTPS proxy: " + proxy
153+
config.proxy.https = proxy
154+
has_proxy = true
155+
break
156+
end
157+
end
158+
159+
if has_proxy
160+
# Only consider no_proxy if we have proxies defined.
161+
no_proxy = ""
162+
["no_proxy", "NO_PROXY"].each do |proxy_var|
163+
if ENV[proxy_var]
164+
no_proxy = ENV[proxy_var]
165+
ui.info "No proxy: " + no_proxy
166+
no_proxy += ","
167+
break
168+
end
169+
end
170+
config.proxy.no_proxy = no_proxy + "localhost,127.0.0.1"
171+
end
172+
else
173+
["http_proxy", "HTTP_PROXY", "https_proxy", "HTTPS_PROXY"].each do |proxy_var|
174+
if ENV[proxy_var]
175+
ui.warn 'To enable proxies in your VM, install the vagrant-proxyconf plugin'
176+
break
177+
end
178+
end
179+
end
180+
181+
# VM hostname
182+
config.vm.hostname = VM_NAME
183+
184+
# Oracle port forwarding
185+
config.vm.network "forwarded_port", guest: VM_LISTENER_PORT, host: VM_LISTENER_PORT
186+
config.vm.network "forwarded_port", guest: VM_EM_EXPRESS_PORT, host: VM_EM_EXPRESS_PORT
187+
config.vm.network "forwarded_port", guest: VM_APACHE_KAFKA_PORT, host: VM_APACHE_KAFKA_PORT
188+
config.vm.network "forwarded_port", guest: VM_APACHE_ZOOKEEPER_PORT, host: VM_APACHE_ZOOKEEPER_PORT
189+
190+
191+
# Provision everything on the first run
192+
config.vm.provision "shell", path: "scripts/install.sh", env:
193+
{
194+
"SYSTEM_TIMEZONE" => VM_SYSTEM_TIMEZONE,
195+
"ORACLE_BASE" => VM_ORACLE_BASE,
196+
"ORACLE_HOME" => VM_ORACLE_HOME,
197+
"ORACLE_SID" => VM_ORACLE_SID,
198+
"ORACLE_PDB" => VM_ORACLE_PDB,
199+
"ORACLE_CHARACTERSET" => VM_ORACLE_CHARACTERSET,
200+
"ORACLE_EDITION" => VM_ORACLE_EDITION,
201+
"LISTENER_PORT" => VM_LISTENER_PORT,
202+
"EM_EXPRESS_PORT" => VM_EM_EXPRESS_PORT,
203+
"ORACLE_PWD" => VM_ORACLE_PWD,
204+
"JAVA_VERSION" => VM_JAVA_VERSION,
205+
"SCALA_VERSION" => VM_SCALA_VERSION,
206+
"KAFKA_VERSION" => VM_APACHE_KAFKA_VERSION,
207+
"ORACLE_DB_SETUP_FILE" => VM_ORACLE_DB_SETUP_FILE,
208+
"ORACLE_GG_SETUP_FILE" => VM_ORACLE_GG_SETUP_FILE,
209+
"ORACLE_GG_BD_SETUP_FILE" => VM_ORACLE_GG_BD_SETUP_FILE
210+
}
211+
212+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.2.0
2+
oracle.install.option=INSTALL_DB_SWONLY
3+
UNIX_GROUP_NAME=dba
4+
INVENTORY_LOCATION=###ORACLE_BASE###/oraInventory
5+
SELECTED_LANGUAGES=en
6+
ORACLE_BASE=###ORACLE_BASE###
7+
ORACLE_HOME=###ORACLE_HOME###
8+
oracle.install.db.InstallEdition=###ORACLE_EDITION###
9+
oracle.install.db.DBA_GROUP=dba
10+
oracle.install.db.BACKUPDBA_GROUP=dba
11+
oracle.install.db.DGDBA_GROUP=dba
12+
oracle.install.db.KMDBA_GROUP=dba
13+
oracle.install.db.OSRACDBA_GROUP=dba
14+
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
15+
DECLINE_SECURITY_UPDATES=true
16+
oracle.installer.autoupdates.option=SKIP_UPDATES

0 commit comments

Comments
 (0)