1

I tried to install oracle 12c in Oracle Linux 7.4 instance upon AWS ORACLE Linux 64 EC2 instance, I could make the installation and connect to the database from the ec2 server without any issue however when I try connecting to the database from my desktop I get generic TNS Protocol adapter error.

Please find more information about my instance: 1. I have set following rule for my EC2 instance instance rule

Please note, I am not sure why i am getting every roles twice also I am not sure why type is 'Oracle -RDS', i always check the type as 'Custom TCP'

  1. hostname value from my unix

ip-xx-x-x-xxx.ap-south-1.compute.internal

  1. tnsnames.ora

ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ip-xx-x-x-xxx.ap-south-1.compute.internal)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.ap-south-1.compute.internal) ) )

  1. listener.ora

LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ip-xx-x-x-xxx.ap-south-1.compute.internal)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) )

  1. lsnrctl status

eLSNRCTL for Linux: Version 12.1.0.2.0 - Production on 30-JAN-2018 13:53:11' Copyright (c) 1991, 2014, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ip-xx-x-x-xxx.ap-south-1.compute.internal)(PORT=1521))) STATUS of the LISTENER Alias LISTENER Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production Start Date 30-JAN-2018 13:25:18 Uptime 0 days 0 hr. 27 min. 52 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/ip-10-0-0-253/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ip-xx-x-x-xxx.ap-south-1.compute.internal)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=ip-xx-x-x-xxx.ap-south-1.compute.internal)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/product/12.1.0/dbhome_1/admin/orcl/xdb_wallet))(Presentation=HTTP)(Session=RAW)) Services Summary... Service "orcl.ap-south-1.compute.internal" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... Service "orclXDB.ap-south-1.compute.internal" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... Service "pdborcl.ap-south-1.compute.internal" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service...

  1. Value from v$instance table

SQL> select host_name, instance_name from v$instance;

HOST_NAME ---------------------------------------------------------------- INSTANCE_NAME ---------------- ip-xx-x-x-xxx.ap-south-1.compute.internal orcl

I am not sure why I cannot connect from outside of ec2 instance; Please help me out of this issue

3
  • May be it's because ip-xx-x-x-xxx.ap-south-1.compute.internal is on the AWS internal network?
    – mustaccio
    Jan 30, 2018 at 18:11
  • could be ,but I am not sure ho convert this ip to public one, I have also tried using the public IP and Public DNS provided by AWS, it is not working . ideally the ip should be like ip-xx-x-x-xxxx , the .ap-south-1.compute.internal should not be there; I am not sure how get my ip as such in AWS
    – pravinsham
    Jan 30, 2018 at 18:27

1 Answer 1

2

Did you check firewall enabled or not on your Linux machine? If it is enabled then you should need to add your port 1521 for accepting requests just like the following command.

sudo iptables -I INPUT -p tcp --dport 1521 -j ACCEPT
1
  • it worked !.. thank you very much for your time and accurately pointing the solution.
    – pravinsham
    Feb 1, 2018 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.