Reading and converting ALL_TAB_COL_STATISTICS

  • From: "Martin Klier" <Martin.Klier@xxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 9 Nov 2009 15:22:40 +0100

Dear list,

how can I convert the raw(32)  columns LOW_VALUE and HIGH_VALUE of
ALL_TAB_COL_STATISTICS to their decimal value? TO_NUMBER(rawtohex
(high_value),'XXXXXXXX') gives me not the value I expect (stats are recent)
and in the table min(id) is 1 and max(id) is 8 million). DUMPing the values
(see last part of the SQL below) does not give me any better idea....

SQL> select column_name, rawtohex(low_value),TO_NUMBER(rawtohex
(high_value),'XXXXXXXX')
  from user_tab_col_statistics
  where table_name='WILLI'
  ;

COLUMN_NAME                    RAWTOHEX(LOW_VALUE)    TO_NUMBER(RAWTOHEX
(HIGH_VALUE),'XXXXXXXX')
------------------------------ ----------------------
------------------------------------------
ID                             C102
50185
DESCRIPTION                    616161
8026746
STATUS                         C102
49508

SQL> select max(id) from willi;

   MAX(ID)
----------
   8000000

SQL> select min(id) from willi;

   MIN(ID)
----------
         1

SQL> select dump(LOW_VALUE) from user_tab_col_statistics where
table_name='WILLI';

DUMP(LOW_VALUE)
--------------------------------------------------------------------------------
Typ=23 Len=2: 193,2
Typ=23 Len=3: 97,97,97
Typ=23 Len=2: 193,2

SQL>


Any idea is greatly appreciated. Thanks in advance!
--
Mit freundlichem Gruß


Martin Klier
Senior Oracle Database Administrator
------------------------------------------------------------------------------

Klug GmbH integrierte Systeme
Lindenweg 13, D-92552 Teunz
Tel.:  +49 9671/9216-245
Fax.: +49 9671/9216-112
mailto: martin.klier@xxxxxxxxxx
www.klug-is.de
------------------------------------------------------------------------------

Geschäftsführer: Johann Klug, Roman Sorgenfrei
Sitz der Gesellschaft: Teunz, USt-ID-Nr. DE175481608,
HRB Nr. 2037, Amtsgericht Amberg

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


Other related posts: