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?