Monday, March 12, 2012

How to recover a deleted table

Hi
We accidentally deleted a table of a DB and we have the log. Is there any
way to recover ? (without using log explorer from lumigent)
Thanks in advance
Hi,
You can use POINT_IN_TIME restore if your Recovery mode for that database is
FULL plus you should have full database backup , transaction log backups.
Stes:-
1. Take a backup transaction log in current database
2. Create a new database
3. Restore with full backup file with NORECOVERY (Use below command)
RESTORE database new_dbname from disk='file' with NORECOVERY, MOve
'logical_mdf' to 'physical_mdf',
move 'logical_ldf' to 'physical_ldf'
4. Restore the subsequent transaction log backups in NORECOVERY mode.
5. Restore the transaction log backup taken in step-1 with RECOVERY and
STOPAT option
RESTORE log new_dbname from disk='tran_backup_file' with RECOVERY,
STOPAT= ''Aug 05, 2004 03:44 AM'
Date and Time should be given based on your requirement for STOPAT option.
Thanks
Hari
MCDBA
"Mark Bushnell" <markbn@.bushnell.com> wrote in message
news:ulc4sAqeEHA.2028@.tk2msftngp13.phx.gbl...
> Hi
> We accidentally deleted a table of a DB and we have the log. Is there any
> way to recover ? (without using log explorer from lumigent)
> Thanks in advance
>

No comments:

Post a Comment