Some times it will be very hard to List down what are the Incident rules we defined in our OEM Application. Particularly, during IT Audit, we may need to provide the list of Incident Rulesets and details about individual rules.

Copy and paste Incident Rulesets/Rules from OEM 12c is not possible.

OEM 13c has an export/import option, but that will give you an xml file. You need to run the show by converting it to your favorite document.

This script will come in handy to get all details about OEM Incident rules.

SELECT

  *

FROM

  (

    SELECT

      r.RULESET_ID,

      r.RULE_ID,

      r.RULE_NAME,

      r.RULE_NAME_NLSID,

      r.CREATED_BY,

      r.DESCRIPTION,

      r.DESCRIPTION_NLSID,

      r.RESOURCE_BUNDLE,

      r.RULE_TYPE,

      r.RULE_ORDER,

      r.IS_REFERED_ACTION,

      r.REFERED_RULE_ID,

      r.IS_ENABLED,

      r.IS_BROKEN,

      r.CREATED_DATE,

      r.LAST_UPDATED_BY,

      r.LAST_UPDATED_DATE,

      r.RL_EXPRESSION,

      r.Event_Class,

      r.PRIV_MODE,

      r.Display_Order,

      ru.Subscribed_Users

    FROM

      (

        SELECT

          EmRulesEO.RULESET_ID,

          EmRulesEO.RULE_ID,

          EmRulesEO.RULE_NAME,

          EmRulesEO.RULE_NAME_NLSID,

          EmRulesEO.CREATED_BY,

          EmRulesEO.DESCRIPTION,

          EmRulesEO.DESCRIPTION_NLSID,

          EmRulesEO.RESOURCE_BUNDLE,

          EmRulesEO.RULE_TYPE,

          EmRulesEO.RULE_ORDER,

          EmRulesEO.IS_REFERED_ACTION,

          EmRulesEO.REFERED_RULE_ID,

          EmRulesEO.IS_ENABLED,

          EmRulesEO.IS_BROKEN,

          EmRulesEO.CREATION_DATE AS CREATED_DATE,

          EmRulesEO.LAST_UPDATED_BY,

          EmRulesEO.LAST_UPDATED_DATE,

          EmRulesEO.RL_EXPRESSION,

          EmrulesEO.Event_Class,

          EmrulesEO.PRIV_MODE,

          To_Number(EmRuleSetsEO.ruleset_order                   + (row_number() over (partition

          BY EmRulesEO.RULESET_ID order by EmRulesEO.RULE_ORDER))/1000) AS

          Display_Order

        FROM

          Em_Rules Emruleseo,

          (

            SELECT

              RULESET_ID,

              rownum AS RULESET_ORDER

            FROM

              (

                SELECT

                  RULESET_ID

                FROM

                  EM_RULE_SETS

                WHERE

                  IS_VISIBLE=1

                ORDER BY

                  Ruleset_Order

              )

          )

          EmRuleSetsEO

        WHERE

          Emrulesetseo.Ruleset_Id = Emruleseo.Ruleset_Id

        ORDER BY

          ruleset_order ASC,

          RULE_ORDER ASC

      )

      r

    LEFT OUTER JOIN

      (

        SELECT

          acts.rule_id AS rule_id,

          em_incident_rules.table_to_string(CAST(COLLECT(notif.recipient) AS SMP_EMD_LONG_STRING_ARRAY)) AS Subscribed_Users

        FROM

          sysman.em_rule_cond_actions acts,

          sysman.em_rule_basic_notifications notif

        WHERE

          acts.COND_ACTION_ID = notif.COND_ACTION_ID

        GROUP BY

          rule_id

      )

      ru

    ON

      r.rule_id = ru.rule_id

  )

  QRSLT

WHERE

  RULESET_ID = 7

ORDER BY

  RULE_ORDER ASC


No comments:

Post a Comment

Kindly make your valuable and progressive comments here.
Junks will be deleted without notice :-)

 SPACE MANAGEMENT :: 1. Table space usuage: ============== SELECT tablespaces.tablespace_name,          allocated.total_alloc allocated_mb, ...