|
本帖最后由 Yong Huang 于 2012-10-19 08:19 编辑
Good to know the problem was indeed caused by CBO's feedback control. That's a feature introduced in 11.2.0.1, judging from the fact that parameters _optimizer_feedback_control and _optimizer_use_feedback both started to appear in x$ksppi in that version. V$sql_shared_cursor in 11.2.0.1 apparently didn't catch up with this new technology. If you really want, you can try the SQL underneath this view, i.e. the SQL shown in the output of this query:
SQL> select view_definition from v$fixed_view_definition where view_name = 'GV$SQL_SHARED_CURSOR';
VIEW_DEFINITION
--------------------------------------------------------------------------------------------------
select inst_id, sql_id, kglhdpar, kglhdadr, childno, decode(bitand(bitvector, POWER(2,0)), POWER(2
...
in 11.2.0.1 when you logon as sys. The only problem is that you need to get that SQL from 11.2.0.1 first and find the fixed table (fixed view) to be x$kkscs because 11.2.0.2 (and above) has the long definition of the view cut off. But the bit in bitvector column representing use_feedback_stats is not in 11.2.0.1. You just have to guess that bit by comparing this long SQL in 11.2.0.1 and 11.2.0.2.
Actually, there's an easier way. Run this command on your 11.2.0.2 server:
strings $ORACLE_HOME/bin/oracle | grep x\$kkscs
You should be able to see the full SQL that queries x$kkscs. Run this SQL in your 11.2.0.1 database when you logon as sys. You still need to find the bit that corresponds to use_feedback_stats.
But if you don't want to pursue further, that's fine. The problem has been fixed anyway. I was just trying to give you a way to check use_feedback_stats in 11.2.0.1.
|
|