A blog about Oracle's Database Cloud Service Technology

  • March 17, 2015

Connecting to a Database Cloud Service with SQL Developer and SSH

Brian Spendolini
Database Cloud Services Product Manager
**You will need SQL Developer 4.1 for Connecting to a Cloud 12c DBaaS PDB** 

When you create a DBaaS instance, by default the only port open is 22, the SSH port. Now we must remember, these instances are on the public internet so security is priority. Personally, the only 2 ports I open in my DBaaS instances are 22 and 443 (for APEX access). So if we need SQL*Net access, what do we do? We create a tunnel over SSH for SQL*Net in SQL Developer.

Find your Public IP for a DBaaS Instance

Let's go through creating a connection, but before this we need to gather some information. First, we need the public IP of our DBaaS instance. That address can be found on your Database details page. Log into your Public Cloud Account, open the Database Cloud Service page. On this page we can see all of our created instances.


Click on the instance you want to connect to. This brings up the database details page. Here we can see the SID, the PDB name, resources used as well as the public IP.


Make note of the public IP and PDB1 connect descriptor for our SQL Developer connection.

Get the Key

Now that we have the public IP, we need one more item for our secured connection, the private key. When you created a DBaaS instance, you created a public and private key. The Public Key was used on instance creation. The private key will be used to connect to the instance at the OS level. We need this key for our SQL Developer connection.

 We need to add an SSH host. In the toolbar across the top, View, select SSH. A new SSH view should appear.

SSH View Panel

Now right click SSH Hosts and Add a host:

Add ssh host

Fill in the details for your SSH host

add ssh host details

Now add a ssh key, start by clicking the Use Key File checkbox

key checkbox

then click the file browse button and add a key 

file browse key

Next continue in the modal and create a  New Local Port Forward.

Name your port forward and ensure the port is 1521. When done, click OK.

The SSH view should look like the following:

ssh host done

We need to alter our SQL net connection now. Edit the connection details of your database connection.

connection type

Now in the Port Forward section, select your SSH connection. 


When finished, save the connection. 

ssh done

Hit the test button to check the connection.

You have now created a SQL Developer connection that uses SSH to tunnel into your DBaaS instance to use SQL*net. Start by changing the connection type to SSH.

Join the discussion

Comments ( 5 )
  • Luis Thursday, August 24, 2017

    We followed all the steps but get the "got minus from a read call" kind of error. Changed the sqlnet.ora to accept any source ip (restarting listeners) but still same error. Any help will be appreciated
  • sai Thursday, September 14, 2017
    How do I get the private key file to use in my SQL Developer SSH host
  • MUTHAMIZH Thursday, January 11, 2018
    Hi All,
  • Naga Wednesday, May 16, 2018

    How can I get the siebel databse which we installed in compute classic to sql developer.

  • Mohan Wednesday, June 20, 2018
    Thanks, it is really useful.
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.