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.Oracle Enterprise Manager

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:

Error

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

Oracle DB Management

Oracle DB Management

Oracle DB Management

We then need to specify one of the two following rules, depending on whether you want to limit to a specific compartment or the whole tenancy:

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

Oracle DB Management

Policies

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

Oracle DB Management

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

Oracle DB Management

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:

Oracle DB Management

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

Oracle DB Management

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

Oracle DB Management

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

Oracle DB Management

Oracle DB Management

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

Oracle DB Management

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:

Oracle DB Management

Oracle DB Management

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

Oracle DB Management

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:

Oracle DB Management

Oracle DB Management

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

Oracle DB Management

Oracle DB Management

 

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

Oracle DB Management

We provide a name, and that’s enough:

Oracle DB Management

Oracle DB Management

Installing the Agent

It’s time to install the agent. I use Oracle Linux 9 and I 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:

Oracle DB Management

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

Oracle DB Management

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

Oracle DB Management

External MySQL DB System

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

Oracle DB Management

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:

Oracle DB Management

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):

Oracle DB Management

It’s recommended to test the connection:

Oracle DB Management

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

Oracle DB Management

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

Oracle DB Management

Oracle DB Management

Oracle DB Management

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

Oracle DB Management

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

Oracle DB Management

Oracle DB Management

Oracle DB Management

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: