Transaction Log Is Full

  • Hi Everybody,

    Here in my Project I am doing data migration from one DB to another, When ever i am moving data with lot of validations(which are in my query). that time i am getting any error and my query is stopped...

    The error it is showing that Transaction Log is full...

    How can i over come this prob...

    excuse me for my bad English.. Please help me Out..

  • A christmas present for you............

    http://www.sqlservercentral.com/articles/Administration/64582/

    ---------------------------------------------------------------------

  • Set the database in simple recovery mode. and increase the restricted size of log file. So that can accumulate the transaction log. If possible try to breakdown your copy transaction in batches so that it won't fail due to log file full.

    java[/url]

  • Transaction Log mismanagement could be a reason but I wonโ€™t jump on that unless I am confident that ETL code is optimized. Most of the times bad code is the reason for huge transaction logs.

    Adjusting Transaction Log would be your temporary solution. If data volume increases you have to adjust it once again next time.

  • Expand the log file size and set autogrow on; if your datatabase is production. If not you can put database in simple recovery mode.

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • If you are doing bulk inserts and the database that you migrating the data to needs to log the transactions, put the database into Bulked Logged mode. If you do not need to log all of the transactions, put the database in "Simple" Recovery mode. This will prevent the transactionlog from filling up.

  • SQLFreeman-486832 (12/29/2011)


    If you do not need to log all of the transactions, put the database in "Simple" Recovery mode. This will prevent the transactionlog from filling up.

    All transactions are logged in all recovery models. Switching to simple does not means that SQL won't log certain operations, nor will it prevent the log from filling up.

    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
  • Adding to Gila's Comment :

    In simple recovery model, Log will be cleared once the checkpoint is fired or Free space falls below 10-30% of the total space ( depends on the db size).

    Whereas, in Full recovery model Log database will be cleared only on Log backup.

  • chetanr.jain (12/30/2011)


    Adding to Gila's Comment :

    In simple recovery model, Log will be cleared once the checkpoint is fired or Free space falls below 10-30% of the total space ( depends on the db size).

    Whereas, in Full recovery model Log database will be cleared only on Log backup.

    only if it is able to clear logspace, i.e. no active transactions preventing log truncation.

    ---------------------------------------------------------------------

  • chetanr.jain (12/30/2011)


    In simple recovery model, Log will be cleared once the checkpoint is fired

    Well, not quite. Checkpoint is what truncates the log (marks space as reusable), but there's no guarantee that it will make any space reusable if there are other things holding the log active

    or Free space falls below 10-30% of the total space ( depends on the db size).

    Not quite as simple as that...

    From Books Online (events that cause a checkpoint)

    The log becomes 70 percent full, and the database is in log-truncate mode.

    A database is in log truncate mode when both these conditions are TRUE: the database is using the Simple recovery model, and, after execution of the last BACKUP DATABASE statement that referenced the database, one of the following events occurs:

    * A minimally logged operation is performed in the database, such as a minimally logged bulk copy operation or a minimally logged WRITETEXT statement is executed.

    * An ALTER DATABASE statement is executed that adds or deletes a file in the database.

    Whereas, in Full recovery model Log database will be cleared only on Log backup.

    Again, log backups truncate the log, but if other things are holding the log active, the the log backup may not free any space at all.

    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
  • george sibbald (12/30/2011)


    chetanr.jain (12/30/2011)


    Adding to Gila's Comment :

    In simple recovery model, Log will be cleared once the checkpoint is fired or Free space falls below 10-30% of the total space ( depends on the db size).

    Whereas, in Full recovery model Log database will be cleared only on Log backup.

    only if it is able to clear logspace, i.e. no active transactions preventing log truncation.

    And no mirroring, replication, active backup, snapshot being created or CDC are holding the log active.

    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
  • GilaMonster (12/30/2011)


    george sibbald (12/30/2011)


    chetanr.jain (12/30/2011)


    Adding to Gila's Comment :

    In simple recovery model, Log will be cleared once the checkpoint is fired or Free space falls below 10-30% of the total space ( depends on the db size).

    Whereas, in Full recovery model Log database will be cleared only on Log backup.

    only if it is able to clear logspace, i.e. no active transactions preventing log truncation.

    And no mirroring, replication, active backup, snapshot being created or CDC are holding the log active.

    pah. You're just upset I've learnt how to type faster than you. ๐Ÿ™‚

    ---------------------------------------------------------------------

Viewing 12 posts - 1 through 11 (of 11 total)

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