connect to oracle through socks proxy - oracle

My application (linux and windows) connects to oracle through OCI interface. Is it possible to connect to oracle through socks proxy? or some other similar proxy method? Simple ssh tunnel is not enough as I need to access multiple services (including oracle) through single port.
Edit: I have tried configuring the proxy as suggested in the answer, but it did not work. And I could not find anywhere information, that oracle can work through socks5 proxy.

I got the same issue to get solved. Anyway the solution above cannot work. You need to tell the client to just USE the proxy for connection initialization, but the target to connect to is supposed to be the oracle database server IP and port. Other forums read there is no such possibility via tnsnames.ora. But you're supposed to be able to achieve that using the Connection Manager. Haven't found out yet how to even download and install it though...

As I see Oracle doesn't support socks proxy.
To work around this for my self I did following:
Install proxifier www.freecap.ru
Start PL/SQL Developer from freecap
As I can see - this method not always work.
PL/SQL Developer was able to connect to database only on 3-4 try.
But after successful connect - it's seems stable enough for work.
Second option - is to use Java based tools like SQL Developer.
For Java there is system options for using SOCKS5 out of the box.
-DsocksProxyHost=localhost
-DsocksProxyPort=8081
there is official doc about SOCKS in java

Yes, this is possible. Your client tnsnames.ora file (or EZConnect string) should specify the proxy host as the database host, and the proxy listening port as the port. The SERVICE_NAME or SID is whatever the SQL*Net listener on the other side of the proxy is expecting.
[Edit]
If your proxy host is listening and forwarding on 1522, you should be able to:
telnet proxyhost 1522
and see:
Trying xx.xxx.xx.xxx...
Connected to proxyhost.domain.
Escape character is '^]'.

Related

What is the cause of this problem "IO Error: The Network Adapter could not establish the connection" on Sql Developer?

I make a connection for connect to the Database Server (other machine).
Then I found "An error was encountered performing the requested operation:
IO Error: The Network Adapter could not establish the connection
Vendor code 17002".
Please look the picture in URL below.
I tried to make a connection but can't access but my team can access it.
My friend used TNS connection type and I did everthing similar him but can't access. I tried to use JDBC thin for connect but can't also.
I had the old connection which I can connect but why I can't connect the new connection.
You're trying to connect to a machine on a network that SQL Developer is unable to reach.
For a TNS connection,
Look at the appropriate TNSNames entry (you will have a tnsnames.ora) file, and find the IP address or network name associated with the connection you're trying to establish -
And then start by trying to ping that resource.
In this case, i'm trying to talk to a database on MY machine, on port 1521. Yours should look quite different.
If you're using a basic connection, then you can look at the connection properties and see what machine/port you're trying to communicate with.
Ping
If you can't reach that machine from your machine, there's zero chance you can connect to a database there.
So, always start with a ping.
Once you see that you can get to that machine, if you're still getting that message, the next thing to think about is blocked ports, the listener defaults to port 1521, but you'll see that in the TNS descriptor as well.
It usually happens when a another process is running on the same port or there is an absence of listener.
Go to Run>services.msc>OracleXETNSListener>Start
Try to reconnect.. Even if the error still prevail then go to cmd
Use code:
npx kill-port <portnumber>
The port number by default is 1521, but you can check the port number in database properties.
It is possible, that your connection is forbidden by the firewall -
go to Control Panel\System and Security\Windows Defender Firewall - Advanced - Outbound Rules - Add a rule. (If you have some antivirus firewall, add rules there)
Create a temporary TCP rule for your port and another rule for UDP. Allow all nets and comps.
Check the telnet connection as cmd -> telnet ->
open remote.host.address PortNumber
If you can connect now, then the problem IS in firewall - edit your new rules, setting the hosts and nets exactly.
This error is because your sqldeveloper is not able to reach the database server's sql service.
One reason could be lsnrctl is down for some reason.
If you have access to machine where database is installed.
In Windows machine, follow: https://www.youtube.com/watch?v=r9pHqOfV2f0&ab_channel=TLinaTutorials
In Linux/macOS machine: Go to $ORACLE_HOME/bin and check status of lsnrctl
execute from $ORACLE_HOME/bin lsnrctl status, if it's down. Then restart it by lsnrctl start.
Check the details of connection in command output like SID, PORT, HOST etc. and try connecting again from sqldeveloper.

JMeter-JDBC Connection error

While running an SQl query in JMeter using JDBC request, I'm getting:
SQL ConnectionException:Cannot create Poolable Connectionfactory
(IO error:Network Adapter could not establish the connection).
Installed Oracle11g in virtual machine.
Please give me solution.
Thanks in Advance.
Make sure you have Oracle JDBC driver somewhere in JMeter Classpath
Make sure you have configured network adapter in the virtual machine in Bridge mode (not "host-only", not "NAT") so the virtual machine would have its own IP address.
Make sure port 1521 (or whatever is used by Oracle) is not blocked by OS firewall. Check if you are able to connect to the port using i.e. telnet client
Add JDBC Connection Configuration test element and provide JDBC url of your Oracle instance along with credentials there.
See The Real Secret to Building a Database Test Plan With JMeter guide to learn more about setting up JMeter for databases load testing

Couchbase server refusing network connections - any ideas what might be the issue?

I downloaded the community edition of couchbase server, and am running it on a mac system.
It's up and running according to the console:
However, when I try to test it:
$ telnet localhost 8091
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
I've told the firewall app to allow the "Couchbase Server.app" application to accept incoming network connections, and doesn't seem to have helped.
Any ideas what might be the issue here?
Yes, telnet into Couchbase should be through 11211... http://www.couchbase.com/docs/couchbase-manual-1.8/couchbase-getting-started-testing.html
Did you try to connect to it through any of the SDK's (C/Ruby/Java/.NET/PHP/Python/Perl)? If you ever need immediate help, you can also go to IRC (freenode.net), in the #libcouchbase or #couchbase channels, or post another question here of course.
I was connecting to the server on the wrong port. To see the port to use when accessing the server, open up the relevant data bucket, and check what port it's running on. By default, it will most likely be accessible on 11211

SOA suite with Remote DB server

I have the Oracle client, weblogic and the SOA suite 11g installed on a Win 7 machine. The Oracle DB is on a server 2008.
I have the hardest time connecting to it. The server name is S2008 on port 1521. I used the RCU to install the schema.
I am able to ping the server. Could someone please help me out in getting this connected? I have not done this configuration before.
Thank you.
This is more of a database concern, not WebLogic.
The simplest thing to do is to confirm you can telnet to port 1521 from the WebLogicmachine (telnet 1521). If this cannot connect, it is either a firewall issue or the TNS listener is not running on port 1521. Check to make sure that port 1521 is opened on the Database host and then try again.
Also, try connecting outside of WebLogic to remove a variable from the problem. This would be easier/faster anyway. Try using SQL developer to connect to the host/port where the database is running. This will show you the ORA-????? error(s) for the connection attempts without having to go through the connection wizard in the weblogic console

postgresql and firewall

I will be building a server/client software on Windows, where many machines need to communicate with a Postresql database running on the server. This is C++ software so I will use libpq to connect to the database.
If I do this, will there be issues with the firewall? I'd like to make configuration as easy as possible and not have users open up firewall ports or disable their firewall.
If I do need to open up firewall ports, can I use WCF to get around the issue? Basically send a command to the server using WCF, run the postgresql command locally, and get the result back (I have never used WCF but understand that it can communication using HTTP port 80).
PostgreSQL typically listens on port 5432, which is not open by default in the Windows firewall. But the only machine where the firewall would need to be re-configured is the one where PostgreSQL is running. If you have many client machines, none of them should require firewall changes (unless they have restrictions on outbound traffic, which is rare).
Hope this helps.
You can also configure SSL connections to ensure better security.

Resources