Solved

Change cursor_sharing dynamically using sid and serial# of v$session

Posted on 2008-06-25
6
983 Views
Last Modified: 2013-12-18
Hi Experts,
I want to change cursor_sharing=FORCE in my session level, I dont want to use 'alter session set cursor_sharing=FORCE'. Is there any alternate for that something like dbms_system.set_int_param_in_session ?
0
Comment
Question by:Devinder Singh Virdi
  • 3
6 Comments
 
LVL 11

Expert Comment

by:mohammadzahid
ID: 21872110
alternate is

alternative alter session set create_stored_outlines=TRUE

goto this site for examples:

http://www.psoug.org/reference/outlines.html
0
 
LVL 73

Expert Comment

by:sdstuber
ID: 22566057
I suggest delete with refund.

stored outlines aren't really equivalent to cursor sharing.
0
 
LVL 73

Accepted Solution

by:
sdstuber earned 50 total points
ID: 22566082
while not at all equivalent, stored outlines can be complimented by cursor sharing

they apply to specific queries so two queries with different literals would not be recognized for the purposes of outlines.

cursor sharing would allow more queries to use a given outline because the literals would be replaced with binds, allowing them to match an outlined query with binds.


However, to answer the virdi_ds's  question...

the boolean equivalent for dbms_system is...


  dbms_system.set_bool_param_in_session(:sid, :serial, 'cursor_sharing', TRUE);


Note, dbms_system has no permissions by default and is undocumented/unsupported by Oracle.
0
 
LVL 73

Expert Comment

by:sdstuber
ID: 22566086
Now that I've posted an answer, I rescind my suggestion of delete with refund.  :)

Hopefully my suggestion will be found acceptable.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now