Skip to content

Commit

Permalink
First cut of Dbvisit installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
oraclebase committed Jun 8, 2019
1 parent 076186e commit d407778
Show file tree
Hide file tree
Showing 27 changed files with 1,023 additions and 0 deletions.
129 changes: 129 additions & 0 deletions dbvisit/ol7_19/README.md
@@ -0,0 +1,129 @@
# Vagrant Dbvisit Standby 9 on Oracle Linux 7 with Oracle Database 19c

The Vagrant scripts here will allow you to build a Dbvisit Standby 9 configuration on Oracle Linux 7 with Oracle Database 19c by just starting the VMs in the correct order.

If you need a more detailed description of this build, check out the article here.

* [Dbvisit Standby 9 Installation on Oracle Linux 7](https://oracle-base.com/articles/misc/dbvisit-standby-9)

## Required Software

Download and install the following software. If you can't figure out this step, you probably shouldn't be considering a RAC installation.

* [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
* [Vagrant](https://www.vagrantup.com/downloads.html)

You will also need to download the 19c database software and the Dbvisit Standby 9 software.

* [Database LINUX.X64_193000_db_home.zip](https://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle19c-linux-5462157.html)
* [Dbvisit Standby 9](https://dbvisit.com/)

## Clone Repository

Pick an area on your file system to act as the base for this git repository and issue the following command. If you are working on Windows, remember to check your Git settings for line terminators. If the bash scripts are converted to Windows terminators you will have problems.

```
git clone https://github.com/oraclebase/vagrant.git
```

Copy the Oracle software under the "dbvisit/ol7_19/software" directory. From the "dbvisit/ol7_19" subdirectory, the structure should look like this.

```
tree
.
+--- config
| +--- install.env
| +--- vagrant.yml
+--- console
| +--- scripts
| | +--- configure_dbvisit.sh
| | +--- oracle_user_environment_setup.sh
| | +--- root_setup.sh
| | +--- setup.sh
| +--- Vagrantfile
+--- node1
| +--- scripts
| | +--- configure_dbvisit.sh
| | +--- oracle_create_database.sh
| | +--- oracle_user_environment_setup.sh
| | +--- root_setup.sh
| | +--- setup.sh
| +--- Vagrantfile
+--- node2
| +--- scripts
| | +--- configure_dbvisit.sh
| | +--- oracle_create_database.sh
| | +--- oracle_user_environment_setup.sh
| | +--- root_setup.sh
| | +--- setup.sh
| +--- Vagrantfile
+--- README.md
+--- shared_scripts
| +--- configure_chrony.sh
| +--- configure_hostname.sh
| +--- configure_hosts_base.sh
| +--- install_os_packages.sh
| +--- oracle_db_software_installation.sh
| +--- prepare_u01_disk.sh
+--- software
| +--- dbvisit-standby9.0.00-el7.zip
| +--- LINUX.X64_193000_db_home.zip
| +--- put_software_here.txt
```

## Build the Dbvisit Standby 9 System

The following commands will leave you with a functioning Dbvisit Standby 9 installation.

Start the first node and wait for it to complete. This will create the primary database.

```
cd node1
vagrant up
```

Start the second node and wait for it to complete. This will create the server to hold the standby database.

```
cd ../node2
vagrant up
```

Start the console node and wait for it to complete. This will create the Dbvisit Standby Console.

```
cd ../console
vagrant up
```

Note. If you are using serveral console windows, you can actually run them all at the same time, but wait for them all to complete before attempting to use the system.

## Turn Off System

Perform the following to turn off the system cleanly.

```
cd ../console
vagrant halt
cd ../node2
vagrant halt
cd ../node1
vagrant halt
```

## Remove Whole System

The following commands will destroy all VMs and the associated files, so you can run the process again.

```
cd ../console
vagrant destroy -f
cd ../node2
vagrant destroy -f
cd ../node1
vagrant destroy -f
```
37 changes: 37 additions & 0 deletions dbvisit/ol7_19/config/install.env
@@ -0,0 +1,37 @@
export DOMAIN_NAME=localdomain

export NODE1_HOSTNAME=ol7-19-dbv1
export NODE2_HOSTNAME=ol7-19-dbv2
export CONSOLE_HOSTNAME=ol7-19-console
export NODE1_FQ_HOSTNAME=${NODE1_HOSTNAME}.${DOMAIN_NAME}
export NODE2_FQ_HOSTNAME=${NODE2_HOSTNAME}.${DOMAIN_NAME}
export CONSOLE_FQ_HOSTNAME=${CONSOLE_HOSTNAME}.${DOMAIN_NAME}

export NODE1_PUBLIC_IP=192.168.56.101
export NODE2_PUBLIC_IP=192.168.56.102
export CONSOLE_PUBLIC_IP=192.168.56.103

export ORACLE_BASE=/u01/app/oracle
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_HOME_EXT=product/19.0.0/dbhome_1

export ORACLE_SID=cdb1
export PDB_NAME=pdb1
export NODE1_DB_UNIQUE_NAME=cdb1
export NODE2_DB_UNIQUE_NAME=cdb1_stby
export GLOBAL_DBNAME=
export ORACLE_TERM=xterm

export ORA_LANGUAGES=en,en_GB

export DATA_DIR=/u01/oradata

export ROOT_PASSWORD=rootpasswd
export ORACLE_PASSWORD=oracle
# Passwords >8 chars, number, special, not containing username.
export SYS_PASSWORD="S1sPassword1!"
export PDB_PASSWORD="PdbPassword1!"

export DB_SOFTWARE=LINUX.X64_193000_db_home.zip

export DBVISIT_PASSPHRASE=MyPassphrase123
23 changes: 23 additions & 0 deletions dbvisit/ol7_19/config/vagrant.yml
@@ -0,0 +1,23 @@
shared:
box: bento/oracle-7.6
non_rotational: 'on'

node1:
vm_name: ol7_19_dbv1
mem_size: 4096
cpus: 2
public_ip: 192.168.56.101
u01_disk: ./ol7_19_dbv1_u01.vdi

node2:
vm_name: ol7_19_dbv2
mem_size: 4096
cpus: 2
public_ip: 192.168.56.102
u01_disk: ./ol7_19_dbv2_u01.vdi

console:
vm_name: ol7_19_console
mem_size: 1024
cpus: 1
public_ip: 192.168.56.103
87 changes: 87 additions & 0 deletions dbvisit/ol7_19/console/Vagrantfile
@@ -0,0 +1,87 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'

# You might need this in the session.
# export SSH_AUTH_SOCK=""

# Variables
params = YAML.load_file '../config/vagrant.yml'
var_box = params['shared']['box']
var_non_rotational = params['shared']['non_rotational']

var_vm_name = params['console']['vm_name']
var_mem_size = params['console']['mem_size']
var_cpus = params['console']['cpus']
var_public_ip = params['console']['public_ip']


# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.

# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = var_box

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
config.vm.network "forwarded_port", guest: 4433, host: 4433

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"

# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: var_public_ip

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
config.vm.synced_folder "../config", "/vagrant_config"
config.vm.synced_folder "../shared_scripts", "/vagrant_scripts"
config.vm.synced_folder "../software", "/vagrant_software"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
vb.memory = var_mem_size
vb.cpus = var_cpus
vb.name = var_vm_name

vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', '0', '--nonrotational', var_non_rotational]
end

#
# View the documentation for the provider you are using for more
# information on available options.

# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<-SHELL
sh /vagrant/scripts/setup.sh
SHELL
end
25 changes: 25 additions & 0 deletions dbvisit/ol7_19/console/scripts/configure_dbvisit.sh
@@ -0,0 +1,25 @@
. /vagrant_config/install.env

echo "******************************************************************************"
echo "Configure Dbvisit." `date`
echo "******************************************************************************"

mkdir -p ~/9.0
cd ~/9.0
cp /vagrant_software/dbvisit-standby*.zip .
unzip -oq dbvisit-standby*.zip
tar xf dbvisit-standby*.tar
cd dbvisit/installer

./install-dbvisit --batch-install \
--force \
--dbvisit-base /usr/dbvisit \
--components dbvserver \
--dbvserver-local-host ${CONSOLE_HOSTNAME} \
--dbvserver-local-port 4433

echo "******************************************************************************"
echo "Start Dbvisit Console." `date`
echo "******************************************************************************"
/usr/dbvisit/dbvserver/dbvserver -d stop
/usr/dbvisit/dbvserver/dbvserver -d start
19 changes: 19 additions & 0 deletions dbvisit/ol7_19/console/scripts/oracle_user_environment_setup.sh
@@ -0,0 +1,19 @@
. /vagrant_config/install.env

echo "******************************************************************************"
echo "Create environment scripts." `date`
echo "******************************************************************************"
mkdir -p /home/oracle/scripts

cat > /home/oracle/scripts/setEnv.sh <<EOF
# Oracle Settings
export TMP=/tmp
export TMPDIR=\$TMP
export ORACLE_HOSTNAME=${CONSOLE_FQ_HOSTNAME}
export ORACLE_TERM=xterm
EOF

cat >> /home/oracle/.bash_profile <<EOF
. /home/oracle/scripts/setEnv.sh
EOF
26 changes: 26 additions & 0 deletions dbvisit/ol7_19/console/scripts/root_setup.sh
@@ -0,0 +1,26 @@
. /vagrant_config/install.env

sh /vagrant_scripts/install_os_packages.sh

echo "******************************************************************************"
echo "Set root and oracle password and change ownership of /u01." `date`
echo "******************************************************************************"
echo -e "${ROOT_PASSWORD}\n${ROOT_PASSWORD}" | passwd
echo -e "${ORACLE_PASSWORD}\n${ORACLE_PASSWORD}" | passwd oracle

sh /vagrant_scripts/configure_hosts_base.sh

sh /vagrant_scripts/configure_chrony.sh

su - oracle -c 'sh /vagrant/scripts/oracle_user_environment_setup.sh'
. /home/oracle/scripts/setEnv.sh

sh /vagrant_scripts/configure_hostname.sh

echo "******************************************************************************"
echo "Configure Dbvisit Base." `date`
echo "******************************************************************************"
mkdir /usr/dbvisit
chown -R oracle:oinstall /usr/dbvisit

su - oracle -c 'sh /vagrant/scripts/configure_dbvisit.sh'
1 change: 1 addition & 0 deletions dbvisit/ol7_19/console/scripts/setup.sh
@@ -0,0 +1 @@
sudo bash -c 'sh /vagrant/scripts/root_setup.sh'

0 comments on commit d407778

Please sign in to comment.