MEM is dead, long live Oracle Database Management

MySQL Enterprise Monitor, aka MEM, retired in January 2025, after almost 20 years of exemplary service!

What’s next?

Of course, plenty of alternatives exist, open source, proprietary, and on the cloud.

For MySQL customers, we provide two alternatives:

  1. Oracle Enterprise Manager for MySQL
  2. OCI Database Management

This post focuses on the latter, as there is no apparent reason to deploy an Oracle Database to “just” monitor your MySQL instance(s) unless you also have an Oracle DB fleet.

Please note that currently, OEM for MySQL provides coverage for many aspects as listed on the product page.

OCI Database Management

DB Management primarily monitors your MySQL HeatWave instances running on OCI. However, it can also monitor your MySQL servers running on OCI compute instances or on-premises.

You need a dedicated agent to monitor your on-prem databases (and those running on compute instances).

Prerequisities

Your OCI environment must be configured before you can monitor external systems. Although this setup is the most complicated part, luckily, it only needs to be done once.

Dynamic Groups

We need to create a Dynamic Group; otherwise, we will get some errors later like this one:

On OCI, I use my dedicated compartment (sandbox-lefred), but I create my dynamic groups on the root compartment in the default domain:

We then need to specify two rules:

ALL {resource.type='managementagent', resource.compartment.id='<my compartment ocid>'}
ALL {resource.type='managementagent'}

Policies

Now we need to create a policy for our new dynamic group.

Please note that it’s essential to use the same dynamic group name as we previously created (in green on the image below):

But this is not yet finished. We still have to add some extra policies, but it should be easier this time.

We first got to the Database Management dashboard, and we click on Add policies:

We then fill our compartment. In my case, I used the “All Domain Users” group and provided access to manage MySQL databases:

When we click on “Generate“, the following policies are created:

Unfortunately, this is not yet enough; we need to update the policy with one more line:

We add the following extra line where the compartment’s name is used this time (sandbox-lefred in my case):

Allow service dpd to read management-agents in compartment sandbox-lefred

We have finally completed the policies!

Getting the Agent

When this is completed, we can get ready to download the agent, but first, we must create a new key to deploy it. Just got to Management Agents and follow those steps:

And we need to download the key file (rsp):

We also need to download the agent that matches the system and the architecture of our on-premises instance.

User, password, and grants

While the agent is downloading, we can start creating a dedicated user on our MySQL server for the monitoring:

CREATE USER 'monitor' IDENTIFIED BY 'M0nit0r@#';
GRANT SERVICE_CONNECTION_ADMIN, SYSTEM_USER, SELECT, PROCESS,
      SHOW VIEW, SHOW DATABASES, REPLICATION CLIENT, REPLICATION SLAVE 
      ON *.* TO 'monitor';
GRANT SELECT ON performance_schema.* TO 'monitor';
GRANT SELECT, EXECUTE ON sys.* TO 'monitor';

Now we need to add these credentials to a Vault in OCI.

You need to deploy one if you don’t have one set up yet.

Vault

OCI provides the possibility to share secrets with a vault. This is how to create one, we start in Identity & Security:

Then we need to be wait for it to become active:

When it’s active, we need to create a Master Encryption Key:

We provide a name, and that’s enough:

Installing the Agent

It’s time to install the agent. I use Oracle Linux 9 and will install it using an RPM.

The agent requires Java. Therefore, a JDK must be installed too:

$ sudo dnf install oracle.mgmt_agent.250414.2239.Linux-x86_64.rpm \
  jdk-8u441-linux-x64.rpm 

When it’s installed, you need to register the agent using the .rsp file generated earlier:

$ sudo /opt/oracle/mgmt_agent/agent_inst/bin/setup.sh \
  opts=/tmp/lefred-agent-key.rsp

Executing configure

	Parsing input response file
	Validating install key
	Generating communication wallet
	Generating security artifacts
	Registering Management Agent

Starting agent...
Agent started successfully

We can check the Agent in OCI:

To monitor MySQL, we must add the related plugin to the agent. This operation can be done on the Agent page:

Once the plugin is active, it’s also listed:

External MySQL DB System

Finally, we need to add (register) our MySQL instance on-premises to Database Management and link it to our agent:

We select our agent and provide the IP on how the agent can reach the database. We also need to create a new secret for the credentials using the Vault:

We point to our vault and encryption key. The credentials used are those to connect to the MySQL database (the user we created and granted some privileges):

It’s recommended to test the connection:

And if everything was correctly configured, the connection should be successful:

A work request is submitted and the progress can be followed:

When it becomes active, you can access the metrics like on the image bellow:

For more details, you can add some predefined charts or access the Performance Hub:

Conclusion

As you can see, monitoring your on-premises MySQL instance using OCI Database Management is possible. This managed service provides a consolidated monitoring and dashboard for all your MySQL instances in the cloud and on-premises.

The tool is in constant evolution, and new features are regularly added.

For more information, check the following articles and videos:

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Leave a Reply

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

As MySQL Community Manager, I am an employee of Oracle and the views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

You can find articles I wrote on Oracle’s blog.