Saturday, May 18, 2024
No menu items!
HomeDatabase ManagementMonitor Amazon RDS for Oracle instances using Oracle Enterprise Manager

Monitor Amazon RDS for Oracle instances using Oracle Enterprise Manager

Amazon Relational Database Service (Amazon RDS) for Oracle is a fully managed commercial database that makes it straightforward to set up, operate, and scale Oracle database deployments in the AWS Cloud. Amazon RDS automation manages time-consuming, repetitive administration tasks like provisioning, backups, software patching, monitoring, and compute scaling, allowing you to focus on tasks and activities needed for application use.
Oracle Enterprise Manager (OEM) is a centralized monitoring tool to monitor Oracle databases. Amazon RDS uses option groups to enable and configure additional features as per your requirements. OEM Agent is one of such feature provided via Oracle DB options.
In this post, we cover the prerequisites before installing OEM Agent, configuration steps, validation procedures, and how to register an RDS for Oracle database with OEM.

Prerequisites before enabling OEM Agent in an Amazon RDS for Oracle instance

Before you can effectively use OEM to monitor your RDS for Oracle instance, you must meet the following prerequisites:

Setting up Oracle Management Service (OMS) to monitor an Oracle database is your responsibility. After you set up OMS, make sure that network connectivity between the OMS, OEM Agent and the RDS for Oracle instance is enabled.

From a networking and firewall perspective of OMS, make sure the DB listener port and OEM Agent port are allowed. If OMS is set up on Amazon Elastic Compute Cloud (Amazon EC2), make sure to modify the security group and network access control list (ACL). If OMS is set up on premises, make sure you engage your network team to provide the required access to the DB listener port and OEM Agent port.
Create an inbound rule for the security group of your RDS for Oracle instance for the OMS port and OMS host IP as the source.

Make sure the OEM Agent version you pick is compatible with the OMS version you have installed. For more information, refer to Accessing the Enterprise Manager Certification Matrix.
OEM Agent is supported for Standard Edition 2 and Enterprise Edition of Amazon RDS for Oracle. Refer to Using the Management Agent for further details related to supported editions and versions.

Install OEM Agent to an RDS instance

OEM Agent will be automatically installed in the RDS for Oracle instance when you add the OEM_AGENT option to the option group. Complete the following steps:

On the Amazon RDS console, navigate to the RDS instance details page.
Choose the option group associated with the instance.
If the instance is associated with the default option group, create a new option group or choose an existing option group that already has OEM enabled and associate the option group with the RDS for Oracle instance.
The following screenshot shows the testenv option group associated with the testenv RDS for Oracle instance.

Choose Add option.
For Option name, choose OEM_AGENT.
Provide the other details for your OMS configuration and security group.
For Apply immediately, select Yes.
Adding the OEM_AGENT option to an RDS for Oracle instance doesn’t cause any downtime. Therefore, you can choose to apply the changes immediately.
Choose Add option.

The instance will be in a modifying state until the agent installation is complete. During this time, you can’t make any further changes to the instance until it returns to the available state. An option group can be associated with more than one RDS for Oracle instance, and when an option is added to an option group, it gets reflected to all the database targets.

Verify that OEM_Agent is successfully configured in the database

Properly configuring the OEM Agent is a crucial step in monitoring your RDS for Oracle database. After you complete the configuration, it’s important to verify that the OEM Agent is functioning as expected and communicating with the database and OMS.
You can log in to OEM to confirm that the OEM Agent is integrated and operating as intended. After the OEM Agent is successfully configured in an RDS instance, in the Hosts section of OMS, you can see a target with the RDS endpoint showing as available.

There are rdsadmin specific PL/SQL packages available to check the status of the agent to confirm that it’s successfully configured, as shown in the following screenshots.

Add an RDS for Oracle instance as a target in OEM

After the agent installation is successful, you must manually add the database to OEM. Complete the following steps:

Connect to the RDS for Oracle instance that you want to configure in OEM. Make sure you’re logging in as a user who has the necessary privileges to reset the password for the DBSNMP user account.
Unlock and set the password for the DBSNMP user:

SQL>Alter user dbsnmp identified by <<password>> account unlock;

Verify if the DBSNMP user has the right ACCOUNT_STATUS and profile:

SQL>select username, account_status, profile from dba_users where username=’DBSNMP’;

Open OEM, choose the Setup menu, and choose Add Target and Add Targets Manually.

Choose Add Target Manually.

For Agent Host, enter the database identifier (for this use case, the database identifier is testenv).

For Target Type, enter Database Instance.
Choose Add.
Choose the endpoint of the RDS for Oracle DB instance and choose Select.
For Monitoring Password, enter the password of the DBSNMP user.
For Oracle Home Path, enter /oracle.
Configure the other database properties, including port, connection protocol, and database SID.
Choose Test Connection to verify the entered values.

Choose Submit to save the target information in OEM.

To verify if the target is saved correctly, on the OEM home page, choose the Targets menu, then choose Databases.

Troubleshooting while configuring OEM_AGENT in an RDS for Oracle instance

Configuring the OEM_AGENT option on an RDS for Oracle instance can sometimes encounter issues, preventing the process from completing successfully.
For example, if the OEM Agent installation is unsuccessful for an RDS for Oracle instance, you can view the generic error message related to the installation failure on the Amazon RDS console. Navigate to the database details page and on the Logs & events tab, look for the error in the Recent events section.

If there is network communication failure between OMS and the RDS for Oracle instance, then the installation is rolled back.
If the agent installation is successful and there are errors related to configuration, you can export the agent logs like emctl.log, emdctlj.log, gcagent.log, gcagent_errors.log, emagent.nohup, and secure.log to Amazon CloudWatch Logs and troubleshoot further.

For more information, refer to How can I troubleshoot common errors when using the OEM_AGENT option with Amazon RDS for Oracle?

Modify the OEM Agent version in an option group

When you modify the OEM Agent configuration in an option group attached to an RDS for Oracle instance, such as modifying the OMS port or agent version, the existing agent is uninstalled and a new agent is installed. Because the instance specific information is already present in OMS, the new targets.xml file on the OEM Agent end can’t have static target information populated and will be empty. When the file is empty, the configuration fails. Therefore, before you modify the agent configuration, make sure that the necessary backups are taken and the database and its targets are decommissioned from OMS. The Targets.xml file contains a static entry for all the targets that will be monitored by the agent of the host, and entries are populated in it automatically.
Similarly, if you delete an RDS for Oracle instance and restore it with the same database identifier, you should first clear the target-specific information from OMS for the deleted instance and then perform the restore.

Identify the targets from OEM for an instance that is already deleted

OEM stores all monitored target information in the SYSMAN schema of the Oracle Management Repository database. You can access this target information by querying the repository management views within the SYSMAN schema. The following screenshot shows a query that displays all the targets for the RDS for Oracle instance with the database identifier testenv.

After you capture the target information, you could use the emcli command mentioned in Oracle Support document Doc ID 1459204.1 to decommission any targets.

Clean up

To revert the changes made to the RDS for Oracle instance as part of this post and clean up your resources, complete the following steps:

If the instance was originally associated with the default option group, reassign it to the same default option group.
If the OEM Agent option was added to a non-default option group, remove the OEM Agent option to uninstall the configuration.
Delete any AWS resources that are no longer required and were created solely for testing, like security groups and the EC2 instance for OMS configuration.

Summary

In this post, we discussed how an RDS for Oracle instance handles the OEM_AGENT option and how to successfully configure an RDS for Oracle instance in your existing OMS.

We welcome your feedback. If you have any questions or suggestions, leave them in the comments section.

About the Authors

Deepak Mani works as Senior Cloud Database Engineer in Amazon Web Services. He is a Subject Matter Expert for Amazon RDS for Oracle and Amazon RDS infrastructure. Deepak has 15 years of experience working with relational databases. At AWS, he works primarily on Process and Service Improvements for Support Engineering and works on internal escalations created for Amazon RDS for Oracle.

Sabarinath Nair is Senior Database Consultant with the Professional Services team at Amazon Web Services. He has over 18 years of experience in Microsoft SQL Server and other relational and non-relational database technologies. He works with customers on architecture, migration, and optimizing their database workloads to AWS, and helps them improve the value of the solutions.

Read MoreAWS Database Blog

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments