In 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.
[youtube http://www.youtube.com/watch?v=CrTo_XoDQwI&w=560&h=315]
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.
Once you have downloaded the zip file, extract it anywhere.
Installing Oracle Database 18c XE
Go into the extracted Oracle 18c XE Installer directory and double-click on setup.exe
. Important: Do not double-click on Oracle Database 18c Express Edition.msi
.
Click “Yes” when Windows asks you whether you want to allow this app to make changes to your device.
The installer will start up now, click “Next“.
Read the license agreement and click “I accept the terms in the license agreement“. Then click “Next“.
Choose a destination folder for where Oracle 18c XE should be installed into, or accept the default location. Then click “Next“.
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“.
On the next screen you will see the summary and confirmation of the destination folders for Oracle Database 18c XE. Click “Install“.
Now 18c XE is being installed, this can take several minutes.
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.
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“.
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"
.
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:
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.
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.
Once your installation is completed you can verify that by executing the following query: SELECT * FROM NLS_DATABASE_PARAMETERS WHERE parameter = 'NLS_CHARACTERSET';
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“.
Then enter the connection details for XE.
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.
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
.
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.
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.
Now change the three parameters INSTALLDIR
, PASSWORD
, CHAR_SET
and then save and close the file.
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!
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.
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.
I can’t get connected. I get: Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection
Hi Ross,
How are you trying to connect?
Thx,
Hi Gerald, Thanks for the reply. I am following the instructions above under the heading, “Connecting via SQL Developer”
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,
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.
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,
XE18C have many problems with network, especially on Win 10 Home, because not certified
in Sys as sysdba run …
SQL> alter system set LOCAL_LISTENER='(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))’ scope=both;
SQL> alter system register;
if necessary set tnsname :
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
(CONNECT_DATA = (SID = XE))
)
LISTENER_XE =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
and Listener:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
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”.
I tried running “sqlplus sys@localhost:1521/XE as sysdba” but I get ERROR: ORA-12541 TNS:no listener
Hi Varghese,
Can you try to reinstall as administrator and see whether you have the same problem?
Thx,
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.
Hi Donnie,
The issue is not exactly the same.
Varghese gets a
ERROR: ORA-12541 TNS:no listener
while you are getting aERROR: 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,
I am getting the same error. Just wanted to ask if you were able to resolve yours? I have installed Oracle XE 18c on windows 10 home as an admin.
Hi,
I can´t get through directory select. No matter if I put mine or use default. When I press next, it “loads for a moment” (circle symbol for mouse pointer – Win 10) and then nothing…
Please help
Simon
Hi Simon,
Can you try to install it via silent mode command line and see what the log file says?
Thx,
Getting this:
MSI (s) (A4:5C) [11:37:56:474]: Note: 1: 1708
MSI (s) (A4:5C) [11:37:56:474]: Product: Oracle Database 18c Express Edition — Installation operation failed.
MSI (s) (A4:5C) [11:37:56:477]: Windows Installer installed the product. Product Name: Oracle Database 18c Express Edition. Product Version: 18.4.0.0.0. Product Language: 1033. Manufacturer: Oracle Corporation. Installation success or error status: 1603.
Hi Andrei,
I have not come across this one yet, you may want to post it over at the forum (https://community.oracle.com/community/database/developer-tools/oracle_database_express_edition_xe/overview) and provide a few more details.
Thx,
Dear Gerald,
I’m writing to express great appreciation.
Your article has just helped me with installation of Oracle Database 18c Express Edition on Windows 8.1 Home! Yes! 8.1 Home!
I have used the silent installation. Usual installation failed 3 times.
But now I have Oracle installed. I have checked. SQL Plus works fine.
It’s great!
Thank you
HI Gerald,
I’ve tried to silent install using your method but I get the error below, what am I doing wrong here?
Product: Oracle Database 18c Express Edition — Installation operation failed.
Windows Installer installed the product. Product Name: Oracle Database 18c Express Edition. Product Version: 18.4.0.0.0. Product Language: 1033. Manufacturer: Oracle Corporation. Installation success or error status: 1603.
Derek
Hi Derek,
You are probably best off to post your issue in the Oracle Database XE Forum.
Thx,
I got this error:
[INS-08101] Unexpected error while executing the action at state: ‘summaryPage’
once I clicked ‘Yes’, it prompt this message:
java.lang.NullPointerException
please help!
Hi Raini,
You are probably best of posting your issue in the Oracle DB XE forum.
Thx,
Hi Gerald,
After succesfully installed the db, I get an error when trying to connect to the db :
Status : Failure -Test failed: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
Here is the listener.ora:
listener.ora Network Configuration File: C:\Oracle\OracleDBExpressEdition\product\18.0.0\dbhomeXE\NETWORK\ADMIN\listener.ora
Generated by Oracle configuration tools.
DEFAULT_SERVICE_LISTENER = XE
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\Oracle\OracleDBExpressEdition\product\18.0.0\dbhomeXE)
(PROGRAM = extproc)
(ENVS = “EXTPROC_DLLS=ONLY:C:\Oracle\OracleDBExpressEdition\product\18.0.0\dbhomeXE\bin\oraclr18.dll”)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.5)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
.
And the tnsnames.ora :
tnsnames.ora Network Configuration File: C:\Oracle\OracleDBExpressEdition\product\18.0.0\dbhomeXE\NETWORK\ADMIN\tnsnames.ora
Generated by Oracle configuration tools.
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
Am I missing something ?
Hi Michail,
At the first look, I do not see a TNSNames entry for the XE instance nor the PDB service, but depending how you try to connect, that may or may not matter.
I recommend you post your issue in the Oracle DB XE Forum.
Thanks,
Hello Gerald,
I tried to install XE 18c on my computer (Windows10 Pro) several times but after a few minutes during the installation a rollback process will be initiate and delete all installation folders completely.
After this rollback there is no any ORACLE folder on my drive.
So it is not possible to have a look on any logs. Only the logfile of Windows Installer with an error code 1603 but this is not helpfully for me in this case …
Definition of Error Code 1603:
“Error installing Windows Installer engine. A file which needs to be replaced may be held in use. Close all applications and try again.”
But which file is it and which tool blocked this ? I don’t know.
Here are my installations points:
– Windows10 Pro
– Run as Administrator
– my windows account belongs to the administration group
– switch off any antivirus tools and firewall during installation
– no oracle folders or systemvariables are noticed
– also tried as silent installation (see oracle doku)
Last week I posted my problem also on Oracle Database XE Forum – but without solution to solve it.
Have you any ideas what happens here and how can I solve this problem ?
Hi Tom,
Unfortunately, I myself have not come across this issue yet (also, I’m using Mac). However, I know that a couple of times we had issues that users were wrongly executing the
Oracle Database 18c Express Edition.msi
instead of thesetup.exe
, which caused unexpected errors. Could that perhaps be the case here too?I’ve also just found https://community.oracle.com/tech/developers/discussion/4271793/oracle-18c-express-edition-setup-rollback-during-installation, which may offer some insights and ideas as well.
Hope this helps!
Thx,
Hi Gerald,
in the meantime I was able to install Oracle 18 XE on my computer.
I created a second user (ADMINISTRATOR account) and the installation worked without errors, although my standard account has also admin privileges.
Thanks for your help.
Best regards
Tom
Hi Tom,
That is great to hear, thanks!
I installed Oracle 18 XE on my computer. I had trouble finding the sample HR database so I uninstalled it and was attempting to reinstall it. Unfortunately, I had a power outage while running the install wizard which caused it to terminate in the middle of the process. When my computer restarted I tried to start the install process again, I received an error saying that I had to uninstall. I did that and it seemed to complete successfully. When I tried to install it again I got the following message:
“There is an existing Oracle Database Express Edition service on this machine”
This was on the prerequisite step.
How can I clear this error?
Hi David,
Unfortunately I do not have a Windows machine anymore to test this but you can ask your question over at the Oracle DB XE Forum.
As to the HR schema, you can find it on GitHub.
Hope this helps!
Thx,