Can I revert back package changes to prev version? [message #549236] |
Thu, 29 March 2012 01:25  |
hari_bk
Messages: 110 Registered: March 2006
|
Senior Member |
|
|
Hi
I overwritten the package and want to get the previous version.
Is there a way I can get it using FLASHBACK or any other feature?
My user_recyclebin is showing only tables.
SELECT object_name, original_name, TYPE
FROM user_recyclebin;
Thanks
|
|
|
|
|
|
|
|
|
|
Re: Can I revert back package changes to prev version? [message #549926 is a reply to message #549236] |
Wed, 04 April 2012 13:25   |
Its_me_ved
Messages: 979 Registered: October 2009 Location: India
|
Senior Member |
|
|
SQL> show user
USER is "SYS"
SQL> grant flashback on user_source to hr
2 /
Grant succeeded.
SQL> conn HR/HR
Connected.
SQL> create or replace procedure prc001
2 as
3 begin
4 dbms_output.put_line('>>>> Print A<<<<<');
5 end;
6 /
Procedure created.
SQL> select text from user_source where name = 'PRC001';
TEXT
--------------------------------------------------------------------------------
procedure prc001
as
begin
dbms_output.put_line('>>>> Print A<<<<<');
end;
SQL> ED
Wrote file afiedt.buf
1* select text from user_source where name = 'PRC001'
SQL>
SQL> create or replace procedure prc001
2 as
3 begin
4 dbms_output.put_line('>>>> Print B<<<<<');
5 end;
6 /
Procedure created.
SQL> select text from user_source where name = 'PRC001';
TEXT
--------------------------------------------------------------------------------
procedure prc001
as
begin
dbms_output.put_line('>>>> Print B<<<<<');
end;
SQL> select text from user_source as of scn timestamp_to_scn(systimestamp - 10/1440)
2 where name = 'PRC001';
no rows selected
SQL> select text from user_source as of scn timestamp_to_scn(systimestamp - 5/1440)
2 where name = 'PRC001';
TEXT
--------------------------------------------------------------------------------
procedure prc001
as
begin
dbms_output.put_line('>>>> Print B<<<<<');
end;
SQL> select text from user_source as of scn timestamp_to_scn(systimestamp - 7/1440)
2 where name = 'PRC001';
TEXT
--------------------------------------------------------------------------------
procedure prc001
as
begin
dbms_output.put_line('>>>> Print A<<<<<');
end;
Source: http://myracle.wordpress.com/2007/09/05/plsql-code-versioning-possible-in-oracle-10g-with-flashack/
Regards
Ved
|
|
|
|
Re: Can I revert back package changes to prev version? [message #549932 is a reply to message #549926] |
Wed, 04 April 2012 13:55  |
 |
Michel Cadot
Messages: 68757 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
1/ About audit
And what if the code is changed once per year or even month?
Do you have one month of audit inline?
Once again it is the wrong way, it is NOT a practical way and, anyway, it will not answer the question as if OP has no source version control tool then it has no audit on the database.
2/ About flashback
Note that flashback on source$ is the FIRST thing I suggested and it is of course limited to undo segment data, I even wonder if it is not limited by the small SYSTEM rollback segment. Anyway, it is even more limited than audit.
Regards
Michel
[Updated on: Wed, 04 April 2012 13:59] Report message to a moderator
|
|
|