Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: reading the SGA from my own program
Not to be picky, but any query on the X$ or V$ (especially joins) will
produce inconsistent results or data. That is the price that you pay. Now
the big problem with reading SGA structures is with structures that are
dynamic (v$session is not really dynamic), for example v$sqlarea. One needs
to get a couple of latches to make sure that the pointers are still valid
(or are valid up to a certain point). Remember the good old days when
SYSTEMSTATE dumps would coredump when executed on a live system? That is why
it was a bad idea to have a backgroundprocess do a system state dump. One
bad pointer and the instance is dead. So the other thing one can do if one
can't use latches is to built in many checks to make sure the structures and
addresses are still valid.
-Anjo.
On 8/21/06, Powell, Mark D <mark.powell_at_eds.com> wrote:
>
> The primary point of directly reading shared memory is that by doing so
> you bypass Oracle. So when the entire instance hangs and will not grant new
> connections you can go around the problem and see what is happening (or not
> happening as the case may be). You also avoid the latching overhead
> required for accessing the shared memory structures via Oracle. True, you
> may see some inconsistent data, but you will see it.
>
> HTH -- Mark D Powell --
>
>
> ------------------------------
> *From:* oracle-l-bounce_at_freelists.org [mailto:
> oracle-l-bounce_at_freelists.org] *On Behalf Of *Allen, Brandon
> *Sent:* Monday, August 21, 2006 12:25 PM
> *To:* tanel.poder.003_at_mail.ee; anjo.kolk_at_oraperf.com; jeremiah_at_ora-600.net
> *Cc:* Oracle Discussion List
>
> *Subject:* RE: reading the SGA from my own program
>
>
>
> Please forgive my ignorance, but what is the point of this direct SGA
> access anyway? Why not just query v$session_event and/or v$session_wait, or
> the underlying x$ tables?
>
> Thanks,
> Brandon
>
> ------------------------------
> *From:* oracle-l-bounce_at_freelists.org [mailto:
> oracle-l-bounce_at_freelists.org] *On Behalf Of *Tanel Poder
> *Sent:* Saturday, August 19, 2006 2:30 AM
> *To:* anjo.kolk_at_oraperf.com
> *Cc:* jeremiah_at_ora-600.net; 'Oracle Discussion List'
> *Subject:* RE: reading the SGA from my own program
>
> Also, if all you're interested in is the current wait state of a session,
> then there's no real fundamental need to map those SHM segments which do not
> contain the data you're interested in (as far as I understand).
>
> Tanel.
>
> . . .
>
>
> ------------------------------
> > *From:* oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org]
> > *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.
> >
> Privileged/Confidential Information may be contained in this message or
> attachments hereto. Please advise immediately if you or your employer do not
> consent to Internet email for messages of this kind. Opinions, conclusions
> and other information in this message that do not relate to the official
> business of this company shall be understood as neither given nor endorsed
> by it.
>
>
-- Anjo Kolk Owner and Founder OraPerf Projects tel: +31-577-712000 mob: +31-6-55340888 -- http://www.freelists.org/webpage/oracle-lReceived on Mon Aug 21 2006 - 12:57:51 CDT
![]() |
![]() |