Friday 20 July 2012

OEM Stand Alone

OEM Stand Alone

OEM Stand Alone Steps:

prerequisites:-

  • check the configrations

               $ which emca
                 /u01/app/oracle/product/10.2.0.1/bin/emca
               $ which emctl
                 /u01/app/oracle/product/10.2.0.1/bin/emctl

Note: "$ emca -help " for help
  • Listener and tnsnames are in up state.
  • Database must be in open state.
SQL> SELECT open_mode FROM V$DATABASE;
 READ WRITE
          or
SQL> SELECT status from v$instance;
   OPEN
SQL> SELECT schema,comp_id,status,version FROM DBA_REGISTRY;

 SCHEMA      COMP_ID       STATUS      VERSION
-------------------------------------------------
   SYS        CATALOG       VALID      10.2.0.1
   SYS        CATPROC       VALID      10.2.0.1

step1:- 

$ emca -config dbcontrol db -repos create

oracle sid = ravi10
port number = 1530
sys password =
dbsnmp password =
 ........
 ........

Note: this type of link will be came & open in browser connect and access the database.
Checking the OEM :

$ emctl status dbconsole
TZ set to Asia/Calcutta
Oracle Enterprise Manager 10g Database Control Release 10.2.0.2.0
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://ravi.apps.com:1158/em/console/aboutApplication
EM Daemon is not running.
------------------------------------------------------------------
Logs are generated in directory /u01/oraprod/db/tech_st/10.2.0//ravi.apps.com_prod/sysman/log



$ emctl start dbconsole
TZ set to Asia/Calcutta
Oracle Enterprise Manager 10g Database Control Release 10.2.0.2.0
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://ravi.apps.com:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ....
 started.
------------------------------------------------------------------
Logs are generated in directory /u01/oraprod/db/tech_st/10.2.0//ravi.apps.com_prod/sysman/log

$ emctl stop dbconsole
TZ set to Asia/Calcutta
Oracle Enterprise Manager 10g Database Control Release 10.2.0.2.0
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://ravi.apps.com:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...

 Cannot determine Oracle Enterprise Manager 10g Database Control process. /u01/oraprod/db/tech_st/10.2.0//ravi.apps.com_prod/emctl.pid does not exist.
[oraprod@ravi prod_ravi]$



steps to delete dbcontrol manually ========================= 
Please drop using the below steps and create it. 1- Delete DBControl Configuration Files Manually: 
Remove the following directories from your filesystem: 
<ORACLE_HOME>/<hostname>_<db_unique_name> <ORACLE_HOME>/oc4j/j2ee/OC4J_DBConsole_<hostname>_<db_unique_name> 
2- Delete DBControl Repository Objects Manually: 
a- Drop AQ related objects in the SYSMAN schema: 
Logon to SQL*PLUS as user SYS and execute the following: 
SQL> exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'SYSMAN.MGMT_NOTIFY_QTABLE',force=>TRUE); 
b- Drop the DBControl Repository Objects: 
Logon to SQL*PLUS as user SYS and execute the following: 
SQL> DECLARE CURSOR c1 IS SELECT owner, synonym_name name FROM dba_synonyms WHERE table_owner = 'SYSMAN'; BEGIN FOR r1 IN c1 LOOP IF r1.owner = 'PUBLIC' THEN EXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM '||r1.name; ELSE EXECUTE IMMEDIATE 'DROP SYNONYM '||r1.owner||'.'||r1.name; END IF; END LOOP; END; SQL> DROP USER mgmt_view CASCADE; SQL> DROP ROLE mgmt_user; SQL> DROP USER sysman CASCADE; SQL> drop public synonym MGMT_TARGET_BLACKOUTS; SQL> drop public synonym MGMT_AVAILABLITY; SQL> drop public synonym SETEMVIEWUSERCONTEXT; 


Before install db-control , make sure you have come up with below prerequisite 

*********************************************************************EMCA checks*********************************** 
Environment Variables Check: 

Before running EMCA command following environment variables must be set. 
ORACLE_HOSTANME=<hostname of the server> 
ORACLE_HOME=<Absolute path of Database oracle home> 
ORACLE_SID=<SID of Database> 
ORACLE_UNQNAME=<db_unique_name from database> 
LD_LIBRARY_PATH=$ORACLE_HOME/lib (For 32 bit Linux) 
----On AIX: LIBPATH=$LD_LIBRARY_PATH;$ORACLE_HOME/lib32 
TNS_ADMIN=<TNS Admin directory> : In case listener is running from non default location 

Database Check:

1)-Ensure that the Database is up and running by executing the below commands: 
<ORACLE_HOME>/bin/sqlplus "/ as sysdba" 
SQL> select status from v$instance; 

2)-Ensure that the Listener servicing the Database is up and running by executing the below command: 
<ORACLE_HOME>/bin/lsnrctl status <listener name> 

3)-SYS should be able to establish connection to the Database both via the listener and also the bequeath adaptor. 
<ORACLE_HOME>/bin/sqlplus sys as sysdba 
or 
<ORACLE_HOME>/bin/sqlplus "sys as sysdba" 
and 
<ORACLE_HOME>/bin/sqlplus sys/<Password>@<TNS Connect descriptor> 

If above connection fails take corrective actions to get the connection working from sqlplus. 

4)-Password file should be correctly configured for SYS user connection. 

Verify the initialization parameter REMOTE_LOGIN_PASSWORDFILE is set to EXCLUSIVE by executing the below command. 
SQL> show parameter REMOTE_LOGIN_PASSWORDFILE; 

5)-DBSNMP user must exist in the database and should be able to connect to the database. 
<ORACLE_HOME>/bin/sqlplus dbsnmp/<password> 


Files need to take backup:


1. Stop the database control: 
export ORACLE_HOSTNAME=10.2.0.xxxexport HOSTNAME=10.2.0.xxxemctl stop dbconsole. 
2. Move all files from /oracle/db/tech_st/11.1.0/10.2.0.xxx_OURPROD/sysman/log 
3. Keep backup of emd.properties and emoms.properties file in /oracle/db/tech_st/11.1.0/10.2.0.xxx_OURPROD/sysman/config folder. 
4. Do following modification: 
* Edit /oracle/db/tech_st/11.1.0/10.2.0.xxx_OURPROD/sysman/config/emagentlogging.properties and modify: 
log4j.rootCategory=WARN, emagentlogAppender, emagenttrcAppender to log4j.rootCategory=DEBUG, emagentlogAppender, emagenttrcAppender 
* Edit /oracle/db/tech_st/11.1.0/10.2.0.xxx_OURPROD/sysman/config/emomslogging.properties and modify: 
log4j.rootCategory=WARN, emlogAppender, emtrcAppender to log4j.rootCategory=DEBUG, emlogAppender, emtrcAppender 
5. Start database control. 
export ORACLE_HOSTNAME=10.2.0.xxxexport HOSTNAME=10.2.0.xxxemctl start dbconsole 


find . -exec grep -q "/oracle/db/tech_st" {} \; -print 



To secure the dbconsole, execute the following steps : 

1) Set the environment variable ORACLE_SID to TEST 
2) /data1/TESTDB/db/tech_st/11.1.0/bin/emctl stop dbconsole 
3) /data1/TESTDB/db/tech_st/11.1.0/bin/emctl config emkey -repos -sysman_pwd < Password for SYSMAN user > 
4) /data1/TESTDB/db/tech_st/11.1.0/bin/emctl secure dbconsole -sysman_pwd < Password for SYSMAN user > 
5) /data1/TESTDB/db/tech_st/11.1.0/bin/emctl start dbconsole 
6)Then check the status using : 
/data1/TESTDB/db/tech_st/11.1.0/bin/emctl status dbconsole 
7) Try to login using the URL shown in the output of command in step 6. 

start the dbconsole without secure:


[oracle@R12-test 11.1.0]$ emctl stop dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.1.0.7.0
Copyright (c) 1996, 2008 Oracle Corporation.  All rights reserved.
https://R12-test.bilt.com:5500/em/console/aboutApplication
Stopping Oracle Enterprise Manager 11g Database Control ...
 ...  Stopped.
[oracle@R12-test 11.1.0]$


[oracle@R12-test 11.1.0]$ emctl unsecure dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.1.0.7.0
Copyright (c) 1996, 2008 Oracle Corporation.  All rights reserved.
https://R12-test.bilt.com:5500/em/console/aboutApplication
Configuring DBConsole for HTTP...   Done.
DBCONSOLE already stopped...   Done.
Agent is already stopped...   Done.
Unsecuring dbconsole...   Started.
DBConsole is now unsecured...  Done.
Unsecuring dbconsole...  Sucessful.

[oracle@R12-test 11.1.0]$ emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.1.0.7.0
Copyright (c) 1996, 2008 Oracle Corporation.  All rights reserved.
http://R12-test.bilt.com:5500/em/console/aboutApplication
Starting Oracle Enterprise Manager 11g Database Control ..... started.
------------------------------------------------------------------
Logs are generated in directory /data2/TESTDB/db/tech_st/11.1.0/R12-test.bilt.com_TEST/sysman/log
[oracle@R12-test 11.1.0]$



Metalink notes:
How to Enable Enterprise Manager on the Oracle E-Business Suite Release 12 (Doc ID 458533.1)
EMCA fails on Oracle Apps R12.1 Oracle Database 11.1.0.7 With "Failed to unlock all EM-related accounts" ( Doc ID 968054.1 ) 
Error copying b64InternetCertificate.txt When Attempting To CreateDBConsole for a Cloned EBS Database ( Doc ID 1290408.1 ) 
EMCA Release 10.1 to 11.1 Puts the Database in Quiesce And No New Connections or Operations Can Be Performed During the DB Control Repository Creation ( Doc ID 375946.1 )
How To Cleanup All DBConsole left-over Processes? ( Doc ID 1171814.1 )