March 4, 2008 at 5:00 am
A dts script got executed unexpectedly and deleted some rows in a table.
Please tell me how to recover the rows .
i put roll back . but it is asking for begin transaction command..
March 4, 2008 at 7:18 am
Is the database in full recovery mode?
Have you got database and transaction log backups?
If so you could restore them to antoher database and then extract the rows out that you have accidently deleted!
March 4, 2008 at 9:55 am
Good advice from Chris. You couldn't roll back the transaction because it had already been commited in the package. You can only roll back a transaction that you explicitly started.
Greg
March 4, 2008 at 10:33 am
Good advice from Chris.
I agree. Not much you can do in this situation. Anyway you look at it there is a potential risk of data loss. I would restore the back as a new database and figure out exactly what the package did and try to restore just those records.
I hope you are in full recovery mode with frequent tran log backups. :pinch:
March 4, 2008 at 9:21 pm
Yes i have some back up logs.
like those mentioned below.
pubs_db_200803041737.BAK
XLANG_db_200803041739.BAK
Northwind_db_200803041737.BAK
msdb_db_200803041736.BAK
model_db_200803041736.BAK
master_db_200803041736.BAK
InterchangeSQ_db_200803041736.BAK
InterchangeDTA_db_200803041736.BAK
InterchangeBTM_db_200803041736.BAK
I tried to retrieve the log and revert the transaction using RED gate's rescue log tool .
But i couldn;t get any recent transaction in all these files. even though these are all taken yesterday evening.I dont know why. any how i am trying some other means also.
March 4, 2008 at 9:43 pm
I tried to retrieve the log and revert the transaction using RED gate's rescue log tool .
I believe Log Resuce only works for 2000, unless Redgate has a new release.
March 5, 2008 at 8:53 am
If you can't use a log reader tool, then follow Chris's advice and restore the database with a new name. Then you can select the rows you want and re-insert them into the original database.
Greg
March 5, 2008 at 10:30 am
Those look like Full database backups. Log backups are very different. First check to see if you are running in Full mode, then check to see if you are running different types of backups, such as log or diff. If running in full mode, and not running log backups, then the first step would be to perform a log backup immediately (hopefully you are not shrinking the log file). once that is done, you can then follow the suggestion submitted by Chris. With a log backup, you can do point in time recovery so you can actually recover up to the minute prior to the DTS Package.
Don't forget, once you recover to that point, any transactions after the DTS package will also have to be reapplied, hence, why you don't want to overwrite the existing database.
If not running in Full mode, you can try to use a Third Party tool to read the logs, but no guarantee that the data would be in the logs.
If you find that you do have log backups, or that you are running in Full mode, and you still need help, just post back and there are plenty of great SQL Server types here that could walk you thru the entire process.
Good Luck
MD
Marvin Dillard
Senior Consultant
Claraview Inc
March 6, 2008 at 7:13 pm
hello,top buddy.
there are 2 ways:
1:use tools.
http://www.yiii.net/app/servlet/net.yiii.club.DownloadServlet?Information_Id=I00023471
2.since now,you can create a new table
sql: select * into newtable from oldtable where 1 <> 1
then create a trigger on oldtable,every operation on the table you can insert the data to the newtable
March 8, 2008 at 5:29 pm
I think, you should follow method recommended by Chris.
[font="Verdana"]--www.sqlvillage.com[/size][/font]
March 9, 2008 at 10:07 pm
yes, I followed that.
I have deleted only the records which are inserted between 2001- 2005 .
I was able to get an old back up and I got the data from that . It was a log table so no updation happened.
So I restored from the back up . now I am safe.
Thanks a lot for all your support.I came to know a lot. As I am working in sql performance tuning , it would be very helpful.
thanks once again.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply