p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   SQL Server 2000 (http://p2p.wrox.com/forumdisplay.php?f=20)
-   -   Dangerous mistake (http://p2p.wrox.com/showthread.php?t=8674)

revinchalil January 28th, 2004 10:00 AM

Dangerous mistake
 
hi friends,

  i did a big mistake.

 in my production database, i had to update one row. normally i had to give one WHERE condition.

But i forgot WHERE condition.

One field in all rows in my table is blank now. Very dangerous maaan.

I am going mad... Please help me...

Rollback transaction is not possible, i guess, since i didnt do any begin trans in the beginning.

if any one knows anything on this, plz send me a reply very fast

Thanx in advance
revin


Adam H-W January 28th, 2004 11:51 AM

Why don't you go back to your previous back up?

defiant January 28th, 2004 02:13 PM

Yes, you should try to recover the lost values from the last complete database backup. You can restore this backup as a _NEW_ database, and you can copy the data from the restored database to the "real" database.

Here is an example of copying the Employees.LastName data in the Northwind database:

update e
set LastName = eold.LastName
from Northwind.dbo.Employees e
    inner join NorthwindOld.dbo.Employees eold
        on e.EmployeeId = eold.EmployeeId

The second option is to do a point-in-time recovery. This is possible if your last backup doesn't contain the values you accidentally deleted. If the database uses the full recovery model (bulk-logged also?), you can restore the last complete database backup as a new database and then restore the transaction log backup until before the accidental delete. You can recover the values from here.

defiant.

revinchalil January 29th, 2004 01:34 AM

thanks for the reply guys.. but i dont have a backup for this table.

can i revert the update someways or can i attain the previous stage of table by doing something from the Transaction log?

if so how can it be done...


defiant February 4th, 2004 12:06 PM

You can use a tool like Lumigent Log Explorer (www.lumigent.com) to browse through the log file. I never used it.

or maybe you can try the following: create a new database and back-it up. Then restore it WITH NORECOVERY and then try to do a point-in-time restore using the transaction log backup, from the production database, to a point before the acident. the chances for this to work are slim, but maybe it will. i don't have time to test this myself.

defiant.


All times are GMT -4. The time now is 02:42 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.