The PLS-00201 exception seems a bit unusual to me, for the "privileges granted through a role not available in a stored procedure" problem. As Steve Broberg and Khb have already pointed out, granting privileges directly to a user will resolve exception
ORA-00942: table or view does not exist.
(That's the exception I normally see when compiling a stored procedure, when the statement works outside the stored procedure, and i find that privileges are granted through roles.)
What's kind of peculiar is that the exception you are seeing is a PLS-00201 (That has me puzzled.)
Another workaround to the ORA-942 "no privileges through roles" issue is to define the procedure with invoker rights and use dynamic SQL:
create procedure foo authid current_user
is
ln_cnt number;
begin
execute immediate 'select cnt(1) from schema.view' into ln_cnt;
end;
/
I don't think this is the best approach (it has its own issues) but it is a workaround.
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/dynamic.htm