How to Enable Remote Access to Oracle Database 23ai

Oracle Database 23ai is a powerful database management system with cutting-edge AI capabilities, but by default, it is locked down for security reasons. If you need to connect to your Oracle 23ai database remotely, you must configure it properly. In this guide, I’ll walk you through the process in a step-by-step to enable remote access to Oracle Database 23ai.

If you haven’t installed the database, you can visit my previous article on How to Install Oracle Database 23ai on Oracle Linux. So in this article, I will configure and connect to my Oracle Database 23ai installed on Oracle Linux version 9. This is a cloud server. Which means, I am running my Oracle Linux on Oracle Cloud Infrastructure.

Steps to Enable Remote Access to Oracle Database 23ai

Step 1. Modify listener.ora file

Oracle Listener is responsible for managing incoming database connections. To enable remote access, you need to modify the listener.ora configuration file. Listener.ora tipycally located in $ORACLE_HOME/network/admin/listener.ora.

Open the listener.ora using favorite text editor. In this example, I use nano.

sudo nano $ORACLE_HOME/network/admin/listener.ora

Change the HOST value to 0.0.0.0

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

Restart listener service

lsnrctl stop
lsnrctl start

Step 2. Open Firewall Port

We need to allow traffic on port 1521. Simply use the following command

sudo firewall-cmd --permanent --add-port=1521/tcp
sudo firewall-cmd --reload

Step 3. Test Remote Connection

Now we can try to connect to the Oracle Database from the network.

Using SQLPLUS

If we use SQLPLUS, use the following command. Modify your_user, your_password, your_server_ip, orcl with your database detail.

 sqlplus your_user/your_password@your_server_ip:1521/orcl

For example, in my case:

sqlplus DHANI/Oracle.12345@192.168.100.211:1521/FREEPDB1

Using SQL Developer

Download SQL Developer if you haven’t done so. Run the app and then enter your Oracle Credentials