Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Recovery using .ldf file in sql server 2005 Expand / Collapse
Author
Message
Posted Friday, June 11, 2010 6:50 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:04 AM
Points: 274, Visits: 1,468
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.
Post #935967
Posted Friday, June 11, 2010 6:57 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 5:34 AM
Points: 43,014, Visits: 36,173
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

Post #935972
Posted Friday, June 11, 2010 7:04 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:04 AM
Points: 274, Visits: 1,468
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.




Post #935979
Posted Friday, June 11, 2010 7:43 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 5:34 AM
Points: 43,014, Visits: 36,173
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

Post #936016
Posted Friday, June 11, 2010 7:47 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:04 AM
Points: 274, Visits: 1,468
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?
Post #936019
Posted Friday, June 11, 2010 7:58 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 5:34 AM
Points: 43,014, Visits: 36,173
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

Post #936027
Posted Friday, June 11, 2010 8:00 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:04 AM
Points: 274, Visits: 1,468
Thanks Gail for your all replies.
Post #936034
Posted Friday, June 11, 2010 8:30 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:04 AM
Points: 274, Visits: 1,468
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 ?
Post #936074
Posted Friday, June 11, 2010 8:38 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 5:34 AM
Points: 43,014, Visits: 36,173
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

Post #936078
Posted Friday, June 11, 2010 8:43 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:04 AM
Points: 274, Visits: 1,468
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).
Post #936085
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse