Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: What is a cursor EXACTLY?(internals question)

Re: What is a cursor EXACTLY?(internals question)

From: Yong Huang <yong321_at_yahoo.com>
Date: 30 Jan 2003 15:43:42 -0800
Message-ID: <b3cb12d6.0301301543.7851e786@posting.google.com>


"Ryan" <rgaffuri_at_cox.net> wrote in message news:<JCXZ9.53852$GX4.2199370_at_news2.east.cox.net>...
> "Norman Dunbar" <Norman.Dunbar_at_lfs.co.uk> wrote in message
> > Cursor : CURrent Set Of Records. (at least it was in IDMS(X)
> > hierarchical databases that I used to work with !)
...
> thanks, but any idea what type of data structure they use to store the
> cursor? Is it on the heap, on the stack? Array, linked list?

Hi, Ryan,

Norman explained what a cursor is in PL/SQL programming. But generally, a cursor is just a SQL statement, possibly modified by the SQL engine from what you originally submitted. A cursor can be a library cache object, which has associated attributes like hash value, address in memory, versions, optimizer goal, parse tree... viewable from v$sql or v$sqlarea, and attributes in session's private memory such as bind information. My understanding is that a single cursor is just a string, not a structure, unless you lump its attributes into this concept. Some books talk about cursor heads and bodies (J. Morle, Scaling Oracle8i,p.277). I think they're just different names for parent cursors, child cursors, respectively, as in documentation. The management of cursors in library cache is by way of a number of data structures, such as linked lists. A cursor can also exist in a session's private memory, in cases like you have session_cached_cursor set to a positive number and you've used the cursor more than 3 times. These private cursors are not managed by LRU. They purely exist in your session's heap memory. If I'm wrong anywhere, I'm willing to learn.

Yong Huang Received on Thu Jan 30 2003 - 17:43:42 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US