Thursday 3 May 2012

Oracle Application Server Status

How to check Oracle Application Server Status?

On Windows services, check the status of OracleASControl and OracleProcessManager.

And for Oracle Process Monitor(OPMN) on command prompt execute opmnctl status command as shown below

ORACLE_HOME\opmn\bin>opmnctl status

Processes in Instance: OAS.XYZ.com
-------------------+--------------------+---------+---------
ias-component | process-type | pid | status
-------------------+--------------------+---------+---------
LogLoader | logloaderd | N/A | Down
dcm-daemon | dcm-daemon | 7688 | Alive
HTTP_Server | HTTP_Server | 22196 | Alive
WebCache | WebCache | 2332 | Alive
WebCache | WebCacheAdmin | 2340 | Alive
OC4J | home | 2372 | Alive
OC4J | OC4J_BI_Forms | 2364 | Alive
OC4J | OC4J_BI_Forms | 2380 | Alive
OC4J | OC4J_BI_Forms | 2396 | Alive
OC4J | OC4J_BI_Forms | 2388 | Alive
DSA | DSA | N/A | Down



The dcm, HTTP Server, WebCache, OC4J status should be alive.

11g DIAGNOSTIC_DEST Initialization parameter

Checking the background_dump_dest for alert log files and user_dump_dest for trace files and errors are going to be a past.

I was excited to know about the new oracle11g initialization parameter DIAGNOSTIC_DEST which replaced BACKGROUND_DUMP_DEST, USER_DUMP_DEST and CORE_DUMP_DEST parameters.

All the trace informations are stored in a single location specified using DIAGNOSTIC_DEST. This helps the Oracle 11g database advisors to have a single point of contact for all the information required to auto tune the SQL or database.

If we do not specify a location for this initialization parameter then it will default to the $ORACLE_BASE/diag

Error 45 initializing SQL*PLUS Internal Error

During pre-11g check the sql script execution fails with the "Error 45 Initializing SQL*PLUS" on the sqlplus as below

SQL> spool utlu1112i.log
SQL> @utlu112i.sql
Error 45 initializing SQL*Plus
Internal error

The reason is the path where the 11g script utlu112i.sql script copied to on the 10g database server.

Solution:
Copy the utlu112i.sql script to the $ORACLE_HOME/rdbms/admin directory and execute the script.


SQL> spool utlu1112i.log
SQL> @utlu112i.sql

Wednesday 2 May 2012

Enterprise Manager 11g fails database instance unavailable

In Oracle 11g RAC the enterprise manager dbconsole doesn't start and gives an OC4J not available error.
If we try to deconfig using emca as below we receive an error database instance unavailable. If you face the same issue then here is one of the possible solution

export ORACLE_SID to the instance id not db id for example if your 2 node rac db is orcl then instance will be orcl1 & orcl2.

Set the ORACLE_SID to orcl2 and export the oracle sid

Go to oracle_home/bin directory and check the emca and emctl files and update if required for the ORACLE_HOME & ORACLE_SID.

And then execute the below command to remove the EM repository


[oracle@home bin]$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at May 2, 2012 11:17:49 AM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: orcl1
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:

Do you wish to continue? [yes(Y)/no(N)]: Y
May 2, 2012 11:18:03 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /opt/oracle/cfgtoollogs/emca/racdb/emca_2012_05_02_11_17_49.log.
May 2, 2012 11:18:03 AM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
May 2, 2012 11:18:06 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...

And after dropping recreate the repository.