监控session process存储过程

来源:互联网 发布:ubuntu 默认文件系统 编辑:程序博客网 时间:2024/06/18 10:45
DECLARE
 v_lower NUMBER :=1;
 v_upper NUMBER :=1000000;

BEGIN
   FOR i IN v_lower .. v_upper LOOP
     DBMS_LOCK.SLEEP(1);
   insert into sp
   select (select count(0) from v$session) s,(select count(0) from v$process) p,sysdate d  from dual;
   commit;
   END LOOP;

END;

/

0 0