Solved

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

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

Join & Write a Comment

Suggested Solutions

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…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Via a live example, show how to take different types of Oracle backups using RMAN.
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.

758 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

19 Experts available now in Live!

Get 1:1 Help Now