Solved

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

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

Expert Comment

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

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

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 74

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to recover a database from a user managed backup

856 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