1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Automatically Truncate MS SQL Log Files?

Discussion in 'Plesk for Windows - 8.x and Older' started by eugenevdm, Jan 23, 2010.

  1. eugenevdm

    eugenevdm Silver Pleskian

    30
    68%
    Joined:
    Nov 11, 2003
    Messages:
    611
    Likes Received:
    0
    How can I automatically truncate the MS SQL log files on all our Plesk servers? The problem is these files grow infinitely and then client moan because they get traffic warning.

    Ideally I want to put a limit on this or automatically truncate them on a regular basis. We have quite a few servers so automation is essential. Maybe there is some default I can change?

    For now I have to manually log in to the server and do this:
     
  2. eugenevdm

    eugenevdm Silver Pleskian

    30
    68%
    Joined:
    Nov 11, 2003
    Messages:
    611
    Likes Received:
    0
    **** bump ****
     
  3. eugenevdm

    eugenevdm Silver Pleskian

    30
    68%
    Joined:
    Nov 11, 2003
    Messages:
    611
    Likes Received:
    0
    Just a minor update. Plesk allows log files to grow to 2 GB by default on MS-SQL.

    On SQL 2008 you have to do:

    Code:
    declare @dbname nvarchar(255)
    set @dbname = 'bigboysdb'
    backup log @dbname to disk='NUL'
    DBCC SHRINKDATABASE (@dbname, 0)
     
Loading...