Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recovering deleted records

Status
Not open for further replies.

phil22046

Programmer
Sep 12, 2001
154
US
Yesterday when I was out sick, a user of our track-it system accidently deleted all records. This is a sql server database that is backed up (FULL), once every 24 hours and I was not informed before the next backup occured.

Is it possible to recover these deleted records?
 
What is the recovery model of the database?
Right click on the db and select properties -> options.

If your database is in simple recovery mode your hosed! you will have to get the last backup from tape and restore that. Then of course you will loose an entire days worth of data.

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
the process in this case would be to:

1) restore your last full backup (With recovery so you can apply further transactional recoveries...)

2) restore each of your transaction logs IN ORDER and each time keep it in recover mode

3) With your last transaction log, recover till the time BEFORE someone deleted all the records, and remember to have it in no recovery mode so it can be used.

there is a further step if your transaction logs don't cover the last period. You can add a step 0) which is to create a transactional backup of your CURRENT transaction file, and then use this backup as the last restore file...


--------------------
Procrastinate Now!
 
There only backing up is once every 24 hours (FULL). There are no transaction log backups. I would know what to do if there were. And I was not informed that the problem existed until I got to work today and the last backup file that had those records was overwritten already.

I was wondering if there was some way to recover deleted records with a SQL command of some type on the table itself?

There were 10000 records in this table. Now we have only records added since the accidental deletion yesterday.
 
HAve you been backing up your transaction log? If yes then follow the directions outlined by crowely if no...

You have one option.

Purchase lumigent log explorer. It can read your transaction log and recreate deleted transactions. you could then re-insert your data.

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
We posted around the same time. I didn't see your post about no log backup.

You must purchase Log Explorer by lumigent. It is a great tool no DBA should without it. You will be able to read your transaction log and recreate the delete as an insert. It will put all your data back for you.

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Do you have the previous backup? Or do you only keep one days backup? If you are only keeping one days backup, then your full backup is the one with the data already missing and I think you are out of luck. If you save previous days backups, then restore the one from the previous day.

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
This particular database, the full backup gets overwritten every day. If I had been informed of this problem yesterday, I would have requested that someone copy the backup file somewhere else before it got overwritten.
 
Phil,
Once you get back the data (if you get log explorer)
You need to completely re-evaluate you backup and recovery plan.

1st - A db that is in FULL recovery must always have it's tlog backed up. If you don't it will grow out of control. You should backup your TLOG every 30 min. That way the most data loss you could have would be 30 min.

2nd - You should always[/] copy your .bak files to tape or another location if you don't have tape available. (This includes the tlog incremental backups)

3rd - You should test your backup and recovery strategy regularly. Say every 6 months just to make sure your backup sets are good and you know how you are going to recover to a point in time.

4th - You don't want to have to be on-call 24/7 365. That's not fair to you or your company if you are unable to get to work. You should have everything well documented so someone else knows what to do in your absence.

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top