• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mdf database

 
sterling sweet
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I’m asking if it possible that a attach a .MDF datafile without the .LDF
I want that because i have a corrupted Log file nd when i attach the database raise the following error:-
-----------
The log cannot be rebuilt because there were open transactions/users when the database was shutdown, no checkpoint occurred to the database, or the database was read-only. This error could occur if the transaction log file was manually deleted or lost due to a hardware or environment failure.
--------------------
I just need the data file this what I need and I don’t need the corrupted Log file any more
I tried
sp_attach_single_file_db 'new_2009', 'C:\Data\new_2009_Data.MDF'
But the same error comes up.
Please note i have no recent backup so don’t suggest to restore the database from backup

Thanks
 
rejar dullum
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More information you can dig out from resources directly connected with SQL Server databases and database corruption in MS SQL Server any version...
https://www.repairtoolbox.com/sqlserverrepair.html SQL Server Repair Toolbox

One of the commands and types of restoring must assist you, good luck...

Recovering a database that is in the restoring state…

Restore full backup WITH RECOVERY
As mentioned above this option is the default, but you can specify as follows.
RESTORE DATABASE AdventureWorks FROM DISK = 'C:\AdventureWorks.BAK'
WITH RECOVERY
GO
Recover a database that is in the "restoring" state
The following command will take a database that is in the "restoring" state and make it available for end users.
RESTORE DATABASE AdventureWorks WITH RECOVERY
GO
Restore multiple backups using WITH RECOVERY for last backup
The first restore uses the NORECOVERY option so additional restores can be done. The second command restores the transaction log and then brings the database online for end user use.
RESTORE DATABASE AdventureWorks FROM DISK = 'C:\AdventureWorks.BAK'
WITH NORECOVERY
GO
RESTORE LOG AdventureWorks FROM DISK = 'C:\AdventureWorks.TRN'
WITH RECOVERY
GO
 
Dazy Parker
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try these methods:



I hope it will help you.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic