Yes, it’s possible. E.g. on Linux, run
ssh -N -Llocalport:dbserver:dbport yourname@connectionserver
where
- localport is the port on your machine which will be forwarded (can be 1521 if there is no local instance of oracle running)
- dbserver is the name or IP of the database server
- dbport is the port of the database (usually 1521)
- yourname is the login on the connectionserver
- connectionserver is the machine where you have ssh access
The same can be done on Windows using Plink (which comes with Putty):
plink -N -L localport:dbserver:dbport yourname@connectionserver
Do this on both machines (your local machine and the server you have access to) to chain the ssh tunnels. Example:
Connection server (assuming Linux):
ssh -N -L1521:dbserver:1521 dblogin@dbserver
Your PC:
plink -N -L 1521:connectionserver:1521 connlogin@connectionserver
The tnsnames.ora entry must look like you are running a local database, e.g.
prodoverssh =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = prod)
)
)