debezium/oracle-vagrant-box

Name: oracle-vagrant-box

Owner: Debezium

Description: A Vagrant box for creating a custom Docker image of Oracle DB for testing purposes

Created: 2018-02-07 20:37:09.0

Updated: 2018-04-06 16:07:52.0

Pushed: 2018-04-06 16:07:51.0

Homepage: null

Size: 18

Language: Shell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Debezium Vagrant Box for Oracle DB

This is a Vagrant configuration for setting up a virtual machine based on Fedora 27, containing an Oracle DB instance for testing. Note that you'll need to download the Oracle installation yourself in order for preparing the testing environment.

Ansible is used for provisioning the VM, see playbook.yml for the complete set-up.

Preparations

Make sure to have the following installed:

Installation

Clone this repository:

clone https://github.com/debezium/oracle-vagrant-box.git

Download the Oracle installation file and provide it within the data directory.

Change into the project directory, bootstrap the VM and SSH into it:

racle-vagrant-box
ant up
ant ssh
Setting up Oracle DB

Clone the Oracle Docker images GitHub repository:

clone https://github.com/oracle/docker-images.git

Build the Docker image with the database:

ocker-images/OracleDatabase/SingleInstance/dockerfiles
vagrant_data/linuxx64_12201_database.zip 12.2.0.1
ildDockerImage.sh -v 12.2.0.1 -i -e

Create a data directory and run the container:

r -p /home/vagrant/oradata/recovery_area
 chgrp 54321 /home/vagrant/oradata
 chown 54321 /home/vagrant/oradata
 chgrp 54321 /home/vagrant/oradata/recovery_area
 chown 54321 /home/vagrant/oradata/recovery_area

Run the container

er run --name dbz_oracle -p 1521:1521 -e ORACLE_PWD=top_secret -v /home/vagrant/oradata/:/opt/oracle/oradata oracle/database:12.2.0.1-ee

and wait for the database to start.

Database configuration

The last step to do is to configure the started database. You can configure it in automated way using provided installation script or you can follow the manual steps to understand the necessary pre-conditions.

To configure the database automatically run

setup.sh | docker exec -i dbz_oracle bash

When the script execution is completed the database is fully configured and prepared to send change events into Debezium. The following chapter explains steps that are executed as part of the configuration process.

Manual steps

Set archive log mode and enable GG replication:

er exec -ti -e ORACLE_SID=ORCLCDB dbz_oracle sqlplus /nolog

ECT sys/top_secret AS SYSDBA
r system set db_recovery_file_dest_size = 5G;
r system set db_recovery_file_dest = '/opt/oracle/oradata/recovery_area' scope=spfile;
r system set enable_goldengate_replication=true;
down immediate
tup mount
r database archivelog;
r database open;
hould show "Database log mode: Archive Mode"
ive log list

;

Create XStream admin user:

er exec -ti dbz_oracle sqlplus sys/top_secret@//localhost:1521/ORCLCDB as sysdba
TE TABLESPACE xstream_tbs DATAFILE '/opt/oracle/oradata/ORCLCDB/xstream_tbs.dbf'
ZE 25M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
;

er exec -ti dbz_oracle sqlplus sys/top_secret@//localhost:1521/ORCLPDB1 as sysdba
TE TABLESPACE xstream_tbs DATAFILE '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/xstream_tbs.dbf'
ZE 25M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
;

er exec -ti dbz_oracle sqlplus sys/top_secret@//localhost:1521/ORCLCDB as sysdba

TE USER c##xstrmadmin IDENTIFIED BY xsa
FAULT TABLESPACE xstream_tbs
OTA UNLIMITED ON xstream_tbs
NTAINER=ALL;

T CREATE SESSION, SET CONTAINER TO c##xstrmadmin CONTAINER=ALL;
T DBA TO c##xstrmadmin;

N
BMS_XSTREAM_AUTH.GRANT_ADMIN_PRIVILEGE(
  grantee                 => 'c##xstrmadmin',
  privilege_type          => 'CAPTURE',
  grant_select_privileges => TRUE,
  container               => 'ALL'
;



;

Create test user:

er exec -ti dbz_oracle sqlplus sys/top_secret@//localhost:1521/ORCLPDB1 as sysdba

TE USER debezium IDENTIFIED BY dbz;
T CONNECT TO debezium;
T CREATE SESSION TO debezium;
T CREATE TABLE TO debezium;
T CREATE SEQUENCE TO debezium;
R USER debezium QUOTA 100M ON users;

;

Create XStream Outbound server:

er exec -ti dbz_oracle sqlplus c##xstrmadmin/xsa@//localhost:1521/ORCLCDB

ARE
bles  DBMS_UTILITY.UNCL_ARRAY;
hemas DBMS_UTILITY.UNCL_ARRAY;
N
tables(1)  := NULL;
schemas(1) := 'debezium';
MS_XSTREAM_ADM.CREATE_OUTBOUND(
server_name     =>  'dbzxout',
table_names     =>  tables,
schema_names    =>  schemas);



;
License

This project is licensed under the Apache License version 2.0.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.