Friday, January 9, 2015

Recover the source code of a dropped Oracle Package

This was a life saver!!!

I have accidentally dropped a package.

Fortunately, I discovered it almost immediately and I was able to recover its source by using the following statements:

select text
from all_source as of timestamp sysdate-1/24
where name 'my_package_name' and type='PACKAGE'
and owner=;

select text
from all_source as of timestamp sysdate-1/24
where name 'my_package_name' and type='PACKAGE BODY'
and owner=;

Obviously, the next step was to commit it in SVN :-)

No comments: