Hi All,
We have oracle 11.2 on Linux.
We have many application. One of the application is muta.It does DML. Every day it runs 6 time.Normally takes less than 10 minutes.
Few occasion takes more than 2 hours to complete due to wrong sqlid. Then we clear that session.Maually do the DML statements.Then it works fine
I am asked to prepare the shell script to kill the session if runs more than 10 minutes and rerun the dml or run the .sql file ( it contains all DML related to the application)
Pleae check the below script and guide me
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
declare
cursor c1 is
select s.sid,s.serial# from v$session s where s.program like 'muta' and a.status ='ACTIVE' and s.last_call_et >= 600;
for c2 in c1
EXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION '''|| c2.Sid || ',' || c2.Serial# || '''';
DML here.....
or
call the script here
end loop;
end;
/
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Are the above steps right one?
How to spool in plsql procedure
How to run the /uo1/script/test.sql file from procedure.
Any Suggestions
Thanks & Regards,