RE: drop a histogram on a single column

  • From: "Ken Naim" <kennaim@xxxxxxxxx>
  • To: <kylelf@xxxxxxxxx>, <Oracle-L@xxxxxxxxxxxxx>
  • Date: Mon, 15 Dec 2008 13:48:20 -0500

This will generate the command to drop the histogram. If the table is a
partitioned table, use the second one.

SELECT   'execute dbms_stats.set_column_stats('''
      || owner
      || ''','''
      || table_name
      || ''','''
      || column_name
      || ''', distcnt=>'''
      || num_distinct
      || ''');'
FROM all_tab_col_statistics
WHERE histogram <> 'NONE' AND table_name = '?' 
And column_name ='?'

SELECT   'execute dbms_stats.set_column_stats('''
      || owner
      || ''','''
      || table_name
      || ''','''
      || column_name
      || ''','''      
      || partition_name      
      || ''', distcnt=>'''
      || num_distinct
      || ''');'
FROM DBA_PART_COL_STATISTICS
where owner in ('DEMANTRA','CUSTOM')
and histogram <> 'NONE' 
And column_name ='?'
 

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]
On Behalf Of kyle Hailey
Sent: Monday, December 15, 2008 11:45 AM
To: Oracle-L@xxxxxxxxxxxxx
Subject: drop a histogram on a single column

Anyone know a way to drop a histogram on single column?

Thanks
Kyle
http://perfvision.com
--
//www.freelists.org/webpage/oracle-l


--
//www.freelists.org/webpage/oracle-l


Other related posts: