1. Create user defined metric on LIVE1, ESTDB2 (has to be a db), DBQLIVE1
- Navigate to Targets->Databases->Selected Database->User-Defined Metrics->Create
- Metric Name : ODL_NEW_CLIENT_APPS_THISMONTH
- Metric Type : NUMBER
- SQL Query Output : Single Value
- SQL Query :
select count(9) ct from
(select program_name
,min(least(nvl(first_allow_time,sysdate+1),nvl(first_deny_time,sysdate+1))) min_first_time
from odl_dbadmin_dbo.client_app_login
where 1=1
group by program_name
order by 2 desc)
where min_first_time >= sysdate-30
- Db Credentials : User/Password
- Comparison Operator : >
- Warning : 0
- Alert Message : ODL_NEW_CLIENT_APPS_THISMONTH: %value% new applications detected
- Schedule
- Enabled : On
- Start : Immediately
- Repeat every : 24 hours
2. Add custom report to show all UDMs
2.1 Create Report
- Navigate to Reports->Create
- Title : ODL010 - ODL User-defined Metric (UDM) Current Values
- Category : Custom Reports (may have to add)
- Subcategory : Development (may have to add)
- Target : Use specified target = EMREP2.ODL (OEM repos)
- Privileges : Run report usign target privs = ticked
- Time Period : This reoport has a time period = ticked Last 24 hours
2.2 Add query as a new element
- Navigate to tab Elements->Add
- Select target_user_table_from_sql
- Navigate to Set Parameters
- Header : Latest UDM values
- Statment :
SELECT DISTINCT
key_value "Metric Name",
UPPER(target_name) "Target Name",
TO_CHAR(collection_timestamp, 'MM-DD-YYYY HH24:MI') "Last Collected"
,nvl(to_char(data_value_int),string_value) "Metric Value"
--,M.*
FROM sysman.em$current_metrics m
WHERE 1=1
AND METRIC_NAME = 'SQLUDM'
AND key_value like 'ODL%'
ORDER BY 1, 2
- Statement type : SQL
- Rows to display : 100
2.3 Set a preferred credentials against the OEM repos target for the report running user
- Navigate to Preferences->Preferred Credentials
- Select Database Instance->Set Credentials
- Fill in valid user/password for OEM Report
0 comments:
Post a Comment