You have to map all the segments, and I always use them with any conversion. I have a little program called websga and you can browse and search in the SGA with a browser instead of a debugger (so much simpler and nicer), this program maps all segments but has to check for gaps if it starts searching for addresses and contents of addresses.
Why bother at all with those calculations?
Just map all SGA SHM segments at the same locations in your program where they'd be mapped in an oracle processes and use all SGA addresses without any conversion needed.
Even if some data is stored in different shared memory segments, it's still the same virtual address space - no need for doing some segment offset calcuations...
------------------------------ *From:* oracle-l-bounce@xxxxxxxxxxxxx [mailto: oracle-l-bounce@xxxxxxxxxxxxx] *On Behalf Of *Jeremiah Wilton *Sent:* Saturday, August 19, 2006 05:14 *To:* 'Oracle Discussion List' *Subject:* reading the SGA from my own program
I am trying to play around with reading the SGA using my own program, as popularized by Kyle Hailey and Miladin Modrakovic's papers and presentations. I am confused about where to find x$ksusecst (session wait) and other items in the fixed area.
The base address of the SGA from x$ksmmem is hex 20000000.
The lowest ADDR I see in x$ksusecst on my instance is 27133F24. So far so good.
That means that x$ksusecst begins (27133F24-20000000=7133F24) bytes into the segment containing the fixed SGA, right?
Hex 7133F24 is decimal 118,701,860, so that should be about 113Mb into the segment.
The problem is that the segment containing my fixed area (from oradebug ipc) is only 4Mb. All the shared memory segments owned by oracle on my host (according to ipcs -a) total less than 108Mb.
So according to x$ksusecst(ADDR), session waits have an address beyond the highest address in the SGA. What am I getting wrong?
Thanks for any insights!
-- Anjo Kolk Owner and Founder OraPerf Projects tel: +31-577-712000 mob: +31-6-55340888