Solved

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

Posted on 2008-06-25
6
985 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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

810 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