Here is an example of how I check (on Solaris, using a C shell [.csh] )
that passwords being prompted for in a different part of the script is
valid.
You can place your sql where the "select...." statement is.
Jeff
==================================================================
if ( $sitetype == "PT" || $sitetype == "TT" ) then
foreach LOOPSITE ( $site1 $site2 $site3 )
$ORACLE_HOME/bin/sqlplus -s <user>/$<user_pw>@$LOOPSITE >
./TEMP/password_test1.temp.$LOOPSITE <<EOF
set heading off echo off verify off feedback off linesize 120
pagesize 0 termout off;
spool ./TEMP/connection_test1.sql.$LOOPSITE
select 'valid_connection' from dual;
spool off;
exit
EOF
set TEMP=`cat ./TEMP/password_test1.temp.$LOOPSITE | grep
valid_connection | cut -d ':' -f1 | wc -l`
if ( $TEMP != 1 ) then
echo " "
echo
"-----------------------------------------------------------"
echo "--> ERROR: Shell_Script terminated. "
echo "--> Password for TIER1 not valid at SITE '$LOOPSITE'."
echo "--> "
echo "--> exiting $0 "
echo
"-----------------------------------------------------------"
echo " "
exit
else
echo " "
echo
"-----------------------------------------------------------"
echo "--> Password for <user> is valid at SITE '$LOOPSITE'."
echo
"-----------------------------------------------------------"
echo " "
endif
sleep 1
end #end the looping for sites
endif
-----Original Message-----
From: oracledba-return-133158-JEFFERY.L.SCHRENK=saic.[Email address protected]
[mailto:oracledba-return-133158-JEFFERY.L.SCHRENK=saic.[Email address protected]
On Behalf Of quigleyd
Sent: Thursday, October 05, 2006 11:46 AM
To: LazyDBA Discussion
Subject: Embeding commands for remote database
I am currently running script that excute commands on other servers, is
there an
easy way to put the command directly in the script, instead of putting
it in
another file. I want to be able to pass a balue to the sql that it is
excuting
instead of the "START" i would just like to put the commands there.
This is what i currently do
sqlplus -s 2>&1 << ENDSQL
id/[Email Address Removed] sqlfile
ENDSQL
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
Oracle LazyDBA home page