• Categories
  • Search
Tuesday, March 17, 2015

Connecting to a Database Cloud Service with SQL Developer and SSH

By: Brian Spendolini | 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.

DB_Home

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.

DB_Details

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. 

add

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 ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
 

Visit the Oracle Blog

 

Contact Us

Oracle

Integrated Cloud Applications & Platform Services