Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
olinmds
Starting Member
25 Posts |
Posted - 2014-03-03 : 12:10:56
|
Msg 8985, Level 16, State 1, Line 1Could not locate file 'XXXXX_Log' for database 'XXXXX' in sys.database_files. The file either does not exist, or was dropped. New to 2012. Logs filled up and get error when try to shrink file.THANKS!!!!! |
|
olinmds
Starting Member
25 Posts |
Posted - 2014-03-03 : 12:43:24
|
Ran to select * from sys.master_files and found that the 'name' value is different from logical log filename on DB. It is missing one character. So DB properties show 'XXXX_log' and logical name and masterfiles show 'XXXX_lo' (missing the g). Not run up against this one before. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-03-03 : 12:47:24
|
Backup the log and then you can do the shrink. How often do you backup the tlogs? Our schedule is every 15 minutes.Regarding the master_files names, no biggie for the database as it's just metadata but it does get annoying when running commands that reference those names. You can fix via ALTER DATABASE.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
olinmds
Starting Member
25 Posts |
Posted - 2014-03-03 : 14:06:50
|
Wondering when the disconnect happened as we changed the logical filename during a restore. |
|
|
olinmds
Starting Member
25 Posts |
Posted - 2014-03-04 : 09:27:13
|
Good morning Tara, Please know I apprectiate your assistance. Alter Database will not let me modify the files to what I want. I would like the database_files value with XXXX_Log to be the true value but get error of XXXX_Lo (Value in master_file) does not exist when trying to modify. Would like to understand how the disconnect happened also as we successdfully altered the value during the restore.Thanks again!!! |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-03-04 : 11:04:08
|
ALTER DATABASE is the correct command for this. Show us what you tried. The disconnect happened during the restore. Someone had a typo.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
olinmds
Starting Member
25 Posts |
Posted - 2014-03-05 : 11:08:45
|
Hi Tara. Thanks for your help. Had to change the logical name to something different and then name it back with our original command. Everything looks great.Please know I appreciate your help.Thanksolinmds |
|
|
|
|
|