Mir Sayeed Hassan – Oracle Blog

Oracle DBA – Tips & Techniques | Learn with real-time examples

  • Translate

  • It’s Me




  • My Certificates

  • Links

    My Acclaim Certification : Credly Profile
    My Oracle ACE Pro Profile

  • Achievements

    Awarded Top 100 Oracle Blogs from Worldwide - #RANK 39
  • VISITORS COUNT

  • Verified International Academic Qualification from World Education Service (WES)

    Verified International Academic Qualification from World Education Service (WES)

  • Jobs

How to clear the stateless alert from OEM 12C/13C by using the EMCLI method

Posted by Mir Sayeed Hassan on July 15th, 2020

How to clear the stateless alert from OEM 12C/13C by using the EMCLI method

The explanation for clearing the unnecessary alert from the OEM 12C/13C.

Login to the sysman user to perform this operation.

To login to the sysman user, you need go to oms bin location as shown below.

[oracle@oem12c ~]$ cd /u01/app/oracle/middleware/oms/bin/

Login to the sysman (Password should be provided as OEM sysman user)

[oracle@oem12c bin]$ ./emcli login -username=sysman
Enter password : *******
Login successful

If you would like to check the Individual database alert, issue the below command

[oracle@oem12c bin]$ ./emcli clear_stateless_alerts -older_than=0 -target_type=oracle_database -target_name=REALDB -unacknowledged_only -ignore_notifications -preview

The following alerts can be cleared:

Total Alerts
==============
2

Note: Here we could see there are 2 alert log in given database

And OEM

 

 

Execute the below command to clear.

[oracle@oem12c bin]$ ./emcli clear_stateless_alerts -older_than=0 -target_type=oracle_database -target_name=REALDB

2 alerts were cleared successfully.

Verify the clear alerts

[oracle@oem12c bin]$ ./emcli clear_stateless_alerts -older_than=0 -target_type=oracle_database -target_name=REALDB
No alert found.

Also verify from OEM

 

 

In case if you would like to view all the clearing alert from all the database, then issue the below command.

[oracle@oem12c bin]$ ./emcli get_metrics_for_stateless_alerts  -target_type=osm_instance

Metric                                    Metric Internal Name
=======                                   =====================
Archive Hung Error Stack                  osm_instance:db_alert_log:archiveHungErr
                                          Stack
Data Block Corruption Error Stack         osm_instance:db_alert_log:blockCorruptEr
                                          rStack
Alert Log Error Stack                     osm_instance:db_alert_log:genericErrStac
                                          k
Media Failure Error Stack                 osm_instance:db_alert_log:mediaFailureEr
                                          rStack
Session Terminated Error Stack            osm_instance:db_alert_log:sessTerminateE
                                          rrStack
Archive Hung Error Stack                  osm_instance:alertLog:archiveHungErrStac
                                          k
Data Block Corruption Error Stack         osm_instance:alertLog:blockCorruptErrSta
                                          ck
Alert Log Error Stack                     osm_instance:alertLog:genericErrStack
Media Failure Error Stack                 osm_instance:alertLog:mediaFailureErrSta
                                          ck
Session Terminated Error Stack            osm_instance:alertLog:sessTerminateErrSt
                                          ack
Checker Failure Detected                  osm_instance:adrAlertLogCheckerFailure:g

Also In case if you are not sure about the target types names then you can get the information through emcli command as shown below:

Syntax:

List all the databases

[oracle@oem12c bin]$ ./emcli get_targets -targets=%database
Status  ID             Status           Target Type           Target Name
      
1                      Up               oracle_database       racdbst_10.116.0.134
2                      Up               oracle_database       rarc_10.117.0.137
3                      Up               oracle_database       Tajmi_Stby_db
4                      Up               oracle_database       tochdb_10.2.102.14

List all the RAC databases

[oracle@oem12c bin]$ ./emcli get_targets -targets=%rac_database

Status ID  Status           Target Type           Target Name
1           Up              rac_database          tarcx
4           Up              rac_database          racdb

List all the osm instances

./emcli get_targets -targets=%osm

List all types of targets

./emcli get_targets -targets

=====Hence tested & verified in our test env=====