Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2006

    Unanswered: SQL LOG file_Problem

    Hi All,

    I am facing problem with SQL LOG_FILE, I kept auto grow file option true in my database which causes my DB file size to grow in GB's.

    I want to know :

    How to kill inactive transactions ?
    How to shrink logfile automatically ?
    What precautions are required to avoid my file to grow unexpectedly?
    How to use @@TRANCOUNT ?
    Is setting AutoShrink TRUE on DB is safe ?

    Thanks in advance

    Pankaj Sutradhar

  2. #2
    Join Date
    Nov 2004
    on the wrong server
    Provided Answers: 6
    "How to kill inactive transactions ?"

    Do not do this.

    "How to shrink logfile automatically ?"

    If you are not backing up your log files, and it sounds like you are not and do not care about full recovery in the case of disaster, truncate and shrink your log file and put your database in simple recovery.

    "What precautions are required to avoid my file to grow unexpectedly?"

    You can swicth your recovery to bulk logged before large imports or index creation. You can also setup an alert for low disk space.

    "How to use @@TRANCOUNT ?"

    See book online, Transact-SQL help.

    "Is setting AutoShrink TRUE on DB is safe ?"

    No. Shrinking a database on a production system during the day can cause the server to slow dramatically. Shrinking a database also causes fragmentation.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts