logical file name different in sys.database_files vs. sys.master_files

  • I restored a copy of a database from a 2008r2 instance to a 2014 instance that is clustered with a different database name. Now the logical name for the log file does not match when I query sys.master_files and sys.database_files. Sys.master_files is showing the original log file name. How can I fix this? When I try to use alter database modify file it says the name does not exist. The instance was restarted before the database was added to an always on group.

  • IIRC you need to restart the instance after the restore. Might be tricky with Always On, might have to take all the servers offline.

  • The instance has been restarted. Both before it was added to the always on group and after.

  • I found this link that said renaming the database to a temporary name and then renaming it back to what it is now will fix the issue. Does anyone have any other suggestions?

    http://jamessql.blogspot.com/2012/09/change-file-logical-name-for-mirror.html

  • I had this same issue. The DB rename didn't work, but this did.

    Right click on DB, Properties, Files and I changed the Logical Log Name to something completely different. This updates in both places. Then I changed it back again to what it actually should be.

    Making the logical log names the same fixed my false SCOM alert that kept saying the database was running out of log file space (when it wasn't).

  • https://msdn.microsoft.com/en-us/library/bb522469.aspx

    To modify the logical name of a data file or log file, specify the logical file name to be renamed in the NAME clause, and specify the new logical name for the file in the NEWNAME clause. For example:

    MODIFY FILE ( NAME = logical_file_name, NEWNAME = new_logical_name )

  • This was removed by the editor as SPAM

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

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