![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Call sqlplus in the shell script | beaniebear | Shell Programming and Scripting | 3 | 05-13-2008 06:30 AM |
| help me in sending parameters from sqlplus script to unix shell script | Hara | Shell Programming and Scripting | 2 | 01-29-2008 11:31 AM |
| Shell Script And SQLPLUS | maco_home | UNIX for Dummies Questions & Answers | 6 | 08-25-2007 09:05 AM |
| connect to sqlplus in a script | big123456 | Shell Programming and Scripting | 1 | 09-18-2006 03:56 AM |
| Need help with ksh script that uses sqlplus, called from PHP | j2owilson | Shell Programming and Scripting | 7 | 02-27-2006 12:35 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
SQLPLUS in script
I have a script that passes a parameter to the sqlplus command that looks like the following:
#!/bin/sh TARGET_SID=$1 AUXILIARY_SID=$2 sqlplus 'sys@$AUXILIARY_SID as sysdba' @shutdown.sql I keep getting the following error: ERROR: ORA-12154: TNS:could not resolve service name HOWEVER, I have my sid defined in the tnsnames.ora AND if I take out the parameter $AUXILIARY_SID and put in the actual sid name (PPRD) it works fine. Any Ideas? Thanks! Rhonda Nichols |
| Forum Sponsor | ||
|
|
|
|||
|
Thanks. I never thought of somthing so simple. One more thing. I am trying to pass the pswd as a parameter so that it doesn't so up during ps -ef as follows:
PSWD=***** (where stars are my password) sqlplus "sys@$AUXILIARY_SID as sysdba" @shutdown.sql <$PSWD but of course this doesn't work. Can this be done? What am I doing wrong? -Rhonda |
|
|||
|
An alternative is:
Code:
echo $PSWD | sqlplus "sys@$AUXILIARY_SID as sysdba" @shutdown.sql Code:
mknod p sysdba_logon.sql echo "connect sys/$PSWD@$AUXILIARY_SID as sysdba" > connect.sql & sqlplus <<-EOF @connect.sql @shutdown.sql EOF rm connect.sql |
|||
| Google The UNIX and Linux Forums |