Log File

Horse06Horse06 Member Posts: 496
edited 2013-10-21 in SQL General
Hi expert, I tried to shrink the log file using the following command:
use [bagstore]
go
dbcc shrinkfile([bagstore_Log.ldf], 10)

But I had an error as below:

Server: Msg 8985, Level 16, State 1, Line 2
Could not locate file 'bagstore_Log.ldf' in sysfiles.
DBCC execution completed.

bagstore_Log.ldf is the only one for the database.
Please advise! Thank you!

Comments

  • mmperis8mmperis8 Member Posts: 19
    You have to put logical name of the file. You can find it in the database properties.
  • bbrownbbrown Member Posts: 3,268
    On a different note:

    Is this a NAV database? 10 MB seems like an awful small log file. Why are you shrinking it?
    There are no bugs - only undocumented features.
  • krikikriki Member, Moderator Posts: 9,112
    [Topic moved from 'NAV/Navision Classic Client' forum to 'SQL General' forum]


    BTW: if you are not used to write TSQL, you can do a shrink selecting the database => rightclick and then Task=Shrink Files and selecting the file you want to shrink.
    BTW2 : If this is a production DB, I wouldn't do this without knowing what (and why) I am doing! Repeating bbrown : Why do you want to shrink it?
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Horse06Horse06 Member Posts: 496
    The log file is more than 3GB, and so that is why I want to shrink it. Thank you!
  • bbrownbbrown Member Posts: 3,268
    Horse06 wrote:
    The log file is more than 3GB, and so that is why I want to shrink it. Thank you!


    Why is 3 GB a problem? That's tiny
    There are no bugs - only undocumented features.
  • Horse06Horse06 Member Posts: 496
    Since last time we had the log file with 9gb and the whole system crushed. Lastly I want to know 10 here in the command means 10mb? Thank you experts!
  • bbrownbbrown Member Posts: 3,268
    Horse06 wrote:
    Since last time we had the log file with 9gb and the whole system crushed. Lastly I want to know 10 here in the command means 10mb? Thank you experts!

    I'm thinking you have other problems then just the size of your log file. Even 9 GB isn't very big. What do you mean by "the whole system crushed"? The fact that the file is growing on its own is a sign of a configuration problem. The log file should be sized large enough that it does not grow between backups.
    There are no bugs - only undocumented features.
Sign In or Register to comment.