This vagrant configuration provides a multiple VM setup with CentOS 7. It contains a VM with a database and (configurable) number of "nodes". The following graphic illustractes the setup:
The VM's build as follow:
- CentOS 7 without a desktop
- Flyway
- Oracle XE Database 18c
- Oracle Sample Schemas loaded into XE database
Please use the user vagrant/vagrant to login into the virtual machine. manager10g is used as password for all Oracle components, like Database and all sample schemas.
Port 1521 (Oracle XE) and 5500 (Enterprise Manager) are automatically exposed by the VM.
- CentOS 7 without a desktop
- Open JDK 11
Please use the user vagrant/vagrant to login into the virtual machine.
Port xx is automatically exposed by the VM.
All nodes using an internal network with fixed ip adresses to communicate to each other. Externally the VM's can be access with NAT and port forwarding.
-
Oracle Virtual Box is installed and configured on your development machine. (http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html)
-
Vagrant is installed and configured on your development machine. (https://www.vagrantup.com/downloads.html)
-
Clone the project from git. The target folder named as PROJECT_HOME afterwards.
$ git clone https://...
-
Download Oracle Database Express Edition 18c to $PROJECT_HOME/provision/OracleXE/oracle-database-xe-18c-1.0-1.x86_64.rpm (http://download.oracle.com/otn/linux/oracle18c/xe/oracle-database-xe-18c-1.0-1.x86_64.rpm)
-
You can fine tune the configuration by open the vagrant file. The following settings can be modified when the default is not suitable:
s.env = { ORACLE_SID: "XE", ORACLE_PASSWORD: "manager10g", => Password for Oracle XE database. ORACLE_CHARACTERSET: "AL32UTF8", ORACLE_BASE: "/opt/oracle", => Base directory where all Oracle software will be installed. ORACLE_HOME: "/opt/oracle/product/18c/dbhomeXE" }
-
Configure the number of nodes needed in vagrant file:
NODE_COUNT = 2 //default number of nodes
-
Open a shell on your development machine and navigate to the folder PROJECT_HOME. Start and provision all VM's:
$ vagrant up
-
Open a shell on your development machine and navigate to the folder PROJECT_HOME
-
Execute start command
$ vagrant up
Note: Start only a specific VM using the corresponding name like vagrant up database
.
-
Open a shell on your development machine and navigate to the folder PROJECT_HOME
-
Execute stop command
$ vagrant halt
Note: Stop only a specific VM using the corresponding name like vagrant halt database
.
-
Open a shell on your development machine and navigate to the folder PROJECT_HOME
-
Execute stop command
$ vagrant ssh database [node1 | node2 | nodeN]
Note: You can sudo su - oracle to switch to the oracle user. The oracle user owns the db installation. Only applicable for the database VM!
-
Open a shell on your development machine and navigate to the folder PROJECT_HOME
-
Pull the latest changes from the git repository
-
Execute the following command. The virtual machine must be started!
$ vagrant rsync $ vagrant provision
- Hostname: localhost
- Port: 1521
- SID: XE
- PDB: XEPDB1
- EM Express port: 5500
- All passwords are auto-generated and printed on install
You can reset the password of the Oracle database accounts (SYS, SYSTEM and PDBADMIN only) by switching to the oracle user (sudo su - oracle), then executing /home/oracle/setPassword.sh .
-
Open a shell on your development machine and navigate to the folder PROJECT_HOME
-
stop command
$ vagrant ssh database $ sudo -s $ /etc/init.d/oracle-xe-18c stop
-
start command
$ vagrant ssh database $ sudo -s $ /etc/init.d/oracle-xe-18c start