Solved

SQLPlus Spool Incomplete

Posted on 2013-12-11
2
724 Views
Last Modified: 2013-12-11
I'm trying to run this script to output index rebuild commands for some of the indexes.
 spool rebuild_index_list

select 'alter index '||owner||'.'||index_name ||' rebuild parallel 4 compute statistics;'
  from dba_indexes
    where (dba_indexes.owner = 'BBS'
    and dba_indexes.num_rows >= 3000000 );
select 'alter index '||owner||'.'||index_name ||' rebuild parallel 4 compute statistics;'
  from dba_indexes
    where (dba_indexes.owner like '%CMS%'
    and dba_indexes.num_rows >= 3000000 );
rebuild_index_list
All the returned rows show up on the display, but when i look in the spool file ,rebuild_index_list, only part of the first query in included and none of the second, CMS,
shows.
What do I need to do to get all the result set into the spool file?
~
~
~
~
0
Comment
Question by:xoxomos
2 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 300 total points
ID: 39713017
Did you issue the 'spool off' command at the end?

If not, it may not have all been flushed.

If you did, can you post the complete script?

What is the "rebuild_index_list" after the end of the second select?

...
and dba_indexes.num_rows >= 3000000 );
rebuild_index_list
...
0
 

Author Closing Comment

by:xoxomos
ID: 39713024
Nopes.  Sure didn't :-)
Thanks.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question