what is wrong with this query............

9 views
Skip to first unread message

rudra swamy

unread,
Apr 5, 2010, 5:37:53 PM4/5/10
to oracle-...@googlegroups.com
Hi,

Can any one please look in to the following query, when run this query NO output even after 2 hours the session is just hangs........


##############################
##########################################
/*************TABLE and Index SIZE SQL **********************/
select     G.TABLE_NAME table_name,
            H.num_rows,
            sum(e.bytes) Row_bytes,
            sum(e.bytes)/H.num_rows Avg_data_bytes ,       
            sum(F.bytes) Index_bytes,
            sum(F.bytes) + sum(e.bytes) All_bytes,          
           ( sum(F.bytes) + sum(e.bytes))/H.num_rows as "Avg row data indx Size"
 from       dba_extents e,
            dba_extents F,
            dba_indexes G,
      (select num_rows, index_name from dba_indexes where index_name = table_name ||'_P1'
        and owner = 'SIEBEL' and table_owner = 'SIEBEL') H
 where 
  H.index_name = g.table_name ||'_P1'
  and e.owner = 'SIEBEL'
  and G.owner = 'SIEBEL'
  and G.Table_owner = 'SIEBEL'  
  and G.Table_name =e.segment_name
  and (e.segment_name  like 'S_%'   or e.segment_name like 'CX%'  )
  and    e.segment_type like 'TAB%'
  and  F.owner ='SIEBEL'
  and    F.segment_type like 'IND%'
  and    G.INDEX_NAME = F.SEGMENT_NAME
  and H.num_rows > 0
  and (G.table_name like 'S_%' or G.table_name like 'CX%'  )
 group by 'TABLE_SIZE', e.owner, e.segment_name , G.TABLE_NAME, H.num_rows
 order by   e.segment_name
/

########################################################################


-swamy


Your Mail works best with the New Yahoo Optimized IE8. Get it NOW!.

ddf

unread,
Apr 5, 2010, 6:09:29 PM4/5/10
to Oracle in World

>       The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.http://in.yahoo.com/

It runs without error so there is nothing 'wrong' with it. It may not
be using an optimal execution plan but no one can say because you
failed to post the current plan. It also may be that fixed object
statistics are not available but, again, NO ONE can say because you
failed to post an execution plan. This is a help foirum, NOT a circus
sideshow attraction using mindreaders.

Post the following missing information if you really want assistance:

the Oracle release you're using (all 4 or 5 NUMBERS, not some lame
marketing speak such as '9i','10g', etc.)
the current execution plan for this query which can be generated by:


explain plan set statement_id = 'splazzo' for


select * from table(dbms_xplan.display);

Spool the results to a file if necessary.


David Fitzjarrell

Reply all
Reply to author
Forward
0 new messages