[20111222]光标快速失效的方法:
关键字:dbms_stats.set_table_stats COMMENT ON TABLE sys.dbms_shared_pool.purge
1.exec dbms_stats.set_table_stats('schema_name', 'table_name', numrows=>null, no_invalidate=>false);
实际上什么也没有修改,但是dba_tab_statistics 的字段user_stats='yes'
2.给表加注解:
COMMENT ON TABLE SCOTT.T1 IS '';
3.利用包DBMS_SHARED_POOL.keep函数,或者purge函数,从shared_pool删除。
SQL> col address new_value v_address
SQL> col hash_value new_value v_hash_value
SQL> select address, hash_value from v$sql where sql_id='9spcsghzm9mj1';
ADDRESS HASH_VALUE
---------------- ----------
00000000977976D0 1060425249
SQL> exec sys.dbms_shared_pool.purge('&v_address, &v_hash_value','c')
select address, hash_value from v$sql where sql_id='9spcsghzm9mj1';
no rows selected
-- flag
-- This is an optional parameter. If the parameter is not specified,
-- the package assumes that the first parameter is the name of a
-- package/procedure/function and will resolve the name. Otherwise,
-- the parameter is a character string indicating what kind of object
-- to keep the name identifies. The string is case insensitive.
-- The possible values and the kinds of objects they indicate are
-- given in the following table:
-- Value Kind of Object to keep
-- ----- ----------------------
-- P package/procedure/function
-- Q sequence
-- R trigger
-- T type
-- JS java source
-- JC java class
-- JR java resource
-- JD java shared data
-- C cursor
4.
http://gavinsoorma.com/2010/08/solving-a-10g-bind-variable-peeking-problem-by-granting-and-revoking-privileges/
SQL> grant select on system.products to public;
Grant succeeded.
SQL> revoke select on system.products from public;
Revoke succeeded.
也是一个方法!
其他目前暂时不清楚!
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-713752/
,如需转载,请注明出处,否则将追究法律责任。