|
| 1 | +# Oracle Data Guard (DG) Vagrant project on VirtualBox or KVM/libVirt provider |
| 2 | + |
| 3 | +###### Author: Ruggero Citton (<[email protected]>) - Oracle RAC Pack, Cloud Innovation and Solution Engineering Team |
| 4 | + |
| 5 | +This directory contains Vagrant build files to provision automatically |
| 6 | +two Oracle RDBMS (18c, 19c, 21c, 23ai) hosts configured with Oracle Data Guard, using Vagrant, Oracle Linux 9 and shell scripts. |
| 7 | + |
| 8 | + |
| 9 | +The virtualization provider can be VirtualBox or KVM/libVirt |
| 10 | + |
| 11 | +## Prerequisites |
| 12 | + |
| 13 | +1. Read the [prerequisites in the top level README](../README.md#prerequisites) to set up Vagrant with either VirtualBox or KVM |
| 14 | +1. You need to download Database binary separately |
| 15 | + |
| 16 | +## Free disk space requirement |
| 17 | + |
| 18 | +- Database binary zip under "./ORCL_software": ~3.2 Gb |
| 19 | +- Database binary on u01 vdisk (node1/node2) : ~10 Gb |
| 20 | +- OS guest vdisk (node1/node2): ~2 Gb |
| 21 | + - In case of KVM/libVirt provider, the disks are created under `storage pool = "storage_pool_name"` |
| 22 | + - In case of VirtualBox |
| 23 | + - Use `VBoxManage list systemproperties |grep folder` to find out the current VM default location |
| 24 | + - Use `VBoxManage setproperty machinefolder <your path>` to set VM default location |
| 25 | +- Database DBFs virtual disks (dynamic size): ~80 Gb |
| 26 | + |
| 27 | +## Memory requirement |
| 28 | + |
| 29 | +Running two RDBMS nodes at least 6Gb per node are required |
| 30 | + |
| 31 | +## Getting started |
| 32 | + |
| 33 | +1. Clone this repository `git clone https://github.com/oracle/vagrant-projects.git` |
| 34 | +2. Change into OracleDG folder (`/repo clone path/vagrant-projects/RACPack/OracleDG`) |
| 35 | +3. Download Database binary from OTN into `./ORCL_software` folder (*) |
| 36 | +4. Run `vagrant up` |
| 37 | +5. Connect the hosts issuing: `vagrant ssh host1/2`. |
| 38 | +6. You can shut down the VM via the usual `vagrant halt` and the start it up again via `vagrant up` |
| 39 | + |
| 40 | +(*) Download Database binary from OTN into `ORCL_software` folder |
| 41 | +https://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html |
| 42 | + |
| 43 | + Accept License Agreement |
| 44 | + go to version (18c, 19c, 21c, 23ai) for Linux x86-64 you need -> "See All", example |
| 45 | + |
| 46 | + * Oracle Database 21c (21.3) for Linux x86-64 |
| 47 | + LINUX.X64_213000_db_home.zip (3,109,225,519 bytes) |
| 48 | + (sha256sum - c05d5c32a72b9bf84ab6babb49aee99cbb403930406aabe3cf2f94f1d35e0916) |
| 49 | + |
| 50 | +## Customization |
| 51 | + |
| 52 | +You can customize your Oracle environment by amending the parameters in the configuration file: `./config/vagrant.yml` |
| 53 | +The following can be customized: |
| 54 | + |
| 55 | +#### node1/node2 |
| 56 | + |
| 57 | +- `vm_name`: VM Guest partial name. The full name will be <prefix_name>-<vm_name> |
| 58 | +- `mem_size`: VM Guest memory size Mb (minimum 6Gb --> 6144) |
| 59 | +- `cpus`: VM Guest virtual cores |
| 60 | +- `public_ip`: VM public ip. VirtualBox `vboxnet0` hostonly is in use |
| 61 | +- `private_ip`: VM private ip. |
| 62 | +- `storage_pool_name`: KVM/libVirt storage pool name |
| 63 | +- `u01_disk`: VirtualBox Oracle binary virtual disk (u01) file path |
| 64 | + |
| 65 | +#### DB storage |
| 66 | + |
| 67 | +- `storage_pool_name`: KVM/libVirt Oradata dbf KVM storage pool name |
| 68 | +- `oradata_disk_path`: VirtualBox Oradata dbf path |
| 69 | +- `oradata_disk_num` : Oradata number of disks |
| 70 | +- `oradata_disk_size`: oradata disk size (Gb) |
| 71 | + |
| 72 | +#### environment |
| 73 | + |
| 74 | +- `provider`: It's defining the provider to be used: 'libvirt' or 'virtualbox' |
| 75 | +- `prefix_name`: VM Guest prefix name |
| 76 | +- `domain`: VM Guest domain name |
| 77 | +- `db_software`: Oracle Database for Linux x86-64 zip file |
| 78 | +- `root_password`: VM Guest root password |
| 79 | +- `oracle_password`: VM Guest oracle password |
| 80 | +- `sys_password`: Oracled RDBMS SYS password |
| 81 | +- `pdb_password`: Oracled PDB SYS password |
| 82 | +- `ora_languages`: Oracle products languages |
| 83 | +- `db_name`: Oracle RDBMS database name |
| 84 | +- `pdb_name`: Oracle RDBMS pluggable database name |
| 85 | +- `db_type`: Oracle RDBMS type: RAC, RACONE, SI (single Instance) |
| 86 | +- `cdb`: Oracle RDBMS database created as container (true/false) |
| 87 | +- `adg`: Oracle Standby created as Active Standby (ADG) (true/false) |
| 88 | + |
| 89 | +#### VirtualBox provider Example: |
| 90 | + |
| 91 | + host1: |
| 92 | + vm_name: primary |
| 93 | + mem_size: 8192 |
| 94 | + cpus: 2 |
| 95 | + public_ip: 192.168.56.131 |
| 96 | + private_ip: 192.168.200.131 |
| 97 | + u01_disk: ./primary_u01.vdi |
| 98 | + |
| 99 | + host2: |
| 100 | + vm_name: standby |
| 101 | + mem_size: 8192 |
| 102 | + cpus: 2 |
| 103 | + public_ip: 192.168.56.132 |
| 104 | + private_ip: 192.168.200.132 |
| 105 | + u01_disk: ./standby_u01.vdi |
| 106 | + |
| 107 | + env: |
| 108 | + provider: virtualbox |
| 109 | + # --------------------------------------------- |
| 110 | + prefix_name: vgt9-213-dg |
| 111 | + # --------------------------------------------- |
| 112 | + domain: localdomain |
| 113 | + # --------------------------------------------- |
| 114 | + non_rotational: 'on' |
| 115 | + oradata_disk_path: |
| 116 | + oradata_disk_num: 2 |
| 117 | + oradata_disk_size: 20 |
| 118 | + # --------------------------------------------- |
| 119 | + db_software: LINUX.X64_213000_db_home.zip |
| 120 | + # --------------------------------------------- |
| 121 | + root_password: welcome1 |
| 122 | + oracle_password: welcome1 |
| 123 | + sys_password: welcome1 |
| 124 | + pdb_password: welcome1 |
| 125 | + # --------------------------------------------- |
| 126 | + ora_languages: en,en_GB |
| 127 | + # --------------------------------------------- |
| 128 | + db_name: DB213H1 |
| 129 | + pdb_name: PDB1 |
| 130 | + cdb: false |
| 131 | + adg: false |
| 132 | + # --------------------------------------------- |
| 133 | + |
| 134 | +#### KVM/libVirt provider Example: |
| 135 | + |
| 136 | + host1: |
| 137 | + vm_name: primary |
| 138 | + mem_size: 8192 |
| 139 | + cpus: 2 |
| 140 | + public_ip: 192.168.125.131 |
| 141 | + private_ip: 192.168.200.131 |
| 142 | + storage_pool_name: Vagrant_KVM_Storage |
| 143 | + |
| 144 | + host2: |
| 145 | + vm_name: standby |
| 146 | + mem_size: 8192 |
| 147 | + cpus: 2 |
| 148 | + public_ip: 192.168.125.132 |
| 149 | + private_ip: 192.168.200.132 |
| 150 | + storage_pool_name: Vagrant_KVM_Storage |
| 151 | + |
| 152 | + env: |
| 153 | + provider: libvirt |
| 154 | + # --------------------------------------------- |
| 155 | + prefix_name: vgt9-213-dg |
| 156 | + # --------------------------------------------- |
| 157 | + domain: localdomain |
| 158 | + # --------------------------------------------- |
| 159 | + oradata_disk_num: 2 |
| 160 | + oradata_disk_size: 20 |
| 161 | + storage_pool_name: Vagrant_KVM_Storage |
| 162 | + # --------------------------------------------- |
| 163 | + db_software: LINUX.X64_213000_db_home.zip |
| 164 | + # --------------------------------------------- |
| 165 | + root_password: welcome1 |
| 166 | + oracle_password: welcome1 |
| 167 | + sys_password: welcome1 |
| 168 | + pdb_password: welcome1 |
| 169 | + # --------------------------------------------- |
| 170 | + ora_languages: en,en_GB |
| 171 | + # --------------------------------------------- |
| 172 | + db_name: DB213H1 |
| 173 | + pdb_name: PDB1 |
| 174 | + cdb: false |
| 175 | + adg: false |
| 176 | + # --------------------------------------------- |
| 177 | + |
| 178 | +## Running scripts after setup |
| 179 | + |
| 180 | +You can have the installer run scripts after setup by putting them in the `userscripts` directory below the directory where you have this file checked out. Any shell (`.sh`) or SQL (`.sql`) scripts you put in the `userscripts` directory will be executed by the installer after the database is set up and started. Only shell and SQL scripts will be executed; all other files will be ignored. These scripts are completely optional. |
| 181 | +Shell scripts will be executed as the root user, which has sudo privileges. SQL scripts will be executed as SYS. |
| 182 | +To run scripts in a specific order, prefix the file names with a number, e.g., `01_shellscript.sh`, `02_tablespaces.sql`, `03_shellscript2.sh`, etc. |
| 183 | + |
| 184 | +## Note |
| 185 | + |
| 186 | +- `SYSTEM_TIMEZONE`: `automatically set (see below)` |
| 187 | + The system time zone is used by the database for SYSDATE/SYSTIMESTAMP. |
| 188 | + The guest time zone will be set to the host time zone when the host time zone is a full hour offset from GMT. |
| 189 | + When the host time zone isn't a full hour offset from GMT (e.g., in India and parts of Australia), the guest time zone will be set to UTC. |
| 190 | + You can specify a different time zone using a time zone name (e.g., "America/Los_Angeles") or an offset from GMT (e.g., "Etc/GMT-2"). For more information on specifying time zones, see [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). |
| 191 | +- Wallet Zip file location `/tmp/wallet_<pdb name>.zip`. |
| 192 | + Copy the file on client machine, unzip and set TNS_ADMIN to Wallet loc. Connect to DB using Oracle Sql Client or using your App |
| 193 | +- Using KVM/libVirt provider you may need add a firewall rule to permit NFS shared folder mounted on the guest |
| 194 | + |
| 195 | + example: using 'uwf' : `sudo ufw allow to 192.168.121.1` where 192.168.121.1 is the IP for the `vagrant-libvirt` network (created by vagrant automatically) |
| 196 | + |
| 197 | + virsh net-dumpxml vagrant-libvirt |
| 198 | + <network connections='1' ipv6='yes'> |
| 199 | + <name>vagrant-libvirt</name> |
| 200 | + <uuid>d2579032-4e5e-4c3f-9d42-19b6c64ac609</uuid> |
| 201 | + <forward mode='nat'> |
| 202 | + <nat> |
| 203 | + <port start='1024' end='65535'/> |
| 204 | + </nat> |
| 205 | + </forward> |
| 206 | + <bridge name='virbr1' stp='on' delay='0'/> |
| 207 | + <mac address='52:54:00:05:12:14'/> |
| 208 | + <ip address='192.168.121.1' netmask='255.255.255.0'> |
| 209 | + <dhcp> |
| 210 | + <range start='192.168.121.1' end='192.168.121.254'/> |
| 211 | + </dhcp> |
| 212 | + </ip> |
| 213 | + </network> |
| 214 | +- If you are behind a proxy, set the following env variables |
| 215 | + - (Linux/MacOSX) |
| 216 | + - export http_proxy=http://proxy:port |
| 217 | + - export https_proxy=https://proxy:port |
| 218 | + - (Windows) |
| 219 | + - set http_proxy=http://proxy:port |
| 220 | + - set https_proxy=https://proxy:port |
0 commit comments