ACA Blog

ACA Blog


July 2019
M T W T F S S
« Jun    
1234567
891011121314
15161718192021
22232425262728
293031  

Categories


Running Oracle XE on OSX

Jan EerdekensJan Eerdekens

If you want to run Oracle XE on OSX you’ll quickly run into the problem that Oracle only provides a Windows & Linux, but not an OSX specific version. This means we’ll need to run Oracle XE in some sort of virtualized environment and for this we’ll use the freely available Oracle VirtualBox (version 4.8.2 r83876) and CentOS (version 6.3).

If you haven’t got VirtualBox installed yet, just download & install it. We’re going to create a CentOS 6.3 x86_64 virtual machine and for this you’ll need to download the corresponding minimal ISO first: CentOS-6.3-x86_64-minimal.iso. Now we are ready to create the virtual machine by going through the following steps:

Screen Shot 2016-01-05 at 12.22.34

Virtual Hard Drive

Screen Shot 2016-01-05 at 07.54.29

Go to the Network tab and for Adapter 1 select Bridged Adapter from the Attached to dropdown.Screen Shot 2016-01-05 at 07.55.13

Click OK to save and close the settings dialog and click Start to boot up the new machine and start the installation of CentOS.

Screen Shot 2016-01-05 at 08.03.29

 

Screen Shot 2016-01-05 at 08.04.02

 

Click Skip in the Disk Found dialog (media testing isn’t needed here).

Screen Shot 2016-01-05 at 08.04.52

Click Next in the graphical installer screen.

Screen Shot 2016-01-05 at 08.05.58

 

Choose your language and click Next (we’ll use English (English)).

 

Screen Shot 2016-01-05 at 08.07.41

Choose your keyboard layout and click Next (we’ll use U.S. English).

Screen Shot 2016-01-05 at 08.08.23

Leave Basic Storage Devices selected and click Next.

Screen Shot 2016-01-05 at 08.09.00

Click Yes, discard any data (there really isn’t any data on this newly created virtual disk anyway).

Screen Shot 2016-01-05 at 08.10.01

On the networking screen we’ll need to change a few settings so that the network interface we’ll be actually up after boot and DNS works correctly.

Screen Shot 2016-01-05 at 08.10.40

Change the Hostname to oraclexe and then click Configure Network.

Screen Shot 2016-01-05 at 09.57.54

 

Click Edit… for the System eth0 interface in the Wired tab.

 

Screen Shot 2016-01-05 at 09.58.32

 

Check the Connect automatically checkbox and in the IPv4 Settings tab select Automatic (DHCP) addresses only in the Method dropdown and add127.0.0.1,8.8.8.8,8.8.4.4 in the DNS servers field and click Apply…

Screen Shot 2016-01-05 at 12.16.52

Select your correct timezone and click Next (we’ll use Brussels, Europe)

Screen Shot 2016-01-05 at 12.17.24

Fill in a suitable root password (twice) and click Next (we’ll use oracle as password).

Screen Shot 2016-01-05 at 12.17.55

If it complains that the password is too weak just click Use Anyway.

 

Screen Shot 2016-01-05 at 12.19.12

Keep the Replace existing Linux System(s) selected and click Next.

Screen Shot 2016-01-05 at 12.19.51

Click Write changes to disk on the dialog that appears, click Next and wait while the system is being installed.

Screen Shot 2016-01-05 at 12.20.28

When the installation is done a screen will appear with a success message and a Reboot button.

Screen Shot 2016-01-05 at 12.21.00

Click the Reboot button to finish the installation and after reboot you should be presented with a terminal screen and you should be able to login in as root with the password you entered during install.

Screen Shot 2016-01-05 at 12.21.41

This is a good time to run yum update y so the system will be updated with the latest versions of several components, libraries and programs. It is also a good idea to run yum install unzip (to unzip the Oracle XE download) and yum install bc (needed by the Oracle XE install) as we’ll need this later on for the Oracle XE installation. The last thing we need to do before we can start the actual install of Oracle XE is to set the hostname in /etc/hosts. Open this file in vi and add the hostname you entered during the install of CentOS (in our case oraclexe) to the entry for 127.0.0.1. If the hostname isn’t correctly set or resolvable the Oracle XE configuration command will fail with an obscure error message. After this we just need to restart the machine for all the changes to take effect. Just run the shutdown -r nowcommand to reboot the machine.

At this point you’ll basically have an running and up to date CentOS 6.3 virtual machine that can be used for multiple purposes. So this is a good moment to create a snapshot that you can use to go back to in case of problems or to use as a base to clone new virtual machines from.

Now we’re ready to install Oracle XE 11g on this machine, but before we can actually start, we’ll first need to download it. Go to the Oracle XE download page, selectAccept License Agreement and click the Oracle Database Express Edition 11g Release 2 for Linux x64 link to download the correct Oracle XE distribution. After it has downloaded you can transfer the ZIP file to the virtual machine via SFTP using the credentials you entered during installation. You can find the correct IP address by running ifconfig -a and looking for the IP address of the eth0 interface.

Go to the location where you transfered the ZIP file, e.g. /opt, and unzip it. After unzipping go to the Disk1 subdirectory and run yum install oracle-xe-11.2.0-1.0.x86_64.rpm

After the installation you’ll need to configure Oracle XE before you can actually use it. This can be done by running /etc/init.d/oracle-xe configure as root. You’ll need to provide an port for the Apex web interface (the default 8080 will do), a port for the database listener (the default 1521 will do) and a password for the SYS/SYSTEM user (we’ll use oracle).

When this configuration completes successfully you should be able to tunnel the database listener port, 1521, to your local machine and connect to it using something like Oracle SQL Developer with user SYS or SYSTEM and the password you provided during the configuration step. Additional users can be created using SQL Developer using the information on this oracle tips site.

Belgian Java and Liferay developer with some weird interests, eternal complainer, atheist, skeptic and geocacher.

Leave a Reply

avatar
  Subscribe  
Notify of