Remember your dreams

Remember your dreams
Remember your dreams
Showing posts with label OEM. Show all posts
Showing posts with label OEM. Show all posts

Friday, May 18, 2012

Clear alerts in Oracle Enterprise Manager OEM

I am using 11g, but this work in 10g as well.
I had this annoying alert appearing under my alert tab on OEM for some time. A failed job, yes I knew it failed and fixed it that day. I waited for the alert to disappear, but alas, it did not. I acknowledged it and thought that was the end of that. Well it's been hanging around for some time and when I click on it the alert it take me to a jobs page with no information on how to clear.

I started hunting around for information on how to clear alerts that have no purpose in OEM and I found a lot of posting that said to log in as sysman and query the mgmt_current_severity and then use em_severity.delete_current_severity to remove the desired alert.

Okay that sounds good, but then I found a post by a Said Ahmed. He posted the following query which I found to be very useful so here it is.

First log in as SYSMAN or your repository owner.


select t.target_name
, t.target_type
, collection_timestamp
, message
, 'exec em_severity.delete_current_severity(''' ||
t.target_guid || ''',''' ||
metric_guid || ''',''' ||
key_value || ''')' em_severity
from sysman.mgmt_targets t
inner join
sysman.mgmt_current_severity s
on
t.target_guid = s.target_guid;


This will give you information about all the alerts in OEM. Copy the result from the em_severity column that you want removed. Run it exactly as it appears. Be sure you are logged in as sysman.

For example:
SQL> exec em_severity.delete_current_severity('stuff','moretuff','SCHEMA')

Before deletion
After deletion




Tuesday, April 17, 2012

Recreating the OEM .

Recreating the Oracle Enterprise Manager (OEM) for your newly duplicated database.
Enterprise Manager Grid Control - Version: 10.1.0.2 to 11.2.0.2 - Release: 10.1 to 11.2

If there is a change in SID, DBID, or hostname for the database that has been restored then you need to recreate the dbconsole.

Refer How To Reconfigure DB Control After a Hostname, Domain name or Listener Change Has Occurred On The Server
(MOS Doc ID 293678.1) Information in this document applies to any platform.

This is the process:

Stop OEM

# emctl stop dbconsole

Drop the existing OEM installation.

# cd $ORACLE_HOME
# cd ./sysman/admin/emdrep/bin/
#./RepManager servername.domain.com 1526 dev311 -action drop

Enter SYS user's password :
Enter repository user name : sysman
Getting temporary tablespace from database...
.
.
.
Dropping Repos User ... Done.
Dropping Roles/Synonymns/Tablespaces ... Done.
Dropped Repository Successfully.

Install the OEM

# cd $ORACLE_HOME/bin
./emca -config dbcontrol db -repos create

STARTED EMCA at Apr 12, 2012 2:26:40 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:
Database SID: dev311
Database Control is already configured for the database dev311
You have chosen to configure Database Control for managing the database dev311
This will remove the existing configuration and the default settings and perform a fresh configuration
Do you wish to continue? [yes(Y)/no(N)]:y

Listener ORACLE_HOME [ /app/oracle/product/11.2.0 ]:
Password for SYS user: xxxx
Password for DBSNMP user: xxxx
Password for SYSMAN user: xxxxx
Email address for notifications (optional): email@company.com
Outgoing Mail (SMTP) server for notifications (optional): smtp-server.com

-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /app/oracle/product/11.2.0.2

Local hostname ................ servername.com
Listener ORACLE_HOME ................ /app/oracle/product/11.2.0.2
Listener port number ................ 1526
Database SID ................ dev311
Email address for notifications ............... email@company.com
Outgoing Mail (SMTP) server for notifications ............... smtp-server.com

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Apr 12, 2012 2:28:25 PM oracle.sysman.emcp.EMConfig perform
.
.
.
***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Apr 12, 2012 2:34:42 PM

I like to finish up with a stop and start of the emctl services.

# emctl stop dbconsole

# emctl start dbconsole

Using my browser I can access OEM and review my newly cloned database.


Proactive Oracle DBA

This is a series of posts. I am working this to share some of the many scripts I schedule to automatically run to alert me of any current o...