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.
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
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:
Note: It is very important that you pass on the
" 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
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
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
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:
||The install directory location. (Replace
||The XE Database password. All users are set with this password.||
||The listener port.||
If listener port is set to 0, available ports will be automatically allocated starting from 1521.
||The EM express port.||
If EM express port is set to 0, available port will be automatically allocated starting from 5550.
||The character set of the database.||
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
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.