One advantage of spooling a file and executing the file is that you can
have the execution file also create a spool file with the commands and
results in the output. This allows verification that the task did run
successfully. Script files also allow copying and pasting of individual
commands when only a partial update is desired or some other
manipulation of the parameters is desired for a specific statement. In
another word, flexibility.

I believe if you have subpartitions you will need to export the
statistics to a stattab table, manipulate the statistics there and then
re-import as there is no set_column_stats for subpartitions.

At 06:23 PM 3/26/2007, Allen, Brandon wrote:
>At first I was thinking that Alberto's procedure would still be
required
>for retrieving the current stats and then resetting just the distcnt >value. However, after thinking it through for a while, I realized what

>you were probably both thinking the whole time, which is that with this

>simplified method, you can just use a simple SELECT statement on >all_tab_col_statistics to retrieve the current num_distinct value and >plug it into the set_column_stats procedure for all columns that >currently have histograms, thereby creating a script that can be used
to
>very quickly remove all existing histograms. It took me a while to get

> > >is, indeed, removed, while all the other statistics are preserved.
I
> > >have also reset density to 1/num_distinct, that is the value you
get
> > >if no histogram is collected.>>Privileged/Confidential Information may be contained in this message or

>attachments hereto. Please advise immediately if you or your employer >do not consent to Internet email for messages of this kind.>Opinions, conclusions and other information in this message that do not