Oracle restores the stored procedure that is overwritten by false Compilation

Source: Internet
Author: User

When writing an Oracle stored procedure, my colleagues modified it based on the previously written process and wanted to change the name. due to negligence, I did not change the name and compiled it. After compilation, I realized it. Then the original one is gone. Find a way to restore the original process.

If you think of a method by checking the information, you can only try it.

SELECT * FROM source $
As of timestamp TO_TIMESTAMP ('2017-9-6 16:50:32 ', 'yyyy-MM-DD HH24: MI: ss ')
Where source like '% sp_copy_project %'
Order by line;

Only some simple information is found, and data cannot be recovered.

The above is the original one, and the below is just compiled.

OBJ # LINE SOURCE
----------------------------------------------------------------------------------------------------
190762 1 procedure sp_copy_project (old_pro_id number, domain_id number, new_pro_id
190471 1 procedure sp_copy_project (dxid number, rtn out number, msg out varchar2 (4000) I
 
The following sentence is used to find the required information. Select a time point of the previous 30 minutes.

Select * from dba_source
As of timestamp TO_TIMESTAMP ('2017-9-6 16:20:00 ', 'yyyy-MM-DD HH24: MI: ss ')
Where name like upper ('% sp_copy_project %') and owner = 'wmx'
Order by line;

 

The process is one row and one row. Therefore, you can paste all the selected items to the plsql editor,

The text is connected in the correct format.

Add "create or replace" to the front to re-compile,

The overwriting process is back.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.