Oracle tablespaces, scheduled jobs or users are deleted and rediscovered frequently

Oracle tablespaces, scheduled jobs or users are deleted and rediscovered frequently

Oracle Monitor Tablespaces, Scheduled Jobs, or Users Are Removed and Rediscovered Frequently

Applies to: Oracle Database Server and Oracle PDB monitors

Problem

Applications Manager raises the notification “Scheduled Jobs, Users and Tablespaces are being discovered frequently.” The linked report lists monitors whose child entities have been deleted and rediscovered repeatedly during the reported period.

The entities may appear and disappear from the monitor's Snapshot page. Their historical data is lost each time they are deleted and recreated.

Cause

Applications Manager discovers Oracle tablespaces, scheduled jobs, and users during configuration polls. A child entity is created for each object returned by Oracle. If an object is no longer returned, its corresponding child entity is deleted. If the object is returned again during a subsequent poll, Applications Manager creates a new child entity for it.

This can occur when the database creates objects with changing names, for example:

  • Tablespaces: APP_DATA1, APP_DATA2
  • Scheduled jobs: JOBTEST17
  • Users: C##APPMON4

Repeated creation and deletion of these entities increases the storage and processing overhead in the Applications Manager database. It also increases the workload associated with polling, alerting, and data purging.

Resolution

Configure a Discovery Filter Regex to exclude dynamically generated object names from discovery. Applications Manager will then stop creating child entities for objects that match the filter.

Note: Applying a Discovery Filter can delete existing child entities and their collected historical data. During the next configuration poll, entities matching the filter are excluded from discovery and deleted, along with their history. Apply the filter only to entities whose historical data you are willing to lose.

1. Identify the suggested regex from the report

Open the report linked in the notification. It lists the affected monitors, resource types, detected name patterns, and the corresponding Suggested Discovery Filter Regex.

Example:

TABLESPACE_NAME=^(?!(APP_DATA[0-9]*)$).+$

In the Pattern Detected column, <n> represents a sequence of digits, while <n?> represents an optional sequence of digits.

For example, APP_DATA<n?> matches APP_DATA, APP_DATA1, and APP_DATA27.

The report may list more patterns than those included in the suggested regex. Patterns observed only once are reported but intentionally omitted from the suggested filter to avoid excluding legitimate objects that happen to match. Only patterns associated with repeated deletions are suggested for exclusion.

2. Check the existing discovery filter

  1. Open the affected Oracle monitor.
  2. Click Edit Monitor.
  3. Locate the Discovery Filter Regex field.

Oracle Database Server monitors have the following default filter:

SCHEDULEDJOBS_CURRENTSTATE=^(?!DISABLED$).+$

This filter excludes disabled scheduled jobs from discovery.

Do not replace the existing filter. Append the suggested regex to retain the existing filtering behavior.

3. Add the suggested regex

Append the suggested regex to the existing Discovery Filter Regex field. Use the appropriate separator:

  • Different attributes: Separate the conditions with a comma (,).
  • The same attribute: Combine the conditions using &&, as described in the Discovery Filters documentation. Do not separate multiple conditions for the same attribute with a comma.

For example, if the suggested filter is:

TABLESPACE_NAME=^(?!(APP_DATA[0-9]*)$).+$

Append it to the existing scheduled-job filter as follows:

SCHEDULEDJOBS_CURRENTSTATE=^(?!DISABLED$).+$,TABLESPACE_NAME=^(?!(APP_DATA[0-9]*)$).+$

The report provides a suggested regex for each affected resource type. If a monitor is reported for tablespaces, scheduled jobs, and users, add the corresponding filters for all three resource types.

The Discovery Filter Regex field supports a maximum length of 10,000 characters.

Click Save to save the monitor configuration.

4. Verify the changes

During the next configuration poll, Applications Manager excludes matching entities from discovery and deletes their existing child entities.

You may receive one additional notification after applying the filter because the deletion of the excluded entities is counted during the next check.

After this initial deletion activity has passed, the monitor should no longer appear in the frequent discovery notification report for these patterns, provided the entities are no longer being recreated.

Understanding the regex

A Discovery Filter uses an include expression: an entity is discovered when its name matches the expression. To exclude a particular name pattern while allowing other names, use a negative lookahead.

ExpressionMeaning
TABLESPACE_NAME=Specifies the attribute to which the filter applies.
^(?! ... )Excludes names matching the pattern inside the negative lookahead.
(APP_DATA[0-9]*)$Matches the generated names, anchored so that the entire name must match.
.+$Matches any other non-empty name.

The end anchor ($) is important. Without it, the filter could also exclude names such as APP_DATA_ARCHIVE, which may need to be monitored.

If the entities need to remain monitored

Use a Discovery Filter when the repeated discovery is caused by objects that are created and dropped dynamically and do not need to be monitored individually.

If these entities need to remain monitored, address the cause of the changing object names in Oracle where possible. For example, use stable object names or keep short-lived objects out of the schema being monitored.

When the notification appears again

The frequent-deletion check runs once a day. A monitor is reported once and is reported again only if it remains affected after the interval configured in am.mo.frequent.deletion.renotify.in.days, which is 7 days by default.

After the filter is applied and the entities stop being recreated, the monitor should no longer be reported for these patterns.

Troubleshooting

If the entities continue to be recreated after the filter is saved, collect the linked report and the monitor's Discovery Filter Regex value, and contact Applications Manager support.

Discovery Filters — Applications Manager help documentation describing filter syntax and the attributes supported by each monitor type.