Тёмный

Step-By-Step Create OEM Metric Extension - Send Alerts on Long Running SQLs Using Metric Extension 

YouVolve
Подписаться 3,9 тыс.
Просмотров 5 тыс.
50% 1

In this tutorial, I am demonstrating the steps to create Metric Extension in OEM along with constructing the SQL queries to be used and how we can use a Metric Extension to send alerts on long running or under-performing SQLs.
A metric extension is an extension to OEM's default capacity to collect certain metric on its targets. For example, OEM collects metrics like tablespace usage, file system usage, number of error logged in alert.log etc. But it does not automatically collect data on SQLs and alert on long running SQLs. To achieve this we will extend OEM's capacity to collect metric data on SQLs running in the database targets and based on conditions applied, the Metric Extension will send critical, warning or clear alerts.
Please note that the run frequency of the ME should be ideally set to a number between half of the threshold minutes and the full threshold minutes set for detecting long running SQLs. For example, if you are trying to catch SQLs running longer than 10 minutes, then the run frequency of the ME should be a number between 5 and 10 (max). If you set smaller frequency like 5, you are less likely to miss an alert. So it is suggested to set a smaller number as run frequency for the ME.
Please watch the video and leave me comments if you have any.
For the SQL queries used, please download the text file from my google drive:
drive.google.com/file/d/1Om62...

Опубликовано:

 

6 окт 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 32   
@user-dl2dc1tw1u
@user-dl2dc1tw1u Год назад
Very well-illustrated video. Thanks for sharing your knowledge with us.
@YouVolve
@YouVolve Год назад
Thanks for your feedback.
@shymonr1009
@shymonr1009 2 года назад
Good video
@YouVolve
@YouVolve 2 года назад
Thanks Shymon
@akamanyangwe5679
@akamanyangwe5679 Год назад
Thank you for such a clear and precise video. I implemented this and created my incident rule, the alerts are coming in now. Question please:- we noticed an insert statement that has been running for 7+ hours on one of the nodes but no alert is generated. Please do you know what could be the issue here?
@YouVolve
@YouVolve Год назад
Hi, the 5 conditions to trigger an alert are as below: status='ACTIVE' and username is not null and type 'BACKGROUND' and username not in ('SYS') and last_call_et/60 > 10. When you are expecting an alert and you know the insert statement is still running, please execute the first SQL I have given in the shared document in a SQL*Plus session and see if that returns anything. I suspect the session May have gone into an inactive state. Please let me know what you find.
@sendilkumar9184
@sendilkumar9184 9 месяцев назад
Very well-illustrated Demo. Thank you for sharing. However, instead of the top 1 if I want all the session that is running more than 15, how do we return all rows? Please let us know. Thank you
@YouVolve
@YouVolve 9 месяцев назад
Hi @sendilkumar9184, thanks for watching my video and providing your feedback. You can find out all the sessions running over 15 minutes by simply changing the condition "greater than 10" to "greater than 15" in the query. However the OEM alerts are meant to be short/precise and notify about the situation rather than sending all the details. If you modify the outer query to return a "count(*)" that will tell you how many sessions are running over 15 minutes and based on the returned count you can determine the severity such as "greater than 20" as critical to "greater than 15" as warning etc. If you really wants to see the list of all sessions then better to create a BIP Report (deprecated in OEM 13.5) or a PowerBI dashboard etc. Hope this will help.
@DUMIE63
@DUMIE63 10 месяцев назад
Hello there, Your videos are very helpful, informative and easy to follow. Thank you so much for your clear explanations and exmples. Do you have a video with a clear example on how to setup and send an SMS notification to a recipient from an incident rule within OEM13c, please? For example, from an incident rule when a metric extention(like a blocking lock on a table) is detected.
@YouVolve
@YouVolve 10 месяцев назад
Hi @DUMIE63, first of all thanks for watching my video and providing your valuable feedback. I am dividing you question to different parts so I can answer them individually. I have a full series named "Mastering OEM" on OEM 13c covering topics from installation to setup incident rules and alerts, patching, upgrade etc. If you want, you may watch the full series using the link below: ru-vid.com/group/PLgWj5dy2RoFZLk49TIxMjW5g8C5K0ntjq Now the question 1: Do you have a video with a clear example on how to setup and send an SMS notification to a recipient from an incident rule within OEM13c, please? Answer: OEM by default does not send an SMS or place a phone call but it is actually easy to achieve. I am explaining alert/monitoring setup in the OEM series in Part 9 and 10. To send SMS or make a phone call, you have to integrate a third party Paging software like PagerDuty, Opsgenie or other similar Pager solution with OEM. This is actually very simple as these software have the option to create an associated email id like dba_team@your_company.pagerduty.com or dba_team@your_company.opsgenie.com etc and you just need to redirect the alert email generated by OEM to the Pager software. Once the software receives the alert email, it will send the SMS, or place a phone call with machine voice or an email etc as per the configuration you did. To your second question- incident rule when a metric extension (like a blocking lock on a table) is detected: Please watch below two of my videos: Oracle Locks Simplified [Part-I] - Understanding Locks Deadlocks and Blocking Locks ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-zbPkyqBPKQ8.html Oracle Locks Simplified [Part-2] - Detecting and Alerting on Blocking Locks using SQL and OEM ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OlGxt-eCkuM.html Hope this will help.
@DUMIE63
@DUMIE63 10 месяцев назад
@@YouVolve Hi there Manash, Thanks for getting back to me so quickly. I really appreciate it. I have now managed to get past the issue of OEM13c not being able to send text messages. I now invoke an OS script on the AIX DB server from the OEM13c incident rule. The script then executes and sends a cell phone number to a sms server who will send the SMS to the receiver's (standby person). To test this I have hard coded the cell number into the script. The problem now is that I need to pass the variable values (cell number, DB name, server name, rule name etc.) to the OS script that I am invoking from within OEM13c. Can you explain how I do that please? Thanks for your much valued reply in advance.
@DUMIE63
@DUMIE63 10 месяцев назад
Hey there Manash. Never mind, I have worked it all out. Thanks again for the reply earlier. Take care.
@YouVolve
@YouVolve 10 месяцев назад
Hi Andre, thanks for the update and glad that it worked.
@vishweshwar1876
@vishweshwar1876 Год назад
Hi. It's a very informative video. Can you also share the link for the video on how to create an incident rule?
@YouVolve
@YouVolve Год назад
Hi Vishweshwar, thanks for your feedback. I have a full series in RU-vid (link below) on OEM starting from downloading, installation to configuring OEM in a virtual machine for learning and practice covering topics from very basic to mid-advance level. Already 8 episodes have been uploaded and in the next 2-3 weeks I will cover the incident rule, notification and alerting setup. Please watch the series and you will get everything you need to know.. Link to the series: ru-vid.com/group/PLgWj5dy2RoFZLk49TIxMjW5g8C5K0ntjq
@muralidharkuthethur9749
@muralidharkuthethur9749 7 месяцев назад
Can u pls post event rule creation of this metric extension sir
@YouVolve
@YouVolve 7 месяцев назад
@muralidharkuthethur9749 - Thanks for watching my video. For the Step-by-Step OEM Incident rule creation please watch my video below. Setting up OEM Notification, Monitoring and Alerting: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-j9bA-xagpsY.html Below is my RU-vid series on Full OEM 13c course: Mastering OEM 13c ru-vid.com/group/PLgWj5dy2RoFZLk49TIxMjW5g8C5K0ntjq Hope this will help.
@arsalakhan8184
@arsalakhan8184 2 года назад
thanks for share , please make video how to create incident rule , and send email notification
@YouVolve
@YouVolve 2 года назад
Thanks Arsala. It is in my To-Do list...
@user-vp8yl9yu7h
@user-vp8yl9yu7h Год назад
I Followed the same steps and i had created incident rule also but iam unable to get alert mails can you please reply me
@YouVolve
@YouVolve Год назад
Hi Naveen, thanks for watching my video. I am going to cover the incident rules and alert configuration in the next episode (Part-10) of the series “Mastering OEM”which I am going to uploaded either this week or the next. Please watch that series..
@SANDATA764
@SANDATA764 Год назад
Hi sir , you are really amazing , can we monitor a complete schema long running Sqls for 24 hours? Thank you
@YouVolve
@YouVolve Год назад
Thanks Salad for your question and watching my video. Can you please elaborate your question and what you meant by "complete schema long running Sqls for 24 hours"?
@SANDATA764
@SANDATA764 Год назад
@@YouVolve thank you sir for your prompt response, I mean, application schema long running SQLs for one complete day . Can we monitor it , if yes how ?
@YouVolve
@YouVolve Год назад
Hi Salad, I am still not very clear on your requirement but trying to answer based on what I understood. 1) Yes you can monitor SQLs running for 24 hours. If you have very long running SQLs and you expect them to take a long time like 24 hours but want to send an alert if the run time crosses 24 hours then all you need to do is to change the time limit in the SQL query used in the Metric Extension from 10 minutes to 1440 minutes. 1440 minutes equal to 24 hours. 2) You can also monitor SQLs run by a particular schema/user. For example, in the tutorial, I am excluding SQLs run by SYS user. You can add another filter expression in the WHERE clause as "username='YOUR SCHEMA NAME' " to monitor long running SQLs only for that schema. Hope you got the answers you wanted.
@bhushanaltekar320
@bhushanaltekar320 2 года назад
This will return only one session information. What if there are multiple sessions running long running sql's
@YouVolve
@YouVolve 2 года назад
Hi, you can modify the SQL to return a comma separated list of all or the top-n session IDs. The ME is meant for alerting on the longest running SQL but you can always use your creativity to enhance it. 😀
@bhaveshkumarthakkar2659
@bhaveshkumarthakkar2659 2 года назад
How to create incident rule for it ? Please share video
@YouVolve
@YouVolve 2 года назад
Thanks for your interest. There are many requests for this and I will definitely share one.
@user-vp8yl9yu7h
@user-vp8yl9yu7h Год назад
please share the video for creating incident rule
@shahzadamd.8023
@shahzadamd.8023 Год назад
How to remove OEM alerts which came unnecessary
@YouVolve
@YouVolve Год назад
Thanks for your question. OEM sends the alert only when certain event/incident takes place. If you just want to remove one occurrence, you can go to the Incident Manager section for the target and delete the incident. If you want to stop it for all future occurrences, then you have to disable/modify the thresholds for the metric for the alerting conditions or if it is coming from from a Metric Extension, then you have to update the thresholds for the alerting conditions or the SQL query (if used) accordingly.
Далее
Я КУПИЛ САМЫЙ МОЩНЫЙ МОТОЦИКЛ!
59:15
Я КУПИЛ САМЫЙ МОЩНЫЙ МОТОЦИКЛ!
59:15