- 论坛徽章:
- 0
|
我想设定一个job,每天在早上二点运行,已经作了如下工作
1 . SQL>; alter system enable restricted session;
2 . grant execute on dbms_job to super;
3 .建立过程
create or replace procedure my_job
is
begin
insert into detailhostmatrix_ipsday(pkid,routerip,srcaddr,dstaddr,protocol,flows,dpkts,doctets,starttime,endtime) select min(pkid),routerip,srcaddr,dstaddr,protocol,sum(flows),sum(dpkts),sum(doctets),min(starttime), max(endtime) from detailhostmatrix_ips where starttime>;=sysdate-1 and endtime<=sysdate group by routerip,srcaddr,dstaddr,protocol;
delete detailhostmatrix_ips where (sysdate-endtime)>;30;
end my_job;
/
4 . 生成job
variable n number;
begin
dbms_job.submit(:n, 'my_job;',sysdate, 'sysdate+1/360');
commit;
end;
/
接下来我在该怎么做呢???? |
|