|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Today @ 2:18 AM
Points: 264,
Visits: 1,288
|
|
Hi I need to recover data from .LDF file whereas I have lost my .MDF file. My database was in Full Recovery Mode, I have full backup of a day back, but no transactional backup. Having full backup of Thursday, changes made in database on Friday. I dont have any backup of Friday, I need to recover till Friday. How can I overcome this problem, I have only .ldf file, please give me some solutions. Thanks in advance.
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 7:38 AM
Points: 37,726,
Visits: 29,987
|
|
Full recovery and no log backups? Was the log getting manually truncated? (backup log .. truncate only)?
Is the database still attached to SQL? (I know the mdf is missing). Is it still listed if you query sys.databases?
p.s. How do you lose an mdf file?
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Today @ 2:18 AM
Points: 264,
Visits: 1,288
|
|
One of my colleague used to truncate manually, database is still attached to SQL and yes, it is still listed if I fire select * from sys.databases.
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 7:38 AM
Points: 37,726,
Visits: 29,987
|
|
If the log was manually truncated since the last full backup, then there is no way to recover anything from the log as the log chain has been broken by the manual truncate.
Please ask your colleague when was the last time that he truncated the log.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Today @ 2:18 AM
Points: 264,
Visits: 1,288
|
|
| The last time he truncated the log on Friday at 8:00PM, I understand I can not go back. Is there any chance of data recovery of 8:00PM onwards?
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 7:38 AM
Points: 37,726,
Visits: 29,987
|
|
There is no chance of recovering anything. By truncating the log you discarded log records and told SQL that you were not interested in retaining log records any further. Additionally, a log chain has to be intact to recover. By discarding log records you broke the log chain and hence, even if the log records post that 8pm were retained (which they weren't), they'd be useless for recovery because of the missing log records.
The best you can do at this point is to restore to the Thursday backup. All data from friday has been lost because of the log truncations. I suggest in future you reconsider your backup and log maintenance strategies. This may be worth a read - Managing Transaction Logs
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Today @ 2:18 AM
Points: 264,
Visits: 1,288
|
|
| Thanks Gail for your all replies.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Today @ 2:18 AM
Points: 264,
Visits: 1,288
|
|
| Sorry, my colleague provided me the wrong informations, he never truncated the log file. .LDF file never got truncated. Is there any chance of recovery ?
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 7:38 AM
Points: 37,726,
Visits: 29,987
|
|
Maybe, as long as he's completely sure that there was no truncation. (by him or anyone else or in a scheduled job)
Backup log <database name> to disk='<location for log backup>' with no_truncate
If it gives any errors, post them.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Today @ 2:18 AM
Points: 264,
Visits: 1,288
|
|
Command run successfully, do I need to restore full backup then all log backups ?
Following message appeared on running the query provided by you.
Processed 5 pages for database 'dr', file 'DR_log' on file 1. BACKUP LOG successfully processed 5 pages in 0.089 seconds (0.431 MB/sec).
|
|
|
|