Create an Oracle database instance in a Multi-AZ deployment

on Amazon RDS

Amazon Web Services (AWS) provides a comprehensive set of services and tools for deploying Oracle Database on the reliable and secure AWS Cloud infrastructure. Amazon Relational Database Service (Amazon RDS) is a managed database service that helps simplify the provisioning and management of Oracle databases. Amazon RDS makes it easy to set up, operate, and scale a relational database in the cloud by automating installation, disk provisioning and management, patching, minor version upgrades, failed instance replacement, as well as backup and recovery tasks. The push-button scaling feature of Amazon RDS allows you to easily scale the database instance up or down for better cost management and performance.

Amazon RDS is available on several database instance types - optimized for memory, performance or I/O - and provides you with six familiar database engines to choose from, including Amazon Aurora, PostgreSQL, MySQL, MariaDB, Oracle Database, and SQL Server. You can use the AWS Database Migration Service to easily migrate or replicate your existing databases to Amazon RDS. 

Amazon RDS offers both Oracle Enterprise Edition and Standard Editions. There are two licensing options available for Amazon RDS for Oracle: License Included and Bring Your Own License (BYOL). In the License Included model, you don't need to purchase Oracle licenses separately. AWS holds the license for the Oracle database software and it allows you to pay per use by the hour.

The License Included model is supported on Amazon RDS for the following Oracle database editions:

  • Oracle Database Standard Edition One
  • Oracle Database Standard Edition Two

In this tutorial, you create an Oracle database Standard Edition Two instance on Amazon RDS using the License Included model in the default VPC. You learn how to enable built-in value-added features of Amazon RDS such as Mutli-AZ deployments for high availability (HA) and disaster recovery (DR), and Performance Insights for enhanced monitoring. Lastly, you learn how to delete Oracle instances when not needed and save recurring cost associated with them.

For complete configuration options, see Oracle on Amazon RDS.

Prerequisites

This tutorial requires that you install an Oracle Database client tool such as SQL Developer to connect to the Oracle Database instance running on Amazon RDS. To download the SQL Developer Client, see Oracle SQL Developer Downloads.

About this Tutorial
Time 10 minutes      
Cost Less than $1
Use Case Databases
Products Amazon RDS
Audience Database administrators, Developers
Level Intermediate
Last Updated July 2, 2020

Step 1: Create Oracle database instance and enable Multi-AZ feature

For this step, you create an Oracle Standard Edition Two instance and enable Multi-AZ deployment.  

1.1 — Open the Amazon RDS dashboard and sign in with your AWS account credentials. If you do not have an AWS account, create a new AWS account to get started.

Already have an account? Log in to your account

1.2 — Choose the Region drop-down and select the AWS Region where you want to launch your Oracle database. This tutorial uses the US West (Oregon) Region.

1.3 — In the left navigation pane, choose Databases, then choose Create database.

1.4 – For Choose a database creation method, choose Standard Create. For Engine options, choose Oracle.

1.5 — For Edition, choose Oracle Standard Edition Two. For Version, keep the default value. For License, choose license-included.

1.6 — For Templates, choose Dev/Test. For Settings, name your instance oracle-db.

1.7 — In Credential Settings, specify admin as the username and create a password for your DB instance. For DB instance size, keep the default selection of Standard classes.

1.8 — In the Storage section, keep the default selections.

1.9 — In the Availability & durability section, for Multi-AZ deployment, choose Create a standby instance.

In a Multi-AZ deployment, Amazon RDS automatically provisions and maintains a synchronous standby replica of your primary DB instance in a different Availability Zone. The primary DB instance is synchronously replicated across Availability Zones to a standby replica to provide data redundancy, eliminate I/O freezes, and minimize latency spikes during system backups. Running a DB instance with high availability can enhance availability during planned system maintenance, and help protect your database against a DB instance failure and/or Availability Zone disruption. For more information on high availability, see High Availability (Multi-AZ) for Amazon RDS.

1.10 — In the Connectivity section, keep the default selection for Default VPC. Then, expand the Additional connectivity configuration section:

  • For Publicly accessible, choose Yes. Amazon RDS assigns a public IP address to the DB instance, and the EC2 instances or devices outside of the VPC will be able to connect the DB instance.
  • For VPC security group, keep the default selection of the default security group.

1.11 — Expand the Additional configuration section, and for Initial database name, type SampleDB. Keep all other settings as their default selections. Under Performance Insights, verify that Enable Performance Insights is selected.  

1.12 — Choose Create database. The Oracle DB launches with a status of Creating. After a few minutes, the Oracle DB instance is created and the status changes to Available.

1.13 — When the instance status shows Available, choose the oracle-db instance to view the details. Choose the Connectivity & security tab and make a note of the instance endpoint. 

This value is the DNS name of your Oracle DB instance. You need this value to connect to the database in Step 2. Also, note that the Availability Zone in which this instance is launched. For this tutorial, the Availability Zone is us-west-2a; you use this info in Step 4.

1.14 — Choose the Configuration tab, and verify that Multi-AZ and Performance Insights features are enabled.

Step 2: Connect to the Oracle DB instance

In this step, you connect to the Oracle DB instance by using Oracle SQL Developer Client. For other connection options, see Connect to a DB Instance Running the Oracle Database Engine.

2.1 — Start the Oracle SQL Developer Client application. Then, in the Connections pane, choose Add (+ icon) to create a new connection.

2.2 – In the New Database Connection box, enter the following information:

  • Name: Tutorial
  • Username: admin (or username you specified in Step 1.7)
  • Password: enter the password you specified for the username in Step 1.7)
  • Hostname: Endpoint value from Step 1.13
  • Port: 1521 (default TCP port)
  • SID: SAMPLEDB (or database name you specified in Step 1.11)

Choose Connect. You can now start creating your own databases and running queries against your DB instance and databases.

 

2.3 – To run a test query against your Oracle DB instance, go to the Worksheet tab for your connection and enter the following SQL query: SELECT NAME FROM V$DATABASE;

Then, choose the Run Statement icon to execute the query. The Oracle SQL Developer Client returns the database name in the Query Result.

Step 3: View database Performance Insights

In this step, you access and view the Performance Insights dashboard. Amazon RDS Performance Insights is a database performance tuning and monitoring feature that helps you to quickly assess the load on your database and determine when and where to take the appropriate action. It requires no configuration or maintenance, and can be easily enabled when creating or modifying an instance of a supported RDS engine, such as Oracle.

3.1 — In the left navigation pane of the Amazon RDS dashboard, choose Databases, then select your Oracle DB instance oracle-db. In the Summary section, under Current activity, choose Sessions to open Performance Insights.

(Altenatively, in the left navigation pane, choose Performance Insights, then select the oracle-db instance.)

3.2 – Explore the Performance Insights dashboard.

In the Performance Insights dashboard, you can visualize the database load and filter the load by waits, SQL statements, hosts, or users. The metric Database Load represents the average number of active sessions for the DB engine. An active session is a connection that has submitted work to the DB engine and is waiting for a response from it.

The dashboard is divided into three parts:

  • Counter Metrics – shows data for specific performance counter metrics.
  • Database load (average active sessions [AAS]) – shows how the database load compares to DB instance capacity as represented by the Max CPU line.
  • Top load items table – shows the top items contributing to database load.

For more information, see Using Amazon RDS Performance Insights.

Step 4: Verify High Availability (HA) of DB instance

In this step, you simulate Availability Zone failover on the Oracle DB instance.

Amazon RDS provides an option to simulate Availability Zone failure and High Availability (HA) by offering an option to reboot the Oracle DB instance with the failover. This option initiates Availability Zone level failover and the instance on the secondary Availability Zone becomes primary, and the instance on the primary Availability Zone becomes secondary.

4.1 — Navigate to the RDS console. In the RDS navigation pane, choose Databases, then select your Oracle DB instance oracle-db. Note that the Region & AZ is us-west-2a. Choose Actions and select Reboot.  

4.2 — On the Reboot DB Instance page, select the Reboot with Failover check box.

The instance status changes to Rebooting.

Once the Oracle DB Instance is rebooted, the status changes to Available. Verify that the AZ for the Oracle DB Instance has changed. In this tutorial, the AZ changed to us-west-2b.

Step 5: Clean up

In the following steps, you clean up the resources you created in this tutorial.

It is a best practice to delete instances and resources that you are no longer using so that you are not continually charged for them.  

Delete RDS Oracle DB instance

5.1 — Navigate to the RDS console, and in the left pane, choose Databases.

5.2 — Choose the tutorial oracle-db.

5.3 — Choose Actions, then choose Delete.

5.4 — Clear the check boxes for Create final snapshot and Retain automated backups. (For a production database, you want to create the final snapshot in the event you need to restore the database.)

5.5 — In the dialog box, select the I acknowledge check box, type delete me and choose Delete.

Remove other resources

If you are not planning to install and manage Oracle databases in future, then uninstall the Oracle SQL Developer Client application from your machine.

Congratulations

You have created an Oracle DB instance on Amazon RDS! You learned how to enable advanced features offered in Amazon RDS for free on Oracle workloads, including Multi-AZ deployment for high availability and Performance Insights for enhanced monitoring.

Was this tutorial helpful?

Learn more about Amazon RDS features

Find out more about the features of Amazon RDS with the Amazon RDS User Guide.

Best practices with Amazon RDS

Learn about general best practices and options for working with Amazon RDS.

Learn more about Amazon RDS for Oracle

If you want to learn more, read the Best Practices for Running Oracle Database on AWS whitepaper and watch the Deep dive on new features in Amazon RDS for Oracle video.