Restore Deleted Records From A Table

Jul 31, 2012

Somebody deleted records from 10,12 tables in one of the schema. I found in one of the forum that table can be restored also if it exists in the recycle bin. I checked by querying:

select object_name, original_name, type, can_undrop as "UND", can_purge as "PUR", droptime from recyclebin;

> select type, can_undrop as "UND", can_purge as "PUR", droptime from recyclebin WHERE TYPE='TABLE' and droptime like '%2012-07-31%';
PHONE      TABLE                 YES YES 2012-07-31:10:23:08
TABLE                 YES YES 2012-07-31:10:23:08
TABLE                 YES YES 2012-07-31:10:23:08
TABLE                 YES YES 2012-07-31:10:23:08
TABLE                 YES YES 2012-07-31:10:23:08
- -
- - I created a test table and dropped it and restored from recycle bin using following flashback table test query....but in my case tables are not dropped...these tables are shoing 0 records. How can I recover only records from recycle bin tables?
SQL> flashback table test to before drop;

Flashback complete.

DB=10.2.0.5 on RHL

View 6 Replies


ADVERTISEMENT

SQL & PL/SQL :: Deleted Table In Oracle 11g - How To Restore

Mar 11, 2013

I deleted a table in oracle sql 11g about two weeks ago and commited. Didn't realise that I would need it later on and now I needed. is there a way a can get reverse this.

View 13 Replies View Related

SQL & PL/SQL :: Deleted All Records From Table - How To Get Back

Nov 8, 2010

I have deleted all the records from the table.And I have committed.Now I want to get all the records back.

View 16 Replies View Related

SQL & PL/SQL :: Procedure To Delete Records / Count Number Of Records Has Been Deleted

Feb 21, 2011

I have written the following PL/SQL procedure to delete the records and count the number of records has been deleted.

CREATE OR REPLACE PROCEDURE Del_emp IS
del_records NUMBER:=0;
BEGIN
DELETE
FROM candidate c
WHERE empid in
(select c.empid
from employee e,
candidate c
where e.empid = c.empid
and e.emp_stat = 'TERMINATED'
);
[code]....

View 6 Replies View Related

SQL & PL/SQL :: List Records Being Deleted From All The Tables

Jan 10, 2011

I am executing a script that is deleting some parent records and the corresponding child records as I have used the "on delete cascade" with the Foreign key Constraint.

My question is that can I list the records that are being delete from all the tables i.e. both parent and child tables. Is some thing like spooling can work in this or do I have some other option with which I can see(select) all the deleted records.

View 12 Replies View Related

Forms :: FRM 40102 Records Must Be Inserted Or Deleted First?

Jul 26, 2011

How to avoid this error. FRM 40102 Records must be inserted or deleted first

i have used next_record.If i remove this it is working.but i need to use next_record built in.

View 8 Replies View Related

Possible To Recover A Deleted Column Of A Table

Mar 18, 2011

I am new to oracle database. I wanted to know if it is possible to recover a deleted column of a table. If yes, how can it be done? I tried flashback but it seems that flashback doesn't support recovery of deleted column.

View 2 Replies View Related

A Datafile Deleted Belongs To Partitioned Table

Oct 11, 2012

A datafile was deleted from a partitioned table which has 31 partitions , that datafile contains data from day 25 to day 31 st I am not having a backups of this database. but I have all the dumps of that table what is the solution to get those 6 partitions data back.

View 9 Replies View Related

Create Trigger So That Whenever Record In Employee Table Deleted?

Dec 7, 2009

I'm trying to create a trigger so that whenever a record in the Employee table is deleted, a trigger will automatically delete corresponding records in the Job History table, then the Employee record is archived to EmployeeArchive before it is deleted. It compiles but with warnings. Here's what I've got.

CREATE TABLE EmployeeArchive
(EmployeeID Int, FirstName Char, LastName Char,
EMail Char, PhoneNumber Int, HireDate Date, JobID Char, Salary Int,
Commission Int, ManagerID Int, DepartmentID Char);

[Code]....

View 11 Replies View Related

SQL & PL/SQL :: Oracle 10g - Update Records In Target Table Based On Records Coming In From Source

Jun 1, 2010

I am trying to update records in the target table based on the records coming in from source. For instance, if the incoming record is present in the target table I would update them in the target else I would simply insert. I have over one million records in my source while my target has 46 million records. The target table is partitioned based on calendar key. I implement this whole logic using Informatica. Looking at the informatica session log I find that the informatica code is perfectly fine but its in the update part it takes long time (more than 5 days to update one million records). find the TARGET TABLE query and the UPDATE query as below.

TARGET TABLE:
CREATE TABLE OPERATIONS.DENIAL_REGRET_FACT
(
CALENDAR_KEY INTEGER NOT NULL,
DAY_TIME_KEY INTEGER NOT NULL,
SITE_KEY NUMBER NOT NULL,
RESERVATION_AGENT_KEY INTEGER NOT NULL,
LOSS_CODE VARCHAR2(30) NOT NULL,
PROP_ID VARCHAR2(5) NOT NULL,
[code].....

View 9 Replies View Related

Restore Recent Backed Up Control File And Then Restore The Database?

May 6, 2013

The controlfiles were corrupted due to some issue. So, I had to restore the recent backed up control file and then restore the database.

The weird thing which I have noticed is that. I tried backing up Yesterday's Control file. So, I would say that the backup pieces it should pick should be from yesterday. however, the backup pieces are getting restored from last week's backup.

View 3 Replies View Related

RMAN :: Restore Point Backup And Restore To New Host

Mar 14, 2013

We want to keep the Guaranteed restore point for week but unfortunately we don't have enough flash space in the server. Is it possible to backup the flashback log(restore point logs) through rman and send bkp file to tape? how to restore the database in new server until Guaranteed restore point.

View 1 Replies View Related

Possible To Restore Database Only Using RESTORE Command?

Dec 4, 2012

It's possible to restore a database only using the RESTORE command? (without use the recovery process)?I trying to do this using the commands:

RMAN> backup database;
RMAN> backup current contolfile;
RMAN> shutdown immediate;
RMAN> startup nomount;
RMAN> restore controlfile from '/opt/oracle/flash_recovery_area/ORCL/backupset/2012_12_04/o1_mf_ncnnf_TAG20121204T2555832_8cx71t4j_.bkp';
RMAN> restore database;
RMAN> alter database open resetlogs;
[code]....

View 2 Replies View Related

Server Administration :: Reorganize A Table And Index After The Deletion Of Records From Table?

Feb 7, 2012

We deleted millions of records from a table.

1.Is it necessary to reorganize a table and index after the deletion of records from table ? Because i see some change in table size after table and index reorganization.

2.Will re org table and index improve the database performance ?

View 7 Replies View Related

PL/SQL :: Selecting Records From 125 Million Record Table To Insert Into Smaller Table?

Jul 17, 2013

Oracle 11gI have a large table of 125 million records - t3_universe.  This table never gets updated or altered once loaded,  but holds data that we receive from a lead company. I need to select records from this large table that fit certain demographic criteria and insert those into a smaller table - T3_Leads -  that will be updated with regard to when the lead is mailed and for other relevant information.  select records from this 125 million record table to insert into the smaller table. 

I have tried a variety of things - views, materialized views, direct insert into smaller table...I think I am probably missing other approaches. My current attempt has been to create a View using the query that selects the records as shown below.  Then use a second query that inserts into T3_Leads from this View V_Market.  This is very slow. Can I just use an Insert Into T3_Leads with this query - it did not seem to work with the WITH clause?    My Index on the large table is t3_universe_composite and includes zip_code, address_key, household_key.   

CREATE VIEW V_Market  asWITH got_pairs    AS     (         SELECT /*+ INDEX_FFS(t3_universe t3_universe_composite) */  l.zip_code, l.zip_plus_4, l.p1_givenname, l.surname, l.address, l.city, l.state, l.household_key, l.hh_type as l_hh_type, l.address_key, l.narrowband_income, l.p1_ms, l.p1_gender, l.p1_exact_age, l.p1_personkey, e.hh_type as filler_data, 1.p1_seq_no, l.p2_seq_no       ,      ROW_NUMBER () OVER ( PARTITION BY  l.address_key                                    ORDER BY      l.hh_verification_date  DESC                    ) AS r_num         FROM   t3_universe  e         JOIN   t3_universe  l  ON                l.address_key  = e.address_key             AND l.zip_code = e.zip_code           AND   l.p1_gender != e.p1_gender      

[code]....

View 2 Replies View Related

SQL & PL/SQL :: Insert All Records From External Table Into Export Table

Mar 25, 2013

following is the requirement

External Table
WKSHT_FILE_EXT
wksht_line
Export Table
Wksht_export
global_idvarchar2(10)
wksht_linevarchar2(250)
[code]....

Step 1.Insert all records from the external table into the export table. Truncate the export table first

Step 2.Read in a record from the export map table

Step 3.Search through export table records looking for the key words BRANCH =. Compare the branch code with the branch code form the map table

Step 4.If a match is found mark all records in the export table for the worksheet with the global ID from the export map table as follows..The first line of a worksheet is marked by the words WKSHTS..The last line of the work sheet is marked by the words COMPANY CONFIDENTIAL..We will need to capture the line break so also mark the next line after the COMPANY CONFIDENTIAL line

Step 5.Continue with Steps 2 - 4 until all records have been processed from the export map table.

first I have to create a procedure ti insert data from external table to export table.Global id will be blank.it will be updated by the mapping table's Global Id when The EB COLUMN's data(i.e 8p,2Betc ) will match with the BRANC=NA,2Betc of the datasheet loaded from the external table.. FOLLOWING IS THE SAMPLE DATASHEET

WKSHTS AAAAA BBBBBBBBBBB ELECTRONICS INC. TIME REPORT-DATE PAGE
SORT - BR, SLSREP AEC FIELD SALES REPRESENTATIVE 16:14 09/21/12 1
BRANCH = 2B
EMPLOYEE NAME SALVAAG, GREGG Days in the Month 28
[code]....

THERE ARE 2 pages..I have to split this LONG REPORT STORED IN WKSHT_LINE COLUMN OF EXPORT TABLE to 2 records..like wise 500 pages are there means 500 records.. AND THEN FIND BRANCH= after that which two words will come i.e NA,2B etc if it will MATCH WITH MAPPING TABLE"S EB COLUMN"S DATA,THEN MAPPING TABLE's GLOBAL ID WILL BE UPDATED TO EXPORT TABLE's GLOBAL ID WHICH IS BLANK

View 1 Replies View Related

Rows Are Not Getting Deleted Using Purge

Nov 8, 2012

declare
min_as_of_dt date;
max_as_of_dt date := to_date('30-SEP-2012', 'DD-MON-YYYY');
begin
DBMS_OUTPUT.ENABLE(10000000);
[code]......

Problem: rows are not getting deleted after running this script.

View 1 Replies View Related

Oracle_home / Bin Directory Deleted

Nov 4, 2011

I have a major problem my oracle_home/bin directory was delete mistakenly by on of our user. Because i cannot use all oracle utitilessqlplus,dbca,netca,netmgr. how do i the cover this problem?

View 2 Replies View Related

SQL & PL/SQL :: How To Take Backup Of Deleted Statement

Mar 27, 2012

i want to insert values in another table whatever i deleted. i don't want whole information like backup, i just want deleted information only. whenever any 1 will try to delete any information on my database ,easily i would get to know what,when he has deleted .

View 14 Replies View Related

SQL & PL/SQL :: Retrieve Deleted Rows

Jun 13, 2013

how to retrieve deleted rows in oracle?

View 7 Replies View Related

Insert Newest Records From One Table Into Another Table

Mar 9, 2004

Trying to auto insert the newest records from one table into another Table. I have a vendor provided table that is part of my database (running Oracle 9i) so I can't change the underlying structure to it or their process stops fluxing. However, I can add a trigger to it. What I want to do is this:

When the vendor's software inserts a new row (through their own automated process) I want to insert data from that same new record into another table of my own. (where of course I can re-format it, etc., and make the data my own)

The original vendor table does not have a insertion timestamp field to work off of.What is the best way to trigger an insert off the latest inserted record? It works to replace all the records in the entire vendor table but I only want to insert one record at a time.

View 2 Replies View Related

How To Know Exact Time Of Row Modified And Deleted

Jul 16, 2010

1)How can i know that in a table when i modified a row or deleted a row and which row i inserted when i want to know the particular time

can it is possiable if possiable then tell me how.

2)Is there any difference between 9i merge and 10g merge command ?

View 4 Replies View Related

SQL & PL/SQL :: Find Out Tables That Are Frequently Getting Deleted?

Mar 25, 2012

How to find out the tables that are frequently getting deleted?

View 2 Replies View Related

Reinsert Deleted Record By Using Same Trigger

Jan 24, 2013

I have a trigger which monitors the deletion activity on the table. But I would like to re-insert those records to the in the table using the same trigger.

View 1 Replies View Related

Backup & Recovery :: Restore Dropped Or Wrongly Updated Table Using RMAN Backup?

Feb 9, 2011

Is it possible to restore dropped table OR wrongly updated table using RMAN backup.

View 18 Replies View Related

Create Trigger To Stop Events From Being Deleted

Jun 2, 2010

I am trying to create a trigger to stop events from being deleted if the date is before the current date. This is the SQL syntax for my table

CREATE TABLE event
(event_id numeric(5) not null,
concert_id numeric(5) not null,
event_date date,
);

What I have attempted so far is:

CREATE OR REPLACE TRIGGER event_deleting
BEFORE DELETE ON event
FOR EACH ROW
BEGIN
IF DELETING THEN
[code]......

This gives me a few warnings, the first is that a DECLARE is missing and the second is a INTO is missing.

View 1 Replies View Related

Cataloging Deleted RMAN Backup Pieces?

Oct 7, 2010

A full, online backup (database, archived redo logs, and control file autobackup) is done with rman ("nocatalog", Oracle 9i on AIX 5.2) daily. A media manger is not in use, so the backup is written to disk, then written to tape using an operating system utility. There is room on disk for two full backups, so "redundancy = 1" and obsolete backup sets are deleted to free up space immediately before running the next backup. If the backup(s) on disk are lost and the tapes containing these backups are lost, will it be possible to restore a tape containing older "deleted" backups (using an operating system utility) and catalog each backup piece in the current control file? In other words, can backups considered "deleted" in the control file be reintroduced if they're available on tape?

View 4 Replies View Related

Forms :: ERROR - Record Must Be Entered Or Deleted First

Jul 19, 2011

I'm getting below error. how can we avoid this error?

ERROR: frm-40102 record must be entered or deleted first

View 4 Replies View Related

Server Administration :: How To Remove Deleted Entry From Sys.ts$

Oct 15, 2011

### Changes made ###
1 week before we did a change on tablespace segment management - from MANUAL to AUTO by following method:
1. create INVD2 & INVX2 & LOBD tablespace.
2. Move TABLE from INVD to INVD2.
3. Rebuild INDEX from INVX to INVX2.
4. Move LOBSEGMENT from INVD to LOBD tablespace.
5. After confirm no segments exist in old tablespace, offline and drop INVD & INVX.
6. Change default tablespace for INV user to INVD2.
7. RENAME TABLESPACE INVD2 to INVD, INVX2 to INVX.
8. Change default tablespace for INV user to INVD back.
9. Run Gather Schema Stat for INV using UNIX scheduler which work usually. However, error ended with ORA-03113 & ORA-03114.
10. Manual execute with same statement the following day, procedure completed successfull.

After 1 week later, inventory forms detected error FRM-40735 in all forms. Checked the gather schema stat job was run in the morning before user feedback..

AFter refer notes from metalink, I understand this is a bug where RENAME of the tablespace could not rename as the previous one, as the deleted entry is still exist in sys.ts$?

There is no segments exist in the deleted tablespace, or any user default tablespace is assigned to the deleted tablespace.

My Question:How can we delete the deleted entry from sys.ts$?And should we rename the tablespace from INVD to INVD3 (or can we use back INVD2) to avoid any unforseen error again?

View 4 Replies View Related

Server Administration :: Bdump Dir Deleted / Cannot Get Cause Of Downtime

Sep 19, 2011

Is there any way I can find out what caused the database to crash; either a history of commands executed within the database, I lost my bdump directory before the scheduled backup ran and the only logs available are after I re-created the directory.

SQL> startup
ORA-00444: background process "PMON" failed while starting
ORA-07446: sdnfy: bad value '' for parameter .
SQL>
[code]....

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved