Tuesday, July 10, 2012

dbstart script/ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener


 
-bash-3.2$ dbstart
 
ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
Usage: /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart ORACLE_HOME
Processing Database instance "orcl": log file /u01/app/oracle/product/11.2.0/dbhome_1/startup.log
 
 
And i try to do the following 
 
-bash-3.2$ export ORACLE_HOME_LISTNER=$ORACLE_HOME
-bash-3.2$ dbstart
ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
Usage: /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart ORACLE_HOME
Processing Database instance "orcl": log file /u01/app/oracle/product/11.2.0/dbhome_1/startup.log
 
Open dbstart and check the Scripts 
 
# First argument is used to bring up Oracle Net Listener
ORACLE_HOME_LISTNER=$1
if [ ! $ORACLE_HOME_LISTNER ] ; then
  echo "ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener"
  echo "Usage: $0 ORACLE_HOME"
 
 
Try the following Solution , over ride value inside dbstart with the below command 
 
-bash-3.2$ dbstart $ORACLE_HOME
 
Enjoy 
 
Osama mustafa
 
 

7 comments:

  1. i want to Automating Database Shutdown and Startup when os linux start/stop i do the following:
    su root
    1-Edit the #vi /etc/oratabfile :
    orcl:/home/oracle/app/oracle/product/11.2.0/dbhome_1:Y

    2-cd /etc/init.d and vi dbora
    add the following lines to dbora
    #!/bin/bash
    # chkconfig: 35 99 10
    # description: Starts and stops Oracle processes
    ORA_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
    ORA_OWNER=oracle
    case "$1" in
    'start')
    su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
    su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
    ;;
    'stop')
    su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
    su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
    ;;
    esac


    3-# chgrp oinstall dbora
    4-# chmod 750 dbora

    5-# /sbin/chkconfig --add dbora

    when i restrat my os and I tried to connect to sqlplus / as sysdba
    the output was you are connected to idle instance please osama,I forgot something???

    ReplyDelete
  2. Thnak you in advance

    ReplyDelete
  3. Please Post database version and Os Version

    ReplyDelete
  4. Salem alkiom;
    thank you osama for reply.
    OS version:centos 5
    DATABASE version: oracle 11.2.0

    ReplyDelete
  5. I did it auto start and stop in this way

    1-Edit the #vi /etc/oratabfile :
    orcl:/home/oracle/app/oracle/product/11.2.0/dbhome_1:Y

    then

    vi /etc/init.d/oracle

    paste this script to it and save

    #!/bin/bash
    #
    # oracle This shell script takes care of starting and stopping
    # the Oracle subsystem (oracle).
    #
    # chkconfig: - 64 36
    # description: Oracle database server.
    # processname: oracle
    # pidfile: /var/run/oracle/oracle.pid
    ### BEGIN INIT INFO
    # Provides: oracle
    # Required-Start: $local_fs $remote_fs $network $named $syslog $time
    # Required-Stop: $local_fs $remote_fs $network $named $syslog $time
    # Short-Description: start and stop Oracle server
    # Description: Oracle database server
    ### END INIT INFO

    # Source function library.
    . /etc/rc.d/init.d/functions

    # Source networking configuration.
    . /etc/sysconfig/network

    start() {
    if [ -e /var/lock/subsys/oracle ];then
    echo "Starting Oracle Enterprise Server"
    failure
    else
    echo "Starting Oracle Enterprise Server"
    success
    echo "`date "+%m/%d/%Y %H:%M:%S"` : Starting Oracle Listeners" >> /var/log/oracle/oracle.log
    su - oracle -c "lsnrctl start" >> /var/log/oracle/oracle.log
    echo "`date "+%m/%d/%Y %H:%M:%S"` : Starting Oracle Databases" >> /var/log/oracle/oracle.log
    su - oracle -c "dbstart" >> /var/log/oracle/oracle.log
    echo "`date "+%m/%d/%Y %H:%M:%S"` : Starting Oracle Enterprise Manager" >> /var/log/oracle/oracle.log
    su - oracle -c "emctl start dbconsole" >> /var/log/oracle/oracle.log
    touch /var/lock/subsys/oracle
    fi
    }

    stop() {
    if [ -f /var/lock/subsys/oracle ];then
    echo "Shutting Down Oracle Enterprise Server"
    success
    echo "`date "+%m/%d/%Y %H:%M:%S"` : Shutting Down Oracle Enterprise Manager" >> /var/log/oracle/oracle.log
    su - oracle -c "emctl stop dbconsole" >> /var/log/oracle/oracle.log
    echo "`date "+%m/%d/%Y %H:%M:%S"` : Shutting Down Oracle Listeners" >> /var/log/oracle/oracle.log
    su - oracle -c "lsnrctl stop" >> /var/log/oracle/oracle.log
    echo "`date "+%m/%d/%Y %H:%M:%S"` : Shutting Down Oracle Databases" >> /var/log/oracle/oracle.log
    su - oracle -c "dbshut" >> /var/log/oracle/oracle.log
    rm -f /var/lock/subsys/oracle
    else
    echo "Shutting Down Oracle Enterprise Server"
    failure
    fi
    }

    case "$1" in
    start)
    start
    ;;
    stop)
    stop
    ;;
    status)
    if [ -e /var/lock/subsys/oracle ]; then
    echo -n "Oracle Enterprise Server is Running"
    success
    echo
    else
    echo -n "Oracle Enterprise Server is Not Running"
    failure
    echo
    fi
    ;;
    restart)
    stop
    sleep 2
    start
    ;;
    *)
    echo $"Usage: $0 {start|stop|restart|status}"
    exit 1

    esac
    exit 0

    then
    chkconfig --add oracle
    chkconfig oracle on


    Cheers Your done

    ReplyDelete
    Replies
    1. There is always another way :) Thanks for sharing

      Delete
  6. I am getting error as mention below.
    ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
    Usage: ./dbstart ORACLE_HOME

    I have go through As you mention in blog but that did not work for me. Please help me with solution.
    Operating system: Suse Linux 11
    Database : Oracle 11g R2

    ReplyDelete