Install Oracle Database 12.1 and PostgreSQL 9.4 + PostGIS on Oracle Linux 7.4

Hey everyone,

I had to install an Oracle Linux 7.4 Server with a running Oracle Database 12.1 and PostgreSQL 9.4 + PostGIS. I will share my steps below.


Install Oracle Linux 7.4

  • Select “Agent for Hypervisor” during installation


[Optional if previous step is done] Install VMWareTools

  • From vSphere client mount source
  • From VM
# mount /dev/cdrom /mnt 
# cp /mnt/VMwareTools-8.6.17-3814316.tar.gz /tmp 
# tar -xvzf /mnt/VMwareTools-8.6.17-3814316.tar.gz 
# cd /tmp/vmware-tools-distrib/ 
# ./


Configure Network settings

# ip addr add dev ens160 
# route add default gw ens160 
# vi /etc/resolv.conf add  "nameserver nameserver" 
# vi /etc/hosts add "   servername.localdomain"


Update Yum and install Oracle Prerequisites

# yum update 
# yum install oracle-rdbms-server-12cR1-preinstall.x86_64


Set “oracle” account password

# passwd oracle


Set secure Linux to permissive

By editing the “/etc/selinux/config” file, making sure the SELINUX flag is set as follows “SELINUX=permissive

Once the change is complete, restart the server or run the following command

# setenforce permissive


Disable (or configure) firewall

# systemctl stop firewalld 
# systemctl disable firewalld


Add new Disk for Oracle Data from vSphere client

Reboot the VM or rescan SCSI bus manually

# echo "- - -" > /sys/class/scsi_host/host#/scan

Replace “#” by “0”,”1″, … Can be found by running

# ls /sys/class/scsi_host

Then check if the new Disk is visible

# fdisk -l


Create a new partition and format it

# fdisk /dev/sdb

Select option “n” select “w” to write changes and exit

# mkfs.ext4 /dev/sdb1


Edit fstab

# vi /etc/fstab

Add “/dev/sdb1       /u01    ext4    defaults        1 2


Create “u01” directory, mount the new partition, create sub-folders structure and modify permissions and ownership

# mkdir u01 
# mount -a 
# mkdir -p /u01/app/oracle/product/ 
# chown -R oracle:oinstall /u01 
# chmod -R 775 /u01


Edit “/home/oracle/.bash_profile” file

# vi /home/oracle/.bash_profile

Add the following at the end of the file

# Oracle Settings

export TMP=/tmp 
export TMPDIR=$TMP
export ORACLE_HOSTNAME=servername.localdomain 
export ORACLE_UNQNAME=orcl 
export ORACLE_BASE=/u01/app/oracle 
export ORACLE_HOME=$ORACLE_BASE/product/ 
export ORACLE_SID=orcl
export PATH=/usr/sbin:$PATH 
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib 
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

Note : For the following steps to work, Xming should be installed and running. Putty should be configured to “Enable X11 Forwarding” and you have to login with oracle user directly from Putty
Upload “” and” to /tmp


Unzip the files

# cd /tmp 
# unzip 
# unzip


Install Oracle Database 12.1.02

# cd database
# ./runInstaller


Note : EM Url become https://servername.localdomain:5500/em


Set automatic DB startup for ORCL instance  

# vi /etc/oratab

Switch the “N” value to “Y” “orcl:/u01/app/oracle/product/



PostgreSQL install will come later.

Temp source:






Install VMWare Tools on Linux VM using open-vm-tools

Hello everyone,


This article will show how to install VMWare Tools on a Linux VM. For this example, I’ll do it on a Debian/Ubuntu & CentOs Distributions.

First thing to know is you can install VMWare Tools as you do on a Windows VM by Right-Clicking the VM – Guest – Install/Upgrade VMWare Tools. VMWare already has a good article on HowTo do it here.

But ! VMWare itself recommends installing 3rd Party OS VM Tools Package named “open-vm-tools” so I’ll go ahead with is installation which is easier and faster than installing VMWare’s own tools from vSphere Client.

For Debian/Ubuntu :

  • Log on to your Server as root and update apt-get
apt-get update
  • Install “open-vm-tools”
apt-get install open-vm-tools


For CentOs :

Depending on your CentOs version, you should be or not be able to install the package instantly from the default Repo if you have one of the latest version, here 7.2. If earlier version, maybe you will need to add a Repo.

  • Install “open-vm-tools”
yum install open-vm-tools
  • Start the service
service vmtoolsd start


Done. Hope this helps.


Clone and Sysprep VM without vCenter Server

When running vCenter Server, you can clone the VM and it will prompt you for new customization settings.

Without it… You will need to manually copy the VM files (or only the VMDK if you attach it to a newly created VM). Then run Sysprep to configure it and avoid duplicate SID.

  • Shutdown your VM and copy its files or VMDK to a new folder on the current or new Datastore. If you want to rename the VMDK file, copy it using “vmkfstools”.

Example :

vmkfstools -i /vmfs/volumes/server/server1.vmdk /vmfs/volumes/datastore1/cloned-server/server2.vmdk -d thin
  • Create a new VM and attach the cloned VMDK. If all files have been copied, just register the VMX file to the Inventory.
  • Boot up the VM and run Sysprep :
sysprep /oobe /generalize /reboot
Tips : You can use the switch /shutdown to turn it off after customization and then convert it to a VM Template if needed.
  • VM will reboot and ask you for customization settings.
Another and easier way to accomplish this task is to use VMWare vCenter Converter Standalone during the “Convert Machine” GUI. Or if you forgot it, you can do it through the “Configure Machine” GUI.



Activate P2V Windows XP or Server 2003 if OEM licence

Issue: After visualizing a physical Windows XP machine, Windows requires activation.

Background: After converting a PC from physical to virtual, Windows recognizes that there has been a hardware change.  This will send it into “Activation Mode”, which will require you to activate Windows XP before use.  In order to work around this, you can apply a new VALID key to your Windows XP installation.

Resolution: Recreate the converted VM’s config files, boot to the Windows installation disk and run the Repair function, which will allow you to specify a Windows XP license key.  You will need to load the VMware SCSI Controller drivers before repairing.


–  Ensure the PC is powered on and networked

  • Clean up any unnecessary data on the physical machine so that it is not converted over to the virtual environment

– Download and install the latest version of VMware Converter

–  Open VMware Converter and select “Convert machine”

  • Enter the following:
    • Select source type: Powered-on machine
    • Specify the powered-on machine: A remote machine
      • IP address or name: <PC Name>
      • User name: <Admin user on source PC>
      • Password: <Password>
      • OS Family: Windows
  • Click Next

– When prompted with the following, choose “Automatically uninstall the files when import succeeds” and click Yes

– In the Destination System screen, enter the following and click Next:

  • Select destination type: VMware Infrastructure virtual machine
  • Server: <VMware host or Vcenter management server>
  • User name: <VMware user with Admin rights>
  • Password: <Password>

– In the Destination Virtual Machine screen, enter the following and click Next:

  • Name: <PC Name>
  • In the “Inventory for:” field, select the destination

– In the Destination Location screen, select the host for the new VM, then choose the appropriate datastore and click Next

– In the Summary screen:

  • Click Edit in the “Data to copy” field
    • Choose the “Destination layout” tab and highlight C:
    • Click the “Size/Capacity” drop-down and choose “Type size in GB”
    • Enter the required size of the drive…make this as small as possible to preserve space, e.g. if there is only 26GB of used space on the physical machine, make the new virtual disk 30GB
  • Click Edit in the “Services” field
    • Check the boxes to stop any services that could slow the conversion process (i.e. antivirus)
  • Click Next

– Click finish and Converter will create the new VM…the process may take over an hour depending on your disk size.

– Once the VM is created, open Vsphere client and connect to your host.

– Switch to the Datastores and Datastore Clusters view and select the datastore that you created the VM on

  • Click “Browse this datastore” and locate the VM that you just created
  • In the VM’s directory, delete all files except for the .VMDK and .VMX files
  • Upload the Windows XP SP3 ISO and VMware SCSI Driver floppy image to the datastore

– Switch back to the Hosts and Clusters view in Vsphere and power on the VM

  • When prompted, choose the option “I moved it” and click OK

– The VM will boot, when you try to log on, it will prompt you for activation

  • Click Cancel and the VM will shutdown

– Edit the VM’s settings

  • Connect the XP ISO as the disk drive and the SCSI driver as the floppy drive (you may need to add a floppy drive)
  • Under the Options tab > Boot Options, check the box in the “Force BIOS Setup” field
  • Click OK and boot the VM

– When the VM boots to the BIOS, set the disk drive as the primary boot device, save changes and exit, you will then boot to the XP installer

– When prompted, press F6 to load third party SCSI drivers

– Hit S to Specify Additional Device

– Hit ENTER to select the VMware SCSI Controller, then hit ENTER again to continue with Windows Setup

– Hit ENTER to set up Windows

– When prompted, select R to repair the existing Windows XP installation.

– After going through the standard installation procedure and entering a valid XP license key, Windows will boot as normal and you will not be prompted to activate

– Network settings may have to be applied manually to bring the VM online, depending on your environment


Source :


VM inaccessible or invalid

If some VMs appear as invalid or inaccessible (often due to a power outage, storage unavailable, …)


You can use the following PowerShell command line through PowerCLI :

Get-View -ViewType VirtualMachine | Where {$_.Runtime.ConnectionState -eq “inaccessible”} | %{$_.reload()}

Replace “inaccessible” by “invalid” if required.

This will reload the VMs  and bring them back if the repository is available.


Configure ESXi SNMP

To configure and enable SNMP on ESXi, connect to your host using SSH and execute the following commands.

  • Set community to “public”
esxcli system snmp set --communities=public
  • Set the target IP who will receive SNMP information on port 161
esxcli system snmp set --targets XXX.XXX.XXX.XXX@161/public
  • Enable SNMP
esxcli system snmp set --enable true