SQL> create table t as select * from all_objects;
SQL>
SQL> create or replace function get_row_cnt return number
2 as
3 countValue number;
4 begin
5 select count(*) into countValue from t;
6 return countValue;
7 end;
8 /
SQL>
SQL> show parameter optimizer_features
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
optimizer_features_enable string 8.1.5
SQL>
SQL> alter session set sql_trace=true;
SQL>
SQL>
SQL> exec dbms_output.put_line( get_row_cnt );
12583
SQL>
SQL> alter system
2 set optimizer_features_enable = '8.1.5' scope = spfile;
SQL>
SQL> drop table t;
SQL>
|