Oracle Active DataGuard on AWS RDS

Reading the latest updates and news I found that AWS has introduced a read-only replica for their AWS RDS for Oracle with the Active DataGuard technology behind that. It allowed clients offload reporting and some read-only activity to the standby freeing the primary Oracle database for transactions. It was possible to use the Data Guard before but only on EC2 type installation of Oracle and it was supposed to be fully configured managed by the customers.

To create the standby you don’t need downtime and all operations can be made online when your main production database is up and running. The process is intuitive and quite simple. The time to create depends mostly from the size of the original primary instance. The fairing up for a replica has taken only a half an hour for my small test database. You can choose availability zone AZ for the replica placing it where you think it serves you better.

For my test, I used a standard 12.2 Enterprise Edition (EE) database. Since it is Data Guard it is the requirement to use the EE and AWS states the version have to be equal or higher than 12.1.0.2.v12 and the backups have to be on for the database. On the main page for my  RDS instance I clicked on “Actions” and choose “Create read replica” from the menu.

Screen Shot 2019-03-12 at 1.10.23 PM

It opened the replica properties page with a number of options there. I left almost everything default only changing availability zone (AZ) option and the new name for the database.

Screen Shot 2019-03-12 at 1.11.53 PM

You have to choose a new name for the replica database. Having the primary unique name “oracle” I picked up “drcl” for the standby.

Screen Shot 2019-03-12 at 1.13.39 PM

After finalizing the setting and committing the replica creation the system started to work on preparing the source database and creating the copy. I was monitoring the activity on the primary and could see that the process was creating standby logs on primary, enabled force logging and performs all the rest.

Screen Shot 2019-03-12 at 1.19.43 PM

As soon as the process completed I could see the result on the main primary database page.  It showed the replication lag and in my case, it was only a couple of milliseconds.

Screen Shot 2019-03-12 at 2.04.52 PM

Upon creation, I ran some queries to check the settings on the new standby.  I found the real unique for the database was “ORCL_A” for my “oracle” instance and “ORCL_B”  for the “drcl”. It was similar for a “Multi-AZ” configuration with failover replica.

orcl.us-east-1.rds.amazonaws.com:1521/orcl> show parameter unique_name
NAME TYPE VALUE
-------------- ------ ------
db_unique_name string ORCL_A
drcl.us-east-1.rds.amazonaws.com:1521/orcl> show parameter unique_name
NAME TYPE VALUE
-------------- ------ ------
db_unique_name string ORCL_B

I noticed that even if the AWS documentation recommended to enable Oracle force logging before creating the standby it was already automatically enabled during the process.

orcl.rds.amazonaws.com:1521/orcl> select force_logging from v$database;
FORCE_LOGGING
---------------------------------------
YES

The replica has been created with the default “Maximum performance” protection mode.

drcl.us-east-1.rds.amazonaws.com:1521/orcl> select open_mode,protection_mode,database_role from v$database;

OPEN_MODE PROTECTION_MODE DATABASE_ROLE
-------------------- -------------------- ----------------
READ ONLY WITH APPLY MAXIMUM PERFORMANCE PHYSICAL STANDBY

And, of course, the old views and ways to see the standby state and stats worked since it was the normal Oracle Active Data Guard standby.

drcl.us-east-1.rds.amazonaws.com:1521/orcl> select NAME,VALUE from v$dataguard_stats;

NAME VALUE
-------------------------------- ----------------------------------------------------------------
transport lag +00 00:00:00
apply lag +00 00:00:00
apply finish time +00 00:00:00.000
estimated startup time 8

After testing the replica I terminated it. It took some time to stop the replication. You can see in the diagram that in my case it takes about an hour to complete.

Screen Shot 2019-03-12 at 2.24.09 PM

A couple of words at the end. I think it is a great addition to the AWS RDS for Oracle. But using that we need to keep in mind that you have to be licensed for Active Data Guard option for both instances primary and standby.

Leave a Reply

Your email address will not be published. Required fields are marked *