Re: dbms_session.set_sql_trace

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1998/03/19
Message-ID: <35109c02.32016607_at_192.86.155.100>#1/1


A copy of this was sent to Ian Wood <iwood_at_novalistech.com> (if that email address didn't require changing) On Wed, 18 Mar 1998 13:37:48 -0400, you wrote:

roles are never enabled during the execution of a procedure.

Try this:

SQL> set role none;
SQL> "statement you want to test to see if it'll work in a procedure"

If you can do it in plus with no roles you can do it in a procedure. If you can't, you must have the privelege from a role and hence dbms_sql/etc won't be able to do it either.

You probably have the privelege to do what you are trying to do in dbms_sql/etc via a role. Grant the privelege directly to the owner of the procedure and it'll
work.

In your case the privilege is "alter session"

>hi,
>
>I have a stored procedure in which I want to invoke tracing. To this
>end I inserted the line:
>
>dbms_session.set_sql_trace(true);
>
>prior to the first executable line of code.
>
>when I run my test in SQL*Plus the following occurs:
>
>SQL> _at_test
>
>begin ns_val_sale.menu(-13, '000000003H'); end;
>
>*
>ERROR at line 1:
>ORA-01031: insufficient privileges
>ORA-06512: at "SYS.DBMS_SESSION", line 32
>ORA-06512: at "SHELL_DBA.NS_VAL_SALE", line 2229
>ORA-06512: at line 1
>
>
>however, If I simply execute the procedure form the command line
>it works fine:
>SQL> execute dbms_session.set_sql_trace(true);
>
>PL/SQL procedure successfully completed.
>
>I would greatly appreciate it if someone could tell me what I am
>missing.
>Why can I execute from the command line and not from the script.
>DBMS_OUTPUT works fine by way of reference.
>
>Kindest Regards,
>
>Ian Wood
>NovaLIS Technologies
>iwood_at_novalistech.com
>
>
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Thu Mar 19 1998 - 00:00:00 CET

Original text of this message