clearing log files for ms sql server express 2005

  • Hi,

    i have seen that error log files in my

    C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG

    is occupying almost 5gb can i delete these files without causing any damage to the user data or functioning of sql server express

    please recommend

  • You can, but you shouldn't need to. SQL only keeps a certain number of log files (default I think is 6).

    Every time the service is restarted or the log is cycled the oldest log file will be discarded and a new one created.

    5 GB? Even my biggest, most active server only has 75 MB worth of error logs dating back almost 3 months.

    Which files are the largest?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Hi,

    the file name are ERRORLOG AND ERRORLOG.1 are the biggest first one is 3gb and second one is 2gb

    please recommend

  • Those are SQL's latest 2 error logs. How often do you restart the SQL Service there?

    Do you ever check SQL's error logs? I can't think of any reason they should get that big, uless you're having very frequent errors.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Hi,

    Those are SQL's latest 2 error logs. How often do you restart the SQL Service there?

    Not very often only when sql server reports some error or stops responding

    Do you ever check SQL's error logs? I can't think of any reason they should get that big, uless you're having very frequent errors.

    its been very long since i checked the sql server error log, but in recent days i found that hard disk was consuming at a high rate but not considerable space was shown used by the helm COntrol panel by users, so i think sql server log is using this space, now with the log size so big its impossible to open or analyse what do you recommend what should i do.

    thanx

  • [font="Verdana"]You can use sp_cycle_errorlog procedure in master database to recycle the errorlog, so that a new errorlog file name ERRORLOG will be generated and it will be used. Once this done, you can delete the old files. Before delete make sure which is filling up the errorlog and rectify it.[/font]

  • Hi,

    thanx for reply

    can you tell me the whole command sp_cycle_errorlog so that i can use it, as i am very new to sql server and what do you recommedn how can i open a 3 GB file, i think it will not open in notepad or any other editor.

    is it possible that i stop sql server and then delete the error log file and then restart it

    please recommend

  • That is the entire command. EXEC sp_cycle_errorlog

    You can get full info on it in Books online.

    I would suggest you cycle the error log, then watch the new log file to see what's getting written into it.

    Maybe set up a job (SQL Agent) to cycle the error log every month if you don't restart SQL often

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply