This is possible using a custom query checkpoint and defining the appropriate variables and creating a named customer QOS for your custom query.
For this exercise, I have set this up with the sqlserver probe but this is applicable to the oracle_monitor probe too as they are structured similarly.
For simulating your scenario I have used the following query:
USE CA_UIM
select profileName, count (*) as count from SSRV2Profile group by profilename
Which provides the following output:
We will create a monitor to store the count of each of the grouped SSRV2 profiles (MCS has nothing to do with this example and it is only taken as an example of a table to extract and monitor)
Once you create the query it's important to set the Row identification and the message variables:
Set the Variables
It is also important to create the QOS in General TAB >> QOS List where you select the metric (in this case the "count" is the metric)
After this one single target is created for each "ProfileName"
The below is just the output from my DB which shows different targets created for the custom QOS Created:
And here is how they are visible in PRD: