How to restore deleted records in another table in the oracle 10g database...

Hi all

I want to restore deleted records in a particular table in the other table

Suppose that:

I make a request

delete from emp

where deptno = 30;

now, I won't restore deptno = 30 records in the other table, let's say table emp1

can someone let me know how to do it?

Thank you...

This is what flashback query is for:

orclz > conn scott/tiger

Connected.

orclz > select count (*) emp;

COUNT (*)

----------

14

orclz > delete from emp where deptno = 30;

6 deleted rows.

orclz > commit;

Validation complete.

orclz > create table deleted30 in select * from emp to the timestamp (systimestamp - 5/1440) where deptno = 30;

Table created.

orclz > select count (*) in the deleted30;

COUNT (*)

----------

6

orclz >

Tags: Database

Similar Questions

  • How do I get the name of the web page in v$ session table in the Oracle database

    We have asp.net web application hosted on IIS (windows) and the connection to the Oracle (10g) database.


    When I query the table v$ session in the database as a Jr.DBA, I don't see the name of the program as "w3wp.exe.
    coming from the computer host IIS (web server).

    Now, it is difficult to diagnose as session in the database that refers to what web page in the web application.

    If I have 10 web pages open in my web application connecting to the Oracle database, now if I wanted to go
    session info, when I browse the v$ session all it shows me what "w3wp.exe.

    Now is there a way to get the name of the web page in the session of $ v.

    (maybe he needs a few changes to the code in the application web asp.net, change in the configuration of IIS web server as well).

    Let me know

    Dear johnpau2013,

    It's an interesting question. See the documentation below and see if they help you or not?

    DBMS_APPLICATION_INFO;

    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14258/d_appinf.htm#CHEEFBBD
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14258/d_appinf.htm#i999290
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14258/d_appinf.htm#ARPLS003

    Hope that helps.

    Ogan

  • I accidentally erased by iphone and all my photos are deleted. can someone help how to restore deleted photos

    I accidentally erased by iphone and all my photos are deleted. can someone help how to restore deleted photos. I do not have the backup, and it was not synchronized with library icloud.

    If you do not have a return to the top, the images have disappeared.

  • How to restore deleted files from Windows Media Player

    Hi, I decided to use Windows Media Player as a software for my Samsung s3 mp3 player.

    He acknowledged the mp3 player, so I've seen a few pictures, the mp3 player has (thanks to Windows Media Player), but I accidentally deleted.

    Now they are gone, and I can not find them...

    How can we get them?

    Hello Compdumb,

    Thank you for visiting the website of Microsoft Windows Vista Community.

    Regarding your question, I found an article that should answer your question.

    How to restore deleted files from Windows Media Player

    Let us know if these steps solve your problem.  I hope the information is useful.

    Kind regards

    Anthony
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Delete query to delete records from multiple tables

    All,

    I need a delete query that will delete the records from the tables. Please see the structure of the table & below
    CREATE TABLE TEMP1 (ID NUMBER(10),NAME VARCHAR2(40),CLASS VARCHAR2(40),COLLEGE VARCHAR2(40));
    CREATE TABLE TEMP2 (ID NUMBER(10),CITY VARCHAR2(40),STATE(40));
    
    INSERT INTO TEMP1 (ID, NAME,CLASS,COLLEGE) VALUES (1000,'SAM','CS','UNIV_1');
    INSERT INTO TEMP1 (ID, NAME,CLASS,COLLEGE) VALUES (2000,'RIO','CS','UNIV_1');
    INSERT INTO TEMP1 (ID, NAME,CLASS,COLLEGE) VALUES (3000,'CHRIS','CS','UNIV_1');
    INSERT INTO TEMP1 (ID, NAME,CLASS,COLLEGE) VALUES (4000,'ALEX','CS','UNIV_1');
    
    INSERT INTO TEMP2 (ID, CITY,STATE) VALUES (1000,'Auburn','NY');
    INSERT INTO TEMP2 (ID, CITY,STATE) VALUES (2000,'Ithaca','NY');
    INSERT INTO TEMP2 (ID, CITY,STATE) VALUES (3000,'Mount Vernon','NY');
    INSERT INTO TEMP2 (ID, CITY,STATE) VALUES (4000,'Port Jervis','NY');
    Now, I need to delete the records in these tables where the ID is '2000' by using a single delete query. Is this possible? This may be a newbie question. Help, please.

    "using a single request deletion. Is this possible?

    Nope.
    You can insert into multiple tables by using a single query, INSERT ALL job, but you cannot delete more than one table using a single query.

  • How can I delete several clips at once from the timeline

    How can I delete several clips at once from the timeline?

    Thanks, Dan

    Shift-click or command-click to select if they are contiguous. Then press the delete key.

    Or select them and use the keyboard shortcut command + X.

    Or select them in the Index of the Timeline and use the key DELETE or command + X.

    Russ

  • How can I add Lightroom to another account on the same computer mac user?

    How can I add Lightroom to another account on the same computer mac user?

    If you have installed normally he is already there. Simply go to the folder applications and double up until it clicks.

  • Change all the triggers table in the oracle schema by using a script - possible?


    Is it possible to modify all the triggers table in the oracle schema using a single script or modify each trigger table separately is the only way?

    A couple of alternatives come to mind.

    (1) you can go in SQL Develolper, go to the schema, expand the node for triggers and select all the triggers that you want to change.  Right-click and choose the fast DDL--> save spreadsheet.  Find and replace in the worksheet and then run the script.

    (2) if the trigger is the same for all 70 tables, you can move the PL/SQL out of the trigger and in a procedure in a package and just call the procedure of 70 triggers.  Now, the code is kept in the same place.  For new tables, you can add a call to the procedure and you are done.  If all 70 triggers are not the same, see if you can pass parameters to allow a generalized procedure that they can all use.

    You have not indicated what your triggers.  Are insert you columns of auditing, archiving data, inserting into a table of log, update another table or something else?  What type of trigger is it?  What you trying to accomplish with your triggers?

    Marcus Bacon

  • Another application on the ebs r12 database

    Hello

    I would like to know if I can create another user on the ebs r12 database.

    That's another application (not ebs).

    What are the risks?

    Is there an id doc on this subject?

    Thank you.


    It may not be available for that Oracle doc. But as a principle, why the unrelated database schema is created in the EBS database. This will add more load on the database of EBS, administrative effort. Let's say that your EBS database is down for maintenance, while the other application accessing this scheme does not require maintenance always, it will be down.

    concerning

    Pravin

  • How to load data from different tables, but record to another table?

    Hi all

    I use the apex and I understand how it updates and saves the files normally.

    In this case, I would need to load from a table, but save on another Board on the button "submit".

    I am aware that it would be easy as forms where I could do a manual insert process. im making in tabular form and I don't really know how to handle this process.

    Suppose that I am loading a set of questionnaires in the form of tables and have a yes / no selection.

    If the questions would come from table A and I need to save it in table B.

    in this case that I can't put just the value default by the tabular row for questions coz it would be dynamic and this example is on a small scale. I would need to load the table A and record in table B.

    could someone guide me on this operation or provide tutorials any?

    Maybe that's what you're after.

    (1) create region report using SQL like this:

    Select apex_item.hidden(1,rownum).

    apex_item.display_and_save(2,question_column) in Question,

    apex_item. Text(3,,4,4) as answer

    from table_a

    apex_item documentation of package found:

    http://docs.Oracle.com/CD/E37097_01/doc/doc.42/e35127/apex_item.htm

    The pidx (first number) in each apex_item parameter is used to identify this item in the same row of the report' / tabular form.

    (2) create a submit in procedure a bit like that.

    Start

    because I 1.apex_application.g_f01.count loop - identifies the "apex_item.hidden(1,rownum)" at the top and gets a count of how many times it occurs

    Insert into table_b (question, answer)

    values (apex_application.g_f02 (i), apex_application.g_f03 (i));

    end loop;

    end;

  • How to restore/show records deleted - please help me on this topic

    Hi all

    Please help me to view/restore deleted data.

    I had removed 2 records in a table without back upward and pledged the same. Now I want to view/restore it, can you please guide me on this topic.

    Oracle Version: 10g
    OS: Windows XP
    Database in Archive Mode.

    With respect,
    Jamearon

    Hello

    If undo_retention is large enough you can try to use FLASHBACK QUERY to retrieve the deleted rows.

    These links may guide you in this operation:

    http://wiki.Oracle.com/page/query+flashback

    http://www.orafaq.com/node/50

    Of course (without using Flashback ) since a backup and the logs archived, you can restore the deleted lines, but it's a lot heavier.

    Hope this helps.
    Best regards
    Jean Valentine

    Published by: Lubiez John Valentine on 23 January 2011 17:22

  • How to delete records from a table that has a composite unique key duplicate

    Hello
    I get the customer data from various sources in the staging of the table where I insert in the database table where the combination of two columns is considered as a unique key. But there is a possibility of duplicates. How to find duplicates in a SQL or pl/sql

    Thank you
    Manoi.

    Kassa,

    You can see the duplicates by using the following query...

    sql> select * from temp_rajesh;
    
          COL1       COL2 MESSAGE
    ---------- ---------- ------------------
           100        200 message
           100        200 message2
           300        400 message3
           400        500 message 4
    
    sql> select col1, col2, count(*)
      2     from temp_rajesh
      3       group by col1, col2
      4         having count(*) > 1;
    
          COL1       COL2   COUNT(*)
    ---------- ---------- ----------
           100        200          2
    

    -If in the case of duplicate records, you should see only the duplicates (according to some timestamp etc., you can use the functinon row_number analytic..)

      1  select col1, col2 from (
      2  select col1, col2,
      3         row_number() over (partition by col1, col2
      4                            order by message) rn
      5    from temp_rajesh)
      6*   where rn > 1
    sql> /
    
          COL1       COL2
    ---------- ----------
           100        200
    

    In the above example, I use message to order, you can replace it with activity_timestamp or the insertd_date according to your logic... when there are two records... one that you choose to duplicate.

    Thank you
    Rajesh.

    Published by: Rajesh Chamarthi on November 20, 2009 12:05 AM (added for example)

  • How to select a record in one table to manipulate data in a database?

    Hello community,

    Using 32-bit Labview 2015.

    I created a user interface that runs a query and retrieves my table from a sql database.

    I want to be able to manage only one record at a time by selecting the record in my table and then manipulate the data according to the needs.

    Whenever the user runs a query, I want as the first record in the table to be selected / highlighted.

    I want an indicator that is currently active.

    Then a click of a button, to be able to scroll the actively selected record.

    Once I have the selected record, I want a way to write a query to edit or delete the record.

    Is attached a photo of my query to select all of my table and connect data in my table (results).

    Attached a photo of my painting showing the timeline of my sql database.

    What is the best way to go on a record selection in a table and the modification of data with a query?

    Any help would be greatly appreciated.

    Thank you

    I guess that's not a table, but multi-column listbox.

    Right click, select--> highlight whole line selection Mode

    The value of the multicolumn listbox is the row index - you can write a local variable to highlight the line, the event structure to handle the user clicking on, etc.

    If you enable the property editable ListBox cells, you can allow users to edit the items of the listbox.

    If you want to get the data in row, you hint REF table and work with the array of strings in row - convert it to cluster, etc..

    I don't know, what type of data, it is, how you structure the database looks like, I don't even know if you use the wrapper to work with the database, I can't write queries for you.

    Something like Update Tablica Set Serial = '5' where ID = '22';

  • How to remove specific records in a table

    source table: temp (c1 number (5), c2 (3), c3 c4 number varchar2 (10)) (5).

    Application of table source:

    SELECT min temp (c2) WHERE c1 ('17 ', '19', '25', '27', '29' ', 35', '45',' 65') and c3 = 'R '.
    HAVING COUNT (DISTINCT c2 > 4)



    you will need to delete records that retrieve the data source query in the target table.

    target table:

    DELETE FROM temp WHERE c2 =?;


    Need a procedure complete? How to load data into the table target in Oracle?



    one please answer


    Thanks in advance.

    Sorry APC,
    The query returns 'min value' also a line.

    Do not use the operator 'c2 IN 'use' c2 = '

    Thank you

  • How can I display the records of a table for the $ e?

    Hi all

    I had some constraints declared in the target data store. In my interface, I can see that some records have been moved to the table$ e.

    I want to see these documents. How can I see who? Help, please...

    GoTo model ODI of the creator--> YOUR DATA (right-click) store--> controls--> errors

    or

    Make sure that in IKM (delete temporary objects is SET to False). You can question him in the target schema. Select * from E$ _ (unless and until what during the installtaion you have not changed the prefix for ODI).

Maybe you are looking for

  • Problem face Time and sky Hub... Help!

    Hi, we have a Hub of Sky - SR102-Z for our connection broadband. Speeds are great, without connection problems with the exception of FaceTime on iPhone, iPad and iMac too. Our connection speeds are- Upstream (Kbps) 5676 Downstream (kbit/s) 30816 We a

  • I'm looking for apps that I bought years ago

    I'm looking for a few applications that I bought years ago and may not be fArrondi in the story bought?

  • Windows cannot find any networks

    Hi all My dsl network connection is not discovered by vista suddenly I have tried all possible means, but to no avail any help would be greatly appreciated! the error message says "windows cannot find any network." its a DSL connected via a LAN conne

  • Enterprise License Manager to 8.6?

    Is it possible to install a stand-alone copy of ELM for the sole purpose of monitoring the use of the licenses in a UC 8.6 environment?  Meaning, No 9.X anywhere (at least for a few months)? What would prevent this scenario work properly? Thank you!

  • Not readable documents file (all yyyyyyyyyyy) help

    Just changed to Windows 7.   Had a document in My Documents, but now I see are yyyyyyyyyyyyyyy until I do.