DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 10

Thread: Problem in dbshut script file. URGENT!!!

  1. #1
    Join Date
    Oct 2002
    Posts
    43

    Problem in dbshut script file. URGENT!!!

    Hi all,
    I'm using oracle8.1.7 on Linux(RH 7.3).
    In my oratab this the entry comes below..

    SMPLE:/usr/local/oracle/product/8.1.7:Y:/usr/local/oracle/product/8.1.7/dbs/initSMPLE.ora

    I give my dbshut script, if there is anything to be change, plz let me know..
    thanx in advance
    Pratheesh
    /*dbshut script */
    ORATAB=/etc/oratab

    trap 'exit' 1 2 3
    case $ORACLE_TRACE in
    T) set -x ;;
    esac

    # Set path if path not set (if called from /etc/rc)
    case $PATH in
    "") PATH=/bin:/usr/bin:/etc
    export PATH ;;
    esac
    # Save LD_LIBRARY_PATH
    SAVE_LLP=$LD_LIBRARY_PATH

    #
    # Loop for every entry in oratab file and and try to shut down
    # that ORACLE
    #

    cat $ORATAB | while read LINE
    do
    case $LINE in
    \#*) ;; #comment-line in oratab
    *)
    # Proceed only if third field is 'Y'.
    if [ "`echo $LINE | awk -F: '{print $3}' -`" = "Y" ] ; then
    ORACLE_SID=`echo $LINE | awk -F: '{print $1}' -`
    if [ "$ORACLE_SID" = '*' ] ; then
    ORACLE_SID=""
    fi
    # Called programs use same database ID
    export ORACLE_SID
    ORACLE_HOME=`echo $LINE | awk -F: '{print $2}' -`
    # Called scripts use same home directory
    export ORACLE_HOME
    # Put $ORACLE_HOME/bin into PATH and export.
    PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/etc ; export PATH
    # add for bug 652997
    LD_LIBRARY_PATH=${SAVE_LLP}:${ORACLE_HOME}/lib ; export LD_LIBRARY_PATH
    # ---- Sam ----
    PFILE=`echo $LINE | awk -F: '{print $4}' -`
    # --- Original --- PFILE=${ORACLE_HOME}/dbs/init${ORACLE_SID}.ora
    # ---- Sam ----

    # See if it is a V6 or V7 database
    if [ -f $ORACLE_HOME/bin/sqldba ] ; then
    VERSION=`$ORACLE_HOME/bin/sqldba command=exit | awk '
    /SQL\*DBA: (Release|Version)/ {split($3, V, ".") ;
    print V[1]}'`
    SQLDBA=sqldba
    else
    if [ -f $ORACLE_HOME/bin/svrmgrl ] ; then
    SQLDBA=svrmgrl
    else
    SQLDBA="sqlplus /nolog"
    fi
    fi
    case $VERSION in
    6) sqldba command=shutdown ;;
    *) $SQLDBA < connect internal
    shutdown
    EOF
    ;;
    esac

    if test $? -eq 0 ; then
    echo "Database \"${ORACLE_SID}\" shut down."
    else
    echo "Database \"${ORACLE_SID}\" not shut down."
    fi
    fi
    ;;
    esac
    done

  2. #2
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    So what exactly is the problem
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  3. #3
    Join Date
    Nov 2002
    Location
    Dublin, Ireland
    Posts
    133
    your /etc/oratab file should look like this :
    SMPLE:/usr/local/oracle/product/8.1.7:Y

    Giani

  4. #4
    Join Date
    Mar 2002
    Posts
    24
    Hi,

    Just follow this

    u can create this file anywhere ..
    $vi /usr/local/oracle/product/8.1.7/myoratab
    PROD:/usr/local/oracle/product/8.1.7:Y
    >>Save and Exit
    Note: why this is in the sense.. don't use /etc/oratab file..
    b'coz u need to consult the sys admin to change the /etc/oratab file
    but here we don't need.

    $vi /usr/local/oracle/product/8.1.7/bin/dbshut

    just change this
    ORATAB=/usr/local/oracle/product/8.1.7/myoratab
    >>Save And exit

    and u can change in dbstart also same thing

    It works....
    Happy DBAing
    Laxman

  5. #5
    Join Date
    Oct 2002
    Posts
    43

    Hi laxman

    Originally posted by laxman
    Hi,

    Just follow this

    u can create this file anywhere ..
    $vi /usr/local/oracle/product/8.1.7/myoratab
    PROD:/usr/local/oracle/product/8.1.7:Y
    >>Save and Exit
    Note: why this is in the sense.. don't use /etc/oratab file..
    b'coz u need to consult the sys admin to change the /etc/oratab file
    but here we don't need.

    $vi /usr/local/oracle/product/8.1.7/bin/dbshut

    just change this
    ORATAB=/usr/local/oracle/product/8.1.7/myoratab
    >>Save And exit

    and u can change in dbstart also same thing

    It works....
    Happy DBAing
    Laxman
    Hi laxman,
    Did u check, is there any probs.. with my dbshut file..
    plz respond asap
    Pratheesh

  6. #6
    Join Date
    Oct 2002
    Posts
    43
    I can go upto this below using the dbshut script file even I showed my dbshut file also in the above..
    Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved.

    Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production
    With the Partitioning option
    JServer Release 8.1.7.0.1 - Production

    SVRMGR> Connected.
    SVRMGR>

    After this not getting moved..
    Very Urgent..
    Pratheesh

  7. #7
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    you've made that overly complicated, but never mind.

    from a quick look through looks like you are not calling EOF after you connect to svrmgrl

  8. #8
    Join Date
    Oct 2002
    Posts
    43

    Lightbulb have a glands!! davey23uk

    Originally posted by davey23uk
    you've made that overly complicated, but never mind.

    from a quick look through looks like you are not calling EOF after you connect to svrmgrl
    No EOF is there next to shutdown..
    check it out once again..
    if anything needs to be added in between plz, let me know..
    thanx in advance
    Pratheesh

  9. #9
    Join Date
    Mar 2001
    Posts
    144
    What davey23uk was saying is that you need to indicate to the shell the commands to get processed with the application to continue until the EOF indicator.

    This is what it needs to look like

    "6) sqldba command=shutdown ;;
    internal) $SQLDBA << EOF
    connect internal
    shutdown
    EOF"

    Without the << EOF shell just logs in and does nothing. This needs to be added for the shutdown command to be processed.
    Last edited by ramaral; 12-09-2002 at 10:15 AM.

  10. #10
    Join Date
    Mar 2001
    Posts
    144
    continuation from this double post:

    http://www.dbasupport.com/forums/sho...threadid=32075

    Look at the message above - it's << not < . Try it again.

Posting Permissions

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


Click Here to Expand Forum to Full Width