Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help with using SQLPlus in KSH script and capturing the log of it

724046Sep 23 2009 — edited Sep 23 2009
Hi,

I am struggling with this for a while so I thought I would try this here.

I have a ksh script that performs several tasks and logs it all to a main log file. I am trying to capture the sql as well with it. So basically I have the following.
# Call the script to build the rebuild index SQL Script then run the rebuilt index constructed script
sqlplus -s <<EOF >>$CurrLogFile
gillray/$PASSWORD
@/home/dradmin/scripts/rebuild_index_COMP.sql
@/home/dradmin/scripts/run_rebuild_index_COMP.sql
exit
EOF
rebuild_index_COMP.sql is a script that builds a file for me to run. run_rebuild_index_COMP.sql is the file to be executed and I would like to capture everything that happens in here including the sql text being performed. So far the log file looks as such.
Index Altered

Index Altered

Index Altered

Index Altered
This is OK, but I would like to also capture the SQL text from each statement. How can I acheive this fellow DBA's?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 21 2009
Added on Sep 23 2009
9 comments
3,062 views