Re: Query System-Views within Stored Procedures

From: Joseph Y. Suh <dbtech_at_inetnow.net.usa>
Date: 1996/09/17
Message-ID: <323F6B53.6397_at_inetnow.net.usa>#1/1


J L Joslin wrote:
>
> On Wed, 11 Sep 96 21:02:00 GMT, Thomas_Kuchenbuch_at_sz.maus.de (Thomas
> Kuchenbuch) wrote:
>
> >Hi,
> >
> >We tried querying the View "v_$session" from a cursor inside a stored
> >procedure. Same query works fine, if issued directly from SQL*DBA or
> >SQL*Plus. Issued inside a stored procedure (or a package containing that
> >procedure) the result constantly is "ORA-00942: Table or View does not
> >exist".
> >
> >Any Hints?
> >
> >Regards, Thomas
> >
> >---
> >Send Mails >16kB to: TKuchenb_at_aol.com
>
> You must execute your stored procedure with a user ID which has been
> granted access rights to the view.
>
> As the SYS or other DBA user:
>
> CREATE USER XYZ IDENTIFIED BY XYZ;
> GRANT SELECT ON SYS.V_$SESSION TO XYZ;
>
> There is also a sql script in $ORACLE_HOME/rdbms/admin that will
> perform the grants for you but I can't remember it's name at the
> moment.
>
> Jim Joslin

It is utlmontr.sql. It creates MONITORER role and grants to the PUBLIC. You need to run the script as SYS user id.  


  • Joseph Suh dbtech_at_inetnow.net.usa *
  • Oracle DBA 770-908-9785 *
  • Database Technology Int'l, Inc. *
  • Atlanta, Georgia *
Received on Tue Sep 17 1996 - 00:00:00 CEST

Original text of this message