Home » SQL & PL/SQL » SQL & PL/SQL » Insufficient privileges in DBMS_SESSION.SET_CONTEXT (Oracle 11.2.0.1.0 on OEL 5.7 )
Insufficient privileges in DBMS_SESSION.SET_CONTEXT [message #610713] Sun, 23 March 2014 08:40 Go to next message
Andrey_R
Messages: 441
Registered: January 2012
Location: Israel
Senior Member
Hi all,
I have a code that is using DBMS_SESSION.SET_CONTEXT,
But as I am digging it to try to realize what is wrong,
I am finding out that even SYS gets an error in trying to set the context:

SQL> show user
USER is "SYS"
SQL>
SQL> begin
  2    DBMS_SESSION.SET_CONTEXT('bla',
  3                             'blabla',
  4                             '1');
  5  end;
  6  /
begin
*
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_SESSION", line 101
ORA-06512: at line 2


SQL>


This object is documented to be owned by SYS, so I don't understand how can this be and how to overcome it?

Thanks in advance,
Andrey R.
Re: Insufficient privileges in DBMS_SESSION.SET_CONTEXT [message #610714 is a reply to message #610713] Sun, 23 March 2014 08:51 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Does this help?
Re: Insufficient privileges in DBMS_SESSION.SET_CONTEXT [message #610716 is a reply to message #610713] Sun, 23 March 2014 09:46 Go to previous messageGo to next message
Michel Cadot
Messages: 68647
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

You cannot directly set a context you have to use the package associated to it to do this task.

Re: Insufficient privileges in DBMS_SESSION.SET_CONTEXT [message #610722 is a reply to message #610716] Sun, 23 March 2014 11:10 Go to previous messageGo to next message
Solomon Yakobson
Messages: 3273
Registered: January 2010
Location: Connecticut, USA
Senior Member
Any stored object: package/procedure/function/trigger...

SY.

[Updated on: Sun, 23 March 2014 11:14]

Report message to a moderator

Re: Insufficient privileges in DBMS_SESSION.SET_CONTEXT [message #610864 is a reply to message #610714] Tue, 25 March 2014 04:57 Go to previous message
Andrey_R
Messages: 441
Registered: January 2012
Location: Israel
Senior Member
Yes, Sorry for not paying attention to some available knowledge in web sources and documentation first.
Thanks for pointing that out to me.

Regards,
Andrey R.
Previous Topic: Dynamic column selection
Next Topic: if in field value "Delete", then don't join other table
Goto Forum:
  


Current Time: Fri Apr 26 21:17:48 CDT 2024