SQL Server log_reuse_wait_desc LOG_BACKUP, Transaction log full, does not become smaller after log backup









up vote
0
down vote

favorite












I did the backup of database which is small 2MB.
I have transaction log file (LDF file) of 15GB!
My database is in Full recovery mode.
First I tried to do the backup of transaction log but it failed because of the space on the server.
Then I succeeded to do the backup of transaction log and now backup+backup of transaction log have 9MB.
statement SELECT name,log_reuse_wait_desc FROM sys.databases; returns now NOTHING instead of LOG_BACKUP which is good.But transaction log is still 15 GB.
What should I do to release it?










share|improve this question



























    up vote
    0
    down vote

    favorite












    I did the backup of database which is small 2MB.
    I have transaction log file (LDF file) of 15GB!
    My database is in Full recovery mode.
    First I tried to do the backup of transaction log but it failed because of the space on the server.
    Then I succeeded to do the backup of transaction log and now backup+backup of transaction log have 9MB.
    statement SELECT name,log_reuse_wait_desc FROM sys.databases; returns now NOTHING instead of LOG_BACKUP which is good.But transaction log is still 15 GB.
    What should I do to release it?










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I did the backup of database which is small 2MB.
      I have transaction log file (LDF file) of 15GB!
      My database is in Full recovery mode.
      First I tried to do the backup of transaction log but it failed because of the space on the server.
      Then I succeeded to do the backup of transaction log and now backup+backup of transaction log have 9MB.
      statement SELECT name,log_reuse_wait_desc FROM sys.databases; returns now NOTHING instead of LOG_BACKUP which is good.But transaction log is still 15 GB.
      What should I do to release it?










      share|improve this question















      I did the backup of database which is small 2MB.
      I have transaction log file (LDF file) of 15GB!
      My database is in Full recovery mode.
      First I tried to do the backup of transaction log but it failed because of the space on the server.
      Then I succeeded to do the backup of transaction log and now backup+backup of transaction log have 9MB.
      statement SELECT name,log_reuse_wait_desc FROM sys.databases; returns now NOTHING instead of LOG_BACKUP which is good.But transaction log is still 15 GB.
      What should I do to release it?







      sql-server database-backups transaction-log






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 29 '15 at 14:41

























      asked Jan 29 '15 at 14:17









      Dejan

      55382147




      55382147






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          If you aren't regularly backing up the transaction log, the log fie will continue to grow. If you are willing to risk losing changes since your last backup, change the database recovery model to Simple. My experience has been that SQL Server will shrink the log file automatically in a short while after making this change. If it does not, you may need to issue a manual shrink.



          You can switch back to Full recovery afterwards-- but verify you are performing the regularly scheduled log backups required for Full recovery.



          There are many resources online about recovery models. Here is an article on MSDN about Backup Under the Full Recovery Model.






          share|improve this answer




















          • Hi Paul, thank you for your time I did some change in my question. I succeeded to do the backup of transaction log (it is 9MB). I changed the recovery model to Simple. but Log is still 15GB although database is only 2MB. Log does not become smaller although it is Simple model. Do I have to do some restart?
            – Dejan
            Jan 29 '15 at 14:33










          • Can you give me instruction how to do the Shrink? Do I have to do the shrink of the database or of the files?
            – Dejan
            Jan 29 '15 at 14:36










          • Hi Paul, now in database is the value NOTHING for ClickMobile which is good. But file is still 15GB? Any idea please?
            – Dejan
            Jan 29 '15 at 14:40










          • Paul can you please assist me with this what to do? LDF file is stil 15GB:(
            – Dejan
            Jan 29 '15 at 15:02










          • You may need to do a 1DBCC SHRINKFILE1 to get it to shrink afterwards.
            – Paul Williams
            Jan 29 '15 at 23:17


















          up vote
          0
          down vote













          The log file size on disk doesn't get smaller after a log backup. The reason for this is that the engine assumes that it's likely that it needs to be that size for future use and growing the log file is an expensive (in terms of time) operation. What the log backup does is mark the internal structures (called "virtual log files" or "VLFs") in the log file as available for reuse. You can check the status of the VLFs in a couple of different ways:




          • DBCC SQLPERF('LOGSPACE') will show you how much of the log is internally used as a percentage


          • DBCC LOGINFO will show you the information regarding each VLF in the log file.

          All that said, if you know for a fact that it's unlikely that you'll need a 15 Gb log file going forward, you can shrink the file using DBCC SHRINKFILE. There's a lot of good information out there on VLFs in general. This blog post is a good start.






          share|improve this answer




















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f28216905%2fsql-server-log-reuse-wait-desc-log-backup-transaction-log-full-does-not-become%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            If you aren't regularly backing up the transaction log, the log fie will continue to grow. If you are willing to risk losing changes since your last backup, change the database recovery model to Simple. My experience has been that SQL Server will shrink the log file automatically in a short while after making this change. If it does not, you may need to issue a manual shrink.



            You can switch back to Full recovery afterwards-- but verify you are performing the regularly scheduled log backups required for Full recovery.



            There are many resources online about recovery models. Here is an article on MSDN about Backup Under the Full Recovery Model.






            share|improve this answer




















            • Hi Paul, thank you for your time I did some change in my question. I succeeded to do the backup of transaction log (it is 9MB). I changed the recovery model to Simple. but Log is still 15GB although database is only 2MB. Log does not become smaller although it is Simple model. Do I have to do some restart?
              – Dejan
              Jan 29 '15 at 14:33










            • Can you give me instruction how to do the Shrink? Do I have to do the shrink of the database or of the files?
              – Dejan
              Jan 29 '15 at 14:36










            • Hi Paul, now in database is the value NOTHING for ClickMobile which is good. But file is still 15GB? Any idea please?
              – Dejan
              Jan 29 '15 at 14:40










            • Paul can you please assist me with this what to do? LDF file is stil 15GB:(
              – Dejan
              Jan 29 '15 at 15:02










            • You may need to do a 1DBCC SHRINKFILE1 to get it to shrink afterwards.
              – Paul Williams
              Jan 29 '15 at 23:17















            up vote
            0
            down vote













            If you aren't regularly backing up the transaction log, the log fie will continue to grow. If you are willing to risk losing changes since your last backup, change the database recovery model to Simple. My experience has been that SQL Server will shrink the log file automatically in a short while after making this change. If it does not, you may need to issue a manual shrink.



            You can switch back to Full recovery afterwards-- but verify you are performing the regularly scheduled log backups required for Full recovery.



            There are many resources online about recovery models. Here is an article on MSDN about Backup Under the Full Recovery Model.






            share|improve this answer




















            • Hi Paul, thank you for your time I did some change in my question. I succeeded to do the backup of transaction log (it is 9MB). I changed the recovery model to Simple. but Log is still 15GB although database is only 2MB. Log does not become smaller although it is Simple model. Do I have to do some restart?
              – Dejan
              Jan 29 '15 at 14:33










            • Can you give me instruction how to do the Shrink? Do I have to do the shrink of the database or of the files?
              – Dejan
              Jan 29 '15 at 14:36










            • Hi Paul, now in database is the value NOTHING for ClickMobile which is good. But file is still 15GB? Any idea please?
              – Dejan
              Jan 29 '15 at 14:40










            • Paul can you please assist me with this what to do? LDF file is stil 15GB:(
              – Dejan
              Jan 29 '15 at 15:02










            • You may need to do a 1DBCC SHRINKFILE1 to get it to shrink afterwards.
              – Paul Williams
              Jan 29 '15 at 23:17













            up vote
            0
            down vote










            up vote
            0
            down vote









            If you aren't regularly backing up the transaction log, the log fie will continue to grow. If you are willing to risk losing changes since your last backup, change the database recovery model to Simple. My experience has been that SQL Server will shrink the log file automatically in a short while after making this change. If it does not, you may need to issue a manual shrink.



            You can switch back to Full recovery afterwards-- but verify you are performing the regularly scheduled log backups required for Full recovery.



            There are many resources online about recovery models. Here is an article on MSDN about Backup Under the Full Recovery Model.






            share|improve this answer












            If you aren't regularly backing up the transaction log, the log fie will continue to grow. If you are willing to risk losing changes since your last backup, change the database recovery model to Simple. My experience has been that SQL Server will shrink the log file automatically in a short while after making this change. If it does not, you may need to issue a manual shrink.



            You can switch back to Full recovery afterwards-- but verify you are performing the regularly scheduled log backups required for Full recovery.



            There are many resources online about recovery models. Here is an article on MSDN about Backup Under the Full Recovery Model.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 29 '15 at 14:30









            Paul Williams

            12.7k33575




            12.7k33575











            • Hi Paul, thank you for your time I did some change in my question. I succeeded to do the backup of transaction log (it is 9MB). I changed the recovery model to Simple. but Log is still 15GB although database is only 2MB. Log does not become smaller although it is Simple model. Do I have to do some restart?
              – Dejan
              Jan 29 '15 at 14:33










            • Can you give me instruction how to do the Shrink? Do I have to do the shrink of the database or of the files?
              – Dejan
              Jan 29 '15 at 14:36










            • Hi Paul, now in database is the value NOTHING for ClickMobile which is good. But file is still 15GB? Any idea please?
              – Dejan
              Jan 29 '15 at 14:40










            • Paul can you please assist me with this what to do? LDF file is stil 15GB:(
              – Dejan
              Jan 29 '15 at 15:02










            • You may need to do a 1DBCC SHRINKFILE1 to get it to shrink afterwards.
              – Paul Williams
              Jan 29 '15 at 23:17

















            • Hi Paul, thank you for your time I did some change in my question. I succeeded to do the backup of transaction log (it is 9MB). I changed the recovery model to Simple. but Log is still 15GB although database is only 2MB. Log does not become smaller although it is Simple model. Do I have to do some restart?
              – Dejan
              Jan 29 '15 at 14:33










            • Can you give me instruction how to do the Shrink? Do I have to do the shrink of the database or of the files?
              – Dejan
              Jan 29 '15 at 14:36










            • Hi Paul, now in database is the value NOTHING for ClickMobile which is good. But file is still 15GB? Any idea please?
              – Dejan
              Jan 29 '15 at 14:40










            • Paul can you please assist me with this what to do? LDF file is stil 15GB:(
              – Dejan
              Jan 29 '15 at 15:02










            • You may need to do a 1DBCC SHRINKFILE1 to get it to shrink afterwards.
              – Paul Williams
              Jan 29 '15 at 23:17
















            Hi Paul, thank you for your time I did some change in my question. I succeeded to do the backup of transaction log (it is 9MB). I changed the recovery model to Simple. but Log is still 15GB although database is only 2MB. Log does not become smaller although it is Simple model. Do I have to do some restart?
            – Dejan
            Jan 29 '15 at 14:33




            Hi Paul, thank you for your time I did some change in my question. I succeeded to do the backup of transaction log (it is 9MB). I changed the recovery model to Simple. but Log is still 15GB although database is only 2MB. Log does not become smaller although it is Simple model. Do I have to do some restart?
            – Dejan
            Jan 29 '15 at 14:33












            Can you give me instruction how to do the Shrink? Do I have to do the shrink of the database or of the files?
            – Dejan
            Jan 29 '15 at 14:36




            Can you give me instruction how to do the Shrink? Do I have to do the shrink of the database or of the files?
            – Dejan
            Jan 29 '15 at 14:36












            Hi Paul, now in database is the value NOTHING for ClickMobile which is good. But file is still 15GB? Any idea please?
            – Dejan
            Jan 29 '15 at 14:40




            Hi Paul, now in database is the value NOTHING for ClickMobile which is good. But file is still 15GB? Any idea please?
            – Dejan
            Jan 29 '15 at 14:40












            Paul can you please assist me with this what to do? LDF file is stil 15GB:(
            – Dejan
            Jan 29 '15 at 15:02




            Paul can you please assist me with this what to do? LDF file is stil 15GB:(
            – Dejan
            Jan 29 '15 at 15:02












            You may need to do a 1DBCC SHRINKFILE1 to get it to shrink afterwards.
            – Paul Williams
            Jan 29 '15 at 23:17





            You may need to do a 1DBCC SHRINKFILE1 to get it to shrink afterwards.
            – Paul Williams
            Jan 29 '15 at 23:17













            up vote
            0
            down vote













            The log file size on disk doesn't get smaller after a log backup. The reason for this is that the engine assumes that it's likely that it needs to be that size for future use and growing the log file is an expensive (in terms of time) operation. What the log backup does is mark the internal structures (called "virtual log files" or "VLFs") in the log file as available for reuse. You can check the status of the VLFs in a couple of different ways:




            • DBCC SQLPERF('LOGSPACE') will show you how much of the log is internally used as a percentage


            • DBCC LOGINFO will show you the information regarding each VLF in the log file.

            All that said, if you know for a fact that it's unlikely that you'll need a 15 Gb log file going forward, you can shrink the file using DBCC SHRINKFILE. There's a lot of good information out there on VLFs in general. This blog post is a good start.






            share|improve this answer
























              up vote
              0
              down vote













              The log file size on disk doesn't get smaller after a log backup. The reason for this is that the engine assumes that it's likely that it needs to be that size for future use and growing the log file is an expensive (in terms of time) operation. What the log backup does is mark the internal structures (called "virtual log files" or "VLFs") in the log file as available for reuse. You can check the status of the VLFs in a couple of different ways:




              • DBCC SQLPERF('LOGSPACE') will show you how much of the log is internally used as a percentage


              • DBCC LOGINFO will show you the information regarding each VLF in the log file.

              All that said, if you know for a fact that it's unlikely that you'll need a 15 Gb log file going forward, you can shrink the file using DBCC SHRINKFILE. There's a lot of good information out there on VLFs in general. This blog post is a good start.






              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                The log file size on disk doesn't get smaller after a log backup. The reason for this is that the engine assumes that it's likely that it needs to be that size for future use and growing the log file is an expensive (in terms of time) operation. What the log backup does is mark the internal structures (called "virtual log files" or "VLFs") in the log file as available for reuse. You can check the status of the VLFs in a couple of different ways:




                • DBCC SQLPERF('LOGSPACE') will show you how much of the log is internally used as a percentage


                • DBCC LOGINFO will show you the information regarding each VLF in the log file.

                All that said, if you know for a fact that it's unlikely that you'll need a 15 Gb log file going forward, you can shrink the file using DBCC SHRINKFILE. There's a lot of good information out there on VLFs in general. This blog post is a good start.






                share|improve this answer












                The log file size on disk doesn't get smaller after a log backup. The reason for this is that the engine assumes that it's likely that it needs to be that size for future use and growing the log file is an expensive (in terms of time) operation. What the log backup does is mark the internal structures (called "virtual log files" or "VLFs") in the log file as available for reuse. You can check the status of the VLFs in a couple of different ways:




                • DBCC SQLPERF('LOGSPACE') will show you how much of the log is internally used as a percentage


                • DBCC LOGINFO will show you the information regarding each VLF in the log file.

                All that said, if you know for a fact that it's unlikely that you'll need a 15 Gb log file going forward, you can shrink the file using DBCC SHRINKFILE. There's a lot of good information out there on VLFs in general. This blog post is a good start.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 29 '15 at 17:54









                Ben Thul

                22k32445




                22k32445



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f28216905%2fsql-server-log-reuse-wait-desc-log-backup-transaction-log-full-does-not-become%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    How to read a connectionString WITH PROVIDER in .NET Core?

                    Museum of Modern and Contemporary Art of Trento and Rovereto

                    In R, how to develop a multiplot heatmap.2 figure showing key labels successfully