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!

Cursor sharing check

HeshApr 12 2019 — edited Apr 15 2019

Hi,

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

how can I check if cursor sharing is happening? I have created following example to test this..

CREATE TABLE t_sh_cur_tst (x NUMBER, y NUMBER);

select count(y) from t_sh_cur_tst where x = 1;

select count(y) from t_sh_cur_tst where x = 10;

select count(y) from t_sh_cur_tst where x = 20;

select count(y) from t_sh_cur_tst where x = 30;

select count(y) from t_sh_cur_tst where x = 40;

select count(y) from t_sh_cur_tst where x = 50;

select count(y) from t_sh_cur_tst where x = 60;

select count(y) from t_sh_cur_tst where x = 70;

select count(y) from t_sh_cur_tst where x = 80;

select count(y) from t_sh_cur_tst where x = 99;

When I check these I got all similar value for SHARABLE_MEM, PERSISTENT_MEM, RUNTIME_MEM .. but all rows have same PARSE_CALLS ..

select address,a.* from gv$sql a where upper(sql_text) LIKE upper('%t_msh_cur_tst%');

following are DB parameter values ..

NAME                                   TYPE    VALUE 

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

_optimizer_adaptive_cursor_sharing     boolean TRUE  

_optimizer_extended_cursor_sharing     string  UDO   

_optimizer_extended_cursor_sharing_rel string  SIMPLE

cursor_sharing                         string  EXACT 

Regards

Hesh

Comments
Post Details
Added on Apr 12 2019
22 comments
2,908 views