Thursday, February 7, 2013

Listener log missing when Oracle Clusterware starts listener resource script

This post could be interesting for those who are running active/passive failover clusters with Oracle Clusterware used for managing resources. In this case owner of the Clusterware installation is not the same as owner of the Oracle RDBMS installation. Among others, Clusterware is assigned for managing listener resource (start,stop,check).

Till 11g version listener logs were by default written in “$ORACLE_HOME/network/log” but with 11g ADR (Automatic Diagnostic Repository) is introduced and location for listener log is changed. From 11g default location is “$ORACLE_BASE/diag/tnslsnr/<hostname>/listener_<dbname>/trace”.

I’ve noticed that when you start listener as owner of Oracle RDBMS everything is working fine. Listener log and traces are written under ADR. But when listener is started from Clusterware environment ADR directory structure is not created and listener log is not written.

In Oracle technical whitepaper Using Oracle Clusterware to Protect A Single Instance Oracle Database 11g is explained how to create active/passive cluster using Oracle Clusterware.

It is said that script for managing listener resource is made generic and you don’t have to modify anything. You only must enter ORACLE_HOME and listener name which will be stored in Oracle Cluster Registry. At the end of the document (page 22) you can find perl script for listener resource so I will not copy it here.


Now lets go back to listener log. As ORACLE_BASE is not specified in the script ADR location could not be found and logging entries are not stored.


There are couple solutions for this problem:

1. You could modify script and specify “ORACLE_BASE” but then this script wouldn’t be generic.

2. Introduce additional parameter “ORACLE_BASE” as part of crs_profile command line to keep script generic and modify script. You should thoroughly test the script afterwards.

3. Disable ADR by setting in listener.ora “DIAG_ADR_ENABLED_<listener_name>=OFF” and restart listener. After disabling ADR listener logs are successfully written in “$ORACLE_HOME/network/log” directory.

4. In listener.ora specify “ADR_BASE_listener = <path>” where <path> should be location stored in “diagnostic_dest” parameter defined in database. Then restart listener and logs should be written in ADR.


I would recommend to avoid first two options and use third or fourth.


1 comment: