This is very old bug but I just encounter this myself recently.
While try to restore the database from the backup, the restore fail. When I look closely with the error log, I notice that the database logical name has been truncate ….
Here are the steps how to reproduce the issue.
The backup file show the logical database file name become ‘testDB_TES’, however from sys.database_file, it should be ‘testDB_TEST’
If we run the restore, we will get the error message like below
Msg 3102, Level 16, State 1, Line 11
RESTORE cannot process database 'testDB' because it is in use by this session. It is recommended that the master database be used when performing this operation.
Msg 3013, Level 16, State 1, Line 11
RESTORE DATABASE is terminating abnormally.
We have to restore the backup using WITH MOVE. The other alternative is to bounce SQL Server and after we execute the alter database command , then take the backup afterword. But I think if you do need to restore the DB, this option probably is not going to work for you.
This is one of the earlier bug in SQL 2008R2 https://support2.microsoft.com/kb/2487231 . The ultimate the fix is to upgrade to latest SP.