Oracle connection problem on Mac OSX: "Status : Failure -Test failed: Io exception: The Network Adapter could not establish the connection" - oracle

I'm trying this with Oracle SQL Developer and am on an Intel MacBook Pro. But I believe this same error happens with other clients. I can ping the server hosting the database fine so it appears not to be an actual network problem.
Also, I believe I'm filling in the connection info correctly. It's something like this:
host = foo1.com
port = 1530
server = DEDICATED
service_name = FOO
type = session
method = basic

That's the message you get when you don't have the right connection parameters. The SID, in particular, tends to trip up newcomers.

If you want to connect to database on other host then you need to know
hostname
port number (by default 1521)
SID name
if you get the connection error that you mentioned in your question then you have not specified correctly either hostname or port number. Try
telnet hostname portnumber
from Terminal to verify if you can connect to portnumber (by default 1521) - if not then probably port number is incorrect.

My problem turned out to be some kind of ACL problem. I needed to SSH tunnel in through a "blessed host". I put the following in my .ssh/config
Host=blessedhost
HostName=blessedhost.whatever.com
User=alice
Compression=yes
Protocol=2
LocalForward=2202 oraclemachine.whatever.com:1521
Host=foo
HostName=localhost
Port=2202
User=alice
Compression=yes
Protocol=2
(I don't think the second block is really necessary.) Then I change the host and port in the oracle connection info to localhost:2202.

Related

How to fix IO Error: The Network Adapter could not establish the connection

I am trying to connect my oracle cloud database using sqldeveloper with connection type basic but it fails connection with error:
Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection.
Anyone can help how can i connect my oracle db system using sqldevloper with connection type either basic or TNS ??
Have you tried to telnet the server on port 1521?
It sounds likely that the dbsystem is not connected to the internet.
Please check if the dbsystem subnet has:
Security List with a rule to allow port 1521 on your ip address
Routing Table that allows internet access via internet gateway

curl_easy_setopt(curl, CURLOPT_FTPPORT, str) on a remote computer - address is not available

I am trying to use the function 'curl_easy_setopt' with 'CURLOPT_FTPPORT' option, for changing the mode from passive to active.
On the local computer the function is working as expected.
On the remote computer when I am using curl_easy_setopt(curl, CURLOPT_FTPPORT, "-") - there is a connection (I can see that in the filezilla-server log, also files are transferring).
But, when I am using curl_easy_setopt(curl, CURLOPT_FTPPORT, "TEST_STRING" )//TEST_STRING includes ip:port, there is no connection. In the filezilla-server log the following information appears:
bind (port=21) on non local address filed: address not available
Rejected command, Requested IP address does not match control connection IP
my code:
curl_easy_setopt(m_curl, CURLOPT_FTPPORT, "192.168.19.19:21");
rc = curl_easy_perform(m_curl);
the rc returns CURL Error 28 - Timeout was reached.
In addition, I have tried several ports, and I have checked them with netstat command.
Your value of CURLOPT_FTPPORT is wrong.
First, it cannot be port 21. It must be a free local port. On most systems it also has to be above 1024.
And the IP address must be your local address, not the FTP server address. And it must be the address, from which the FTP server accepts your connection.
And in general, you should use the passive mode, not the active mode. See my article on FTP Connection Modes for details.

How do I find out whats closing my port?

On a Windows Server 2016 Standard, 64-bit, x64-based server, I try to connect to a specific port (1807) to access a third party application using Eclipse. However, an as yet unidentified process is closing it.
How do I find out what?
There seems to be lots of info about how to close ports on SO, but can't find anything about how to monitor what is closing it.
According to a co-worker who looks after the firewall the port is open. Although I also tried running Eclipse on the server and connection to the port inside the firewall. Tried connecting via a testing tool and get "The underlying connection was closed. The connection was closed unexpectedly."
The message connecting via Eclipse is "Cannot join host http://myHost:1807 - Possible reasons could be the host is temporarily unavailable, DNS cannot resolve this name. The port is not open to the outside. The host name is mispelt. The host response has timed out. The host has multiple network cards but one of them is not responding. The newtwork infrastructure does not allow the access to this host".
Eclipse connects via another port OK.
Please let me know if you have any ideas about how to solve this.
You can get the PID of port closing program by netstat -a -n -o. Then by using
tasklist /fi "pid eq 6368" you can find the name of program. 6368 is the pid of program that's blocking the port

TCPServer socket in ruby

I would like to establish a connection between 2 computers using socket. For this purpose one of them is a server and this is the code I've write:
sock= TCPServer.open('localhost', 6666)
sock.accept
the client try to establish the connection:
client = TCPSocket.open(ip_server, 6666)
but is not working. I've notice scanning server's ports that the server does not open the port to the network, only works in local mode.
Any suggestion, thk in advance
I've used this code successfully. Server side:
serverSocket = TCPServer.new( "", port )
serverSocket.accept
and on the client
t = TCPSocket.new(server_ip, port.to_i)
However, recently I've started using the 'EventMachine' gem, which made handling sockets 10 times easier
It's already been said that the service is running in "Local Mode" using the loopback "localhost".
sock= TCPServer.open('localhost', 6666)
sock.accept
TCPServer is a handy interface for the underlying file descriptor. Frankly, it almost makes socket programming too easy.
Like what has already been said, 'localhost' is a loopback to 127.0.0.1. Therefore, your statement is equivalent to:
sock= TCPServer.open('127.0.0.1', 6666)
sock.accept
If you will be using the network connection on a local network, assuming the server has an assigned IP of 192.168.0.1, you can assign a local IP address to listen on:
sock= TCPServer.open('192.168.0.1', 6666)
sock.accept
For an open port, conceivably open to all, use:
sock= TCPServer.open(6666)
sock.accept
Remember that everything is a file – the connection you're making is reading and writing to the same file or series of files from two (or more) locations. It's important to control who might have access to those files, and to what extent.
Yes, and it allright so, because you said it should bind the server port to the interface of 'localhost' and this is 127.0.0.1 and is bind to your loopback interface and not to any real interface connecting to the realworld.
You should try
sock = TCPServer.new(6666)
sock.accept
It works in "local mode" because it listens on localhost wich is loopback address for the computer the server is launched in. The IP address of your server should be address your computer has on local network (something like 192.168.x.x).

How do you use telnet to check a connection to Oracle?

I've been trying to get sqlplus to connect to Oracle from my OS X machine. I asked another question about it here.
One person suggested that I try telnet. Consulting the man page, I tried:
[ ethan#gir ~ ]$ telnet DBHOST:1521
Trying xxx.xxx.xxx.xxx...
telnet: connect to address xxx.xxx.xxx.xxx: Operation timed out
telnet: Unable to connect to remote host
Also...
[ ethan#gir ~ ]$ telnet DBHOST 1521
...with same result.
I'm not sure how to interpret these results. Seems like what you'd expect in any case. You wouldn't do this...
$ ssh some_mysql_host:3306
How is telnet to Oracle different?
Or maybe I didn't understand what they meant.
If anyone could help me understand how one uses telnet to test a connection to Oracle I would be grateful.
They're proposing use of telnet simply because it's one of the simplest TCP/IP clients and because it's installed almost everywhere. It's just an easy way to check from the command line whether you're actually able to make a TCP/IP connection to any particular service.
Also, on many of the ASCII based IP protocols it's straight forward to actually interact with the server to check its working by typing in commands and looking at the responses - I've done this numerous times myself with SMTP servers.
In your case, as you're getting a timeout, either the whole host is down, or the access to that particular host or service is being blocked by a firewall. If you can reach the server with a ping then the latter is more likely.
There's also an outside chance that your name resolution is actually taking you to the wrong host, but you should be able to confirm that by looking at the IP address that telnet said it was trying to connect to.
Another common response is "connection refused". That means that the host is up, but that there's no service running on the specified port.
Basically when you specify a port number e.g
Telnet myserver 1521
It will try to connect to the machine on that port. If you see any data returned or even a blank console then it has connected. If you receive an unable to connect message then the machine is not listening on that port or a firewall is blocking the connection.
Your attempt to telnet to dbhost 1521 getting 'unable to connect' with a timeout suggests that either your hostname resolution for 'dbhost' is giving you the wrong answer, or that host is offline, down or you have network problems.
If oracle was working, you'd get a connection. You wouldn't really be able to do anything with it, but it would confirm that oracle was up and listening.
Oracle instance is not connected from other systems, while it is connected from localhost, I think port is not opened and it is showing problem to telnet 1521 port from other system.
Why not do it the 'right' way? Telnetting to some arbitrary network port will not give you correct information, if the database and it's listener is working correctly.
Just install the oracle instantclient software and use the configuration wizard.

Resources