Bạn có thể lấy lại bằng cách sử dụng truy vấn flashback trên all_source.
ví dụ: cơ thể gói của tôi hiện đang ở phiên bản 2, thực hiện truy vấn này như một người dùng chuẩn:
SQL> select text
2 from all_source
3 where name = 'CARPENTERI_TEST'
4 and type = 'PACKAGE BODY';
TEXT
package body carpenteri_test
is
procedure do_stuff
is
begin
dbms_output.put_line('version 2');
end do_stuff;
end carpenteri_test;
10 rows selected.
Tôi biết tôi đã thay đổi này khoảng 9:30 tối nay nên sau khi kết nối như một người dùng SYSDBA Tôi chạy truy vấn này:
SQL> select text
2 from all_source
3 as of timestamp
4 to_timestamp('04-JUN-2010 21:30:00', 'DD-MON-YYYY HH24:MI:SS')
5 where name = 'CARPENTERI_TEST'
6 and type = 'PACKAGE BODY';
TEXT
----------------------------------------------------------------------------
package body carpenteri_test
is
procedure do_stuff
is
begin
dbms_output.put_line('version 1');
end do_stuff;
end carpenteri_test;
10 rows selected.
Thông tin thêm về hồi tưởng có thể được tìm thấy here. Tom Kyte cũng demostrates cách sử dụng flashback với all_source here.
Nguồn
2010-06-04 21:05:00
Còn CVS/etc thì sao? –