Undo SQL command?

Stiganator

Platinum Member
Oct 14, 2001
2,492
3
81
Can you undo an SQL command?

We have a online lab notebook. My advisor accidentally replaced all the notes for each experiment with a picture.


Any way to save it or are all my notes gone?

Edit: I'm trying to look at the logs, but when I go the logs tab nothing shows up. When I go into the directory I see a couple 10 MB log files, but I can't open them in notepad or anything.
 

Hyperblaze

Lifer
May 31, 2001
10,027
1
81
have you taken an sql dump recently?

That's the only thing I can think of. If not, Is there any backup databases?
 

cyberia

Platinum Member
Oct 22, 1999
2,535
0
0
I am certainly not a DB guru, but I think this is relevant:

Link

I wouldn't screw with it in production. I would create a backup and restore to a new database on another server and play with it.
 

Stiganator

Platinum Member
Oct 14, 2001
2,492
3
81
looking at the logs I see the notes that were deleted, but it doesn't have the corresponding file that the notes should go to.

:( That pretty much makes 300+ experiments worthless
 

KLin

Lifer
Feb 29, 2000
30,213
562
126
You can do a point in time restore with the following conditions:

1. The database recovery model is set to full
2. You have a full database backup from a past date

You would then do a backup of the transaction log, then restore the previous full backup to a different database, and tell it to restore to a point in time, which would let you restore the transaction log to the point in time you specified(before the teachers hosed the data.)

there is 3rd part software that will let you undo transactions, but they're very expensive. Apex SQL Log is one program that can look at transactions in a transaction log and back them out for you.
 

JACKDRUID

Senior member
Nov 28, 2007
729
0
0
Originally posted by: KLin
You can do a point in time restore with the following conditions:

1. The database recovery model is set to full
2. You have a full database backup from a past date

You would then do a backup of the transaction log, then restore the previous full backup to a different database, and tell it to restore to a point in time, which would let you restore the transaction log to the point in time you specified(before the teachers hosed the data.)

there is 3rd part software that will let you undo transactions, but they're very expensive. Apex SQL Log is one program that can look at transactions in a transaction log and back them out for you.

exactly right , klin, as always.

but if the user is trying to open a log file with notepad.. I don't think he would be backing up databases with transactional log backup, which is required for point in time backup...

he definately should be looking for professional help...
 

KLin

Lifer
Feb 29, 2000
30,213
562
126
Originally posted by: JACKDRUID
Originally posted by: KLin
You can do a point in time restore with the following conditions:

1. The database recovery model is set to full
2. You have a full database backup from a past date

You would then do a backup of the transaction log, then restore the previous full backup to a different database, and tell it to restore to a point in time, which would let you restore the transaction log to the point in time you specified(before the teachers hosed the data.)

there is 3rd part software that will let you undo transactions, but they're very expensive. Apex SQL Log is one program that can look at transactions in a transaction log and back them out for you.

exactly right , klin, as always.

but if the user is trying to open a log file with notepad.. I don't think he would be backing up databases with transactional log backup, which is required for point in time backup...

he definately should be looking for professional help...

That is correct. :laugh: