????TRANSLATION_MISMATCH???SQL?α??漰??????????????????AUTH_CHECK_MISMATCH???????????SQL??????????????
??????2???????SQL?????л?????????????????????SQL???????????????/*+ first_rows */??HINT??????????????/*+ all_rows */??HINT?????????????????м?????????????????????????????????????????????SQL??л??????????????????????????workarea_size_policy???????????????SQL?????е????

 

SQL> alter system flush shared_pool;
System altered.
SQL> show parameter workarea_size_policy
NAME                                 TYPE        VALUE
------------------------------------ ----------- --------------
workarea_size_policy                 string      AUTO
SQL> select count(*) from t;
COUNT(*)
----------
5736
SQL> alter session set workarea_size_policy=manual;
Session altered.
SQL> select count(*) from t;
COUNT(*)
----------
5736
SQL> select sql_text?? child_number?? hash_value?? address
from v$sql
where upper(sql_text) = 'SELECT COUNT(*) FROM T'
/
SQL_TEXT                       CHILD_NUMBER HASH_VALUE ADDRESS
------------------------------ ------------ ---------- --------
select count(*) from t                    0 2199322426 78717328
select count(*) from t                    1 2199322426 78717328
...

???????????????????workarea_size_policy????ò???????????????SQL??仹??????????????????????v$sql_shared_cursor??????????????????????????????????

 

SQL>selectoptimizer_mismatch
fromv$sql_shared_cursor
wherekglhdparin
(selectaddress
fromv$sql
whereupper(sql_text)='SELECTCOUNT(*)FROMT');
O
-
N
Y
...

???????????????????????????SQL???????μ??????????????SQL??????м??????????????????????????????????????SQL?????????????????????????????????????
????4??Oracle????????SQL???????????????????????????????????????????????????CBO?????????Щ?????????????п??????м??????????????????????????Cost???????Cost????????м???????????????????????????????RBO??????????????????м??????????????????к?????????????????ü???????????????????????????????????????????Oracle??????????????????м?????SQL?????????????????