1.找回ID
SELECT obj#
FROM obj$ AS OF TIMESTAMP TO_TIMESTAMP(‘2022-11-16 17:26:20’, ‘YYYY-MM-DD HH24:MI:SS’)
WHERE NAME = ‘GG_TEST’;
注:1.请登录服务器,以sys用户执行
2.GG_TEST为存储过程,或者包
2.通过ID反查
SELECT source
FROM source$ AS
OF TIMESTAMP TO_TIMESTAMP(‘2022-11-16 17:26:20’, ‘YYYY-MM-DD HH24:MI:SS’)
where obj# = 42260;
或者
create table p_temp as
select *
from dba_source as of timestamp TO_TIMESTAMP(‘2022-11-16 17:26:20’, ‘YYYY-MM-DD HH24:MI:SS’)
where TYPE = ‘PROCEDURE’
And owner = ‘TEST’
And Name = ‘GG_TEST’;
select text
from p_temp
where name like upper(’%GG_TEST%’)
and owner = ‘TEST’
1.在用户TEST下14:31下建立存储过程
create or replace procedure GG_TEST
as l_cnt number;
begin
for i in 1 … 10000
loop
execute immediate 'select count(*) from t where x = ’ || i into l_cnt;
end loop;
end;
2.在用户TEST下在14:33下删除存储过程
drop procedure GG_TEST;




