How to view the security status and OMS port information?

Displays OMS port information and security status

/u01/weblogic/oms11g/bin $ ./emctl status oms -details
Oracle Enterprise Manager 11g Release 1 Grid Control
Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
Enter Enterprise Manager Root (SYSMAN) Password :
Console Server Host : calora4db01
HTTP Console Port : 7788
HTTPS Console Port : 7799
HTTP Upload Port : 4889
HTTPS Upload Port : 1159
OMS is not configured with SLB or virtual hostname
Agent Upload is unlocked.
OMS Console is unlocked.
Active CA ID: 1

So this indicates the console can be accessed via https://hostname:7799/em or htpp://hostname:7788/em

Advertisements

How to start/stop Oracle Enterprise Manager (OEM)/ Grid Control (GC)?

To start the Oracle Enterprise Manager/Grid Control components in version 11g (11.1.0.1)
$ cd /bin; ./emctl start oms
$ cd /bin; ./emctl start agent
Where OMS_HOME is /u01/weblogic/oms11g and AGENT_HOME is /u01/weblogic/agent11g
Note: This will also start weblogic too

To stop Oracle Enterprise Manager version 11g (11.1.0.1)
$ cd /bin; ./emctl stop agent
$ cd /bin; ./emctl stop oms -all
Where OMS_HOME is /u01/weblogic/oms11g and AGENT_HOME is /u01/weblogic/agent11g
Note: This will also stop weblogic too

Check if any process not terminated and still running, if any found terminate the process
$ ps -ef | grep emagent
$ ps -ef | grep oms11g
$ ps -ef | grep gc_inst

To check OMS Status
/u01/weblogic/oms11g/bin $ ./emctl status oms
Oracle Enterprise Manager 11g Release 1 Grid Control
Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
WebTier is Up
Oracle Management Server is Up

Job to delete log and trace files from OEM

I use this script to clean up all the log and trace file from each host..  You can schedule a job in OEM to go and execute this in all hosts you want.

$cat /etc/oratab

ESRTSP:/oracle/app/EPW/rdbms/v10203_ee_suse10:N
ESRTSS:/oracle/app/EPW/rdbms/v10203_ee_suse10:N
RESTST:/oracle/app/EPW/rdbms/v10203_ee_suse10:N
LISTENER_10g:/oracle/app/EPW/rdbms/v10203_ee_suse10:N
AGENT_10g:/oracle/app/EPW/agent/v10203_ee_suse10:N

#!/bin/ksh

export PATH=/usr/bin:$PATH
export USERNAME=`whoami`
export HOSTNAME=`hostname`

#
#      Clean up Oracle Export logs
#
find /work/dba/logs -name ‘*${HOSTNAME}_*’ -mtime +7 -exec rm {} \;
find /tmp -name ‘*${HOSTNAME}_*’ -mtime +7 -exec rm {} \;
find /work/dba/prod/backups -name ‘tmp_ora_${HOSTNAME}_*’ -mtime +3 -exec rm -r {} \;

###############################################
###############################################
##  ADD ALL INSTANCES TO THE FOR LOOK LIST   ##
###############################################
###############################################

for SID in `cat /etc/oratab|egrep ‘:N|:Y’|grep -v \*|cut -f1 -d’:’|egrep -v  ‘LISTENER|AGENT’`
do

find /oracle/EPW/${SID}/admin/udump -name ‘*.trc’ -mtime +13 -exec rm {} \;
find /oracle/EPW/${SID}/admin/cdump -name ‘core*’ -mtime +13 -exec rm -r {} \;
find /oracle/EPW/${SID}/admin/bdump -name ‘*.trc’ -mtime +13 -exec rm {} \;
find /oracle/EPW/${SID}/admin/adump -name ‘*.aud’ -mtime +13 -exec rm {} \;

done

job-oem

How to change SYSMAN password in OEM (OMS)

To change the Sysman password:
1. Stop the OMS instances that are associated with the repository
a. opmnctl stopall

2. Change the sysman password in the database:
a. Logon to sqlplus as a dba user
b. Issue the command: alter user sysman identified by newpassword;
c. Exit Sqlplus

3. On each management server host, cd to the OMS $ORACLE_HOME/sysman/config directory
a. backup the emoms.properties file
b. edit the emoms.properties file and modify the parameters;
eml.mntr.emdRepPwd=new_password
oracle.sysman.eml.mntr.emdRepPwdEncrypted=FALSE

NOTE: When you restart the OMS, the FALSE setting will change to TRUE and the password will become encrypted in the file

4. Still on Management Repository host, cd to the AGENT_HOME/bin and stop the agent:
./emctl stop agent
5. Next, cd to the AGENT_HOME/sysman/emd directory
a. Edit the targets.xml file and modify the oracle_emrep target definition with the following in bold:
<Target TYPE=”oracle_emrep” NAME=”Management Services and Repository” VERSION=”1.0″>
<Property NAME=”MachineName” VALUE=”host.us.oracle.com”/>
<Property NAME=”Port” VALUE=”1521″/>
<Property NAME=”SID” VALUE=”sid”/>
<Property NAME=”UserName” VALUE=”552f2080d6d8c3c6″ ENCRYPTED=”TRUE”/>
<Property NAME=”password” “newpassword” ENCRYPTED”FALSE”/>
..
..
b. Save the file. The TRUE value will change to FALSE and the newpassword will become encrypted when you restart the Agent.

6. Issue the command (from the Agent O_H/bin):
./emctl start agent

7. Restart each of the OMS’s
emctl start oms

8.Start the OMS instances that are associated with the repository
opmnctl startall

Note that after change all the config files shown in the document, the OEM still had issues to connect to the repository due to the sysman user been locked. After unlock the sysman account everything was back to normal.

Entries found in the $OMS_HOME/sysman/log/emoms.log

2008-07-17 10:40:54,685 [AJPRequestHandler-ApplicationServerThread-7] ERROR conn.ConnectionService verifyRepositoryEx.818 – Invalid Connection Pool. ERROR = ORA-28000: the account is locked