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. big deletes transaction log full

big deletes transaction log full

Scheduled Pinned Locked Moved Database
databasehelp
4 Posts 4 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.
  • D Offline
    D Offline
    devvvy
    wrote on last edited by
    #1

    Hello I'm trying to run some big delete statements and keep running into the following exception: Error - The transaction log for database 'SomeDatabase' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases, Line: 16 I've already created a 20GB log file for it, still failing

    dev

    L D M 3 Replies Last reply
    0
    • D devvvy

      Hello I'm trying to run some big delete statements and keep running into the following exception: Error - The transaction log for database 'SomeDatabase' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases, Line: 16 I've already created a 20GB log file for it, still failing

      dev

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      I know this is a long shot, however I would look for an explanation in the log_reuse_wait_desc column in sys.databases, more particularly at line 16. And if that does not help, at least tell us what you see there. :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

      Please use <PRE> tags for code snippets, and update CP Vanity to V2.0 if you haven't already.

      1 Reply Last reply
      0
      • D devvvy

        Hello I'm trying to run some big delete statements and keep running into the following exception: Error - The transaction log for database 'SomeDatabase' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases, Line: 16 I've already created a 20GB log file for it, still failing

        dev

        D Offline
        D Offline
        David Mujica
        wrote on last edited by
        #3

        Are you using transactions ? If so, maybe you need to change your algorithm so that you are not deleting so many rows at one time. Something like: select key from mytable into #Temp1 Loop begin transactioin delete some rows where select top 1000 from #Temp1 delete same rows from #Temp1 Commit Until No more rows in #Temp1 Otherwise, if this is part of a one-time data cleanup, then you might want to A) Get your users off the database, so that you can do system maintenace. 1) Take a full backup of the database 2) switch the recover mode of the database to "simple" 3) Perform your delete 4) Take another full backup 5) Put the database back into the recovery mode you had before 6) Allow your users back into the database Just some ideas. Good luck. :thumbsup:

        1 Reply Last reply
        0
        • D devvvy

          Hello I'm trying to run some big delete statements and keep running into the following exception: Error - The transaction log for database 'SomeDatabase' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases, Line: 16 I've already created a 20GB log file for it, still failing

          dev

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          Devvy, look at David's answer, understand it and implement the idea, he has identified problem and told you the solution. Managing really large transactions can be a complete PITA.

          Never underestimate the power of human stupidity RAH

          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