Solved

SQLPlus Spool Incomplete

Posted on 2013-12-11
2
755 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
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.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
Suggested Courses

630 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