oracle 11g ora-00979 bug的處理
將oracle 10g報表庫遷移到 oracle 11g上發現有個儲存過程編譯時報ora-00979錯誤,經確定是group by 後面加的遊標不能使用,後來用metlink查詢發現是11g的一個bug:
ORA-979 bugs on 11.2.0.1 [ID 1085766.1]
修改時間 23-MAR-2012 型別 FAQ 狀態 PUBLISHED
Applies to:
Oracle Server - Enterprise Edition - Version: 11.2.0.1.0 to 11.2.0.1.0 - Release: 11.2 to 11.2
Information in this document applies to any platform.
Purpose
The purpose of this document is to have a complete list of ORA-979 bugs with workarounds and their current status on 11.2
Questions and Answers
1. BUG 9411496 - ORA-979 ON 'UNION ALL PUSHED PREDICATE' (Query Optimizer bug)
--- Symptoms ---
When the query has group by and order by, and they use the same attribute and the cursor_sharing is set to a value <> EXACT, the queries fail with ORA-979.
The call stack from the event 979 errorstack is:
... qcuErroer qcuErroep erroep qecgoc qecoby qecpqbcheck qecdrv kkqcttcalo kkqctdrvJPPD kkqjpdctr qksqbApplyToQbc kkqctdrvTD kkqjpddrv kkqdrv kkqctdrvIT apadrv opitca kksFullTypeCheck rpiswu2 kksSetBindType kksfbc ...
--- Changes ---
Following the upgrade to 11.2.
--- Cause ---
Bug 9411496 - ORA-979 ON 'UNION ALL PUSHED PREDICATE'
--- Solution ---
The workarounds are:
1. "_fix_control"="5520732:OFF"
OR
2. optimizer_features_enable = '11.1.0.7'
OR
3."_optimizer_push_pred_cost_based" = false
OR
4."_optimizer_cost_based_transformation" = off
The bug is fixed and there are patches for some platforms. If the workarounds are not acceptable, a one-off patch for the bug should be requested from Oracle Support.
2. Bug 9478304 "LOOP FAILING WITH ORA-00979 NOT A GROUP BY EXPRESSION" (Query Optimizer bug)
--- Symptoms ---
GROUP BY/ORDER BY in PL/SQL cursor loops fails with ORA-979.
1,3,4都是隱含引數,修改必須重啟資料庫,只有2可以線上修改,修改後編譯通過,問題解決。