• beejug1983 (10/17/2010)


    As my .ldf has become 140 gb and disk space is also 140 gb what I can do in this situation ?

    First : - The query that is being run by user will be stopped or what ?

    Second : - If I shrink the .ldf file what will happen?

    Third : - Can I shrink file only to its initial size ? If I am not wrong shrinking reduce the physical size of file only.

    Probably exactly nothing will happen if you shrink the .ldf file, because the oldest part of it is likely to be in your "open for a long time" transaction, so shrink will be unable to change the size. But you could try it and see what happens - it may not have got that bad yet. If you are one full recovery model you should backup the log first (to enable space to be freed) - but if there is really no free space you can't do that because the backup has to be logged.

    If you can't contact the user, and the system is unable to make progress because it's out of disc space, you have two options: leave the system stuck until the user becomes contactable (with some risk that the situation will deteriorate further, so that the transaction can't be rolled back or committed because there isn't space to log that action) or roll the transactiopn back now, as Gail suggested - but that too may not work if there isn't enough space on the disc to do it.

    So you may be in the situation where you have to make space by moving some other file off the disc or shrinking something other than this log file before you can do anything to alleviate the situation.

    Tom