Recover dropped package / Procedure

I accidentally dropped a procedure on production database and We don't have an up to date copy of that code on Source Safe ( version control).


How to recover the dropped procedure?
LVL 1
vishali_vishuAsked:
Who is Participating?
 
slightwv (䄆 Netminder) Commented:
If this wasn't done that long ago try flashback query:

create table source_recovery as
(SELECT * FROM DBA_SOURCE AS OF TIMESTAMP ('03-OCT-11 8:00:00','DD-MON-YY HH24: MI: SS'));

Of course use a timestamp before the drop.

If this doesn't work, you will likely have to restore a backup on a different server.
0
 
schwertnerCommented:
select text from dba_source
     as of timestamp systimestamp - interval '1500' minute
     where name='PROCEDURE_NAME_HERE' and type = 'PROCEDURE'
order by line asc;

adjust the clause
 '1500' minute
to point to the time just before you dropped the procedure

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.