Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2007
    Location
    Tallahassee, FL
    Posts
    10

    Unanswered: auto start the listener in AIX when the systems is rebooted

    I've written a couple of very simple scripts that start the listener as root or as the user oracle. However, when I add the script in the inittab file and issue the teleinit q command, the listener still doesn't start. I've contacted IBM and they say it should work. The inittab entry is correct. The script is correct.

    Any ideas?

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >I've contacted IBM and they say it should work. The inittab entry is correct. The script is correct.

    Then you don't have any problem we (TINW) can help you with.
    You provide us (TINU) nothing of substance to give us clues to assist.

    Since I have to guess, it is possible your environment is lacking;
    As the 1st line of your script add the following:
    env | sort -o /tmp/furbar.env
    After the script run, post the contents of this file back here.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Mar 2007
    Location
    Tallahassee, FL
    Posts
    10
    My initial goal was to auto start/stop the oracle database and listener on AIX. Oracle suggested the following for starting and stopping the database (not the listener):

    1. Create a file called dbora in the /etc directory.
    2. chgrp dba /etc/dbora (change the group for the file permissions)
    3. chmod 750 /etc/dbora (change the permissions of the file.)
    4. add the following lines in the dbora file:

    #! /bin/sh -x
    #
    # Change the value of ORACLE_HOME to specify the correct Oracle home
    # directory for your installation.

    ORACLE_HOME=/u01/app/oracle/product/ora10g
    #
    # Change the value of ORACLE to the login name of the
    # oracle owner at your site.
    #
    ORACLE=oracle

    PATH=${PATH}:$ORACLE_HOME/bin
    HOST=`hostname`
    PLATFORM=`uname`
    export ORACLE_HOME PATH
    #
    if [ ! "$2" = "ORA_DB" ] ; then
    if [ "$PLATFORM" = "HP-UX" ] ; then
    remsh $HOST -l $ORACLE -n "$0 $1 ORA_DB"
    exit
    else
    rsh $HOST -l $ORACLE $0 $1 ORA_DB
    exit
    fi
    fi
    #
    case $1 in
    'start')
    $ORACLE_HOME/bin/dbstart $ORACLE_HOME &
    ;;
    'stop')
    $ORACLE_HOME/bin/dbshut $ORACLE_HOME &
    ;;
    *)
    echo "usage: $0 {start|stop}"
    exit
    ;;
    esac
    #
    exit

    5. Now that we have the dbora file with the correct oracle user and oracle home, we simply create the soft links as follows:

    # ln -s /etc/dbora /etc/rc.d/rc2.d/S99dbora
    # ln -s /etc/dbora /etc/rc.d/rc2.d/K01dbora

    6. You then have to edit the /etc/hosts.equiv file with the following entry:

    host root (where the host is the name of the server)

    My database now will auto start and stop when the AIX system is shutdown.

    I tried doing the same thing for the listener with the following changes:

    I created a dblsn file with the following changes in the script:

    case $1 in
    'start')
    $ORACLE_HOME/bin/lsnstart $ORACLE_HOME &
    ;;
    'stop')
    $ORACLE_HOME/bin/lsnstop $ORACLE_HOME &
    ;;
    *)
    echo "usage: $0 {start|stop}"
    exit
    ;;
    esac
    #
    exit

    The lsnstart script works when I run it from the user Oracle or root. It is as follows:

    #
    # Startup the oracle listener
    #
    export PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/product/ora10g
    export ORACLE_SID=orasql
    export AGENT_HOME=/u01/app/oracle/product/agent10g

    /bin/su oracle -c /u01/app/oracle/product/ora10g/bin/lsnrctl start

    For the /etc/dblsn file, I implemented the following soft links:

    # ln -s /etc/dbora /etc/rc.d/rc2.d/S97dbora
    # ln -s /etc/dbora /etc/rc.d/rc2.d/K03dbora

    If it worked for the database, I thought it should work for the listener. When it didn't, I tried a different method for auto starting the listener:

    1. I copied the lsnstart script above to the /etc directory and renamed it to rc.lsnstart
    2. I then added the script to the inittab by using the following:

    #/usr/sbin/mkitab "rclsnstart:2:wait:/etc/rc.lsnstart > /dev/console 2>&1"

    If I do a telinit q, it should reread the inittab file and start the listener. It doesn't work.

    So, I've tried two methods to automajically starting the oracle listener in an AIX environment with no luck. Any suggestions would be appreciated.
    Last edited by joy32327; 03-27-07 at 14:50.

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Rhetorical question - 'cuz i don't run AIX & have no way to test.
    At Run level 2 is the OS Network interface "alive" so the listener can even function when it gets invoked?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Mar 2007
    Location
    Tallahassee, FL
    Posts
    10
    The inittab entry for the tcpip daemons is as follows:
    rctcpip:23456789:wait:/etc/rc.tcpip > /dev/console 2>&1 # Start TCP/IP daemons

    All the inittab entries that follow the system start entries in the inittab are using run-level 2. I called IBM to troubleshoot and they reviewed the inittab file and checked the current run-level. They said everything looked fine and did not offer any help.

    Very good question though.

  6. #6
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    #/usr/sbin/mkitab "rclsnstart:2:wait:/etc/rc.lsnstart > /dev/console 2>&1"
    Rather than doing something like above; try > /tmp/capture.log 2>&1
    Since it is "not working", it should be throwing error(s) to provide clue as to why it fails.
    Is there any change when changed to Run level 4?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  7. #7
    Join Date
    Mar 2007
    Location
    Tallahassee, FL
    Posts
    10
    I made the inittab entries using both run-levels 3 and 4 as suggested. I also changed the error log file as suggested. After issuing a telinit q to reread the inittab file, the listener didn't start for either run level. No error file was generated in the /tmp direcotry.

  8. #8
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >No error file was generated in the /tmp direcotry.[sp?]
    1) It is NOT an "error file". It is an output file (STDOUT & STDERR)
    2) this leads me to ask what concrete evidence do you have that your script is ever actually invoked?
    3) echo "I started" > /tmp/verify-start.log
    Include the line above at the start of your script as a sanity test.
    If this file does not exist with string, then you have different problem than you 1st thought.

    If you are using Bourne or bash (or similar), you can gain some visibility by invoking script similar to following:
    bash -x myscript.sh
    Last edited by anacedent; 03-27-07 at 15:38.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  9. #9
    Join Date
    Mar 2007
    Location
    Tallahassee, FL
    Posts
    10
    If I add the lines to the script:

    #! /bin/sh -x
    echo "I started" > /tmp/verify-start.log

    and run the script manually, I do see the script execution and a log file is generated. When I attempt to run the script by rereading the inittab file:

    #telinit q

    Nothing happens. You're right, the script isn't even being invoked.

  10. #10
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Nothing happens. You're right, the script isn't even being invoked
    Then I've done all I can & this is not really an Oracle problem but an AIX problem.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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