MSSQL 2008R2

  • 1
    Posts
    9
    Years
    • Seen Jan 28, 2016
    The situation is as follows:
    MSSQL 2008R2
    Base was copied into itself. As a result, mdf completely overwritten, there was only ldf.
    The base was established and never backup, the log is not truncated.
    mdf file size to rubbing was in the region of 300 MB
    file size GB ldf 2,5
    recovery model "full"
    Is there any chance to recover?
     
    And you can get more helpful resources on following threads, where users share their knowledge about SQL databases

    https://www.fixya.com/support/t25285738-creating_new_database_using_mdf_file
    https://ccm.net/forum/affich-777411-creating-a-new-database-using-an-mdf-file

    Last one variant provided for completely crashed .mdf and .ldf files, when other ways can't handle the situation https://repairsql.recoverytoolbox.com/ Recovery Toolbox for SQL Server

    To find out what exactly gone wrong with database we tried following query
    DBCC CHECKDB ('YOUR_DATABASE_NAME') WITH NO_INFOMSGS, ALL_ERRORMSGS
    (It wasn't much helpful in my case . I am just posting here in-case it hepls other !)
    After a while we run another block of code , to put the database in emergency mode
    EXEC sp_resetstatus 'YOUR_DATABASE_NAME';
    ALTER DATABASE YOUR_DATABASE_NAME SET EMERGENCY
    DBCC checkdb('YOUR_DATABASE_NAME')
    ALTER DATABASE YOUR_DATABASE_NAME SET SINGLE_USER WITH ROLLBACK IMMEDIATE
    DBCC CheckDB ('YOUR_DABASE_NAME', REPAIR_ALLOW_DATA_LOSS)
    ALTER DATABASE YOUR_DATABASE_NAME SET MULTI_USER
    Finally we got database back online!
     
    Back
    Top