Oracle Script....


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Oracle Script....
# 1  
Old 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.
# 2  
Old 03-15-2006
got a bit further...

well got a bit further... above is what I had, I now have the following:

# !/bin/sh
#varables

today=`date +"%a"`

if [ "$today" = "Wed" ]; then
echo "running"
script
fi
script {

#main part of the script
<<EOF su - oracle
<<EOF_1 rman

connect target /
connect catalog rman/rman@rman

list backup summary;
EOF_1
EOF

}[/CENTER]


this works fine, except during the execution of the script after the "su - oracle" the script falls over.

Any ideas?

thanks in advance.
# 3  
Old 03-15-2006
resolved me I think....

I think have resolved this myself, just been tweaking a lot. is my first script. Thanks for reading guys. I got to alter it a bit, but don't see why it won't work.

Thanks again.

b14
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Automation Script for Oracle

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

2. Shell Programming and Scripting

Executing Oracle script from UNIX Script

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

3. Shell Programming and Scripting

How to pass Oracle sql script as argument to UNIX shell script?

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

4. Shell Programming and Scripting

Shell script to call Oracle archive backup script when file system reaches threshold value

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

5. Shell Programming and Scripting

Oracle to shell script

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

How to produce a executable Oracle script from bash script?

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

7. Shell Programming and Scripting

Need help in perl script for oracle

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

8. Shell Programming and Scripting

need help with oracle repair script

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

9. Shell Programming and Scripting

Oracle surveillance script

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
Login or Register to Ask a Question