Problem – I have found VLF size of my database abc is very huge and when i have tried to shrink the file i have received below error –
Could not locate file ‘xy_abc_Log’ for database ‘abc’ in sys.database_files.
While my investigation I have found logical fine name under sys.master_files is different as compare to sys.database_files.
select name from sys.master_files where database_id = db_id(‘abc’)
select name from sys.database_files
You will find logical name is different hence you need to update logical file name in sys.master_files table.
ALTER DATABASE [abc] MODIFY FILE (NAME=N’xy_abc_Log’, NEWNAME=N’xy_abc_Log’)