{"name":"Invalid Objects (Count)","description":"Counts invalid objects in each container so you can alert once the count exceeds a threshold you choose (\"X\"). Oracle-maintained schemas are excluded, which can carry a small number of invalid objects after patching that are not usually actionable; to include that patch-related noise, remove AND o.oracle_maintained = 'N' from the join. The alert detail text lists the invalid objects as owner.object_name.","tsql":"-- Returns the count of invalid objects per container,\r\n-- excluding Oracle-maintained schemas (patch-related noise)\r\nSELECT c.con_id,\r\n       COUNT(o.object_name) AS metric_value,\r\n       LISTAGG(CASE WHEN o.object_name IS NOT NULL\r\n                    THEN o.owner || '.' || o.object_name\r\n               END, ', ' ON OVERFLOW TRUNCATE)\r\n           WITHIN GROUP (ORDER BY o.owner, o.object_name) AS alert_detail_text\r\n  FROM v$containers c\r\n  LEFT JOIN cdb_objects o\r\n    ON o.con_id = c.con_id AND o.status = 'INVALID' AND o.oracle_maintained = 'N'\r\n WHERE c.name <> 'PDB$SEED'\r\n   AND c.open_mode <> 'MOUNTED'\r\n GROUP BY c.con_id","instances":true,"databases":{"mode":1},"frequency":600,"frequency_comment":"seconds (collected every 10 minutes)","rateofchange":false,"metricenabled":true,"alertname":"Invalid object count above baseline","alertdescription":"The number of invalid objects in this container has exceeded X. A common starting point for X is 5-10; tune to the normal baseline for your environment. Force recompilation with utl_recomp.sql or DBMS_UTILITY.COMPILE_SCHEMA and investigate failed deployments, missing grants, or dropped dependencies if objects stay invalid.","aboveorbelow":"above","thresholds_comment":"Note: These thresholds are intended as guideline values. If they seem too high or too low for your environment, replace them with values more suited to your server performance.","_thresholds_high":{"selected":true,"value":5},"collections":2,"alertenabled":true,"_thresholds_medium":{"selected":false},"_thresholds_low":{"selected":false},"targetentitytype":2}