Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Fwd: Looking for help.

Re: Fwd: Looking for help.

From: Yong Huang <yong321_at_yahoo.com>
Date: Wed, 12 Nov 2003 13:44:32 -0800
Message-ID: <F001.005D673F.20031112134432@fatcity.com>


Ron and Jonathan,

Glad to know the problem is solved. We do need SQL*Loader control file whenever we have such a problem.

Any DDL would invalidate a cursor in library cache. I'm testing with the "harmless" GRANT, which is a DDL.

SQL> create table yongtst (a number);

Table created.

SQL> delete from yongtst;

0 rows deleted.

SQL> select sql_text, invalidations from v$sql where sql_text like '%yongtst%';

SQL_TEXT                                                                       
      INVALIDATIONS
-------------------------------------------------------------------------------------
-------------
delete from yongtst                                                            
                  0
select sql_text, invalidations from v$sql where sql_text like '%yongtst%'      
                  0

SQL> grant select on yongtst to system;

Grant succeeded.

SQL> select sql_text, invalidations from v$sql where sql_text like '%yongtst%';

SQL_TEXT                                                                       
      INVALIDATIONS
-------------------------------------------------------------------------------------
-------------
delete from yongtst                                                            
                  1
select sql_text, invalidations from v$sql where sql_text like '%yongtst%'      
                  0

After GRANT, the delete statement has an invalidation of 1 so a hard parse will occur next time. I think this hard parse is slightly less expensive than a brand new SQL. After invalidation, the cursor (cursor head or parent cursor) still shows up in v$sql, but it disappears from v$sql_plan. A brand new SQL does not have an entry in v$sql.

Other "harmless" DDLs acting on tables are COMMENT, ANALYZE, REVOKE, but not EXPLAIN PLAN as you might believe.

Yong Huang


Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Yong Huang
  INET: yong321_at_yahoo.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Nov 12 2003 - 15:44:32 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US