0

I have oracle database on my computer that i am accessing through a java program using localhost:1521 more precisely using ojdbc7 and host String as "jdbc:oracle:thin:@localhost:1521:orcl". Everything is working fine but now I want to access same database through another computer with different internet connection. I read that I have to change listener.ora file and add ip address where localhost is.

Now I have tried using ip address of my computer which i have set to 192.168.1.5 in network connection and same in listener.ora file and created a virtual server in my router settings and set this same ip address and port there as well. Still when I try to connect to server computer's Internet IP(not 192.168.1.5) it states "TNS:no listener".

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

Firewall is off. I have also tried using 127.0.0.1 and creating virtual server for that in router as well but didn't work. Oracle 11g is installed on both server and client's computer.

I have also tried using 0.0.0.0 ip in listener.ora file so it may listen to all ip's but that didn't work as well.

Can someone point me in the right direction.

Edit: Different internet connection means one is my home internet (ip:39.40.xx.1xx) other is my friends home internet (different ip) we live few miles apart and use same ISP. My computer is acting as server which is using Windows 10. Its firewall is disabled. I am assuming that my friend would use my internet IP address which would be forwarded to my computer (192.168.1.5)

  • What does "different internet connection" mean? Are these two computers on the same network segment? Or are you trying to connect across a NAT? You've given two local IP addresses but I'm not sure whether those are local addresses in the same network segment or different network segments. What firewalls (hardware and software) are in place? If they are on the same network, I would expect that one of the two systems has a firewall that prevents the connection. – Justin Cave Sep 15 '16 at 20:45
  • Based on a recent edit request it appears as if you have created a duplicate account. If this is true please merge your accounts and you will be able to freely edit your question and comment on it. – Erik Sep 15 '16 at 21:57
  • Thank Erik, Thanks Justin for the reply... I have edited the question to make it more clear about what i mean by different internet connections and firewall.. I want my computer's Oracle database to be accessed by someone over the internet which may or may not be provided by same ISP and things i have tried to make it work are in question. I have used server computer's public ip to connect... public ip(provided by ISP): 39.40.29.xxx server computer network conn IP and listener setting ip: 192.168.1.5 – noumanniazi Sep 15 '16 at 22:19
  • If edit is not approved here it is: Edit: Different internet connection means one is my home internet(ip:39.40.xx.1xx) other is my friends home internet(different ip) we lvie few miles apart and use same ISP..(my computer is acting as server)which is using windows 10 its firewall are disabled..I am assuming that my friend would use my internet ip address which would be forwarded to my computer(192.168.1.5).. – noumanniazi Sep 15 '16 at 22:20
  • I would be very surprised if your ISP allowed connections on arbitrary ports between computers on your network and computers on your friend's network. If it did, you would need a public IP address-- the two IP addresses you posted are local, neither would be addressable from the other person's network. – Justin Cave Sep 16 '16 at 6:50
2

Presuming port forwarding and network items are working as expected (can be checked with telnet host 1521).

Make sure that you restart the listener service.

Also connect to the database from your local machine and run the following commands:

ALTER SYSTEM SET LOCAL_LISTENER = "(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.5)(PORT=1521))";

ALTER SYSTEM REGISTER;

Outside of that it looks good from a listener config side.

  • Thank You!! i checked portforwarding through www.canyouseeme.org as well as my friends computer it was successful...and made these changes you stated and now everything is working fine.. – noumanniazi Sep 16 '16 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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