why do I have problems connecting remotely to oracle? - oracle

I'm trying to connect to oracle database on the following ip 192.168.1.1 port 1521
The firewall is off
but I'm still unable to connect i get the following error while using oracle sql developer: "the network adapter could not establish the connection"
The port 1521 is opened since i could connect to it on localhost
any help?

The port 1521 is opened since i could connect to it on localhost
Unless you've configured your listener with multiple addresses, it will only be listening on one, and since you can connect with localhost then it's (only) using that one. You can verify that with lsnrctl status which will show either localhost or 127.0.0.1, but not the external IP address 192.168.1.1.
You need to reconfigure your listener to use 192.168.1.1 instead of, or as well as, localhost before you'll be able to connect to it from anywhere else.

Related

Oracle Database Connection Running on Virtual Machine

I'm trying to connect to Oracle database hosted in a Linux Virtual Machine, using SQL Developer. Any leads on how to go about it?
I tried connecting using the IP address as HostName. But doesn't work.
In SQL Developer, create a new connection using the following
Connection Name:
Username: The username you use to log into the database
Password:
Hostname: The IP address of the virtual machine
Port: 1521
SID: The Oracle SID of the database you want to connect to
Status : Failure -Test failed: IO Error: The Network Adapter could not
establish the connection (CONNECTION_ID)
This error is almost always caused by a firewall. Make sure the local firewall on the database VM has opened the port 1521 for external connections. It can also sometimes be caused by anti-virus software on the client, preventing outgoing connections that haven't been whitelisted, but this is less common.

How to connect laravel with Firebird database? [duplicate]

I'm trying to connect to a remote Firebird database "test" (alias already added). It is not an embedded server, and is installed on VM with IP 192.168.1.147.
Here is my connection string:
User=sysdba;Password=masterkey;Database=test;DataSource=192.168.1.147
However I got an error:
FirebirdSql.Data.FirebirdClient.FbException (0x80004005): Unable to complete network request to host "192.168.1.147". ---> Unable to complete network request to host "192.168.1.147".
I've done some research on that but haven't got a clue yet. Some help needed. Thanks
My IP address is 192.168.2.108, and I can ping that server IP successfully
Make sure that
Firebird is running
Firebird is listening on port 3050 on the specified IP (or on 0.0.0.0)
Your firewall allows access to port 3050
You're using the correct host name
For Linux, the Firebird port is closed by default. You need to modify RemoteBindAddress in /etc/firebird/2.5/firebird.conf from
RemoteBindAddress = localhost
to
RemoteBindAddress =
and restart service.
Make sure you have excluded tcp port 3050 in VMs' firewall.
Ok. I think your connection to firebird is faililing because the firebird client looks up the network service file by name and does not find gds_db in the services file.
If your connection string refers to the host by using IP, the Client might fail to identify it because it gethostbyname() and not by IP
Manually include this in the file and you should be fine.
C:\windows\system32\drivers\etc\services

Vagrant Running Services between host and guest

I am working in a software where I am running a couple of specific web service in the host machine and I want to access them from the guest machine. These are the configuration of my services.
guest IP : 192.168.33.10
host IP : 192.168.1.100
The services on the host runs on port 10001, 7000. When I try to connect to the service on port 10001 everything works fine. But I cannot connect to the service in port 7000.
I connect to the service on port 10001 in the host in the following
URL http://192.168.1.100:10001
I connect to the service on port 10001 in the host in the following
URL http://192.168.1.100:7000
I get the message Failed to connect to 192.168.33.1 port 7000: Connection refused.
Can anyone tell me the reason and how to resolve it?
Stop the second service. Reconfigure the first onto 7000 port to see if it still works. If not, try a different port. If so you can rule out firewall/vagrant etc.
If it turns out to be a service specific issue, which IP address does the second service bind to? localhost/127.0.0.1/192.168.1.100? The service might never be accessible via the public IP 192.168.1.100.

How can I run Oracle XE on localhost only?

Is there a way that I can configure a XE installation on Windows to only use ports on the localhost interface and not the external interfaces? I'd like to run it for development without having anyone else be able to connect to my instance.
I tried modifying the listener.ora and tnsnames.ora file, changing the 'HOST =' entries to localhost. My hosts file has the following line in it:
127.0.0.1 localhost
When I've done this, and restarted the services, apex stops working (it doesn't listen on port 8080) and I'm unable to connect to the database using JDBC. I get the following error with JDBC:
Exception in thread "main" java.sql.SQLException: Listener refused the connection
with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect
descriptor
The Connection descriptor used by the client was:
localhost:1521:XE
I should note that both apex and JDBC work fine if I change the 'HOST = entries back to my machines hostname and restart the services.
There are two parts for this (because there are two 'technologies' serving different ports).
Firstly the listener for database port 1521. You use a SQLNET.ORA setting (tcp.invited_nodes) as a soft firewall, so the listener will ignore other nodes.
Secondly, for the 8080 PL/SQL gateway you need to use DBMS_XDB.SETLISTENERLOCALACCESS as described here

Oracle Connection exception via JDBC

I have installed Oracle 11gR2 on my machine, now when i try to connect to it using IP address as 'localhost' or '127.0.0.1' there is no issue, but when I use ip address of machine '192.168.1.6' it throws exception: Io exception: Then Network Adapter could not establish the connection.
I have installed ms loopback adapter prior to installation and my machine get IP from DHCP.
do i need to configure any setting oracle config or what i might be missing here?
Before looking at the network you need to check what address your listener is actually configured for. If it's specifying localhost or 127.0.0.1 then you won't be able to access remotely. If it's specifying a different IP previously allocated by DHCP then your current one won't work. If it's a host name, is that resolvable to your DHCP address?
As well as looking at listener.ora, you can try running netstat -an | find "1521" to see what address(es) it's actually listening on.
It's a network issue. Likely a firewall, router or proxy somewhere in the line isn't properly configured to forward the desired port.
Not a programming problem.
localhost and 127.0.0.1 are known to be the local machine. It can bypass a lot of the fluff.
When you try for 192.168.1.6, it will go and 'ask' a router (or similar) to send the traffic to that IP address. First I'd try to PING the IP address. If that works, I'd try telnet 10.253.82.33 1521 to see if you can connect to the port without involving JDBC or SQL or anything.

Resources