Skip to content

Oracle XE 18C on EC2

Qingye Jiang (John) edited this page Mar 31, 2022 · 1 revision

Oracle XE 18 C on RHEL 7

These notes work for RHEL 7 only.

  • Preparation
cd ~
sudo yum update
sudo yum install -y bc binutils elfutils-libelf elfutils-libelf-devel fontconfig-devel \
gcc gcc-c++ glibc glibc-devel ksh ksh libaio libaio-devel libgcc libnsl libnsl.i686 \
libnsl2 libnsl2.i686 librdmacm-devel libstdc++ libstdc++-devel libX11 libXau libxcb \
libXi libXrender libXrender-devel libXtst make net-tools nfs-utils smartmontools \
sysstat targetcli unixODBC wget telnet
  • Download
wget https://download.oracle.com/otn-pub/otn_software/db-express/oracle-database-xe-18c-1.0-1.x86_64.rpm
wget https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
  • Install
sudo yum localinstall oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
sudo yum localinstall oracle-database-xe-18c-1.0-1.x86_64.rpm
  • Init
sudo /etc/init.d/oracle-xe-18c configure

At the end of this command, you will see the following output:

Connect to Oracle Database using one of the connect strings:
     Pluggable database: ip-xxx-xxx-xxx-xxx.ec2.internal/XEPDB1
     Multitenant container database: ip-xxx-xxx-xxx-xxx.ec2.internal
Use https://localhost:5500/em to access Oracle Enterprise Manager for Oracle Database XE

You can verify that the service is listening on port 1521:

telnet localhost 1521
Trying ::1...
Connected to localhost.
Escape character is '^]'.
^]quit

telnet> quit
Connection closed.
  • Start / Stop Service
sudo /etc/init.d/oracle-xe-18c start
sudo /etc/init.d/oracle-xe-18c stop
  • Connect to the default database XEPDB1.
export ORACLE_HOME=/opt/oracle/product/18c/dbhomeXE
export PATH=$PATH:/opt/oracle/product/18c/dbhomeXE/bin
sqlplus system@localhost:1521/XEPDB1

In the sqlplus command, you can replace localhost with the private IP address or the hostname of the EC2 instance.

  • Create a simple table.
SQL> CREATE TABLE test (id INT, name VARCHAR(50));

Table created.

SQL> INSERT INTO test (id, name) VALUES (1, 'Test');

1 row created.

SQL> SELECT * FROM test;

	ID NAME
---------- --------------------------------------------------
	 1 Test

SQL> quit
Disconnected from Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0

Clone this wiki locally