How to restore/view the deleted records - Please help me on this regard

Hi All,
Please help me in restore/view the deleted data.
I had removed 2 records from a table without back up and commited the same. Now I want to restore/view it, can you please guide me on this regard.
Oracle Version: 10g
OS: Windows XP
Database in Archive Mode.
With Regards,
Jamearon

Aman.... wrote:
<snip>
If all what you want is to view the data, you can use the Flashback's as of query which would enable you to go back either by SCN or by Timestamp. If you want to restore those rows back in the time( and losing the changes that has happened in that time ), you can use the Flashback Table option. An example of this is given below,
http://www.oracle-base.com/articles/10g/Flashback10g.php
HTH
Aman....As promised, here's one way to use flashback to restore the one deleted row without having to impact the rest of the table with a general FLASHBACK TABLE.
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2011.01.23 15:17:56 =~=~=~=~=~=~=~=~=~=~=~=
login as: oracle
oracle@vmlnx01's password:
Last login: Sun Jan 23 15:13:10 2011 from 192.168.160.1
[oracle@vmlnx01 ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jan 23 15:18:11 2011
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
SQL> @doit
SQL> col col_ts for a15
SQL> conn scott/tiger
Connected.
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE10.2.0.4.0Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
5 rows selected.
SQL> --
SQL> alter session set nls_timestamp_format='hh24:mi:ss.FF';
Session altered.first we will create a test table and populate it. Pay close attention to the row identified by col_id=2
SQL> drop table flashtest;
Table dropped.
SQL> create table flashtest
  2   (col_id number(1),
  3    col_ts timestamp,
  4    col_txt varchar2(10)
  5   );
Table created.
SQL> --
SQL> insert into flashtest
  2    values (1, systimestamp, 'r1 v1');
1 row created.
SQL> commit;
Commit complete.
SQL> exec dbms_lock.sleep(5);
PL/SQL procedure successfully completed.
SQL> --
SQL> insert into flashtest
  2    values (2, systimestamp, 'r2 v1');
1 row created.
SQL> commit;
Commit complete.
SQL> exec dbms_lock.sleep(5);
PL/SQL procedure successfully completed.
SQL> --
SQL> insert into flashtest
  2    values (3, systimestamp, 'r3 v1');
1 row created.
SQL> commit;
Commit complete.
SQL> exec dbms_lock.sleep(5);
PL/SQL procedure successfully completed.
SQL> --
SQL> select * from flashtest;
    COL_ID COL_TS          COL_TXT
         1 15:18:14.896167 r1 v1
         2 15:18:21.841682 r2 v1
         3 15:18:28.772038 r3 v1
3 rows selected.
SQL> --
SQL> update flashtest
  2   set col_ts = systimestamp,
  3       col_txt = 'r2 v2'
  4   where col_id = 2;
1 row updated.
SQL> commit;
Commit complete.
SQL> select * from flashtest;
    COL_ID COL_TS          COL_TXT
         1 15:18:14.896167 r1 v1
         2 15:18:35.929847 r2 v2
         3 15:18:28.772038 r3 v1
3 rows selected.
SQL> exec dbms_lock.sleep(5);
PL/SQL procedure successfully completed.So at this point we can see that we have 3 rows, and row 2 has been modified from its original values.
Now we will delete that row.
SQL> --
SQL> delete from flashtest
  2  where col_id=2;
1 row deleted.
SQL> commit;
Commit complete.
SQL> --
SQL> select * from flashtest
  2  order by col_id;
    COL_ID COL_TS          COL_TXT
         1 15:18:14.896167 r1 v1
         3 15:18:28.772038 r3 v1
2 rows selected.Now let's do a SELECT...VERSIONS and see what flashback knows about the row.
SQL> --
SQL> select col_id,
  2         col_ts,
  3         col_txt,
  4         nvl(versions_startscn,0) START_SCN,
  5         versions_endscn END_SCN,
  6         versions_xid xid,
  7         versions_operation operation
  8  from flashtest
  9  versions between scn minvalue and maxvalue
10  where col_id=2
11  order by col_id, start_scn;
    COL_ID COL_TS          COL_TXT     START_SCN    END_SCN XID              O
         2 15:18:21.841682 r2 v1               0    2802287
         2 15:18:35.929847 r2 v2         2802287    2802292 0200260082060000 U
         2 15:18:35.929847 r2 v2         2802292            0A002300A4060000 D
3 rows selected.
SQL> --And having seen the above, we can use a more selective form to provide the values for an INSERT statement to put the row back.
SQL> insert into flashtest
  2     select col_id,
  3            col_ts,
  4            col_txt
  5     from flashtest
  6     versions between scn minvalue and maxvalue
  7     where col_id=2
  8       and versions_operation = 'D'
  9  ;
1 row created.
SQL> --
SQL> select * from flashtest
  2  order by col_id;
    COL_ID COL_TS          COL_TXT
         1 15:18:14.896167 r1 v1
         2 15:18:35.929847 r2 v2
         3 15:18:28.772038 r3 v1
3 rows selected.
SQL>One could also query FLASHBACK_TRANSACTION_QUERY to get the actual DML needed to UNDO an operation on a single table.

Similar Messages

  • I have an ipad mini, i took a video and then it was deleted. 2 other videos where taken right after it was deleted. How can I recover the deleted video please!!!!!

    I have an ipad mini, i took a videoand then it was deleted. 2 other videos where taken right after it was deleted. How can I recover the deleted video please!!!!! There was no backup done as I was not in wifi at the time.
    HELP!!!

    iPad Photo Recovery: How to Recover Deleted Photos
    http://www.iskysoft.com/iphone-data-recovery-mac/ipad-photo-recovery.html
    How to Restore Lost or Deleted Files from iPad
    http://www.iphone-ipad-recovery.com/recover-ipad-mini-files.html
    How to Recover Deleted Files from iPad
    http://www.kvisoft.com/tutorials/recover-deleted-files-from-ipad.html
     Cheers, Tom

  • I lost my iPhone 3 days ago.. it wasn't connet to internet and I don't know how find it without the connection.. please help me and give me some advices!!

    I lost my iPhone 3 days ago.. it wasn't connet to internet and I don't know how find it without the connection.. please help me and give me some advices!!

    Change your passwords.

  • I have already downloaded the ios 7 but cannot access the iTunes Radio from the music app. There is no iTunes Radio icon at all! How did that happen? How can I resolve the problem? Please help. Thanks!

    I have already downloaded the ios 7 but cannot access the iTunes Radio from the music app. There is no iTunes Radio icon at all! How did that happen? How can I resolve the problem? Please help. Thanks!

    It didn't show up in my music app for several hours.   Don't know why... But it's there.
    I can now access and add stations through the iTunes Store to play through music app icon.

  • HT1212 I have an ipod 4 touch with a broken power button and Im locked out of the ipod. How can I reset the ipod? Please help!

    I have an ipod 4 touch with a broken power button and Im locked out of the ipod. How can I reset the ipod? Please help!
    I also don't know the operating system.

    See the method in my reply in this discussion for how to place the iPod in Recovery mode w/o buttons
    Turn on without Home/Power Button

  • Query Issue in Creating a View....Please help me with this query..

    I would like to create a view on this table with four columns
    1. PN#_EXP_DATE
    2. PN#
    3. PN#_EFF_DATE
    4. PN#
    P_S_C     A_C     P     EXP_DT
    21698     13921     1     5/29/2009 3:15:41 PM     
    21698     13921     1     5/29/2009 3:54:57 PM     
    21698     1716656     4     5/29/2009 3:15:41 PM     
    21698     3217     3     5/29/2009 3:15:40 PM     
    21698     3217     3     5/29/2009 3:54:57 PM     
    21698     60559     2     5/29/2009 3:15:41 PM     
    21698     60559     2     5/29/2009 3:54:57 PM     
    I have a trigger on A, which inserts the DML records into B. (Table A and B structure is the almost the same,
                                       where table B will have one extra column exp_dt)
    NOw Table B can have records with same P_S_C and A_C columns and exp_dt will capture the history.
    for example: from the above sample data, let us take first two records..
    P_S_C     A_C     P     EXP_DT
    21698     13921     1     5/29/2009 3:15:41 PM     --- Record 1
    21698     13921     1     5/29/2009 3:54:57 PM     --- Record 2
    from this..
    Note: 1. Table A and Table C can be joined using A.P_S_C and C.R_C to get the start_date.
    2. PN# comes from table D. It contains numbers for the resp. weeks.
    3. PN#_EFF_DATE is the previous immediate previous date for that record in history table (Table B).
    I wanted the data like..
    ---- this is for the second record in the above..
    PN#_EXP_DATE PN# PN#_EFF_DATE PN#
    5/29/2009 3:54:57 PM     214 5/29/2009 3:15:41 PM     214
    ---- this is for the first record in the above..
    PN#_EXP_DATE PN# PN#_EFF_DATE PN#
    5/29/2009 3:54:41 PM     214 ( for this we should query the table C to get the
                        start_date, for this combinatation of P_S_C and A_C in table B
                             where B.P_S_C = C.A_C
                             and that value should be the EFF_DT for this record)
    Please help me with this....
    Thanks in advance..

    Hi All,
    select d.P# as "PN#_EXP_DATE", exp_date
    from daily_prd d, cbs1_assoc_hist b
    where to_char(d.day_date,'MM/DD/YYYY') = to_char(b.exp_date,'MM/DD/YYYY')
    and d.period_type = 'TIMEREPORT';
    This above query gives the output as follows:
    pn#_exp_date exp_date
    214     5/29/2009 3:15:40 PM
    214     5/29/2009 3:15:41 PM
    214          5/29/2009 3:15:41 PM
    214          5/29/2009 3:15:41 PM
    214          5/29/2009 3:54:57 PM
    214          5/29/2009 3:54:57 PM
    214          5/29/2009 3:54:57 PM
    This below is the data from history table (Table B).
    P_S_C     A_C PLACE EXP_DATE
    21698          3217          3     5/29/2009 3:15:40 PM     
    21698          13921          1     5/29/2009 3:15:41 PM     
    21698          1716656          4     5/29/2009 3:15:41 PM     
    21698          60559          2     5/29/2009 3:15:41 PM     
    21698          13921          1     5/29/2009 3:54:57 PM     
    21698          3217          3     5/29/2009 3:54:57 PM     
    21698          60559          2     5/29/2009 3:54:57 PM     
    I got the pn#_exp_date from the Table 'D', for the given exp_date from Table B.
    My question is again....
    CASE - 1
    from the given records above, I need to look for exp_date for the given same P_S_C and A_C.
    in this case we can take the example...
    P_S_C     A_C PLACE EXP_DATE
    21698          3217          3     5/29/2009 3:15:40 PM
    21698          3217          3     5/29/2009 3:54:57 PM
    In this case, the
    pn#_exp_date exp_date     pn#_eff_date eff_date
    214     5/29/2009 3:15:57 PM     < PN# corresponding to the     5/29/2009 3:15:40 PM
                        eff_date .>
                        <Basically the eff_date is
                        nothing but the exp_date only.
                        we should take the immediate before one.
    In this case, our eff_date is '5/29/2009 3:15:40 PM'.
    but how to get this.
    CASE - 2
    from the above sample data, consider this
    P_S_C     A_C PLACE EXP_DATE
    21698     1716656     4     5/29/2009 3:15:41 PM
    In this case, there is only one record for the P_S_C and A_C combination.
    The expected result :
    pn#_exp_date exp_date               pn#_eff_date eff_date
    214     5/29/2009 3:15:41 PM     < PN# corresponding to the     5/29/2009 3:15:40 PM
                        eff_date .>
                   <Basically the eff_date is
                   nothing but the exp_date only.
                        we should take the immediate before one.
    In this case to get the eff_date, we should query the Table 'C', to get the eff_date, which is START_DT column in this table.
    for this join B.P_S_C and C.R_C.
    Hope I am clear now..
    Thanks in advance.....

  • My ipod 7th generation is not recognised by itunes and my computer. I am not able to transfer any songs. Please help me on this regard. I tried all the steps from apple website

    my ipod 7th generation is not recognised by itunes and my computer. I am not able to transfer any songs. Please help me on this regard. I tried all the steps from apple website

    This article should give you the options
    https://discussions.apple.com/docs/DOC-3991

  • Getting Error "Apple ID does not have permission to access iTunes Connect" while logging to iTunes. Please help me in this regard

    Getting Error "Apple ID does not have permission to access iTunes Connect" while logging to iTunes. Please help me in this regard
    Regards,
    Amar

    See the "More Like This" section over there ===============>
    In the future, search before posting.

  • My wifi has gone grey???? PLease help me in this regard

    After updating my iphone 4S with iOS 6.1, my wifi has gone grey , please help me in this regard??

    IOS: Wi-Fi or Bluetooth settings greyed out or dim.
    http://support.apple.com/kb/TS1559

  • I have unlocked my iphone and when tried to upgrade it, i got an error, so i restored it.But i was not able to activate my iphone 3gs now...it is showing a message like ' sim card not found'..please help me with this regard

    I have unlocked my iphone and when tried to upgrade it, i got an error, so i restored it.But i was not able to activate my iphone 3gs now...it is showing a message like ' sim card not found'..please help me with this regard

    Try popping out the SIM card and turn off the phone.
    Pop in the SIM card once again and turn on the phone, make sure that the SIM card is placed and seated perfectly in the tray!
    Tell me how did you unlock your phone!?

  • HT2521 A pop up window in my safari is not closing. Even after several clicks on OK it keeps popping up. And the open window is not allowing me to use the Safari nor is it allowing to restart/Shutdown the Mac. Please help me rectify this error.

    A pop up window on my Safari does not close even after several clicks on OK... this window keeps popping up and is not allowing using the safari nor is it alowing to close the browser. The open Safari is also not allowing to restart or shutdown the notebook. Please help me rectify the problem.

    Force Quit .
    Press command + option + esc keys together at the same time.    Wait.
    When Force Quit window appears, select  Safari, if not already.
    Press Force Quit button at the bottom of the window.      Wait.
    Application will quit.
    If this does not help, press the power button for 7 or more seconds.
    Computer will shut down.
    Restart.
    Hold the shift key down and launch Safari.
    Best.

  • My daughter has an iPod touch and is emailing a much older boy via text free app she downloaded. How can I see the conversations? Please help and thank you

    Please help me...My 12year old daughter has been talking to a older teenager through the text free app. How can I see the conversations? Also, there is a photo vault that is locked. What is that? Please someone help me. I don't know what else to do. I paid and downloaded a program that is supposed to tell you everything that's on the ipod but that was a joke. Thanks for your help.

    As long as you can't get a hold of the device, you can't do anything more than talking to your daughter about it.
    Erasing the device could also be an option to keep her from using apps you don't want her to have on her device.
    Try talking first

  • IMovie 11, How do I complete the movie? Please Help!!

    I just got my MacBook last week so imovie is brand new to me and I'm only use to using Windows Movie Maker. Anyways I'm just trying to figure out how I save a video when I'm finished editing it? I finally realized how to trim the clips I want and get rid of the one's I don't but I can't for the life of me save the video when I'm done? Please help, the only thing that I can do to get them is to finalize it which takes forever and I keep forgetting how to do it.

    Hi
    Imovie'08 or 09 or 11 - was a totally new product with a new concept.
    It stores Event and Projects by it self.
    To get Your movie out - then use Share on top Menu list.
    If You want a DVD then - I don't use Share to iDVD - but Share to Media Browser
    and the big and large size. Then in iDVD open it's Media Browser and use the movie here.
    Yours Bengt W

  • I am using 3.0.1 software in my iphone. may i eligible to update it and if yes how can i do the same? please help me.

    hello friends.
    i am using apple iphone model MB384LL version 3.0.1,am i able to update it with latest version,if yes how may i do that. please help me.
    thanks

    You will need to update through iTunes on your computer.

  • The font for my yahoo log in is very very small anbd my email fonts are far too big and the words overlap, please help to correct this problem

    The font for sign into my yahoo mail is so small that I am unable to make out my ID and password and when I do get into my mailbox, the fonts are far too big and the words overlap. Tried going into tools /options to make changes but not successful, please help.thanks

    Reset the page zoom on pages that cause problems, make sure that the window is not maximized:
    *<b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)
    *http://kb.mozillazine.org/Zoom_text_of_web_pages
    If you have increased the minimum font size then try the default setting "none" as a high value can cause such issues.
    *Tools > Options > Content : Fonts & Colors > Advanced > Minimum Font Size (none)
    Make sure that you allow websites to choose their fonts.
    *Tools > Options > Content : Fonts & Colors > Advanced > [X] "Allow pages to choose their own fonts, instead of my selections above"
    You can use an extension to set a default font size and page zoom on web pages.
    *Default FullZoom Level: https://addons.mozilla.org/firefox/addon/default-fullzoom-level/
    *NoSquint: https://addons.mozilla.org/firefox/addon/nosquint/

Maybe you are looking for