FAQ
Oracle 8.0.5
Solaris 2.6

List:
I've created a script (ksh) called from elsewhere that shuts down the
database. I REALLY want to echo the name of the database into my log file
before I shut down. While "select name from v$database" works fine from
svrmgrl interactively, it throws up in the script. I'd guess the $ sign is
screwing it up. (I can get other commands to work within the script.)
However, I don't know what to do about it.

Any ideas?

Thx!!!

Barb

$ svrmgrl

SVRMGR> connect internal
Connected.
SVRMGR> select name from v$database;
NAME

TADENT

1 row selected.

#!/usr/bin/ksh
# $Id: stop_db.sh ver.1 10/02/2002 B.Baker Exp $
# Name: stop_db.sh
# Author: Barb Baker
# Purpose: execute shutdown immediate on current database
# (i.e., database pointed to by current value of ORACLE_SID)
############################################################
echo "Stop oracle instance \"${ORACLE_SID}\" at `date` "
${ORACLE_HOME}/bin/svrmgrl << EOF
connect internal
select name from v_$database;
EOF

$ ./stop_db.sh
Stop oracle instance "tadent" at Wed Oct 2 16:24:59 MDT 2002

SVRMGR> Connected.

SVRMGR> select name from v_
*

ORA-00942: table or view does not exist
SVRMGR>

Server Manager complete.

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Baker, Barbara
INET: bbaker_at_denvernewspaperagency.com

Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).

Search Discussions

  • Ron Thomas at Oct 3, 2002 at 12:33 am
    Sounds like you svrmgrl commands are in a "where document". You need to escape the $, ie

    select name from v\$database;

    Ron Thomas
    Hypercom, Inc
    rthomas_at_hypercom.com
    Each new user of a new system uncovers a new class of bugs. -- Kernighan

    root_at_fatcity.com
    To: ORACLE-L_at_fatcity.com
    10/02/02 04:28 PM cc:
    Please respond to Subject: svrmgrl echo v$database in script
    ORACLE-L

    Oracle 8.0.5
    Solaris 2.6

    List:
    I've created a script (ksh) called from elsewhere that shuts down the
    database. I REALLY want to echo the name of the database into my log file
    before I shut down. While "select name from v$database" works fine from
    svrmgrl interactively, it throws up in the script. I'd guess the $ sign is
    screwing it up. (I can get other commands to work within the script.)
    However, I don't know what to do about it.

    Any ideas?

    Thx!!!

    Barb

    $ svrmgrl

    SVRMGR> connect internal
    Connected.
    SVRMGR> select name from v$database;
    NAME

    TADENT

    1 row selected.

    #!/usr/bin/ksh
    # $Id: stop_db.sh ver.1 10/02/2002 B.Baker Exp $
    # Name: stop_db.sh
    # Author: Barb Baker
    # Purpose: execute shutdown immediate on current database
    # (i.e., database pointed to by current value of ORACLE_SID)
    ############################################################
    echo "Stop oracle instance \"${ORACLE_SID}\" at `date` "
    ${ORACLE_HOME}/bin/svrmgrl << EOF
    connect internal
    select name from v_$database;
    EOF

    $ ./stop_db.sh
    Stop oracle instance "tadent" at Wed Oct 2 16:24:59 MDT 2002

    SVRMGR> Connected.

    SVRMGR> select name from v_
    *

    ORA-00942: table or view does not exist
    SVRMGR>

    Server Manager complete.

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Baker, Barbara
    INET: bbaker_at_denvernewspaperagency.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Ron Thomas
    INET: rthomas_at_hypercom.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
  • Sujatha Madan at Oct 3, 2002 at 12:43 am
    Hi Barbara!

    Try using a "\" before the "$".

    So your script should read:

    echo "Stop oracle instance \"${ORACLE_SID}\" at `date` "

    ${ORACLE_HOME}/bin/svrmgrl << EOF
    connect internal
    select name from v\$database;

    EOF

    Cheers
    Suji

    -----Original Message-----
    Sent: Thursday, 3 October 2002 9:28 AM
    To: Multiple recipients of list ORACLE-L

    Oracle 8.0.5
    Solaris 2.6

    List:
    I've created a script (ksh) called from elsewhere that shuts down the
    database. I REALLY want to echo the name of the database into my log file
    before I shut down. While "select name from v$database" works fine from
    svrmgrl interactively, it throws up in the script. I'd guess the $ sign is
    screwing it up. (I can get other commands to work within the script.)
    However, I don't know what to do about it.

    Any ideas?

    Thx!!!

    Barb

    $ svrmgrl

    SVRMGR> connect internal
    Connected.
    SVRMGR> select name from v$database;
    NAME

    TADENT

    1 row selected.

    #!/usr/bin/ksh
    # $Id: stop_db.sh ver.1 10/02/2002 B.Baker Exp $
    # Name: stop_db.sh
    # Author: Barb Baker
    # Purpose: execute shutdown immediate on current database
    # (i.e., database pointed to by current value of ORACLE_SID)
    ############################################################
    echo "Stop oracle instance \"${ORACLE_SID}\" at `date` "
    ${ORACLE_HOME}/bin/svrmgrl << EOF
    connect internal
    select name from v_$database;
    EOF

    $ ./stop_db.sh
    Stop oracle instance "tadent" at Wed Oct 2 16:24:59 MDT 2002

    SVRMGR> Connected.

    SVRMGR> select name from v_
    *

    ORA-00942: table or view does not exist
    SVRMGR>

    Server Manager complete.

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Baker, Barbara
    INET: bbaker_at_denvernewspaperagency.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Sujatha Madan
    INET: Sujatha.Madan_at_cmc.optus.net.au

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
  • Jacques Kilchoer at Oct 3, 2002 at 12:48 am
    The shell thinks that "$database" is an environment variable.
    Try instead "select name from v\$database"
    -----Original Message-----
    From: Baker, Barbara

    Oracle 8.0.5
    Solaris 2.6

    List:
    I've created a script (ksh) called from elsewhere that shuts down the
    database. I REALLY want to echo the name of the database
    into my log file
    before I shut down. While "select name from v$database"
    works fine from
    svrmgrl interactively, it throws up in the script. I'd guess
    the $ sign is
    screwing it up. (I can get other commands to work within the script.)
    However, I don't know what to do about it.

    $ svrmgrl

    SVRMGR> connect internal
    Connected.
    SVRMGR> select name from v$database;
    NAME
    ---------
    TADENT
    1 row selected.


    #!/usr/bin/ksh
    # $Id: stop_db.sh ver.1 10/02/2002 B.Baker Exp $
    # Name: stop_db.sh
    # Author: Barb Baker
    # Purpose: execute shutdown immediate on current database
    # (i.e., database pointed to by current value
    of ORACLE_SID)
    ############################################################
    echo "Stop oracle instance \"${ORACLE_SID}\" at `date` "
    ${ORACLE_HOME}/bin/svrmgrl << EOF
    connect internal
    select name from v_$database;
    EOF

    $ ./stop_db.sh
    Stop oracle instance "tadent" at Wed Oct 2 16:24:59 MDT 2002


    SVRMGR> Connected.
    SVRMGR> select name from v_
    *
    ORA-00942: table or view does not exist
    SVRMGR>
    Server Manager complete.
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Jacques Kilchoer
    INET: Jacques.Kilchoer_at_quest.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
  • Scott.Shafer_at_dcpds.cpms.osd.mil at Oct 3, 2002 at 3:43 pm
    echo $ORACLE_SID >> logfile

    Scott Shafer
    San Antonio, TX
    210.581.6217
    -----Original Message-----
    From: Baker, Barbara [SMTP:bbaker_at_denvernewspaperagency.com]
    Sent: Wednesday, October 02, 2002 6:28 PM
    To: Multiple recipients of list ORACLE-L
    Subject: svrmgrl echo v$database in script


    Oracle 8.0.5
    Solaris 2.6

    List:
    I've created a script (ksh) called from elsewhere that shuts down the
    database. I REALLY want to echo the name of the database into my log file
    before I shut down. While "select name from v$database" works fine from
    svrmgrl interactively, it throws up in the script. I'd guess the $ sign
    is
    screwing it up. (I can get other commands to work within the script.)
    However, I don't know what to do about it.

    Any ideas?

    Thx!!!

    Barb

    $ svrmgrl

    SVRMGR> connect internal
    Connected.
    SVRMGR> select name from v$database;
    NAME
    ---------
    TADENT
    1 row selected.


    #!/usr/bin/ksh
    # $Id: stop_db.sh ver.1 10/02/2002 B.Baker Exp $
    # Name: stop_db.sh
    # Author: Barb Baker
    # Purpose: execute shutdown immediate on current database
    # (i.e., database pointed to by current value of ORACLE_SID)
    ############################################################
    echo "Stop oracle instance \"${ORACLE_SID}\" at `date` "
    ${ORACLE_HOME}/bin/svrmgrl << EOF
    connect internal
    select name from v_$database;
    EOF

    $ ./stop_db.sh
    Stop oracle instance "tadent" at Wed Oct 2 16:24:59 MDT 2002


    SVRMGR> Connected.
    SVRMGR> select name from v_
    *
    ORA-00942: table or view does not exist
    SVRMGR>
    Server Manager complete.

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Baker, Barbara
    INET: bbaker_at_denvernewspaperagency.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author:
    INET: Scott.Shafer_at_dcpds.cpms.osd.mil

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
  • Robertson Lee - lerobe at Oct 3, 2002 at 5:33 pm
    Hi,

    This works....

    #!/bin/ksh
    export ORACLE_SID=ADW
    export ORACLE_HOME=/usr/app/oracle/product/8.0.5
    export PATH=$ORACLE_HOME/bin:$PATH

    svrmgrl <> logfile

    Scott Shafer
    San Antonio, TX
    210.581.6217
    -----Original Message-----
    From: Baker, Barbara [SMTP:bbaker_at_denvernewspaperagency.com]
    Sent: Wednesday, October 02, 2002 6:28 PM
    To: Multiple recipients of list ORACLE-L
    Subject: svrmgrl echo v$database in script


    Oracle 8.0.5
    Solaris 2.6

    List:
    I've created a script (ksh) called from elsewhere that shuts down the
    database. I REALLY want to echo the name of the database into my log file
    before I shut down. While "select name from v$database" works fine from
    svrmgrl interactively, it throws up in the script. I'd guess the $ sign
    is
    screwing it up. (I can get other commands to work within the script.)
    However, I don't know what to do about it.

    Any ideas?

    Thx!!!

    Barb

    $ svrmgrl

    SVRMGR> connect internal
    Connected.
    SVRMGR> select name from v$database;
    NAME
    ---------
    TADENT
    1 row selected.


    #!/usr/bin/ksh
    # $Id: stop_db.sh ver.1 10/02/2002 B.Baker Exp $
    # Name: stop_db.sh
    # Author: Barb Baker
    # Purpose: execute shutdown immediate on current database
    # (i.e., database pointed to by current value of ORACLE_SID)
    ############################################################
    echo "Stop oracle instance \"${ORACLE_SID}\" at `date` "
    ${ORACLE_HOME}/bin/svrmgrl << EOF
    connect internal
    select name from v_$database;
    EOF

    $ ./stop_db.sh
    Stop oracle instance "tadent" at Wed Oct 2 16:24:59 MDT 2002


    SVRMGR> Connected.
    SVRMGR> select name from v_
    *
    ORA-00942: table or view does not exist
    SVRMGR>
    Server Manager complete.

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Baker, Barbara
    INET: bbaker_at_denvernewspaperagency.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author:
    INET: Scott.Shafer_at_dcpds.cpms.osd.mil

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).

    **********************************************************************
    The information contained in this communication is
    confidential, is intended only for the use of the recipient
    named above, and may be legally privileged.
    If the reader of this message is not the intended
    recipient, you are hereby notified that any dissemination,
    distribution, or copying of this communication is strictly
    prohibited.
    If you have received this communication in error,
    please re-send this communication to the sender and
    delete the original message or any copy of it from your
    computer system. Thank You.

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Robertson Lee - lerobe
    INET: lerobe_at_acxiom.co.uk

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
  • Fink, Dan at Oct 3, 2002 at 5:33 pm
    What happens if the ORACLE_SID is set to one value and the caller uses
    SQL*Net to access a different database? While this is not usually the case
    in scripts, it could be a problem if the script is parted of a called
    function.
    ORACLE_SID=DEV

    sqlplus scott/tiger_at_PROD <-- I'm not connected to DEV anymore.

    I realize this is nit-picking, but I've done far too many recoveries because
    someone thought they were in DEV when they actually connected to PROD. I'd
    rather know EXACTLY which db I'm connected to, not which one the O/S thinks
    I should be in.

    My $.02

    Dan Fink

    -----Original Message-----

    Sent: Thursday, October 03, 2002 9:43 AM
    To: Multiple recipients of list ORACLE-L

    echo $ORACLE_SID >> logfile

    Scott Shafer
    San Antonio, TX
    210.581.6217
    -----Original Message-----
    From: Baker, Barbara [SMTP:bbaker_at_denvernewspaperagency.com]
    Sent: Wednesday, October 02, 2002 6:28 PM
    To: Multiple recipients of list ORACLE-L
    Subject: svrmgrl echo v$database in script


    Oracle 8.0.5
    Solaris 2.6

    List:
    I've created a script (ksh) called from elsewhere that shuts down the
    database. I REALLY want to echo the name of the database into my log file
    before I shut down. While "select name from v$database" works fine from
    svrmgrl interactively, it throws up in the script. I'd guess the $ sign
    is
    screwing it up. (I can get other commands to work within the script.)
    However, I don't know what to do about it.

    Any ideas?

    Thx!!!

    Barb

    $ svrmgrl

    SVRMGR> connect internal
    Connected.
    SVRMGR> select name from v$database;
    NAME
    ---------
    TADENT
    1 row selected.


    #!/usr/bin/ksh
    # $Id: stop_db.sh ver.1 10/02/2002 B.Baker Exp $
    # Name: stop_db.sh
    # Author: Barb Baker
    # Purpose: execute shutdown immediate on current database
    # (i.e., database pointed to by current value of ORACLE_SID)
    ############################################################
    echo "Stop oracle instance \"${ORACLE_SID}\" at `date` "
    ${ORACLE_HOME}/bin/svrmgrl << EOF
    connect internal
    select name from v_$database;
    EOF

    $ ./stop_db.sh
    Stop oracle instance "tadent" at Wed Oct 2 16:24:59 MDT 2002


    SVRMGR> Connected.
    SVRMGR> select name from v_
    *
    ORA-00942: table or view does not exist
    SVRMGR>
    Server Manager complete.

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Baker, Barbara
    INET: bbaker_at_denvernewspaperagency.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author:
    INET: Scott.Shafer_at_dcpds.cpms.osd.mil

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Fink, Dan
    INET: Dan.Fink_at_mdx.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
  • Rachel Carmichael at Oct 3, 2002 at 5:44 pm
    If fyou want to do it from within a script, you either need to code the
    select into a .sql file that you run OR you need to "escape" the $ with
    a \ in your ksh script

    Scott.Shafer_at_dcpds.cpms.osd.mil wrote:
    echo $ORACLE_SID >> logfile

    Scott Shafer
    San Antonio, TX
    210.581.6217

    -----Original Message-----
    From: Baker, Barbara [SMTP:bbaker_at_denvernewspaperagency.com]
    Sent: Wednesday, October 02, 2002 6:28 PM
    To: Multiple recipients of list ORACLE-L
    Subject: svrmgrl echo v$database in script


    Oracle 8.0.5
    Solaris 2.6

    List:
    I've created a script (ksh) called from elsewhere that shuts down the
    database. I REALLY want to echo the name of the database into my log file
    before I shut down. While "select name from v$database" works fine from
    svrmgrl interactively, it throws up in the script. I'd guess the $ sign
    is
    screwing it up. (I can get other commands to work within the script.)
    However, I don't know what to do about it.

    Any ideas?

    Thx!!!

    Barb

    $ svrmgrl

    SVRMGR> connect internal
    Connected.
    SVRMGR> select name from v$database;
    NAME
    ---------
    TADENT
    1 row selected.


    #!/usr/bin/ksh
    # $Id: stop_db.sh ver.1 10/02/2002 B.Baker Exp $
    # Name: stop_db.sh
    # Author: Barb Baker
    # Purpose: execute shutdown immediate on current database
    # (i.e., database pointed to by current value of
    ORACLE_SID)
    ############################################################
    echo "Stop oracle instance \"${ORACLE_SID}\" at `date` "
    ${ORACLE_HOME}/bin/svrmgrl << EOF
    connect internal
    select name from v_$database;
    EOF

    $ ./stop_db.sh
    Stop oracle instance "tadent" at Wed Oct 2 16:24:59 MDT 2002


    SVRMGR> Connected.
    SVRMGR> select name from v_
    *
    ORA-00942: table or view does not exist
    SVRMGR>
    Server Manager complete.

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Baker, Barbara
    INET: bbaker_at_denvernewspaperagency.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services

    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like
    subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author:
    INET: Scott.Shafer_at_dcpds.cpms.osd.mil

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    Do you Yahoo!?
    New DSL Internet Access from SBC & Yahoo!
    http://sbc.yahoo.com

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Rachel Carmichael
    INET: wisernet100_at_yahoo.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
  • Kevin Lange at Oct 3, 2002 at 5:44 pm
    In order for the K Shell to let you use a Dollar Sign ($) as a litteral
    you need to use the escape character before it (\)


    So, instead of
    select name from v$database;
    use
    select name from v\$database;

    -----Original Message-----

    Sent: Thursday, October 03, 2002 10:43 AM
    To: Multiple recipients of list ORACLE-L

    echo $ORACLE_SID >> logfile

    Scott Shafer
    San Antonio, TX
    210.581.6217
    -----Original Message-----
    From: Baker, Barbara [SMTP:bbaker_at_denvernewspaperagency.com]
    Sent: Wednesday, October 02, 2002 6:28 PM
    To: Multiple recipients of list ORACLE-L
    Subject: svrmgrl echo v$database in script


    Oracle 8.0.5
    Solaris 2.6

    List:
    I've created a script (ksh) called from elsewhere that shuts down the
    database. I REALLY want to echo the name of the database into my log file
    before I shut down. While "select name from v$database" works fine from
    svrmgrl interactively, it throws up in the script. I'd guess the $ sign
    is
    screwing it up. (I can get other commands to work within the script.)
    However, I don't know what to do about it.

    Any ideas?

    Thx!!!

    Barb

    $ svrmgrl

    SVRMGR> connect internal
    Connected.
    SVRMGR> select name from v$database;
    NAME
    ---------
    TADENT
    1 row selected.


    #!/usr/bin/ksh
    # $Id: stop_db.sh ver.1 10/02/2002 B.Baker Exp $
    # Name: stop_db.sh
    # Author: Barb Baker
    # Purpose: execute shutdown immediate on current database
    # (i.e., database pointed to by current value of ORACLE_SID)
    ############################################################
    echo "Stop oracle instance \"${ORACLE_SID}\" at `date` "
    ${ORACLE_HOME}/bin/svrmgrl << EOF
    connect internal
    select name from v_$database;
    EOF

    $ ./stop_db.sh
    Stop oracle instance "tadent" at Wed Oct 2 16:24:59 MDT 2002


    SVRMGR> Connected.
    SVRMGR> select name from v_
    *
    ORA-00942: table or view does not exist
    SVRMGR>
    Server Manager complete.

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Baker, Barbara
    INET: bbaker_at_denvernewspaperagency.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author:
    INET: Scott.Shafer_at_dcpds.cpms.osd.mil

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Kevin Lange
    INET: kgel_at_ppoone.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
  • Deshpande, Kirti at Oct 3, 2002 at 6:03 pm
    Use \ to escape the $ sign.

    select name from v_\$database;

    Kirti
    -----Original Message-----
    From: Baker, Barbara [SMTP:bbaker_at_denvernewspaperagency.com]
    Sent: Wednesday, October 02, 2002 6:28 PM
    To: Multiple recipients of list ORACLE-L
    Subject: svrmgrl echo v$database in script


    Oracle 8.0.5
    Solaris 2.6

    List:
    I've created a script (ksh) called from elsewhere that shuts down the
    database. I REALLY want to echo the name of the database into my log file
    before I shut down. While "select name from v$database" works fine from
    svrmgrl interactively, it throws up in the script. I'd guess the $ sign
    is
    screwing it up. (I can get other commands to work within the script.)
    However, I don't know what to do about it.

    Any ideas?

    Thx!!!

    Barb

    $ svrmgrl

    SVRMGR> connect internal
    Connected.
    SVRMGR> select name from v$database;
    NAME
    ---------
    TADENT
    1 row selected.


    #!/usr/bin/ksh
    # $Id: stop_db.sh ver.1 10/02/2002 B.Baker Exp $
    # Name: stop_db.sh
    # Author: Barb Baker
    # Purpose: execute shutdown immediate on current database
    # (i.e., database pointed to by current value of ORACLE_SID)
    ############################################################
    echo "Stop oracle instance \"${ORACLE_SID}\" at `date` "
    ${ORACLE_HOME}/bin/svrmgrl << EOF
    connect internal
    select name from v_$database;
    EOF

    $ ./stop_db.sh
    Stop oracle instance "tadent" at Wed Oct 2 16:24:59 MDT 2002


    SVRMGR> Connected.
    SVRMGR> select name from v_
    *
    ORA-00942: table or view does not exist
    SVRMGR>
    Server Manager complete.

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Baker, Barbara
    INET: bbaker_at_denvernewspaperagency.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author:
    INET: Scott.Shafer_at_dcpds.cpms.osd.mil

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Deshpande, Kirti
    INET: kirti.deshpande_at_verizon.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
  • Scott.Shafer_at_dcpds.cpms.osd.mil at Oct 3, 2002 at 6:08 pm
    Change your unholy methods to use the light side of the force.
    or
    Just use a different variable to hold the tnsnames.ora entry of wherever
    you happen to be connecting to. Or initialize the $ORACLE_SID variable to
    whatever you want it to be. This allows you to iterate through a list of
    SIDs to perform ops on multiple db's if needed, i.e.,

    "sqlplus user_at_current_sid
    ...
    exit
    echo $current_sid >> logfile"

    in your script.

    Scott Shafer
    San Antonio, TX
    210.581.6217
    -----Original Message-----
    From: Fink, Dan [SMTP:Dan.Fink_at_mdx.com]
    Sent: Thursday, October 03, 2002 12:34 PM
    To: Multiple recipients of list ORACLE-L
    Subject: RE: svrmgrl echo v$database in script

    What happens if the ORACLE_SID is set to one value and the caller uses
    SQL*Net to access a different database? While this is not usually the case
    in scripts, it could be a problem if the script is parted of a called
    function.
    ORACLE_SID=DEV
    sqlplus scott/tiger_at_PROD <-- I'm not connected to DEV anymore.

    I realize this is nit-picking, but I've done far too many recoveries
    because
    someone thought they were in DEV when they actually connected to PROD. I'd
    rather know EXACTLY which db I'm connected to, not which one the O/S
    thinks
    I should be in.

    My $.02

    Dan Fink

    -----Original Message-----

    Sent: Thursday, October 03, 2002 9:43 AM
    To: Multiple recipients of list ORACLE-L


    echo $ORACLE_SID >> logfile

    Scott Shafer
    San Antonio, TX
    210.581.6217

    -----Original Message-----
    From: Baker, Barbara [SMTP:bbaker_at_denvernewspaperagency.com]
    Sent: Wednesday, October 02, 2002 6:28 PM
    To: Multiple recipients of list ORACLE-L
    Subject: svrmgrl echo v$database in script


    Oracle 8.0.5
    Solaris 2.6

    List:
    I've created a script (ksh) called from elsewhere that shuts down the
    database. I REALLY want to echo the name of the database into my log file
    before I shut down. While "select name from v$database" works fine from
    svrmgrl interactively, it throws up in the script. I'd guess the $ sign
    is
    screwing it up. (I can get other commands to work within the script.)
    However, I don't know what to do about it.

    Any ideas?

    Thx!!!

    Barb

    $ svrmgrl

    SVRMGR> connect internal
    Connected.
    SVRMGR> select name from v$database;
    NAME
    ---------
    TADENT
    1 row selected.


    #!/usr/bin/ksh
    # $Id: stop_db.sh ver.1 10/02/2002 B.Baker Exp $
    # Name: stop_db.sh
    # Author: Barb Baker
    # Purpose: execute shutdown immediate on current database
    # (i.e., database pointed to by current value of
    ORACLE_SID)
    ############################################################
    echo "Stop oracle instance \"${ORACLE_SID}\" at `date` "
    ${ORACLE_HOME}/bin/svrmgrl << EOF
    connect internal
    select name from v_$database;
    EOF

    $ ./stop_db.sh
    Stop oracle instance "tadent" at Wed Oct 2 16:24:59 MDT 2002


    SVRMGR> Connected.
    SVRMGR> select name from v_
    *
    ORA-00942: table or view does not exist
    SVRMGR>
    Server Manager complete.
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author:
    INET: Scott.Shafer_at_dcpds.cpms.osd.mil

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
  • Ruth Gramolini at Oct 3, 2002 at 6:28 pm
    Lee, you're alive. I'll let the OT list know! Ruth
    ----- Original Message -----
    To: "Multiple recipients of list ORACLE-L"
    Sent: Thursday, October 03, 2002 1:33 PM
    Hi,

    This works....

    #!/bin/ksh
    export ORACLE_SID=ADW
    export ORACLE_HOME=/usr/app/oracle/product/8.0.5
    export PATH=$ORACLE_HOME/bin:$PATH

    svrmgrl < connect internal
    select name from v_\$database;
    exit

    EOF
    Just escape the $ sign with a backslash.

    HTH
    Lee

    -----Original Message-----

    Sent: 03 October 2002 16:43
    To: Multiple recipients of list ORACLE-L


    echo $ORACLE_SID >> logfile

    Scott Shafer
    San Antonio, TX
    210.581.6217

    -----Original Message-----
    From: Baker, Barbara [SMTP:bbaker_at_denvernewspaperagency.com]
    Sent: Wednesday, October 02, 2002 6:28 PM
    To: Multiple recipients of list ORACLE-L
    Subject: svrmgrl echo v$database in script


    Oracle 8.0.5
    Solaris 2.6

    List:
    I've created a script (ksh) called from elsewhere that shuts down the
    database. I REALLY want to echo the name of the database into my log
    file
    before I shut down. While "select name from v$database" works fine
    from
    svrmgrl interactively, it throws up in the script. I'd guess the $ sign
    is
    screwing it up. (I can get other commands to work within the script.)
    However, I don't know what to do about it.

    Any ideas?

    Thx!!!

    Barb

    $ svrmgrl

    SVRMGR> connect internal
    Connected.
    SVRMGR> select name from v$database;
    NAME
    ---------
    TADENT
    1 row selected.


    #!/usr/bin/ksh
    # $Id: stop_db.sh ver.1 10/02/2002 B.Baker Exp $
    # Name: stop_db.sh
    # Author: Barb Baker
    # Purpose: execute shutdown immediate on current database
    # (i.e., database pointed to by current value of
    ORACLE_SID)
    ############################################################
    echo "Stop oracle instance \"${ORACLE_SID}\" at `date` "
    ${ORACLE_HOME}/bin/svrmgrl << EOF
    connect internal
    select name from v_$database;
    EOF

    $ ./stop_db.sh
    Stop oracle instance "tadent" at Wed Oct 2 16:24:59 MDT 2002


    SVRMGR> Connected.
    SVRMGR> select name from v_
    *
    ORA-00942: table or view does not exist
    SVRMGR>
    Server Manager complete.

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Baker, Barbara
    INET: bbaker_at_denvernewspaperagency.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author:
    INET: Scott.Shafer_at_dcpds.cpms.osd.mil

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).




    **********************************************************************
    The information contained in this communication is
    confidential, is intended only for the use of the recipient
    named above, and may be legally privileged.
    If the reader of this message is not the intended
    recipient, you are hereby notified that any dissemination,
    distribution, or copying of this communication is strictly
    prohibited.
    If you have received this communication in error,
    please re-send this communication to the sender and
    delete the original message or any copy of it from your
    computer system. Thank You.

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Robertson Lee - lerobe
    INET: lerobe_at_acxiom.co.uk

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Ruth Gramolini
    INET: rgramolini_at_tax.state.vt.us

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
  • Scott.Shafer_at_dcpds.cpms.osd.mil at Oct 3, 2002 at 6:28 pm
    Or a here document that allows you to iterate through a list of SID's if
    necessary. Env variables don't have to be static on *nix...

    Scott Shafer
    San Antonio, TX
    210.581.6217
    -----Original Message-----
    From: Rachel Carmichael [SMTP:wisernet100_at_yahoo.com]
    Sent: Thursday, October 03, 2002 12:44 PM
    To: Multiple recipients of list ORACLE-L
    Subject: RE: svrmgrl echo v$database in script

    If fyou want to do it from within a script, you either need to code the
    select into a .sql file that you run OR you need to "escape" the $ with
    a \ in your ksh script


    --- Scott.Shafer_at_dcpds.cpms.osd.mil wrote:
    echo $ORACLE_SID >> logfile

    Scott Shafer
    San Antonio, TX
    210.581.6217

    -----Original Message-----
    From: Baker, Barbara [SMTP:bbaker_at_denvernewspaperagency.com]
    Sent: Wednesday, October 02, 2002 6:28 PM
    To: Multiple recipients of list ORACLE-L
    Subject: svrmgrl echo v$database in script


    Oracle 8.0.5
    Solaris 2.6

    List:
    I've created a script (ksh) called from elsewhere that shuts down the
    database. I REALLY want to echo the name of the database into my log file
    before I shut down. While "select name from v$database" works fine from
    svrmgrl interactively, it throws up in the script. I'd guess the $ sign
    is
    screwing it up. (I can get other commands to work within the script.)
    However, I don't know what to do about it.

    Any ideas?

    Thx!!!

    Barb

    $ svrmgrl

    SVRMGR> connect internal
    Connected.
    SVRMGR> select name from v$database;
    NAME
    ---------
    TADENT
    1 row selected.


    #!/usr/bin/ksh
    # $Id: stop_db.sh ver.1 10/02/2002 B.Baker Exp $
    # Name: stop_db.sh
    # Author: Barb Baker
    # Purpose: execute shutdown immediate on current database
    # (i.e., database pointed to by current value of
    ORACLE_SID)
    ############################################################
    echo "Stop oracle instance \"${ORACLE_SID}\" at `date` "
    ${ORACLE_HOME}/bin/svrmgrl << EOF
    connect internal
    select name from v_$database;
    EOF

    $ ./stop_db.sh
    Stop oracle instance "tadent" at Wed Oct 2 16:24:59 MDT 2002


    SVRMGR> Connected.
    SVRMGR> select name from v_
    *
    ORA-00942: table or view does not exist
    SVRMGR>
    Server Manager complete.

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Baker, Barbara
    INET: bbaker_at_denvernewspaperagency.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services

    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like
    subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author:
    INET: Scott.Shafer_at_dcpds.cpms.osd.mil

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).

    __________________________________________________
    Do you Yahoo!?
    New DSL Internet Access from SBC & Yahoo!
    http://sbc.yahoo.com
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Rachel Carmichael
    INET: wisernet100_at_yahoo.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author:
    INET: Scott.Shafer_at_dcpds.cpms.osd.mil

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
  • Robertson Lee - lerobe at Oct 4, 2002 at 8:08 am
    Heh heh,

    Just popped in for a quicky !!!!!!!

    Regards

    Lee

    -----Original Message-----
    Sent: 03 October 2002 19:29
    To: Multiple recipients of list ORACLE-L

    Lee, you're alive. I'll let the OT list know! Ruth
    ----- Original Message -----
    To: "Multiple recipients of list ORACLE-L"
    Sent: Thursday, October 03, 2002 1:33 PM
    Hi,

    This works....

    #!/bin/ksh
    export ORACLE_SID=ADW
    export ORACLE_HOME=/usr/app/oracle/product/8.0.5
    export PATH=$ORACLE_HOME/bin:$PATH

    svrmgrl < connect internal
    select name from v_\$database;
    exit

    EOF
    Just escape the $ sign with a backslash.

    HTH
    Lee

    -----Original Message-----

    Sent: 03 October 2002 16:43
    To: Multiple recipients of list ORACLE-L


    echo $ORACLE_SID >> logfile

    Scott Shafer
    San Antonio, TX
    210.581.6217

    -----Original Message-----
    From: Baker, Barbara [SMTP:bbaker_at_denvernewspaperagency.com]
    Sent: Wednesday, October 02, 2002 6:28 PM
    To: Multiple recipients of list ORACLE-L
    Subject: svrmgrl echo v$database in script


    Oracle 8.0.5
    Solaris 2.6

    List:
    I've created a script (ksh) called from elsewhere that shuts down the
    database. I REALLY want to echo the name of the database into my log
    file
    before I shut down. While "select name from v$database" works fine
    from
    svrmgrl interactively, it throws up in the script. I'd guess the $ sign
    is
    screwing it up. (I can get other commands to work within the script.)
    However, I don't know what to do about it.

    Any ideas?

    Thx!!!

    Barb

    $ svrmgrl

    SVRMGR> connect internal
    Connected.
    SVRMGR> select name from v$database;
    NAME
    ---------
    TADENT
    1 row selected.


    #!/usr/bin/ksh
    # $Id: stop_db.sh ver.1 10/02/2002 B.Baker Exp $
    # Name: stop_db.sh
    # Author: Barb Baker
    # Purpose: execute shutdown immediate on current database
    # (i.e., database pointed to by current value of
    ORACLE_SID)
    ############################################################
    echo "Stop oracle instance \"${ORACLE_SID}\" at `date` "
    ${ORACLE_HOME}/bin/svrmgrl << EOF
    connect internal
    select name from v_$database;
    EOF

    $ ./stop_db.sh
    Stop oracle instance "tadent" at Wed Oct 2 16:24:59 MDT 2002


    SVRMGR> Connected.
    SVRMGR> select name from v_
    *
    ORA-00942: table or view does not exist
    SVRMGR>
    Server Manager complete.

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Baker, Barbara
    INET: bbaker_at_denvernewspaperagency.com

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author:
    INET: Scott.Shafer_at_dcpds.cpms.osd.mil

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).




    **********************************************************************
    The information contained in this communication is
    confidential, is intended only for the use of the recipient
    named above, and may be legally privileged.
    If the reader of this message is not the intended
    recipient, you are hereby notified that any dissemination,
    distribution, or copying of this communication is strictly
    prohibited.
    If you have received this communication in error,
    please re-send this communication to the sender and
    delete the original message or any copy of it from your
    computer system. Thank You.

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Robertson Lee - lerobe
    INET: lerobe_at_acxiom.co.uk

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Ruth Gramolini
    INET: rgramolini_at_tax.state.vt.us

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).
    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author: Robertson Lee - lerobe
    INET: lerobe_at_acxiom.co.uk

    Fat City Network Services -- 858-538-5051 http://www.fatcity.com
    San Diego, California -- Mailing list and web hosting services
    ---------------------------------------------------------------------
    To REMOVE yourself from this mailing list, send an E-Mail message
    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
    the message BODY, include a line containing: UNSUB ORACLE-L
    (or the name of mailing list you want to be removed from). You may
    also send the HELP command for other information (like subscribing).

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouporacle-l @
categoriesoracle
postedOct 2, '02 at 11:28p
activeOct 4, '02 at 8:08a
posts14
users11
websiteoracle.com

People

Translate

site design / logo © 2022 Grokbase