Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. increasing size of LDF file

increasing size of LDF file

Scheduled Pinned Locked Moved Database
databasequestionsql-serversysadmin
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 2071301
    wrote on last edited by
    #1

    Hi All, In my project database is SQL server. The LDF file size is increasing considerably(now it is 16 gb). It may be due to unCommited transactions. My question is that if I close the connection after each query execution will it commit the transaction so that the file size will be small.? or is there any other solution to decrease the file size? Thanks

    D 2 Replies Last reply
    0
    • U User 2071301

      Hi All, In my project database is SQL server. The LDF file size is increasing considerably(now it is 16 gb). It may be due to unCommited transactions. My question is that if I close the connection after each query execution will it commit the transaction so that the file size will be small.? or is there any other solution to decrease the file size? Thanks

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      anant.awadhut wrote:

      My question is that if I close the connection after each query execution will it commit the transaction

      In general terms, no, you have to commit the transaction yourself, provided you actually started one. If you start a transaction and don't explicitly commit it, then, upon disconnection from the database, it assumes the transaction is not complete and any changes within that transaction are rolled back. You might find this[^] MS KB article useful in helping you determine where the problem is. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      1 Reply Last reply
      0
      • U User 2071301

        Hi All, In my project database is SQL server. The LDF file size is increasing considerably(now it is 16 gb). It may be due to unCommited transactions. My question is that if I close the connection after each query execution will it commit the transaction so that the file size will be small.? or is there any other solution to decrease the file size? Thanks

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        OK. This has been bugging me for a little while. I assumed you where doing the basics: Are you backing up the database regularly? Are you backing up the Transaction Log, and truncating the log to remove old, unneeded transactions? If not, you might want to go into the Enterprise Manager and setup a Maintenance Plan.... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        U 1 Reply Last reply
        0
        • D Dave Kreskowiak

          OK. This has been bugging me for a little while. I assumed you where doing the basics: Are you backing up the database regularly? Are you backing up the Transaction Log, and truncating the log to remove old, unneeded transactions? If not, you might want to go into the Enterprise Manager and setup a Maintenance Plan.... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          U Offline
          U Offline
          User 2071301
          wrote on last edited by
          #4

          Yes I am backing up the database daily. I am taking the backup of complete database not just a ldf or MDF file. But I don't know how to truncate the log to remove old,unneeded transactions. How this can be done? Thanks

          D 1 Reply Last reply
          0
          • U User 2071301

            Yes I am backing up the database daily. I am taking the backup of complete database not just a ldf or MDF file. But I don't know how to truncate the log to remove old,unneeded transactions. How this can be done? Thanks

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            Well, you can read the docs on the BACKUP sql statement here[^]. If you're doing a Full backup of the database, and the log doesn't get truncated already, you can follow it up with the SQL statement

            BACKUP LOG databaseName TRUNCATE_ONLY

            to dump the old transactions in the log that are no longer required to rebuild the database. What you're trying to maintain is a backup of the data, which you're doing daily, and a backup of the transactions in the log since the backup of the data was last done. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome -- modified at 12:31 Saturday 7th January, 2006

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups