|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 3:13 AM
Points: 1,186,
Visits: 2,104
|
|
Hi All
I had a weird situation this morning
On one of my test systems, I tried running the following command to shrink my log file
DBCC shrinkfile(filename,1024) I received this error Could not locate file 'filename' for database 'database_name' in sys.database_files. The file either does not exist, or was dropped.
I checked and the file does exist.
I ran a full Consistency Check (DBCC CHECKDB) and that seems to have fixed the problem.
Has anyone else come across this before? Should I be worried?
Thanks
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Tuesday, March 26, 2013 8:41 AM
Points: 2,562,
Visits: 3,451
|
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Yesterday @ 7:41 AM
Points: 81,
Visits: 859
|
|
Use the following command: SELECT file_id,name ,size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0 AS AvailableSpaceInMB FROM sys.database_files;
after this command u will find the file id which has free space then run DBCC shrinkfile(file id)
|
|
|
|