Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: problem with select from v$session
Hi,
this behaviour is absolutely correct. If you want to use a Table or View or
any
other object from another user (in this case SYS) in a stored
prdocedure or in a package, you need the grant of the table
directly from the user or the select any table grant from SYSTEM.
So grant select on v$session to <USER> instead of select any table
would cause your procedure to compile as well.
This behaviour exists for the following reason: if you grant execute on
your procedure to another user, he'll got success on the v$session view
as well, even he has not dba-rights or other rights on successing this
table.
Do you see the security problem? If you give a user select grants over a
role (like dba), you can be sure, that he can not create a view or procedure
and grant anything on it to another user.
On SQL-Plus, you've got the grant to select on v$session over the dba-role.
As already said, you need the grant directly if you want to use it in a
package.
I would never grant the 'select any table' grant because of the security
problem, you've got with this grant.
Hope that helped, sorry for my bad english,
Bye
Uli
>
> If from the sqlplus i query the view v$session it gives me the result
> but if the same select statement inside a stored procedure it says
> v$session not declared. Now if i grant select any table to this user
> then the stored procedure is compiling fine.
>
Received on Sun Aug 08 1999 - 07:36:11 CDT