Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003
    Location
    Jagdishpur
    Posts
    146

    Unanswered: To Start TNS listener automatically when DB start-up

    Hi,

    We are using Oracle9iDB Version 9.2 on SUN Solaris 5.8. We wish to start the DB listener task automatically when we start-up the database.
    Can anyone help how it could be done. I mean by writing some database level trigger or any other way of doing the same. Pls. help.

    Thanks a lot in advance.

    Regards,
    - KR

  2. #2
    Join Date
    Apr 2002
    Location
    California, USA
    Posts
    482
    You can do it on the OS level:

    1. Create this file - oralsnr


    #!/bin/sh
    #
    # Startup for Oracle listener
    #

    ORACLE_HOME=
    ORACLE_OWNER=oracle

    case "$1" in
    'start')
    if [ -f $ORACLE_HOME/bin/lsnrctl ] ; then
    echo "Starting Oracle listener."
    su - $ORACLE_OWNER -c $ORACLE_HOME/bin/lsnrctl start >/dev/null 2>&1 &
    fi
    ;;
    'stop')
    if [ -f $ORACLE_HOME/bin/lsnrctl ] ; then
    echo "Shutting down Oracle listener."
    su - $ORACLE_OWNER -c $ORACLE_HOME/bin/lsnrctl start >/dev/null 2>&1 &
    fi
    ;;
    *)
    echo "Usage: /etc/init.d/oralsnr { start | stop }"
    ;;
    esac
    exit 0

    2. Save the file in /etc/rc.d/init.d

    3. Create soft links in /etc/rc2.d (for start) and /etc/rc0.d (for stop)


    Hope that helps,

    clio_usa - OCP - DBA


  3. #3
    Join Date
    Apr 2003
    Location
    Jagdishpur
    Posts
    146
    Originally posted by clio_usa
    You can do it on the OS level:

    1. Create this file - oralsnr


    #!/bin/sh
    #
    # Startup for Oracle listener
    #

    ORACLE_HOME=
    ORACLE_OWNER=oracle

    case "$1" in
    'start')
    if [ -f $ORACLE_HOME/bin/lsnrctl ] ; then
    echo "Starting Oracle listener."
    su - $ORACLE_OWNER -c $ORACLE_HOME/bin/lsnrctl start >/dev/null 2>&1 &
    fi
    ;;
    'stop')
    if [ -f $ORACLE_HOME/bin/lsnrctl ] ; then
    echo "Shutting down Oracle listener."
    su - $ORACLE_OWNER -c $ORACLE_HOME/bin/lsnrctl start >/dev/null 2>&1 &
    fi
    ;;
    *)
    echo "Usage: /etc/init.d/oralsnr { start | stop }"
    ;;
    esac
    exit 0

    2. Save the file in /etc/rc.d/init.d

    3. Create soft links in /etc/rc2.d (for start) and /etc/rc0.d (for stop)


    Hope that helps,

    clio_usa - OCP - DBA

    dbaclick.com


    Hi, Clio_usa,
    When i used the steps on SUN OS, i got an error message and my system is not going to CDE mode, it is going to character mode and givign me the cosole login. The error message is
    "The X-Server can not be started on display : 0....
    SUN Management center is not setup. Please setup first and then run es-start"

    Pls. see & help. What may be the reason why i am getting this error.

    Please help. Thanks in advance.

    Regards,
    - KR

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •