![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| found error 138 while run shell script | rinku | Shell Programming and Scripting | 1 | 06-02-2008 03:29 AM |
| Shell Script Error | jazz8146 | UNIX for Dummies Questions & Answers | 0 | 04-23-2008 08:38 AM |
| awk Shell Script error : "Syntax Error : `Split' unexpected | Herry | UNIX for Dummies Questions & Answers | 2 | 03-17-2008 11:16 AM |
| FTP shell script error caturing | im_new | Shell Programming and Scripting | 6 | 01-15-2008 03:21 AM |
| shell script error logging | niamh | UNIX for Dummies Questions & Answers | 1 | 04-05-2004 12:17 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
error in shell script
Hi,
I have written a small shell script which logs into each oracle database on the server and displays whether it is in archivelog mode or not.. The script is as under: #!/bin/bash dblist=`ps -ef | grep smon | grep -v grep |cut -d'_' -f3` for ohome in $dblist; do sqlplus -s /nolog << EOF connect / as sysdba ; ORACLE_SID=$ohome; export ORACLE_SID set heading off set feedback off set verify off output=`select log_mode from v$database;` exit; EOF echo $ohome echo $output | sort -u done When I run it .. i received errors as under: jalpan.sh: select: not found Connected. SP2-0734: unknown command beginning "ORACLE_SID..." - rest of line ignored. SP2-0042: unknown command "output=" - rest of line ignored. bnkdbp01 jalpan.sh: select: not found Connected. SP2-0734: unknown command beginning "ORACLE_SID..." - rest of line ignored. SP2-0042: unknown command "output=" - rest of line ignored. dosdbp01 --> Oracle Database Name Pls help Thx in advance |
|
||||
|
1. is the ORACLE_SID line supposed to be before the sqlplus line?
2. Are the 'set x y' lines as part of the SQL*PLUS script supposed to have a ';' at the end? 3. The 'output', it looks like you are trying to assign in the SQL*PLUS script but have it magically read by the shell script. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|