JDBC automatical query turned to be very slow

后端 未结 5 2028
一向
一向 2021-02-10 10:57

I am maintaining an application creating an Oracle DB via JDBC. Starting from today this query:

SELECT  NULL                                                   AS         


        
5条回答
  •  你的背包
    2021-02-10 11:26

    Data dictionary or fixed object statistics might be old, try re-gathering them:

    exec dbms_stats.gather_dictionary_stats;
    exec dbms_stats.gather_fixed_objects_stats;
    alter system flush shared_pool;
    

    Even that does not necessarily gather statistics for all system objects. Some objects, like X$KFTBUE, must be gathered manually. Although that's a rare data dictionary problem that may not be relevant here.

    If that doesn't work some next possible steps are looking at tools like SQL Tuning Advisor to create a profile, or using SQL Plan Management to force the optimizer to use a specific plan that has worked before. Tuning a data dictionary query can be very difficult since you don't have much control.

提交回复
热议问题