I created an sql file running a series of analyze table and index rebuild commands for group of tables. When I run the script in Toad, it is OK. However, via sqlplus -s, it hangs at the middle of the operation.
An example run:
$ORACLE_HOME/bin/sqlplus -s xxx/yyy@zzz @/opt/app/table_statistics.sql
The system is Red-Hat Enterprise Linux with 64 GB of RAM, 4 Processors. How can I solve this problem?
One difference between Toad and Sqlplus is the way in which pl/sql blocks are run. If you have a script containing a pl/sql block, ensure you place a forward slash "/" on the line following the block as it is this slash that tells sqlplus to run the pl/sql block. I don't believe Toad requires this slash to run the block.
Have you tried running the script in sqlplus without the -s (silent) option so you can determine exactly where it hangs?