Unix Technical Forum

How to recover deleted records?

This is a discussion on How to recover deleted records? within the SQL Server forums, part of the Microsoft SQL Server category; --> Hello I accidentaly ran a DELETE command against a table with a wrong WHERE clause. My database had no ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-24-2008, 07:07 PM
nano2k
 
Posts: n/a
Default How to recover deleted records?

Hello

I accidentaly ran a DELETE command against a table with a wrong WHERE
clause.
My database had no backup, but the recovery model was Full.
I am using SQL Server 2005.

Is there a way, or any utility software that could help me recover the
lost data?
The .ldf file is twice as big than the .mdf file, so I think that my
records are still there in the .ldf file.

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-24-2008, 07:07 PM
Helmut Woess
 
Posts: n/a
Default Re: How to recover deleted records?

Am Thu, 24 Apr 2008 01:06:28 -0700 (PDT) schrieb nano2k:

> Hello
>
> I accidentaly ran a DELETE command against a table with a wrong WHERE
> clause.
> My database had no backup, but the recovery model was Full.
> I am using SQL Server 2005.
>
> Is there a way, or any utility software that could help me recover the
> lost data?
> The .ldf file is twice as big than the .mdf file, so I think that my
> records are still there in the .ldf file.
>
> Thanks.


I don't know a way to read the log file. And the only tool i know which can
possibly help you is Apex SQL Log, but it has it's price:
http://apex-sql-log.apex-sql-llc.qarchive.org/

bye,
Helmut
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-24-2008, 07:07 PM
Hugo Kornelis
 
Posts: n/a
Default Re: How to recover deleted records?

On Thu, 24 Apr 2008 01:06:28 -0700 (PDT), nano2k wrote:

>Hello
>
>I accidentaly ran a DELETE command against a table with a wrong WHERE
>clause.
>My database had no backup, but the recovery model was Full.
>I am using SQL Server 2005.
>
>Is there a way, or any utility software that could help me recover the
>lost data?
>The .ldf file is twice as big than the .mdf file, so I think that my
>records are still there in the .ldf file.
>
>Thanks.


Hi Nano2k,

If you have ever made a full backup, then you can restore the lost data
by performing the following steps:

1. Make a tail-log backup;
2. Restore from the full backup;
3. Restore any regular log backups you made since the full backup (if
you never made any, skip this stip), with the NORECOVERY option;
4. Restore from the tail-log backup made previously with the STOPAT and
the RECOVERY options.

You can find more information about all these steps in Books Online.


If you really never made a backup, you'll either need some third-party
product (Helmut mentions Apex; I'll throw in Red Gate as an alternative;
there might be more options available), or a bunch of very good and fast
typists.


After mopping the floor (recovering the data), your first task will be
to fix the ceiling, i.e. to set up a regular backup schedule and to test
restoring in various disaster scenarios. Good luck!

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:22 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com