473,394 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to recover deleted rows

hi

two days before arount 20,000 rows are manuly deleted, is there any way
to recover it back.
We have backup, that is 10 days old, Is there any way to recover only
that 20,000 rows,
Plz help me out ASAP.

Regards
Senthil Kumar.T

Sep 6 '06 #1
2 12546

se********@gmail.com wrote:
hi

two days before arount 20,000 rows are manuly deleted, is there any way
to recover it back.
We have backup, that is 10 days old, Is there any way to recover only
that 20,000 rows,
Plz help me out ASAP.

Regards
Senthil Kumar.T
Provided that no other rows other than the 20,000 ones were deleted
since then, you can write a trivial program that goes through all rows
available in the backup ( dumped into memory, files whatever) comparing
them with the ones you have left.

Find the ones that exist in the original set ( provided by the backup
) but do not exist on the current set ( the ones left after the manual
removal ).

Use INSERT IGNORE VALUES (...), (...), (...), (...)
to insert them back. Providing the column data for many rows ( as
opposed to just one ) for INSERT will considerably speed up the
process.

Sep 6 '06 #2
se********@gmail.com wrote:
hi

two days before arount 20,000 rows are manuly deleted, is there any way
to recover it back.
We have backup, that is 10 days old, Is there any way to recover only
that 20,000 rows,
Plz help me out ASAP.

Regards
Senthil Kumar.T
Yes, It may prove tedious, but step-by-step.

1. Create a temporary table using

CREATE TABLE temp AS SELECT * FROM realtable.

2. Delete the contents of the temp table.

3. Add the same primary index to temp

4. Load temp from your backup

5. Delete from the temp table where the primary key can be
found in the real table

What is left in the temp table are the deleted records

6. Insert them into the real table.
HTH
Jerry
Sep 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Grant | last post by:
Hi Is there a way to recover deleted records from a table. A mass deletion has occurred and Access has been closed since it happened Louis
1
by: Roberto La Forgia | last post by:
Hi all, there is a utility o procedure to recovery deleted record from a Access table (versione 2002/2003) ? Thanks in advance Roberto
2
by: Snonck | last post by:
Is is possible to recover deleted rows from a table from archive logs? For example, say you have a database with archive logging turned off. You create a table and populate it with records. You...
1
by: Astlik | last post by:
Hi, I was using phpmyadmin when, by mistake I deleted some rows from a table I didn't wanted to. I would like to know if anyone could help me recovering those records I deleted. I don't have any...
0
by: mike_dba | last post by:
I have been testing the db2 recover command on a DB2 V8.2 Linux database. The database contains a single partition. I am not archiving logs but retaining them on disk. the backup image is to...
4
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
I'm working in Visual Studio 2005 and C#. I have a DataTable with many rows. The user can delete a row. After the row is deleted, I'd like to column values for the deleted row, but any attempt to...
2
by: kalvarahul | last post by:
Hi All, I deleted few rows from a Table by mistake. Please could you write on the ways to rollback that data? I have still not commited any transaction. Please provide the steps / links /...
6
by: MLH | last post by:
Utilities to recover tbl removed from TABLE tab of database window with the DELETE key?
1
by: dbquest | last post by:
Hi, Is there a way to recover the deleted rows? We do have a backup but not for all the rows that got deleted. Appreciate some quick help on this. Thanks.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.