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

  • From: kyle Hailey <kylelf@xxxxxxxxx>
  • To: Marcin Przepiorowski <pioro1@xxxxxxxxx>
  • Date: Fri, 17 Jan 2014 23:15:37 -0800

I second that. Though I never wrote a the SGA access that way, it always
seemed like an easier method to just get the starting address of each
session via SQL and uses that array of address for the C program.

Even the way I did it in Oracle Wait Interface required SQL access before
creating the C program.

Anjo Kolk said he had way of getting the starting address of x$ksuse at a
set location without SQL but he never shared that method with me. With such
a method one could startup the C program without ever running SQL.

Best
Kyle
http://kylehailey.com



On Thu, Jan 16, 2014 at 12:04 PM, Marcin Przepiorowski <pioro1@xxxxxxxxx>wrote:

> Hi,
>
> I did similar project in the past - way before Oracle 10g and ASH.
> Based on Kyle's examples I created a HPUX and Linux version for 8i,9i and
> 10g
> and Windows version for 9i.
>
> My approach was really simple - every session is allocating same structure
> in x$ksuse of if you will find out a starting address of x$ksuse you can
> run your software without need of extracting addresses from instance every
> time. As far as I remember I never found out how to find a starting address
> without query a instance but it was same after restart and was changed only
> if you changed a memory parameters.
>
> Offset between sessions is different for different versions of Oracle and
> even a patches so you need to mitigate it anyhow.
>
> If you are interested in I can try to find these sources somewhere but I'm
> wondering why you are looking into that topic now when ASH is build in into
> Oracle or you can run S-ASH or other similar tools from SQL.
>
> regards,
> Marcin
>
>
>
> On Tue, Jan 7, 2014 at 10:33 PM, keydana@xxxxxx <keydana@xxxxxx> 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--
>> //www.freelists.org/webpage/oracle-l
>>
>>
>>
>
>
> --
> Marcin Przepiorowski
> http://oracleprof.blogspot.com
>

Other related posts: