java - JDBC automatical query turned to be very slow -


I maintain an application forming an Oracle DB through JDBC. Starting this query today:

  select NULL as pktable_cat, p.owner as pktable_schem, p.table_name as pktable_name, pc.column_name as pkcolumn_name, fktable_cat As f.owner fktable_schem, f.table_name fktable_name, fc.column_name as fkcolumn_name, as fc.position key_seq, update_rule, as decode as zero (f.delete_rule, 'CASCADE' , 0, 'zero set', 2, 1) as delete_rule, f.constraint_name as fk_name, p.constraint_name pk_name, as decode (f.deferrable, 'deferrable', 5, 'not deferable' , 7, 'Tall', 6) all_cons_columns pc, all_constraints p, all_c Ons_columns fc, all_constraints f where 1 deferrability = 1 and p.table_name =: 1 and p.owner =: 3 and f.constraint_type = 'r' and p.owner = f.r_owner and p.constraint_name = f.r_constraint_name and P.constraint_type = 'P' and PC. Owner = p.owner and pc.constraint_name = p.constraint_name and pc.table_name = p.table_name and fc.owner = f.owner and fc.constraint_name = f.constraint_name and fc.table_name = f.table_name and fc.position = Pcposition ORDER fktable_schem, fktable_name, key_seq  

get started

Does anyone have a possible reason and how to cope with this?

Regards, Negino

Data dictionary or fixed object statistics can be outdated, Try to collect them again:

  exec dbms_stats.gather_dictionary_stats; Exec dbms_stats.gather_fixed_objects_stats; Change system flush share_pool;  

Even some of the objects, such as X $ KFTBUE , do not collect data for all system objects, Must be assembled manually. Although this is a rare data dictionary problem, which can not be relevant here.

If something like this does not work for the next possible steps, then to create a profile, SQL Tuning Advisor, or SQL Planning Management, make the Optimizer use a specific plan that has worked earlier . Tune the data dictionary query can be very difficult because you do not have much control.


Comments