Re: Looking for suggestions - how find cause of sql invalidations

From: Stefan Koehler <contact_at_soocs.de>
Date: Tue, 18 Jul 2017 18:37:41 +0200 (CEST)
Message-ID: <1036394470.74051.1500395861888_at_ox.hosteurope.de>


Hey Chris,
just use a script by grandmaster Tanel Poder.

SQL> _at_http://blog.tanelpoder.com/files/scripts/nonshared2.sql PRINT 49s16x6k5ubwc

Best Regards
Stefan Koehler

Independent Oracle performance consultant and researcher Website: http://www.soocs.de
Twitter: _at_OracleSK

> Chris Taylor <christopherdtaylor1994_at_gmail.com> hat am 18. Juli 2017 um 17:37 geschrieben:
>
> DB: 12.1.0.2
> OS: Red Hat Enterprise Linux Server release 6.8  (x86_64)
>
> TL;DR:  How to find cause of high sql invalidations when nothing obvious is happening (such as stats or table ddl).
>
> We're having some library cache/shared pool thrashing and I ran an AWR for a 2 hour period this morning.
>
> In the library cache activity, for SQL AREA, I see:
> sql_id = 49s16x6k5ubwc
> Invalidations_Total = 2065
> Invalidations_Delta = 1287
>
> This SQL_ID is executed many, many times every hour and I'm trying to figure out why it's getting invalidated.
>
> So, far I've checked v$active_session_history and dba_hist_active_sess_history to get the full history of the sessions that have executed that SQL_ID.
>
> Nothing in those sessions appear to be doing any type of DDL (stats or anything like that) so it appears to be something outside those sessions causing the cursor invalidations.
>
> There is one table involved in the query - and it has 1444 partitions.
>
> I checked LAST_DDL_TIME from dba_objects and I don't see any DDL timestamps that would be related. 
>
> I've checked last_analyzed from DBA_TAB_PARTITIONS and that the table hasn't been analyzed during the period of invalidations.
>
> Much of the SQL being executed against this table is "EXECUTE IMMEDIATE" from within pl/sql.
>
> One of the code blocks does have an IF statement that would do a "LOCK TABLE" if the condition is met (I can't tell if that condition is being met however).   Would a LOCK TABLE cause invalidations?
>
> Any suggestions on how to crack this particular egg?
>
> Chris

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jul 18 2017 - 18:37:41 CEST

Original text of this message