Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

oracle

telnet

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.

like image 702
Ethan Avatar asked Apr 17 '09 22:04

Ethan


People also ask

How does telnet test database connection?

Connecting to your database with Telnet To test the connection to your database, run the telnet hostname port on your Looker server. For example, if you are running MySQL on the default port and your database name is mydb, the command would be telnet mydb 3306 .

What is Oracle telnet?

The telnet utility communicates with another host using the TELNET protocol. If telnet is invoked without arguments, it enters command mode, indicated by its prompt, telnet>. In this mode, it accepts and executes its associated commands.


1 Answers

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.

like image 149
Alnitak Avatar answered Oct 04 '22 21:10

Alnitak