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 <<EOF
connect internal
select name from v_\$database;
exit

EOF

Just escape the $ sign with a backslash.

HTH

Lee

-----Original Message-----
[mailto:[EMAIL PROTECTED]]
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:[EMAIL PROTECTED]]
> 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: [EMAIL PROTECTED]
> 
> 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: [EMAIL PROTECTED] (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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to