03-15-2006
Oracle Script....
Hi Guys,
I am trying to delevop this script that eventually will be used to validate oracle database backups.
So far I have:
#!/bin/sh
#varables
today=`date +"%a"`
if [ "$today" == "Wed" ] ; then
#main part of the script
<<EOF_1 su - oracle
<<EOF rman
connect target /
connect catalog rman/rman@rman
list incarnation;
exit
exit
exit
echo "completed"
EOF
EOF_1
exit;
else
echo "is not the correct day"
exit;
fi;
exit;
When ever I execute this, alls I get is that there was an error on line 29 but the file is only 28 lines. Looking at previous postings I am guessing there is a syntax error somewhere. Any ideas?
Without the if statement the script works fine, although I have tested the if statment seperately and it work fine.
Thanks for reading.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Anyone who knows where I can find home made scripts that monitoring a oracle database ?
Bourne, korn or perl scripts ..... monitoring processes and maybe tablespace and so on ...
Thanks ! (2 Replies)
Discussion started by: sunguru
2 Replies
2. Shell Programming and Scripting
I have a problem. I am attempting to create a repair script for oracle that will read in a print file and perform a repair on an oracle database using the data in the print file. My restrictions are
1) each in list (items with-in parens) must be no more the 250 lines and the last item in the... (1 Reply)
Discussion started by: beilstwh
1 Replies
3. Shell Programming and Scripting
Hi,
#!/usr/bin/perl
my @sid=`cat /etc/oratab|grep -v "^#"|grep -v "*"|grep -v "#"|cut -d: -f1 -s`;
my $log;
my $body="";
my $oraclesid="";
chomp($hostname);
foreach my $oraclesid (@SID){
$body="";
chomp($oraclesid);
$dbname=print ($oraclesid);
print... (2 Replies)
Discussion started by: rocky1954
2 Replies
4. Shell Programming and Scripting
Hi here's my code
${ORACLE_HOME}/bin/sqlplus /nolog <<!EOF
--step 5 create db script start
set feedback off
set heading off
set echo off
conn / as sysdba
spool ${ORACLE_SID}_db_link.sql
SELECT 'CREATE '||DECODE(U.NAME,'PUBLIC','public ')||'DATABASE LINK '||CHR(10)... (2 Replies)
Discussion started by: jediwannabe
2 Replies
5. Shell Programming and Scripting
hi , i have some procedures that were written in oracle (sql/plsql).
I need to convert them into shell scripts. So is there any procedure to this. or any tools available to do this. I need some guidance on this as i am totally new . I dont know shell scripting at all. My main target get the logic... (5 Replies)
Discussion started by: harishbabuy
5 Replies
6. Shell Programming and Scripting
Hello All,
I need immediate help in creating shell script to call archivebkup.ksh script when archive file system capacity reaches threshold value or 60%
Need to identify the unique file system that reaches threshold value.
ex:
capacity
... (4 Replies)
Discussion started by: sasikanthdba
4 Replies
7. Shell Programming and Scripting
Hi all,
$ echo $SHELL
/bin/bash
Requirement - How to pass oracle sql script as argument to unix shell script?
$ ./output.sh users.sql
Below are the shell scripts and the oracle sql file in the same folder.
Shell Script
$ cat output.sh
#!/bin/bash
.... (7 Replies)
Discussion started by: a1_win
7 Replies
8. Shell Programming and Scripting
Hi,
I am new to UNIX and want to execute oracle script from unix script.
I have written below script but i am getting below error.
#!/bin/bash
file="/home/usr/control/control_file1"
while read line
do
#$line=@$line
#echo $line
sqlplus tiger/scott@DB
@$line
exit
#echo "$line"
done... (3 Replies)
Discussion started by: vipin kumar rai
3 Replies
9. Shell Programming and Scripting
Hi,
As a Oracle Developer, I am writing many Procedures,Functions and Packages. Facing Many optimization issue after writing these Database objects. Trying to tune it manually.
Can we write any Shell/Perl/Python script to Optimize these Database objects instead of doing manual check and... (1 Reply)
Discussion started by: vasuvv
1 Replies