How to install Oracle Database 18c XE on Windows

Get up and running with the free Oracle Database edition on Windows

Oracle Database 18c XE Successful InstallationIn my previous post, I demonstrated how you can install Oracle Database 18c XE on Linux. In this post, you will learn how you can install Oracle Database 18c XE on Windows. I am performing the installation on Windows 10 but it should remain the same for all Windows versions.

Preparing for the installation

Before you can start the installation, you will have to download the Oracle Database 18c XE Windows installer zip file. Head over to https://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html, click on “Accept License Agreement” and download the “Oracle Database 18c Express Edition for Windows x64” zip file.

Oracle 18c XE Download page

Once you have downloaded the zip file, extract it anywhere.

Oracle Database 18c XE extracted folder

Installing Oracle Database 18c XE

Go into the extracted Oracle 18c XE Installer directory and double-click on setup.exeImportant: Do not double-click on Oracle Database 18c Express Edition.msi.

Oracle Database 18c XE Setup

Click “Yes” when Windows asks you whether you want to allow this app to make changes to your device.

Oracle Database 18c XE User Access Control

The installer will start up now, click “Next“.

Oracle Database 18c XE Installer

Read the license agreement and click “I accept the terms in the license agreement“. Then click “Next.

Oracle Database 18c XE License screen

Choose a destination folder for where Oracle 18c XE should be installed into, or accept the default location. Then click “Next.

Oracle Database 18c XE Destination Folder Option

Specify and confirm a database password. This is the password that will be set for the SYS, SYSTEM and PDBADMIN accounts, which you will later use to connect to the database directly. Then click “Next.

Oracle Database 18c XE Database password

On the next screen you will see the summary and confirmation of the destination folders for Oracle Database 18c XE. Click “Install“.

Oracle Database 18c XE Summary screen

Now 18c XE is being installed, this can take several minutes.

Oracle Database 18c XE Installation progress

If you have the Windows Defender Firewall activated, you will be asked to allow network access to the Java Platform SE binary. Check the checkboxes to allow access to the networks of your choice and click the “Allow access” button. Note: If you do not allow network access for Java, some features of Oracle Database 18c XE might not work correctly.

Oracle Database 18c XE Windows Firewall

The installation will proceed. Once it is finished, you will be presented with a “Oracle Database Installed Successfully” summary screen that also lists the container database, pluggable database and Enterprise Manager Express connection details. Click on “Finish“.

Oracle Database 18c XE Successful Installation

Congratulations, you now have Oracle Database 18c XE installed on your Windows machine.

Installing Oracle Database 18c XE with a different character set

Oracle 18c XE ships again with all character sets, unlike 11g XE, which only shipped with AL32UTF8. Oracle did this to help users to migrate from their country or region specific character set to the recommended UTF-8 one. You can (now again) install an 18c XE with your country/region specific character set but also with UTF-8 and see whether your applications still run the same, or fix them. On that note, I urge everybody to adopt the UTF-8 character set as soon as possible. UTF-8 is a superset of all regional characters and there should be no reason from the database side of things as to why you cannot adopt it. And if there is, please let me know so that we can overcome it. You may find that in the future it will get harder and harder to use other character sets than UTF-8.

The default character set for 18c XE is, just like in 11g XE, AL32UTF8. So if your application already happily runs on 11g XE or 18c XE today, you are all set! If you want to install 18c XE with a different character set, the installer wizard unfortunately doesn’t provide you the option to choose one. Instead you will have to call the setup.exe from the command line and pass on the CHAR_SET parameter, as documented in the Globalization Support chapter. You can do this by opening a command prompt, change into the extracted Oracle Database 18c XE installer directory and call setup.exe /v"CHAR_SET=[character_set]". Let’s say you want to install Oracle Database 18c XE with the WE8ISO8859P1 character set. You will have to call setup.exe like this: setup.exe /v"CHAR_SET=WE8ISO8859P1".

Oracle Database 18c XE Character Set command line

Note: It is very important that you pass on the /v and " quotes with no space in between, just like above! Otherwise you will get the following window as error:

Oracle Database 18c XE Character Set command line error

Once you hit Enter you will once again be prompted by Windows as to whether you want to allow this app to make changes to your machine. Click “Yes” to proceed.

Oracle Database 18c XE User Access Control

Now you are back again at the same installer wizard as shown above. All steps from here on remain the same. The only difference is that the database will be created with the WE8ISO8859P1 character set.

Oracle Database 18c XE Character Set command line installer

Once your installation is completed you can verify that by executing the following query: SELECT * FROM NLS_DATABASE_PARAMETERS WHERE parameter = 'NLS_CHARACTERSET';

Oracle Database 18c XE Character Set SQL

Connecting to Oracle Database 18c XE

Connecting via SQL Developer

To connect to Oracle Database 18c XE, I highly recommend to download and install SQL Developer (please see the installation instructions for SQL Developer).

Open a new connection window by clicking on the green + sign at the top left under “Connections“.

Oracle Database 18c XE SQLDeveloper New Connection

Then enter the connection details for XE.

Oracle Database 18c XE SQLDeveloper XE Connection Details

Don’t forget to change the role to SYSDBA if you are trying to connect as SYS. Check the “Save Password” box, if you want SQL Developer to remember your password. Then click “Connect“.

A new SQL worksheet should have popped up and you are connected to Oracle Database 18c XE.

Oracle Database 18c XE SQLDeveloper Connection Success

Connecting via Command Prompt

To connect to Oracle Database 18c XE via command prompt, fire up a command prompt and type sqlplus / as sysdba, which will connect you as SYS to the container database XE.

Oracle Database 18c XE SqlPlus connect to CDB as SYS

You can switch to the pluggable database XEPDB1 by typing alter session set container=XEPDB1; You can confirm the container switch by typing show con_name which should return XEPDB1. If you do not see XEPDB1 but CDB$ROOT instead, you have not switched the container. Check for potential errors in your alter session command.

Oracle Database 18c XE SqlPlus connected to PDB as SYS

Performing a silent installation of Oracle Database 18c XE

You can also execute the installation of Oracle 18c XE silently, i.e. without having to click through the installer wizard. That method has the benefit that you can script and automate the installation. The prerequisites remain the same,  you will have to download and extract the installer zip file first. Once extracted, you will find a file called XEInstall.rsp inside the directory which is the response (or parameter) file that you have to pass on to setup.exe. You can set values for all parameters that you would otherwise be asked during the installation:

Parameter Purpose Default value
INSTALLDIR The install directory location. (Replace [USERNAME] with your current user) INSTALLDIR=C:\app\[USERNAME]\product\18.0.0\
PASSWORD The XE Database password. All users are set with this password. PASSWORD=passwordvalue
LISTENER_PORT The listener port. LISTENER_PORT=0

If listener port is set to 0, available ports will be automatically allocated starting from 1521.

EMEXPRESS_PORT The EM express port. EMEXPRESS_PORT=0

If EM express port is set to 0, available port will be automatically allocated starting from 5550.

CHAR_SET The character set of the database. CHAR_SET=AL32UTF8

Let’s say you want to install Oracle 18c XE into C:\oracle\product\18c, with the character set WE8MSWIN1252 and set the password to Hello18cXE. To do so, open the XEInstall.rsp file with the Notepad application. Right-click on the XEInstall.rsp file, click on “Open with” and choose Notepad.

Oracle Database 18c XE Silent Install Open with

Now change the three parameters INSTALLDIR, PASSWORD, CHAR_SET and then save and close the file.

Oracle Database 18c XE Silent Install Response File values

To kick off the silent installation, open a command prompt, go into the 18c XE installer directory (where you have also edited the XEInstall.rsp file) and execute the following command:

setup.exe /s /v"RSP_FILE=[Your Oracle XE Installer directory]\XEInstall.rsp" /v"/L*v [Your Oracle XE Installer directory]\setup.log" /v"/qn"

You are best of to copy/paste the command above, as the command prompt is rather unforgiving with typos. Change [Your Oracle XE Installer directory] to the path of your extracted Oracle XE Installer files directory.

Note: You will have to use absolute paths for both, the location of the response file and the location of the log file!

Oracle Database 18c XE Silent Install execution

You will be asked again by Windows whether you want to allow the app to make changes to your device. Click on “Yes” and the installation will proceed. You can bypass the pop-up by running the command prompt as Administrator. There is no installer wizard coming up anymore, as the installation is silent. So how do you check the progress of the installation? You may have noticed that the above command did specify a setup.log log file, which is a detailed (and rather big) log of the installation process. Once the installation is successfully finished, you will see the following at the bottom of the log file:

Product: Oracle Database 18c Express Edition -- Installation operation completed successfully.

Oracle Database 18c XE Silent Install execution

Note: If the Windows Defender firewall is activated, you may still get a pop-up to allow or deny the Java Platform SE access to your networks. There is no way around this in a silent installation. If you want a truly silent installation you may want to have the Windows Defender firewall already appropriately configured to avoid the pop-up.

Congratulations, you have successfully performed a silent Oracle Database 18c XE installation on your Windows machine.

For more information about the silent installation, see the Performing a Silent Installation section in the documentation.

Author: Gerald

Developer, Oracle expert, performance enthusiast and genuine technology geek.

11 thoughts on “How to install Oracle Database 18c XE on Windows”

        1. Sure thing! Where is the database running? What connect details did you specify? Is there a firewall running preventing you to reach the database? The error basically means that SQL Developer can’t reach the database.

          Thx,

          Like

          1. Thanks for the context. I am new to MySQL; I was using Postgres before, and that was pretty straightforward. I have been following installation instructions in a book to learn MySQL, and instructions from Oracle, and from this page. So I tried a few things for the connection details, and lastly I tried what you have printed above. I presumed this was local, but maybe I’m wrong? I am starting from scratch and I want to be able to create a database, I presume, as I did when I was using Postgres. I spent most of the day Googling to try to figure out why it wasn’t working. Thanks for your patience.

            Like

            1. Hi Ross,

              This blog post isn’t about MySQL, it’s about Oracle Database Express Edition, just to clarify.
              If you have just installed Oracle XE on Windows, you should have no issues opening a command prompt and connect via “sqlplus / as sysdba” as shown in the post. If you cannot connect via that then most likely something went wrong during the installation. If you can connect like that, then it’s merely a question of connection details that are wrong or need to be reconfigured. Can you try to connect via “sqlplus / as sysdba”?

              Thx,

              Like

  1. Hi Gerald, The Installation went through and I received the “Installation Successful” message exactly the way you have displayed here.
    I then tried to connect to the Oracle Database using sqlplus (sqlplus / as sysdba) as you have mentioned.
    When I start it, I get the message “ERROR: ORA-12560: TNS: protocol adapter error”, but I got the login prompt, so I log in using user-name: sys and my password and I get the same ERROR again.
    I have not installed Oracle specifically using “Run as Administrator”.

    Like

        1. I have the same problem as above, installs successfully but then “ERROR: ORA-12560: TNS: protocol adapter error” when I try to login. I have installed as administrator.

          Like

          1. Hi Donnie,

            The issue is not exactly the same.
            Varghese gets a ERROR: ORA-12541 TNS:no listener while you are getting a ERROR: ORA-12560: TNS: protocol adapter error

            Your error suggests that the firewall is blocking the connection.
            Varghese error suggests that the listener isn’t running (or wasn’t setup correctly during the install).

            Thx,

            Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.