RE: drop a histogram on a single column

From: Ken Naim <kennaim_at_gmail.com>
Date: Mon, 15 Dec 2008 13:48:20 -0500
Message-ID: <9F000821899C41A286EF412671FDC899@KenPC>


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_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of kyle Hailey
Sent: Monday, December 15, 2008 11:45 AM To: Oracle-L_at_freelists.org
Subject: drop a histogram on a single column

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

Thanks
Kyle
http://perfvision.com

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


--
http://www.freelists.org/webpage/oracle-l
Received on Mon Dec 15 2008 - 12:48:20 CST

Original text of this message