DEV Community

Cover image for Oracle Fleet Patching and Provisioning using BrokeDBA Vagrant fork
Project-42
Project-42

Posted on

Oracle Fleet Patching and Provisioning using BrokeDBA Vagrant fork

I didn't have the opportunity yet to test anything related to Oracle Fleet Patching and Provisioning but a BrokeDBA's tweet, made me realised I really should check it out:



Since BrokeDBA forked the Official Vagrant git and added a couple of interesting scripts, I decided to try it out using my recent installed VirtualBox (but you can use Libvirt)

The first thing I needed to do is to test Vagrant with VirtualBox, so I decided to create a simple Oracle 8 Box:

|=| server in ~/Vagrant_VBox β—‹ β†’ vagrant init oraclelinux/8 https://oracle.github.io/vagrant-projects/boxes/oraclelinux/8.json
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

|=| server in ~/Vagrant_VBox β—‹ β†’ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'oraclelinux/8' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'https://oracle.github.io/vagrant-projects/boxes/oraclelinux/8.json'
    default: URL: https://oracle.github.io/vagrant-projects/boxes/oraclelinux/8.json
==> default: Adding box 'oraclelinux/8' (v8.3.182) for provider: virtualbox
[....]
==> default: Mounting shared folders...
    default: /vagrant => /home/solifugo/Vagrant_VBox

|=| server in ~/Vagrant_VBox β—‹ β†’ vagrant ssh
Welcome to Oracle Linux Server release 8.3 (GNU/Linux 5.4.17-2036.100.6.1.el8uek.x86_64)
[....]
[vagrant@localhost ~]$ head -1 /etc/*rel*
==> /etc/oracle-release <==
Oracle Linux Server release 8.3
[....]
[vagrant@localhost ~]$
Enter fullscreen mode Exit fullscreen mode

Let's try "BrokenDBA's FFP" now πŸ˜„

First, cloning the github and making sure we have the software ISOs (both 12.1 and 19c) located in the right place

|=| server in /kvm/SDD/Vagrant_FPP β—‹ β†’ git clone https://github.com/brokedba/OracleFPP.git
Cloning into 'OracleFPP'...
remote: Enumerating objects: 56, done.
remote: Counting objects: 100% (56/56), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 218 (delta 26), reused 0 (delta 0), pack-reused 162
Receiving objects: 100% (218/218), 309.18 KiB | 1.24 MiB/s, done.
Resolving deltas: 100% (107/107), done.

|=| server in /kvm/SDD/Vagrant_FPP β—‹ β†’

|=| server in /kvm/SDD/Vagrant_FPP β—‹ β†’ tree
.
└── OracleFPP
    β”œβ”€β”€ config
    β”‚   β”œβ”€β”€ neofetch_config.conf
    β”‚   └── vagrant.yml
    β”œβ”€β”€ images
    β”‚   β”œβ”€β”€ fpp_vagrant_yml.png
    β”‚   β”œβ”€β”€ OracleFPP.png
    β”‚   └── westworld1.jpg
    β”œβ”€β”€ ORCL_software
    β”‚   β”œβ”€β”€ check_crs.sh
    β”‚   β”œβ”€β”€ check_pdb.sql
    β”‚   β”œβ”€β”€ fpp_software.png

    β”‚   β”œβ”€β”€ linuxamd64_12102_database_1of2.zip   <<<<<<<<<<
    β”‚   β”œβ”€β”€ linuxamd64_12102_database_2of2.zip   <<<<<<<<<<
    β”‚   β”œβ”€β”€ LINUX.X64_193000_db_home.zip         <<<<<<<<<<
    β”‚   β”œβ”€β”€ LINUX.X64_193000_grid_home.zip       <<<<<<<<<<

    β”‚   β”œβ”€β”€ put_Oracle-software_here.txt
    β”‚   └── rac-status.sh
    β”œβ”€β”€ README.md
    β”œβ”€β”€ scripts
    β”‚   β”œβ”€β”€ 01_setup_u01.sh
    β”‚   β”œβ”€β”€ 01_setup_u02.sh
    β”‚   β”œβ”€β”€ 02_install_os_packages.sh
    β”‚   β”œβ”€β”€ 03_setup_hosts.sh
    β”‚   β”œβ”€β”€ 04_setup_chrony.sh
    β”‚   β”œβ”€β”€ 05_setup_shared_disks.sh
    β”‚   β”œβ”€β”€ 06_setup_users.sh
    β”‚   β”œβ”€β”€ 07_setup_user_equ.expect
    β”‚   β”œβ”€β”€ 08_asmfd_label_disk.sh
    β”‚   β”œβ”€β”€ 08_asmlib_label_disk.sh
    β”‚   β”œβ”€β”€ 10_gi_setup.sh
    β”‚   β”œβ”€β”€ 12_Setup_FPP.sh
    β”‚   β”œβ”€β”€ 13_Setup_db.sh
    β”‚   β”œβ”€β”€ oracle-rdbms.service
    β”‚   β”œβ”€β”€ ora-response
    β”‚   β”‚   β”œβ”€β”€ dbca.rsp.tmpl
    β”‚   β”‚   └── db_install.rsp.tmpl
    β”‚   └── setup.sh
    β”œβ”€β”€ userscripts
    β”‚   └── put_custom_scripts_here.txt
    └── Vagrantfile

7 directories, 34 files

|=| server in /kvm/SDD/Vagrant_FPP β—‹ β†’
Enter fullscreen mode Exit fullscreen mode

I did a small change to ./config/vagrant.yml file, since the ASM disk Path is originally set to "C:\" and I'm using Linux. Needed also to change the default VirtualBox VMs base location to a bigger filesystem

|=| server in /kvm/SDD/Vagrant_FPP/OracleFPP Β± |master U:1 ?:9 βœ—| β†’ cat config/vagrant.yml
  [....]
  asm_disk_path: /kvm/SDD/Vagrant_FPP/disks
  asm_disk_num:   6
  asm_disk_size: 10
  [....]

|=| server in ~/VirtualBox VMs β—‹ β†’ vboxmanage setproperty machinefolder /kvm/SDD/Vagrant

|=| server in ~/VirtualBox VMs β—‹ β†’  
Enter fullscreen mode Exit fullscreen mode

Everything is ready to go, so let's just make vagrant to do its magic

|=| server in /kvm/SDD/Vagrant_FPP/OracleFPP Β± |master U:1 ?:4 βœ—| β†’ vagrant up
--------------------
Detected virtualbox
--------------------
Installing vagrant-reload Plugin...
Installing the 'vagrant-reload' plugin. This can take a few minutes...
Building native extensions. This could take a while...
Building native extensions. This could take a while...
Fetching fog-libvirt-0.8.0.gem
Fetching vagrant-reload-0.0.1.gem
Successfully uninstalled fog-libvirt-0.7.0
Installed the plugin 'vagrant-reload (0.0.1)'!
Installing vagrant-proxyconf Plugin...
Installing the 'vagrant-proxyconf' plugin. This can take a few minutes...
Building native extensions. This could take a while...
Building native extensions. This could take a while...
Fetching vagrant-proxyconf-2.0.10.gem
Installed the plugin 'vagrant-proxyconf (2.0.10)'!
Bringing machine 'host1' up with 'virtualbox' provider...
Bringing machine 'host2' up with 'virtualbox' provider...
==> host1: Box 'ol74' could not be found. Attempting to find and install...
    host1: Box Provider: virtualbox
    host1: Box Version: >= 0
==> host1: Box file was not detected as metadata. Adding it directly...
==> host1: Adding box 'ol74' (v0) for provider: virtualbox
    host1: Downloading: https://yum.oracle.com/boxes/oraclelinux/ol74/ol74.box
==> host1: Successfully added box 'ol74' (v0) for 'virtualbox'!
==> host1: Importing base box 'ol74'...
==> host1: Matching MAC address for NAT networking...
==> host1: Setting the name of the VM: london-fleet-fpp-Server
==> host1: Clearing any previously set network interfaces...
==> host1: Preparing network interfaces based on configuration...

[....]

    host1: -----------------------------------------------------------------
    host1: INFO: 2021-01-18 17:26:55: Grid Infrastructure configuration as 'RAC'
    host1: INFO: 2021-01-18 17:26:55: - ASM library   : ASMLIB
    host1: -----------------------------------------------------------------
    host1: Launching Oracle Grid Infrastructure Setup Wizard...
    host1: You can find the logs of this session at:
    host1: /u01/app/oraInventory/logs/GridSetupActions2021-01-18_05-26-56PM
    host1: You can find the log of this install session at:
    host1:  /u01/app/oraInventory/logs/UpdateNodeList2021-01-18_05-26-56PM.log

[....]

    host1: === Enabling NFS SERVER ===
    host1: Created symlink from /etc/systemd/system/multi-user.target.wants/nfs-server.service to /usr/lib/systemd/system/nfs-server.service.
    host1: -----------------------------------------------------------------
    host1: INFO: 2021-01-18 18:12:48: Running user-defined post-setup scripts
    host1: -----------------------------------------------------------------
==> host2: Box 'ol74' could not be found. Attempting to find and install...
    host2: Box Provider: virtualbox
    host2: Box Version: >= 0
==> host2: Box file was not detected as metadata. Adding it directly...
==> host2: Adding box 'ol74' (v0) for provider: virtualbox
==> host2: Importing base box 'ol74'...
==> host2: Matching MAC address for NAT networking...
==> host2: Setting the name of the VM: london-fleet-fpp-Client
==> host2: Fixed port collision for 22 => 2222. Now on port 2200.
==> host2: Clearing any previously set network interfaces...
==> host2: Preparing network interfaces based on configuration...
    host2: Adapter 1: nat
    host2: Adapter 2: intnet
==> host2: Forwarding ports...
    host2: 22 (guest) => 2200 (host) (adapter 1)
==> host2: Running 'pre-boot' VM customizations...
==> host2: Booting VM...
==> host2: Waiting for machine to boot. This may take a few minutes...
    host2: SSH address: 127.0.0.1:2200
    host2: SSH username: vagrant
    host2: SSH auth method: private key
[....]
Enter fullscreen mode Exit fullscreen mode

By the way, the whole process can take very long depending on your system performance, but as long as the host1 (fpp-Server by default) is created, you can actually check the deployment process, like here where I wanted to confirm the GI installation in the server was progressing:

|=| server in /kvm/SDD/Vagrant_FPP/OracleFPP Β± |master U:1 ?:8 βœ—| β†’ vagrant ssh host1
-------------------------
Detected virtualbox
-------------------------
[....]
[vagrant@fpp-Server ~]$ sudo su -
[root@fpp-Server ~]# tail /u01/app/19.3.0.0/grid/install/root_fpp-Server_2021-01-18_16-59-57-194194477.log
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   bf8d8643f1b94fe1bf01963358729a9e (/dev/oracleasm/disks/ORCL_DISK2_P1) [DATA]
Located 1 voting disk(s).
2021/01/18 17:08:38 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
2021/01/18 17:10:42 CLSRSC-343: Successfully started Oracle Clusterware stack
2021/01/18 17:10:42 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
2021/01/18 17:13:53 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.

[root@fpp-Server ~]# ps -ef |grep pmon
grid      4066     1  0 17:10 ?        00:00:00 asm_pmon_+ASM1
grid     10180     1  0 17:14 ?        00:00:00 apx_pmon_+APX1
root     14827  9687  0 17:22 pts/0    00:00:00 grep --color=auto pmon
[root@fpp-Server ~]#
Enter fullscreen mode Exit fullscreen mode

And voilΓ ! our server and client are ready:

[....]
    host2: INSTALLER: Database created
    host2: INSTALLER: Oratab configured
    host2: ******************************************************************************
    host2:  Configure systemd to start oracle instance on startup  Mon Jan 18 20:50:55 GMT 2021
    host2: ******************************************************************************
    host2: Created symlink from /etc/systemd/system/multi-user.target.wants/oracle-rdbms.service to /etc/systemd/system/oracle-rdbms.service.
    host2: INSTALLER: Created and enabled oracle-rdbms systemd's service
    host2: INSTALLER: Done running user-defined post-setup scripts
    host2: ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN: welcome1
    host2: INSTALLER: Installation complete, database ready to use!
    host2: -----------------------------------------------------------------
    host2: ESC[0;34mINFO: ESC[0m2021-01-18 20:51:18: Running user-defined post-setup scripts
    host2: ----------------------------------------------------------------- 
Enter fullscreen mode Exit fullscreen mode

Once the initial deployment is completed, we can see the Server and Client current status, including a 12.1 DB created already (and that nice and colourful Neofetch welcome screen added by Brokedba's script 😜 )

|=| server in /kvm/SDD/Vagrant_FPP/OracleFPP Β± |master U:1 ?:12 βœ—| β†’ vssh host2
-------------------------
Detected virtualbox
-------------------------
getting Proxy Configuration from Host...
Last login: Mon Jan 18 21:55:56 2021 from 10.0.2.2
                                      vagrant@fpp-Client
      `-/+++++++++++++++++/-.`        ------------------
   `/syyyyyyyyyyyyyyyyyyyyyyys/.      OS: Oracle Linux Server 7.4 x86_64
  :yyyyo/-...............-/oyyyy/     Host: VirtualBox 1.2
 /yyys-                     .oyyy+    Kernel: 4.1.12-112.16.4.el7uek.x86_64
.yyyy`                       `syyy-   Uptime: 19 mins
:yyyo                         /yyy/   Packages: 407 (rpm)
.yyyy`                       `syyy-   Shell: bash 4.2.46
 /yyys.                     .oyyyo    Terminal: /dev/pts/0
  /yyyyo:-...............-:oyyyy/`    CPU: Intel Xeon X5670 (1) @ 2.934GHz
   `/syyyyyyyyyyyyyyyyyyyyyyys+.      GPU: VirtualBox Graphics Adapter
     `.:/+ooooooooooooooo+/:.`        Memory: 1431MiB / 5708MiB




[vagrant@fpp-Client ~]$ sudo su - oracle
Last login: Mon Jan 18 20:50:55 GMT 2021
[oracle@fpp-Client ~]$ ps -ef |grep pmon
oracle    1161     1  0 13:19 ?        00:00:00 ora_pmon_cdb1
oracle   22420 22396  0 13:41 pts/0    00:00:00 grep --color=auto pmon
[oracle@fpp-Client ~]$

[oracle@fpp-Client ~]$ . oraenv
ORACLE_SID = [cdb1] ?
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@fpp-Client ~]$ sqlplus / as sysdba
[....]

DB_NAME   DB_UNIQUE_NAME INSTANCE_NAME  CDB HOST_NAME   DATABASE_ROLE 
-------------- -------------- -------------- --- ----------- --------------
CDB1      cdb1           cdb1           YES fpp-Client  PRIMARY       


   INST_ID     CON_ID NAME      OPEN_MODE   STATUS
--------------- ---------- --------- ----------  -------
         1          2 PDB$SEED  READ ONLY   NORMAL
         1          3 PDB1      READ WRITE  NORMAL



|=| server in /kvm/SDD/Vagrant_FPP/OracleFPP Β± |master U:1 ?:12 βœ—| β†’ vssh host1
[....]
[vagrant@fpp-Server ~]$ sudo su - grid
Last login: Tue Jan 19 13:46:08 GMT 2021 on pts/0
[grid@fpp-Server ~]$
[grid@fpp-Server ~]$ ps -ef |grep pmon
grid      1577  1402  0 13:46 pts/0    00:00:00 grep --color=auto pmon
grid      7919     1  0 13:19 ?        00:00:00 asm_pmon_+ASM1
grid      9749     1  0 13:21 ?        00:00:00 apx_pmon_+APX1
grid     10710     1  0 13:21 ?        00:00:00 mdb_pmon_-MGMTDB
[grid@fpp-Server ~]$
Enter fullscreen mode Exit fullscreen mode

Like you see, as long as you have space, memory and Vagrant installed, there is nothing that stops you to try Oracle FPP.

I will try few more things on the coming days, so I hope to share more posts about Oracle FPP soon.

Thanks to BrokeDBA for sharing his experience!! 😊

Top comments (0)