Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Multiple child cursor for a single query (executed just once)

Martin PreissJul 31 2015 — edited Aug 3 2015

Hello,

in a Standard Edition database of version 11.2.0.3 I see a strange behaviour that I can't explain at the moment: if I issue a simple query on dba_temp_free_space I get multiple child cursors for the first execution:

-- first execution of the query (that returns 3 rows)

select /* test: cursor duplicate */ *

  from dba_temp_free_space;

select child_number, open_versions, fetches, rows_processed

     , executions, px_servers_executions, parse_calls, buffer_gets

  from v$sql

where sql_id = '69azwxdshhffc'

order by child_number;


CHILD_NUMBER OPEN_VERSIONS    FETCHES ROWS_PROCESSED EXECUTIONS PX_SERVERS_EXECUTIONS PARSE_CALLS BUFFER_GETS

------------ ------------- ---------- -------------- ---------- --------------------- ----------- -----------

           0             1          2              3          1                     0           1           7

           1             0          0              0          0                     1           1          55

           2             0          0              0          0                     1           1           2

select VERSION_COUNT, LOADED_VERSIONS, EXECUTIONS, PX_SERVERS_EXECUTIONS, PARSE_CALLS, BUFFER_GETS, ROWS_PROCESSED

  from v$sqlarea

where sql_id = '69azwxdshhffc'

VERSION_COUNT LOADED_VERSIONS EXECUTIONS PX_SERVERS_EXECUTIONS PARSE_CALLS BUFFER_GETS ROWS_PROCESSED

------------- --------------- ---------- --------------------- ----------- ----------- --------------

            3               3          1                     2           3          64              3


-- second execution

select /* test: cursor duplicate */ *

  from dba_temp_free_space;


select child_number, open_versions, fetches, rows_processed

     , executions, px_servers_executions, parse_calls, buffer_gets

  from v$sql

where sql_id = '69azwxdshhffc'

order by child_number;


CHILD_NUMBER OPEN_VERSIONS    FETCHES ROWS_PROCESSED EXECUTIONS PX_SERVERS_EXECUTIONS PARSE_CALLS BUFFER_GETS

------------ ------------- ---------- -------------- ---------- --------------------- ----------- -----------

           0             0          2              3          1                     0           1           7

           1             0          0              0          0                     1           1          55

           2             0          0              0          0                     1           1           2

           3             1          2              3          1                     0           1           7

           4             0          0              0          0                     1           1          55

           5             0          0              0          0                     1           1           2

select VERSION_COUNT, LOADED_VERSIONS, EXECUTIONS, PX_SERVERS_EXECUTIONS, PARSE_CALLS, BUFFER_GETS, ROWS_PROCESSED

  from v$sqlarea

where sql_id = '69azwxdshhffc'

VERSION_COUNT LOADED_VERSIONS EXECUTIONS PX_SERVERS_EXECUTIONS PARSE_CALLS BUFFER_GETS ROWS_PROCESSED

------------- --------------- ---------- --------------------- ----------- ----------- --------------

            6               6          2                     4           6         128              6

Just for the sake of completeness: the given system is a two-node-RAC cluster.


So every following execution creates new child cursors:

  • I don't understand why I get three child cursors for one execution.
  • I don't understand why the following executions don't reuse an existing cursor.

Taking a look at v$sql_shared_cursor I see the reasons the optimizer mentions for not reusing the cursors - but again I fail to understand

select child_number

     , PX_MISMATCH

     , USE_FEEDBACK_STATS

     , TOP_LEVEL_RPI_CURSOR

  from v$sql_shared_cursor

where sql_id = '69azwxdshhffc'

order by child_number;

CHILD_NUMBER P U T

------------ - - -

           0 N Y N

           1 Y N N

           2 Y N N

           3 N N Y

           4 Y N N

           5 Y N N

But again I fail to see why these reasons should be valid. If I issue the query frequently enough I see strange plan renderings when I use dbms_xplan.display_cursor - as described by Timur Akhmadeev in https://timurakhmadeev.wordpress.com/2012/03/19/obsolete-cursors/.

So the question is: has someone seen something like this before? And is there an explanation why the server stops to reuse cursors?

Thanks for your answers in advance.

Regards

Martin Preiss

This post has been answered by John Spencer on Jul 31 2015
Jump to Answer

Comments

807559
Really appreciate for any help, thanks!
I have a very similar issue, although I'm using XSun, and I'm on an old Gateway Solo 1450. Did you have any luck?
Brian
I recently installed Solaris 10 in a DELL GX260 pc.
After I've changed from Xorg to Xsun, I was able to
go into X-window. However, when I tried to change the
resolution in the Java desktop, it shows an error
message:

The XServer does not support the XRandR extension.
Runtime resolution changes to the display size are
not available.

The size is supposed to be 1024x 768 however it only
shows 640x480.

I've tried to use kdmconfig to set ressolution
however it still appears as 640x480.

I've go thur several previuos message in this forum
about changing the Xorgconfig however if I change
back to Xorg the X-window could not start.
807559
Hi,

What�s the GFX card?
Whilst running the kdmconfig, does the screen res look correct on the test?

Tom
807559
For me, its an Intel 830. The screen res looks fine on the test, colors seem right, edges aren't jagged on the ovals.
807559
Oops, that would be an 4X AGP 8MB.
807559
Can you end me a "prtvconf -vp" through, I might have something.

Tom
807559
Sorry, my fingers are all thumbs today:

Lets try a "prtconf -pv"
807559
Hey Tom,
I tried to send it to the e-mail you have listed, but it came back to me. Would you please send me an e-mail at the address shown on my listing, and I'll send it right along?
Brian
807559
OK, now I'm having typing difficulties. No 'h' in there.
807559
Always get that, gotcha now Brian.
807559
If anyone's interested, with a lot of explanation and assistance from Tom, I finally got a good resolution and colordepth by installing xterm-196 (XFree86) (from the companion DVD, http://www.sun.com/software/solaris/freeware/) and then installing the Accellerated-X Summit package from www.xig.com. It wasn't free, but so far it's the only money I've spent so far putting Solaris 10 on my old Gateway laptop. Now, has anyone had any luck installing a PCMCIA Lucent Wireless Gold Card?
807559
Dang, I have to start thinking before I hit post. I actually downloaded xterm from the website, http://www.sun.com/software/solaris/freeware/. While I downloaded the iso for the companion disk, I couldn't figure out if it was supposed to be a bootale disk. Anyone know?
807559
Brian,

The Solaris 10 1/06 OS Companion Software DVD is not normally bootable. Is this a problem for you build?

Tom
807559
Hey again, Tom,
Maybe. As I recall, there's an opportunity to add certain documentation at the the end of the install, but it never said what disk to put in. I tried some different things, including that disk, but in the end, I always had to say "skip." It wasn't until I tried cherry-picking apps off the disk that I figured there might be something wrong with the media.
Brian
807559
Brian,

I�m just downloading the DVD iso of the Comp DVD, I'll take a look at it and see what's happening with the pkgadd.
Can you tell me if the actual pkgs have been added to the OS?
Run "# ls -lart /var/sadm/pkgs | more" this should reverse timestamp list the SUNW pkgs installed.
Find the new ones added by the timestamp and then run "pkginfo -l SUNW"name"" This will at least tell you if they are installed correctly and for the right cut of Sol (x86, etc etc)

Thanks

Tom
807559
In the latest update, Solaris 10 1/06, the Xorg version suports XRANDR
807559
The Xsun server does not support the Xrandr extension needed to change screen resolution via the tool in JDS. You must use the Xorg server to use that tool - kdmconfig allows you to switch which X server is started.
1 - 16
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 31 2015
Added on Jul 31 2015
15 comments
15,135 views