views:

136

answers:

3

I am trying to shrink my log file using DBCC SHRINKFILE(db_2.ldf), which is the name for log file

It gives me error every time:

8985, Level 16, State 1, Line 1 Could not locate file 'FIelD' for database db in sys.database_files. The file either does not exist, or was dropped.

Can you please suggest what can I do to fix it.

+1  A: 

Are you running it in the context of the database that has the log you are trying to shrink? Make sure you have the right USE statement before running DBCC commands

curtisk
Thanks and yes I was using the database that I was shrinking.
+3  A: 

The file name should be the logical file name and not the physical file name. Look in the Database properties, on the Files tab for the Logical Name of the file you are trying to shrink, and use that name.

onupdatecascade
A: 

Hi Friends,

The command below worked. However I don't see it reducing the size. I see the same size after and before running it. Can you please let me know what I might have missed.

fileid  groupid size    maxsize     growth  status  perf name filename 
2           0   1048    268435456      10   1048642 0           PrimaryLogFileName

Thanks