hi , i am using oracle 10g db , and i am trying to kill all sessions connected to the database with this code :
CREATE OR REPLACE PROCEDURE kill_sessions IS
begin
for x in (
select Sid, Serial#, machine, program
from v$session
where
username <> 'the one i am connected to in order to kill sessions'
) loop
execute immediate 'Alter System Kill Session '''|| x.Sid
|| ',' || x.Serial# || ''' IMMEDIATE';
end loop;
end;
when i issue this code from a user which i granted the DBA privilege to him , i face these errors :
| PL/SQL: SQL Statement ignored |
| PL/SQL: ORA-00942: table or view does not exist |
| PL/SQL: Statement ignored -- for execute immediate |
| PLS-00364: loop index variable 'X' use is invalid |
but when i log on with " sys as sysdba " , the procedure is created successfully without any errors .
do i miss something here ? do i need any other privileges other than the " DBA " one ?
thanks a lot