unable to ping Oracle port 1521 in Azure VM but other ports are working fine

Mahesh Babu 1 Reputation point
2022-12-16T23:06:20.61+00:00

I have created a VM(RHEL -linux) in Azure and installed Oracle DB on it. I want to connect to Oracle DB using 'Oracle SQL Developer' in my Windows system. The below are the Listener and tnsnames details.

cat listener.ora  
# listener.ora Network Configuration File: /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora  
# Generated by Oracle configuration tools.  
SID_LIST_LISTENER =  
  (SID_LIST =  
    (SID_DESC =  
           (GLOBAL_DBNAME = ORCLCDB)  
           (ORACLE_HOME = /opt/oracle/product/19c/dbhome_1)  
           (SID_NAME = ORCLCDB)  

The entries of tnsnames.ora cat tnsnames.ora

# tnsnames.ora Network Configuration File: /opt/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora  
# Generated by Oracle configuration tools.  
  
ORCLCDB =  
  (DESCRIPTION =  
    (ADDRESS = (PROTOCOL = TCP)(HOST = azurerhel.internal.cloudapp.net)(PORT = 1521))  
    (CONNECT_DATA =  
      (SERVER = DEDICATED)  
      (SERVICE_NAME = ORCLCDB)  
    )  
  )  
  
LISTENER_ORCLCDB =  
  (ADDRESS = (PROTOCOL = TCP)(HOST = azurerhel.internal.cloudapp.net)(PORT = 1521))  
            )  
    )  
    LISTENER =  
      (DESCRIPTION_LIST =  
        (DESCRIPTION =  
          (ADDRESS = (PROTOCOL = TCP)(HOST = azurerhel.internal.cloudapp.net)(PORT = 1521))  
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))  
        )  
      )  
    ADR_BASE_LISTENER = /opt/oracle  

Oracle service is working fine without any issues. and lsnrctl status is showing the url for that's different from those showing in above file.

Alias                     LISTENER  
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production  
Start Date                10-DEC-2022 06:23:21  
Uptime                    6 days 7 hr. 14 min. 55 sec  
Trace Level               off  
Security                  ON: Local OS Authentication  
SNMP                      OFF  
Listener Parameter File   /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora  
Listener Log File         /opt/oracle/diag/tnslsnr/azureRHEL/listener/alert/log.xml  
Listening Endpoints Summary...  
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=azureRHEL.tolzstizeobujjzahdvcdkfbwa.rx.internal.cloudapp.net)(PORT=1521)))  
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))  
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=azureRHEL.tolzstizeobujjzahdvcdkfbwa.rx.internal.cloudapp.net)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/ORCLCDB/xdb_wallet))(Presentation=HTTP)(Session=RAW))  
Services Summary...  
Service "ORCLCDB" has 1 instance(s).  
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...  
Service "ORCLCDBXDB" has 1 instance(s).  
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...  
Service "ef748d50f3d7d6efe0530400000a867c" has 1 instance(s).  
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...  
Service "orclpdb1" has 1 instance(s).  
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...  
The command completed successfully  

But when i am pinging from my windows PC, all the other ports(80,22,443) are connecting fine but not port 1521.

271478-capture.png

I have already set up inbound rules for windows firewall in my PC and VM side port 1521 is opened at Azure VM as well.
271479-image.png

271457-image.png

I have gone through lot of search but nothing could resolve the issue and and i am unable to connect my SQL Developer. Could somebody who is expert in this networking issues shed light on this?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,013 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anders Jensen 106 Reputation points
    2022-12-18T03:10:21.943+00:00

    Are you able to connect to that port from inside the RHEL VM?
    Is there a local firewall on the RHEL VM that needs to allow traffic on TCP/1521?

    0 comments No comments

  2. dkrishnaveni-MSFT 1,961 Reputation points Microsoft Employee
    2022-12-26T15:45:50.903+00:00

    Hi,

    On your netstat results, I see that port 1521 is listening on tcp6 which is TCP on IPv6 address. Can you make sure that your service is listening on IPv4 address and then try again?

    Regards,
    Divya

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.