In this video, you’re going to learn the exact steps to take to install Oracle on your
Mac computer.
This video includes step-by-step instructions on downloading and setting up the required
software, and explanations of the configurations you need to set (such as connecting to the
database).
So if you want to set up Oracle on your Mac computer, you’ll love this video.
Let’s get right into it.
Installing an Oracle database on a Mac computer is a bit different to installing it on a Windows
or Linux computer.
Oracle doesn’t support running an Oracle database directly on a Mac computer.
You can’t install Oracle Express, for example, in the same way that you can on a Windows
computer.
The good news is that you can use a Virtual Machine.
To get set up with Oracle on your Mac, the general process is shown below.
The overall process is: Step 1, Get VirtualBox
Step 2, Download the Oracle Developer VM Step 3, Set Up Oracle VM
Step 4, Run the Oracle VM Step 5, Test Using SQL Developer
Now, there are other ways to access an Oracle database on a Mac (such as using a Docker
container, or using a cloud-hosted database such as Oracle Cloud or AWS).
This video doesn’t cover those methods, but I’ll outline those in another video.
Let’s take a look at the requirements, and then get into the steps.
So, what do you need to be able to run Oracle using a VM on a Mac?
The requirements for running a virtual machine are listed on Oracle’s website and are shown
here: At least 2GB RAM.
Default VM is 1G RAM, for better performance increase.
At least 15GB of free space 2GHz processor (a lesser processor will be
acceptable but slower) Admin privileges on your computer
My current Mac is a 2018 MacBook Pro with 8GB of RAM and a 256GB hard drive, which runs
the VM pretty well.
On my previous MacBook Air (2015, 4GB RAM), it actually ran pretty slowly, because the
4GB RAM is split with 2GB for the VM and 2 GB for the Mac OS, bringing both systems to
a crawl.
MacBook Airs are not designed to be able to run intensive programs such as VMs.
If you really want to use Oracle on a Mac, but don’t quite meet the requirements, you
can use Oracle Live SQL, which is a web-based Oracle database.
Assuming you want to install Oracle on your Mac, let’s look at the steps.
The first step to getting Oracle on your Mac is to download a program called VirtualBox.
This program allows you to run virtual machines, which are self-contained operating systems.
It will let you run a Windows or Linux operating system inside your Mac.
I suggest VirtualBox because it’s free, and Oracle provides a ready-made file that
you can use with it.
To download VirtualBox: Go to the VirtualBox website, which is www.virtualbox.org/wiki/Downloads
The current version is shown at the top of the page.
Click on “OS X Hosts”.
This is a direct link to a .dmg file, which is the installer file for Mac.
The file will start downloading.
It’s approximately 120 MB.
Once the file is downloaded, open it.
Double click the VirtualBox.pkg icon in the window that appears.
Click Continue if a message appears about installing the package.
Click Continue on the welcome screen.
The installer will tell you how much space VirtualBox will take up (approx 251.8 MB).
Click Install.
Enter your password if prompted.
The program will now be installed.
Once completed, it will inform you the installation was successful.
Click Close, and move the installer to the trash.
Did you get an error saying the installation had failed for VirtualBox VM?
I got this error when attempting to install VirtualBox on 10 May 2020, running macOS Catalina
10.15.4 How can you resolve this?
I've listed the steps on a blog post that outlines this process, which you can read
in the description.
I won't go through the details now, but it involves unlocking a process on the Mac.
Now you’ve got VirtualBox installed, you need to download the file that contains the
Oracle database.
This is the virtual machine file and is provided by Oracle.
It’s called the “Oracle Developer VM” or “Oracle Developer Day VM”, as it was
originally created for developers but it has expanded since then.
To download this file: Visit the Oracle Developer Day download page
here.
I have a link in the description for this.
This page lists the versions of software it comes with.
At the time of recording, this is Oracle Linux 7 with Oracle Database 19.3.
Scroll to the bottom of the page and click the Oracle DB Develop VM link.
On the popup that appears, check the box to accept the license agreement, and click the
green Download button.
You’ll be asked to log in to your Oracle account.
If you have an account, enter your details.
If you don’t have an account, you can create one.
It’s easy and free.
Once you have logged in, the Developer Days VM file will start downloading.
It has an “ova” extension.
This file is about 7GB so may take a while.
I’ve had no issues downloading it with Chrome, but you may want to use a download manager
if your connection isn’t very good.
Now you have downloaded the Oracle VM file, it’s time to set it up.
Open VirtualBox.
I usually do this by pressing Command + Space and typing in VirtualBox.
Click File, then click Import Appliance (or click the Import button at the top of the
main screen).
The Appliance to Import screen is displayed.
Click the Choose File button on the right of the textbox, which is the little yellow
folder icon with the green arrow.
Select the DeveloperDays OVA file you have just downloaded, and click Open.
There’s no need to extract the file before opening it.
Leave the Source as Local File System Click the Continue button.
The Appliance Settings screen will show some information about the imported file.
Click Import on this Application Settings screen.
Click Agree on the popup that appears.
The import process will begin.
This process took about 2 minutes for me.
Once the installer is finished, you should see “Oracle Developer Days (Powered Off)”
on the left panel of the VirtualBox window.
This means the VM is installed but not running.
Now the installation has finished, it’s time to run the Oracle VM.
To run the Virtual Machine, click once to select “Oracle DB Developer VM” and click
the green Start arrow.
There will be a minute or so of a black screen with white text as the virtual machine loads,
and a black screen.
A Linux desktop will appear, and a moment later a terminal window will appear:
In previous versions of VirtualBox and this VM, we had to take extra steps to make the
VM visible to the host (the Mac that you are running the VM on).
We also had to set up port forwarding, which would allow us to enter in an IP address such
as “localhost” on the Mac and have it forward to the Virtual Machine.
However, this configuration is already done in the latest version.
So, these steps are no longer needed.
Once the VM is running, as mentioned above, we can connect to it using SQL Developer (or
another IDE).
The last step is to test this connection using SQL Developer.
Open SQL Developer on your mac.
If you haven’t downloaded it, you can download it from the Oracle website.
Create a new connection by clicking on the green + icon.
Enter these details for your connection: Name: whatever you like.
A name such as “VirtualBox Oracle” is OK if you can’t think of anything.
Username: hr Password: oracle
Check Save Password if you don’t want to enter the password every time.
Hostname: localhost Port: 1521
Select “Service Name” instead of “SID” Service Name: orcl
Connection Type: Basic Your connection screen should look something
like this: Click “Test” to test the connection.
The message should say “Success”, which means the connection has worked.
If it says “Listener refused the connection with the following error: 12514”, then you
likely have the Service Name incorrect.
If it says “Listener refused the connection with the following error: 12505”, then you
likely have selected SID instead of Service Name.
If it says “Test failed: ORA0-1017: invalid username/password, logon denied”, then you
likely have an incorrect username or password, or one of several other issues.
I've linked to an article below about connection issues, so if you have connection issues here
then try some of the steps in that article.
Click Save to save your connection in the list.
Click Connect.
After a moment, a new SQL worksheet window is opened on this new connection.
You can now run SQL queries on Oracle on your Mac.
This will work for as long as you have the Virtual Machine running in the background.
To test this, you can run this query: SELECT * FROM v$version;
This will show the current version of the Oracle database:
Your Mac can now access your Oracle database running on your own virtual machine!
Once you have finished with your Oracle SQL session, you can shut down your VM.
To do this, go to Machine > ACPI Shutdown.
The Virtual Machine will go back to a “Powered Off” when it’s done.
So that's how you can install Oracle on your Mac computer
If you learned something new from this video, make sure to subscribe to my channel.
If you want to learn more about database design and development, visit databasestar.com.
That’s where I share my best database-related content.
Which step from this tutorial was the most helpful?
Was it the ability to use an Oracle VM that has already been made, or the specific connection
details to use, or something else?
Thanks for watching.