Auto shrink Log file.

  • I can't seem to get the log file to auto shrink.
    It is set to auto shrink in the properties, but doesn't seem to do it.

    I have no problem doing manually but want the system to do it for me.

    I have it set to simple recovery model.

    How often should it automatically shrink?

    Thanks,

    Tom

  • tshad - Sunday, April 8, 2018 9:03 PM

    I can't seem to get the log file to auto shrink.
    It is set to auto shrink in the properties, but doesn't seem to do it.

    I have no problem doing manually but want the system to do it for me.

    I have it set to simple recovery model.

    How often should it automatically shrink?

    Thanks,

    Tom

    Shrinking of either data or log files should be an exception and not treated as standard operational procedure.
    😎
    Questions?
    1. Why do you need to shrink the log files?
    2. What are the file settings (initial size, file growth etc.)?
    3. What is the recovery model for the database(s)?
    4. Are you doing transaction log backups?
    5. What are the maintenance procedures and schedules?

  • The reason this is being done is because we are setting up an archival database that will be sent about 40,000 records at a crack but only about two weeks at a time and the log file get very large.  We are not concerned with the transaction file here.
    Initial size was 1MB and not concerned with file growth.
    No maintenance procedures or schedules to worry about.

    I have it set to auto shrink, so why doesn't it do that - whether or not it is a prudent thing to do.

    Is there something else I need to do to get this to work?

  • tshad - Monday, April 9, 2018 1:14 PM

    The reason this is being done is because we are setting up an archival database that will be sent about 40,000 records at a crack but only about two weeks at a time and the log file get very large.  We are not concerned with the transaction file here.
    Initial size was 1MB and not concerned with file growth.
    No maintenance procedures or schedules to worry about.

    I have it set to auto shrink, so why doesn't it do that - whether or not it is a prudent thing to do.

    Is there something else I need to do to get this to work?

    Suggest you read the following articles
    😎

    https://www.sqlskills.com/blogs/kimberly/8-steps-to-better-transaction-log-throughput/
    https://www.sqlskills.com/blogs/kimberly/transaction-log-vlfs-too-many-or-too-few/
    https://technet.microsoft.com/en-us/library/ms191244(v=sql.105).aspx
    https://docs.microsoft.com/en-us/sql/relational-databases/import-export/prerequisites-for-minimal-logging-in-bulk-import
    http://www.sqlservercentral.com/articles/Administration/100856/

  • -- ignore

    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 5 posts - 1 through 4 (of 4 total)

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