The Problem:
When I try to run gather stats over OpenVPN on my Oracle 19c database, SQL Developer doesn't return the typical "PL/SQL procedure successfully completed" message if it runs for more than a certain amount of time.
Apparently, the connection hangs after a while, and I either need to disconnect from OpenVPN or kill SQL Developer in Windows Task Manager to close it.
My Oracle 19c database and OpenVPN server are on different cloud providers.
Running gather stats on this database typically takes about half an hour.
Running the gather stats command on SQL Developer
What I checked:
Nothing unusual on the Iptables and OpenVPN logs on the OpenVPN Server or on the listener and alert logs on the Oracle 19c Server.
net.ipv4.tcp_keepalive_time and net.netfilter.nf_conntrack_tcp_timeout_established are set to their default values of 7200 (2 hours) and 432000 (5 days) on both machines.
If I connect to the database as system and run:
select x.sid, x.serial#, x.username, x.status, x.osuser, x.machine, x.program, x.event, x.state, sql.sql_text from v$sqlarea sql, v$session x where x.sql_hash_value = sql.hash_value and x.sql_address = sql.address and x.username = 'myuser';
After about half an hour, I noticed that the session for gather stats is inactive. So I assume that gather stats does indeed run and finish successfully, but just doesn’t return the aforementioned output message.
Gather stats running on the database
Gather stats session inactive after about half an hour
What I tried:
On a smaller database in the same instance, running gather stats over OpenVPN returns the aforementioned success message. This one takes around 10 minutes.
Connecting directly (without OpenVPN) to the database by adding my IP address to the firewall of the cloud provider and running gather stats also returns the aforementioned success message.
Generating a SSH public/private key pair on the Oracle 19c server and using SSH Hosts on SQL Developer, but the connection is very unstable/always resetting.
Setting up a Dante proxy server. Apparently, SQL Developer can only use some kind of special proxy server.
Setting up a IPSEC VPN with StrongSwan. My Windows 10 couldn't establish a connection with it for some reason.