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

Creating an Oracle DB Instance and Connecting to a Database on an Oracle DB Instance

The basic building block of Amazon RDS is the DB instance. Your Amazon RDS DB instance is similar to your on-premises Oracle database.

Important

You must have an AWS account before you can create a DB instance. If you don't have an AWS account, open https://aws.amazon.com/, and then choose Create an AWS Account.

In this topic you create a sample Oracle DB instance. You then connect to the DB instance and run a simple query. Finally you delete the sample DB instance.

Creating a Sample Oracle DB Instance

In this procedure you use the AWS Management Console to create a sample DB instance. Since you are only creating a sample DB instance, each setting is not fully explained. For a full explanation of each setting, see Creating a DB Instance Running the Oracle Database Engine.

To create a DB instance running the Oracle database engine

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the top right corner of the Amazon RDS console, choose the region in which you want to create the DB instance.

  3. In the navigation pane, choose Instances.

  4. Choose Launch DB Instance.

    The Select Engine page appears.

    
						Engine selection
  5. Choose the Oracle icon, and then choose Select for the Oracle SE Two edition.

  6. The Production? page asks if you are planning to use the DB instance you are creating for production. Choose Dev/Test and then choose Next Step.

    The Specify DB Details page appears.

    
    					DB instance details
  7. On the Specify DB Details page, provide the information for your DB instance as shown in the following table:

    For This Parameter Do This

    License Model

    Choose license-included to use the general license agreement for Oracle.

    DB Engine Version

    Choose the most recent version of Oracle available in the list.

    DB Instance Class

    Choose db.t2.small. This instance class is appropriate for testing.

    Multi-AZ Deployment

    For development and testing, choose No.

    Storage Type

    Choose the storage type General Purpose (SSD).

    Allocated Storage

    Type 10 to allocate 10 GB of storage for your database. There is a warning that you should consider allocating more storage, but since this is a sample DB instance, 10 GB is sufficient.

    DB Instance Identifier

    Type sample-instance.

    Master Username

    Type a name that you will use as the master user name to log on to your DB Instance with all database privileges. The master user name is a SQL Server Authentication login.

    Master Password and Confirm Password

    Type a password for your master user password. It must contain between 8 and 128 printable ASCII characters (excluding /,", and @).

  8. Choose Next to continue.

    The Configure Advanced Settings page appears.

    
    					Additional Configuration panel
  9. On the Configure Advanced Settings page, provide the information for your DB instance as shown in the following table:

    For This Parameter Do This

    VPC

    Choose Create new VPC.

    Subnet Group

    Choose Create new DB Subnet Group.

    Publicly Accessible

    Choose Yes.

    Availability Zone

    Choose No Preference.

    VPC Security Group

    Choose Create new Security Group.

    Database Name

    Type ORCL

    Database Port

    Leave the default value of 1521 unless you have a specific port you want to access the database through. Oracle installations default to port 1521, but in some cases a firewall might block this port. If in doubt, ask your network administrator what port you should use.

    DB Parameter Group

    Leave the default value.

    Option Group

    Leave the default value.

    Copy Tags To Snapshots

    Leave this setting unselected.

    Character Set Name

    Choose the default value of AL32UTF8 for the Unicode 5.0 UTF-8 Universal character set.

    Enable Encryption

    Choose No to enable encryption at rest for this DB instance.

    Backup Retention Period

    Choose 7.

    Backup Window

    Choose No Preference.

    Enable Enhanced Monitoring

    Choose No.

    Auto Minor Version Upgrade

    Choose Yes.

    Maintenance Window

    Choose No Preference.

  10. Choose Launch DB Instance.

  11. Choose View Your DB Instances.

    On the RDS console, the new DB instance appears in the list of DB instances. The DB instance has a status of creating until the DB instance is ready to use. When the state changes to available, you can connect to the DB instance. Depending on the DB instance class and the amount of storage, it can take up to 20 minutes before the new instance is available.

    
    					My DB instances list

Connecting to Your Sample Oracle DB Instance

After Amazon RDS provisions your DB instance, you can use any standard SQL client application to connect to the instance. In this procedure you connect to your sample DB instance by using the Oracle sqlplus command line utility. To download a stand-alone version of this utility, see SQL*Plus User's Guide and Reference.

To connect to a DB Instance using SQL*Plus

  1. Find the DNS name and port number for your DB Instance.

    1. Open the RDS console and then choose Instances to display a list of your DB instances.

    2. Choose the row for your Oracle DB instance to display the summary information for the instance.

      
    							My DB instances list
    3. Copy the endpoint. 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 number.

  2. Type the following command on one line at a command prompt to connect to your DB instance by using the sqlplus utility. The value for Host will be the DNS name for your DB instance, the value for Port will be the port you assigned the DB instance, and the value for the Oracle SID will be the name of the DB instance's database that you specified when you created the DB instance, not the name of the DB instance.

    Copy
    PROMPT>sqlplus 'mydbusr@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=endpoint DNS name) (PORT=1521))(CONNECT_DATA=(SID=ORCL)))'>

    You should 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>

Deleting Your Sample DB Instance

Once you are done exploring the sample DB instance that you created, you should delete the DB instance so that you are no longer charged for it.

To delete a DB instance

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the Instances list, choose your sample DB instance.

  3. Choose Instance Actions, and then choose Delete.

  4. For Create final Snapshot, choose No.

    Note

    You should create a final snapshot for any production DB instance that you delete.

  5. Choose Delete.

Related Topics