Invalid Objects (Count)

Install metric...

Metrics install automatically if you have Redgate Monitor installed.

If you are using Redgate’s SQL Server monitoring tool, Redgate Monitor, you can instantly install and run this metric on your servers.

Invalid objects are views, PL/SQL packages, procedures, functions, triggers, and materialized views whose status has changed to INVALID, typically because a dependency was altered or dropped. A small number is often transient and self-resolving, but a growing or persistent count can point to a failed deployment, a missing grant, or a dependency issue that will surface as an application error the next time the object is called.

Required permissions:

GRANT SELECT ON CDB_OBJECTS TO redgate_monitor_user CONTAINER=ALL;
GRANT SELECT ON V_$CONTAINERS TO redgate_monitor_user CONTAINER=ALL;

These are covered by Redgate Monitor’s standard Oracle monitoring user — if it was set up as described in the product documentation, no additional grants are needed.

Metric definition

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.

Supported database engine

  • Oracle

The T-SQL query that will collect data

Instances to collect from

Select all monitored Oracle instances

Databases to collect from

Not applicable - Oracle custom metrics collect once per instance, and values are stored per container (PDB) via the con_id column

Collection frequency

600

seconds (collected every 10 minutes)

Use collected or calculated values

Leave the Use a calculated rate of change between collections check box unchecked

Metric collection

Enabled

Alert definition

Alert name

Invalid object count above baseline

Description

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.

Raise an alert when the metric value goes

Above the defined threshholds

Default threshold values

High:5
Medium:
Low:

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.

Raise an alert when the threshold is passed for

2 collections

Alert is

Enabled