パッケージ内では、(ロールを介して)間接的に付与された特権は削除されます。 基になるオブジェクトに対して必要な権限を付与する必要があります アカウントに直接;例:
conn sys/example@sqldat.com as sysdba
create user A identified by A;
grant connect, dba to A;
conn A/example@sqldat.com
create table test_tab(pk number);
conn sys/example@sqldat.com as sysdba
create user B identified by B;
grant connect, dba to B;
conn B/example@sqldat.com
select * from A.test_tab; -- this works
create or replace procedure do_it as
l_cnt pls_integer;
begin
select count(*) into l_cnt from A.test_tab; -- error on compile
end;
この例では、
が必要ですgrant select on A.test_tab to B;
それを機能させるために(動的SQLと静的SQLのどちらを使用しているかは関係ありません)。