Enable Debug Mode Oracle Enterprise Manager

you need to change directory to below :

/u01/app/oracle/product/11.2.0/dbhome_1/sysman/config

under this directory you will work on

  • emd.properties
  • emagentlogging.properties
Backup two files. using cp command.
Open 

  • emagentlogging.properties
File :

change 

log4j.rootCategory=WARN, emagentlogAppender, emagenttrcAppender
TO 
log4j.rootCategory=DEBUG, emagentlogAppender, emagenttrcAppender
  • emd.properties
Change 
EMAGENT_PERL_TRACE_LEVEL=WARN
TO 
EMAGENT_PERL_TRACE_LEVEL=DEBUG
Restart dbconsole
Thank you 
Osama mustafa

Script to Restart the OEM Agent When It Has Failed

Gaurav Batta has published this nice script to restart the OEM agent when it has failed:

$ cat agent_check.sh
#!/usr/bin/ksh
#
agent_status=`ps -ef|awk ‘{print $8}’|grep agent10g/bin/emagent`

if [[ -z $agent_status ]]
then
$AGENT_HOME/bin/emctl start agent
echo Agent started on server `hostname` at `date`
else
echo Agent is running fine on server `hostname` at `date`
fi

It is running every 30min.
crontab –l

00,30 * * * * /home/oemagent/agent_check.sh >> /home/oemagent/agent_status.log




Enjoy 


Thank you
Osama Mustafa

Reconfigure Oracle EM

Sometimes when you do something wrong  and problems start you need tons of works to recreate what you did ?
But is this mean its impossible to fix it , Oh No
Today i am going to talk about how to reconfigure Oracle enterprise manager using command line :

1- set ORACLE_SID=orcl
2-emca -deconfig dbcontrol db -repos drop
3- You’ll receive the following prompts :

STARTED EMCA at AUG 10, 2011 8:26:42 AM
EM Configuration Assistant, Version 10.2.0.5.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
 
Enter the following information:
Database SID: orcl
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: y


But if you already have Sysman schema the following error will be appear :

CONFIG: ORA-20001: SYSMAN already EXISTS..
ORA-06512: at line 17


4-Drop User Sysman in the following steps (sqlplus /as sysdba)

DROP USER sysman CASCADE;
DROP PUBLIC SYNONYM setemviewusercontext;
DROP ROLE mgmt_user;
DROP PUBLIC SYNONYM mgmt_target_blackouts;
DROP USER mgmt_view;


5-emca -config dbcontrol db -repos create

STARTED EMCA at AUG 10, 2011 8:28:48 AM
EM Configuration Assistant, Version 10.2.0.5.0 Production
Copyright (c) 2003, 2005, Oracle.  ALL rights reserved.
 
Enter the following information:
DATABASE SID: orcl
Listener port NUMBER: 1521
Password FOR SYS USER:
Password FOR DBSNMP USER:
Password FOR SYSMAN USER:
Password FOR SYSMAN USER: Email address FOR notifications (optional):
Outgoing Mail (SMTP) server FOR notifications (optional):
-----------------------------------------------------------------
 
You have specified the following settings
 
DATABASE ORACLE_HOME ................ C:\app\Administrator\product\11.1.0\db_1
 
LOCAL hostname ................ mclaughlin11g
Listener port NUMBER ................ 1521
DATABASE SID ................ orcl
Email address FOR notifications ...............
Outgoing Mail (SMTP) server FOR notifications ...............
 
-----------------------------------------------------------------
 
Do you wish TO continue? [yes(Y)/no(N)]: y