I am new to UNIX shell script programming. I have coded one korn shell script used on solaris 10 for Oracle database rman cold backup. The first part of script is working. But only following part is not working. Please help me to point out the problem and errors in my code. Thanks a lot.

# the first part has been omitted.

# Started to shutdown database and startup database mount for cold backup .

You are using <<EOF "here documents" without a closing EOF terminator. The whole remainder of the script gets passed to SQL (which ignores it, if it doesn't outright choke on it).

The "exit" is apparently not really supposed to be there? If it is, that's where the script terminates.

The "here document" syntax is a bit hard to grok until you get the hang of it. Maybe a few examples can help.

Code:

cat <<END_OF_FIRST_HERE_DOCUMENT
This will be copied to standard output
including this part which really looks a lot like a shell script
#!/bin/sh
echo frnod
exit 255
This is all just text as far as the shell is concerned,
so we don't care even that this looks like an unterminated
single-quoted string (because of the single quote between "don" and "t").
END_OF_FIRST_HERE_DOCUMENT
echo Script execution continues here
cat <<!
Another here document
you can use almost anything as a terminator
!
echo Back to the studio
exit 0