As @Gary says, not initially, but you can get compression using the SSH tunnel, assuming you have command line access. The SSH manual page notes that compression can slow down a fast network, but this compromise may be worth it if you are very limited in bandwidth; and you may need to experiment with CompressionLevel in ssh_config to get the best results for your situation.
For example, if your existing link is defined to connect to remote_server port 1521 :
create database link direct connect to usr identified by pwd using 'DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=remote_server)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=remote_service)))'
You can create an SSH tunnel using a free local port, with something like:
ssh -C -N -L1522:localhost:1521 remote_server
And then you can have a DB link pointing to the local side of the tunnel:
create database link direct connect to usr identified by pwd using 'DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1522)) (CONNECT_DATA=(SERVICE_NAME=remote_service)))'
So you just change the host and port. If your existing link uses the tnsnames entry, you can simply change it instead to specify localhost:1522 instead of remote_server:1521 .
Of course, you must make sure that the SSH link does not work when you use the DB link. If this happens, you will get ORA-12541: TNS:no listener error, since nothing will be listened to on your local port 1522.
source share