誤刪預存程序,誤刪檔案恢複軟體

來源:互聯網
上載者:User

誤刪預存程序,誤刪檔案恢複軟體

當預存程序被誤刪後,使用下面語句找到被刪除的預存程序並恢複。需要用sys使用者登入。
TIMESTAMP是需要恢複到的時間戳記。
SELECT *
  FROM DBA_SOURCE AS OF TIMESTAMP TO_TIMESTAMP ('2009-03-18 10:07:00', 'YYYY-MM-DD HH24: MI: SS’)
 WHERE OWNER = 'USER_NAME'
   AND NAME = 'PROCEDURE_NAME'
ORDER BY LINE;

DBA_SOURCE、ALL_SOURCE、USER_SOURCE三個視圖中都可以找出。


怎恢複被誤刪的系統預存程序

相恢複是不可能了..除非在刪除之前你資料庫有備份..否則是別想了..
至於“未啟用對系統目錄的特殊更新,系統管理員必須重新設定SQL Server以允許這種操作”的錯誤請看:hi.baidu.com/...5.html
 
質詢個問題:用PL/SQL Developer誤刪了預存程序怎恢複?

用Flashback查詢一下是否還能恢複:
SELECT obj# FROM obj$ AS OF TIMESTAMP TO_TIMESTAMP(you time, 'YYYY-MM-DD HH24:MI:SS') WHERE NAME=your procedure

SELECT * FROM source$ AS OF TIMESTAMP TO_TIMESTAMP(youtime, 'YYYY-MM-DD HH24:MI:SS') where obj# = ?id
 

相關文章

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.