Backup/Restore Stand By Strangeness

  • Sometimes our larger databases when performing our weekend backup/restores error with the following:

    Server: Msg 5173, Level 16, State 1, Line 1

    Cannot associate files with different databases.

    Server: Msg 5173, Level 16, State 1, Line 1

    Cannot associate files with different databases.

    Log file 'C:\xxx\Data\medanes_log.ldf' does not match the primary file.  It may be from a different database or the log may have been rebuilt previously.

    Log file 'C:\xxx\Data\medanes_log.ldf' does not match the primary file.  It may be from a different database or the log may have been rebuilt previously.

    What is odd is that we perform the following backup command:

    backup database medanes to disk = '\\someip\c$\xxx\medanes\medanes.bkp' 

       with init

    then immediately follow with this restore:

    restore database medanes from disk = '\\someip\c$\xxx\medanes\medanes.bkp'

      with replace, standby = 'c:\xxx\medanes.dlt'

    The main server and standby server have the exact same directory structure and SQL/Windows logins.

    Any help would be appreciated. 

  • Hi,

    looks like the db tries to use a wrong log file. Do the file paths to the log file actually match on both servers? (looking at master.sysfiles, master.sysaltfiles and medanes.sysfiles on each server?

    regards karl

    Best regards
    karl

  • Yes the database and log files are in the exact same directories.

  • If you restart the restore later, does it work or do you get the same error?

    Best regards
    karl

Viewing 4 posts - 1 through 3 (of 3 total)

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