Failed Transaction Log Restore

  • Hello,

    Being new to SQL and trying to teach myself via the excellent tutorials on SQL Central, I created a test database using the full recovery model and created a single table which I populated on an ongoing basis. The aim of this was to practice the concept of backups and ultimately restores so that I could get to grips with the idea of taking a full DB backup followed by multiple log backups.

    I had my test DB running for a few days and started the chain with a full DB backup. At random times during the day as the table within the test DB grew I would take log backups.

    A couple of days of log backups (7 in total) and I figured I was ready to practice restoring. I deliberately "broke" the DB by renaming the mdf file after stopping the server. After restart I first did a "tail log" backup using the NORECOVERY and NO_TRUNCATE options.

    So far, so good.

    I next restored using the full database backup I had first taken to begin the restore chain.

    No problem. All the time I am using the NORECOVERY option on the T-SQL RESTORE commands being used.

    However, once I try to restore the 4th log backup in the chain an error is reported. The restore apparently completes, but an error message telling me that the DB was not able to initialize was issued. Checking the error log for more details as suggested did not yield any more information.

    After scratching my head for a while and thinking back over what I'd done over the period covered by the log chain, I remembered that between log backup 3 and 4 (the one where the restore failed) I had created 3 filegroups with associated .ndf data files for the DB. Subsequent attempted restores of log backups beyond the failed one seem to spit out errors which also mention the new filegroup logical filenames, so I'm wondering if the transaction log chain cannot recreate new filegroups as part of the transaction roll forward.

    Can anyone please help or clarify what's going on?

    Regards

    Steve

  • can you post details of the exact error you receive?

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Perry Whittle (11/14/2012)


    can you post details of the exact error you receive?

    Sure,

    here's the entire output from the restore of the 4th log backup:

    10 percent processed.

    20 percent processed.

    30 percent processed.

    40 percent processed.

    50 percent processed.

    60 percent processed.

    70 percent processed.

    80 percent processed.

    90 percent processed.

    100 percent processed.

    Processed 0 pages for database 'FullDB', file 'FullDB' on file 4.

    Processed 0 pages for database 'FullDB', file 'FG1_1' on file 4.

    Processed 0 pages for database 'FullDB', file 'FG2_1' on file 4.

    Processed 0 pages for database 'FullDB', file 'FG3_1' on file 4.

    Processed 45824 pages for database 'FullDB', file 'FullDB_log' on file 4.

    Msg 3283, Level 16, State 2, Line 1

    The file "FullDB" failed to initialize correctly. Examine the error logs for more details.

    Msg 3013, Level 16, State 1, Line 1

    RESTORE LOG is terminating abnormally.

  • What does the SQL error log say?

  • anthony.green (11/14/2012)


    What does the SQL error log say?

    SQL Server Log:

    Date14/11/2012 10:15:28

    LogSQL Server (Current - 14/11/2012 10:15:00)

    Sourcespid57

    Message

    The file "FullDB" failed to initialize correctly. Examine the error logs for more details.

  • Nothing more? Nothing above or below that line?

  • anthony.green (11/14/2012)


    Nothing more? Nothing above or below that line?

    As far as I can tell, no.

    There are multiple errors appearing within the SQL Server section of the error log viewer. When I double-click on the one in question, then all I get for the details is what you've seen.

    If I restore up to and including the last log backup that works (file 3) then I can see that the DB has one of the three filegroups I had started setting up.

    I know that i removed and recreated filegroups and threi files a few times and backed up the log at least once during those sessions, so I wonder if there is a problem in that regard?

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply