高手请进--权限问题
在ps/sql developer(或sql/plus)上用system/manager连接
1、创建了表空间:
CREATE TABLESPACE EmsNetOn DATAFILE '/usr/u02/EmsNet.DBF' SIZE 10M AUTOEXTEND ON NEXT 1M MAXSIZE 30M DEFAULT STORAGE (INITIAL 64K NEXT 32K PCTINCREASE 0 MINEXTENTS 1 MAXEXTENTS UNLIMITED)/
提示创建成功。
2、创建存储过程:
create or replace procedure sp_iccpdel
as nums number;
begin
select count(1) into nums from user_tablespaces where tablespace_name = 'EMSNETON';
if nums > 0 then
execute immediate 'drop tablespace EMSNETON including contents and datafiles';
end if;
end;
提示编译和创建成功。
3、执行存储过程sp_iccpdel出错:
提示没有权限,位置:execute immediate 'drop tablespace EMSNETON including contents and datafiles';
4、单独执行一条sql语句:drop tablespace EMSNETON including contents and datafiles;
提示drop成功。
请问:1、在同一个用户会话的情况,为什么执行存储过程没有权限?而单独执行又有权限?
2、给system赋予drop tablespace(即执行sql语句:grant drop tablespace to system)后,
执行存储过程sp_iccpdel成功,为什么一定还要给system赋予drop tablespace权限,不是
赋予权限之前单独执行一条drop语句没问题吗?