我的用户是DBA权限,能在plsql中使用
ALTER SYSTEM KILL SESSION '11,2923'
可在存储过程中使用的时候就报“权限不足”,哪位高手知道怎么解决?
存储过程如下:
PROCEDURE DBA_KILL_WORKSPACE_SESSION(WORKSPACENAME VARCHAR2) AS
s VARCHAR2(1000);
BEGIN
FOR CUR IN (select s.SID, s.SERIAL#
from v$session s
where sid in (select sid
from dba_workspace_sessions t
where t.workspace = WORKSPACENAME)) LOOP
s := 'ALTER SYSTEM KILL SESSION ''' || CUR.SID || ',' || CUR.SERIAL# || '''';
EXECUTE IMMEDIATE S;
END LOOP;
END;
------解决方案--------------------
显式授权
grant alter system to user_name;