Connecting to a DB System

This topic explains how to connect to an active DB System using SSH or SQL Developer. How you connect depends on how your cloud network is set up. You can find information on various networking scenarios in Overview of Networking, but for specific recommendations on how you should connect to a database in the cloud, contact your network security administrator.

Prerequisites

For SSH access to the DB System, you'll need the following:

  • The full path to the file that contains the private key associated with the public key used when the DB System was launched.

  • The public or private IP address of the DB System. Use the private IP address to connect to the DB System from your on-premises VPN, or from within the virtual cloud network (VCN). This includes connecting from a host located on-premises connecting through a VPN to your VCN, or from another host in the same VCN. Use the DB System's public IP address to connect to the system from outside the cloud (with no VPN). You can find the IP addresses in the Oracle Cloud Infrastructure Console on the Database page.

If you have problems connecting, see Troubleshooting Connection Issues.

Connecting to a DB System with SSH

You can connect to a DB System by using a Secure Shell (SSH) connection. Most UNIX-style systems (including Linux, Solaris, BSD, and OS X) include an SSH client by default. For Windows, you can download a free SSH client called PuTTY from http://www.putty.org.

When connecting to a multi-node DB System, you'll SSH to each individual node in the cluster.

Connecting to a Database with SQL Developer

You can connect to a database with SQL Developer by using one of the following methods:

  • Create a temporary SSH tunnel from your computer to the database. This method provides access only for the duration of the tunnel. (When you are done using the database, be sure to close the SSH tunnel by exiting the SSH session.)
  • Open port 1521 for the Oracle default listener by updating the security list used for the DB System. This method provides more durable access to the database. For more information, see Updating the Security List for the DB System.

Connecting to a Database on a 1-Node DB System

After you've created an SSH tunnel or opened port 1521 as described above, start your SQL Developer client and create a connection using the following connection details:

  • Username: sys as sysdba
  • Password: The Database Admin Password that was specified in the Launch DB System dialog in the Console.
  • Hostname: localhost if using an SSH tunnel, or the public IP address of the DB System if not using a tunnel.
  • Port: 9999 (or the port of your choice) if using an SSH tunnel, or 1521 if not using a tunnel.
  • Service name: The concatenated Database Unique Name and Host Domain Name, for example, db1_phx1tv.mycompany.com. You can find both these names in the Console by clicking Database and then clicking the DB System name for details.

Connecting to a Database on a Multi-Node DB System

After you've created an SSH tunnel or opened port 1521 as described above, you can connect to a multi-node DB System using SCAN IP addresses or public IP addresses, depending on how your network is set up and where you are connecting from. You can find the IP addresses in the Console, in the Database details page.

Troubleshooting Connection Issues

The following issues might occur when connecting to a DB System or database.

ORA-28365: Wallet is Not Open Error

For a 1-node DB System or 2-node RAC DB System, regardless of how you connect to the DB System, before you use OS authentication to connect to a database (for example, sqlplus / as sysdba) be sure to set the ORACLE_UNQNAME variable. Otherwise, commands that require the TDE wallet will result in the error ORA-28365: wallet is not open.

Note that this is not an issue when using a TNS connection because ORACLE_UNQNAME is automatically set in the database CRS resource.

SSH Access Stops Working

If the DB System’s root volume becomes full, you might lose the ability to SSH to the system (the SSH command will fail with permission denied errors). Before you copy a large amount of data to the root volume, for example, to migrate a database, use the dbcli create-dbstorage command to set up storage on the system’s NVMe drives and then copy the database files to that storage. For more information, see Setting Up Storage on the DB System.

What Next?

Before you begin updating your DB System, review the information in Updating a DB System.

For information about setting up an Enterprise Manager console to monitor your databases, see Monitoring a Database.