Re: Direct SGA access problem because of structs' changing start addresses (e.g., x$ksmsp)

From: Tanel Poder <tanel_at_tanelpoder.com>
Date: Fri, 10 Jan 2014 21:43:55 +0200
Message-ID: <CAMHX9J+_8b0TD_kD_9ZuoTC5r1UyU_DAtK6oRePsSeDWX2aF=g_at_mail.gmail.com>



Not all X$ tables read their data directly from the source data structure. For some X$ tables a helper function is first executed, which then extracts th required data from wherever needed (by walking some linked list or even doing disk IO) and then copies the required data to your sessions UGA for presentation via the X$ fixed table interface. So you can't trust the addresses.

I just wrote a blog entry to elaborate this and hopefully have time to write part 2 & 3 some day too:

https://blog.tanelpoder.com/2014/01/10/oracle-x-tables-part-1-where-do-they-get-their-data-from/

If you want to walk the shared pool structures, then I'd start from reading a bunch of shared pool heapdumps and Julian Dyke's shared pool presentation...

-- 
*Tanel Poder*
Enkitec (The Exadata Experts)
Services <http://enkitec.com> | Training<http://blog.tanelpoder.com/seminar/>
 | Troubleshooting <http://blog.tanelpoder.com/> | Exadata
Book<http://www.amazon.com/Expert-Oracle-Exadata-Apress/dp/1430233923>



On Wed, Jan 8, 2014 at 12:33 AM, keydana_at_gmx.de <keydana_at_gmx.de> wrote:


> Hi,
>
> I'm trying to write some Haskell code for direct SGA access of -
> preferredly, as of today - x$ksmsp (sql queries against this table being
> expensive, possibly...), and for that I'm following the approach from Kyle
> Hailey, as detailed in the Oracle Wait Interface book.
>
> So I need the struct's start address, but unfortunately, when I query
> x$ksmsp several times in a row - even from the same sqlplus process - I
> get different results every time... (Actually, this seems to be the case
> with most fixed tables, apart from those "fixed" fixed ones as x$ksuse...)
>
> It'd be great if anyone had advice, or an idea, what I could do to get
> this working all the same (and as to what the reason might be?)
> It ought to be possible somehow to do this, as I've tried oradebug direct
> access with x$ksmsp and it worked (of course, it runs in sqlplus, so I
> don't know...)
>
> Thanks a lot in advance!
>
> Sigrid--
> http://www.freelists.org/webpage/oracle-l
>
>
>
-- http://www.freelists.org/webpage/oracle-l
Received on Fri Jan 10 2014 - 20:43:55 CET

Original text of this message