Menu
Amazon Relational Database Service
User Guide (API Version 2014-10-31)

Connecting to a DB Instance Running the Oracle Database Engine

Once Amazon RDS provisions your DB instance, you can use any standard SQL client application to connect to the instance. In this example, you connect to a DB instance running the Oracle database engine using the Oracle command line tools. For more information on using Oracle, go to the Oracle website.

Note

This example uses the Oracle sqlplus command line utility. This utility is part of the Oracle software distribution. To download a stand-alone version of this utility, go to the SQL*Plus User's Guide and Reference.

Console

After Amazon RDS provisions your DB instance, you can use any standard SQL client application to connect to the instance. In this example, you connect to a DB instance running the Oracle database engine using the Oracle command line tools. For more information on using Oracle, go to the Oracle website.

This example uses the Oracle sqlplus command line utility. This utility is part of the Oracle software distribution. To download a stand-alone version of this utility, go to the SQL*Plus User's Guide and Reference.

To connect to an Oracle DB instance with Information from the RDS Console

  1. Open the RDS console, then select Instances in the left column to display a list of your DB instances.

  2. In the row for your Oracle DB instance, select the arrow to display the summary information for the instance.

  3. The Endpoint field contains part of the connection information for your DB instance. The Endpoint field has two parts separated by a colon (:). The part before the colon is the DNS name for the instance, the part following the colon is the port.

    
                        Locate DB instance server name and port

To connect to a DB Instance using sqlplus

You can use a utility like sqlplus to connect to an Amazon RDS DB instance running Oracle.

To connect to an Oracle DB instance using sqlplus

  • Type the following command on one line at a command prompt to connect to a DB instance using the sqlplus utility. Substitute the DNS name for your DB instance, then include the port and the Oracle SID. The SID value is the name of the instance's database that you specified when you created the DB instance, not the name of the DB instance. When using sqlplus from a Windows command line, do not use the single quotes.

    Copy
    sqlplus 'mydbusr@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<dns name of db instance>) (PORT=<listener port>))(CONNECT_DATA=(SID=<database name>)))'

    You will see output similar to the following.

    Copy
    SQL*Plus: Release 11.1.0.7.0 - Production on Wed May 25 15:13:59 2011 SQL>

    Note

    The shorter format connection string (Easy connect or EZCONNECT), such as PROMPT>sqlplus USER/PASSWORD@LONGER-THAN-63-CHARS-RDS-ENDPOINT-HERE:1521/DATABASE_IDENTIFIER, may encounter a maximum character limit and should not be used to connect.

CLI

To connect to a DB Instance using the AWS CLI

  • Find the DNS name for your DB instance using the AWS CLI describe-db-instances command below, or use the Amazon RDS console to find the necessary connection information.

    Copy
    aws rds describe-db-instances --headers

    You will see output similar to the following:

    Copy
    DBINSTANCE DBInstanceId Created Class Engine Storage Master Username Status Endpoint Address Port AZ Backup Retention Multi-AZ Version Read Replica Source ID License DBINSTANCE oracledb 2011-05-14T01:11:01.727Z db.m1.small oracle-ee 20 mydbusr available oracledb.mydnsnameexample.rds.amazonaws .com 1521 us-east-1a 1 n 11.2.0.2.v3 bring-your-own-license

Related Topics