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. LDF file Size is so increased

LDF file Size is so increased

Scheduled Pinned Locked Moved Database
sysadminhelpquestion
25 Posts 5 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.
  • A Azam Niaz Ch

    Dear I take full back of DB after that i take only logs backup then try to shrink the log file but failed to reduce the LDF size.

    Kornfeld Eliyahu PeterK Offline
    Kornfeld Eliyahu PeterK Offline
    Kornfeld Eliyahu Peter
    wrote on last edited by
    #6

    Can you share the commands you run?

    Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

    "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

    A 1 Reply Last reply
    0
    • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

      Can you share the commands you run?

      Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

      A Offline
      A Offline
      Azam Niaz Ch
      wrote on last edited by
      #7

      I do with MS management studio.

      Kornfeld Eliyahu PeterK 1 Reply Last reply
      0
      • A Azam Niaz Ch

        I do with MS management studio.

        Kornfeld Eliyahu PeterK Offline
        Kornfeld Eliyahu PeterK Offline
        Kornfeld Eliyahu Peter
        wrote on last edited by
        #8

        OK. Explain how! (when you are using the Management Studio you have a 'Script' button at the top of the backup window. Pressing that button will give you the script Management Studio will run - copy that here!) (I ask you this because these kind of things are working so probably you miss something and I try to figure out what)

        Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

        "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

        A 1 Reply Last reply
        0
        • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

          OK. Explain how! (when you are using the Management Studio you have a 'Script' button at the top of the backup window. Pressing that button will give you the script Management Studio will run - copy that here!) (I ask you this because these kind of things are working so probably you miss something and I try to figure out what)

          Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

          A Offline
          A Offline
          Azam Niaz Ch
          wrote on last edited by
          #9

          Please see the generated script USE [TEST_APP] GO DBCC SHRINKFILE (N'TEST_APP_Log' , 0, TRUNCATEONLY) GO I just want to truncate the logs.

          Kornfeld Eliyahu PeterK 1 Reply Last reply
          0
          • A Azam Niaz Ch

            Please see the generated script USE [TEST_APP] GO DBCC SHRINKFILE (N'TEST_APP_Log' , 0, TRUNCATEONLY) GO I just want to truncate the logs.

            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu Peter
            wrote on last edited by
            #10

            TRUNCATE_ONLY option does not reorganize the file but try to free the empty block at the end of the log file...It is possible that without page-reorganization there is no actual space to free... Instead of TRUNCATE_ONLY use tager_size...

            DBCC SHRINKFILE('your-log-file', 200) -- for 200 MB

            It will take much more time as SQL will try to reorganize pages inside the log file and drop them if marked properly by the backup process...

            Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

            "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

            A 1 Reply Last reply
            0
            • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

              TRUNCATE_ONLY option does not reorganize the file but try to free the empty block at the end of the log file...It is possible that without page-reorganization there is no actual space to free... Instead of TRUNCATE_ONLY use tager_size...

              DBCC SHRINKFILE('your-log-file', 200) -- for 200 MB

              It will take much more time as SQL will try to reorganize pages inside the log file and drop them if marked properly by the backup process...

              Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

              A Offline
              A Offline
              Azam Niaz Ch
              wrote on last edited by
              #11

              I just need some help to configure the DB as when i take bake up of LDF then DB must truncate the logs and LDF again in 2mb size. is it possible ? i am doing the same exercise on another DB but on this i am failed.

              Kornfeld Eliyahu PeterK 1 Reply Last reply
              0
              • A Azam Niaz Ch

                I just need some help to configure the DB as when i take bake up of LDF then DB must truncate the logs and LDF again in 2mb size. is it possible ? i am doing the same exercise on another DB but on this i am failed.

                Kornfeld Eliyahu PeterK Offline
                Kornfeld Eliyahu PeterK Offline
                Kornfeld Eliyahu Peter
                wrote on last edited by
                #12

                Not with your model...

                Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

                A 1 Reply Last reply
                0
                • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                  Not with your model...

                  Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                  A Offline
                  A Offline
                  Azam Niaz Ch
                  wrote on last edited by
                  #13

                  Can i change the model ? how ?

                  Kornfeld Eliyahu PeterK 1 Reply Last reply
                  0
                  • A Azam Niaz Ch

                    Can i change the model ? how ?

                    Kornfeld Eliyahu PeterK Offline
                    Kornfeld Eliyahu PeterK Offline
                    Kornfeld Eliyahu Peter
                    wrote on last edited by
                    #14

                    ALTER DATABASE [your-database-name] SET RECOVERY SIMPLE;

                    Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                    "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

                    A 3 Replies Last reply
                    0
                    • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                      ALTER DATABASE [your-database-name] SET RECOVERY SIMPLE;

                      Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                      A Offline
                      A Offline
                      Azam Niaz Ch
                      wrote on last edited by
                      #15

                      my issue is still with me. on recovery model simple nothing happend ... can you suggest me some more options??

                      C G 2 Replies Last reply
                      0
                      • A Azam Niaz Ch

                        my issue is still with me. on recovery model simple nothing happend ... can you suggest me some more options??

                        C Offline
                        C Offline
                        Corporal Agarn
                        wrote on last edited by
                        #16

                        After changing to simple try shrinking the log file

                        Mongo: Mongo only pawn... in game of life.

                        1 Reply Last reply
                        0
                        • A Azam Niaz Ch

                          my issue is still with me. on recovery model simple nothing happend ... can you suggest me some more options??

                          G Offline
                          G Offline
                          GuyThiebaut
                          wrote on last edited by
                          #17

                          Are you using replication?

                          “That which can be asserted without evidence, can be dismissed without evidence.”

                          ― Christopher Hitchens

                          A 1 Reply Last reply
                          0
                          • G GuyThiebaut

                            Are you using replication?

                            “That which can be asserted without evidence, can be dismissed without evidence.”

                            ― Christopher Hitchens

                            A Offline
                            A Offline
                            Azam Niaz Ch
                            wrote on last edited by
                            #18

                            No i am not using replication

                            G Richard DeemingR 2 Replies Last reply
                            0
                            • A Azam Niaz Ch

                              No i am not using replication

                              G Offline
                              G Offline
                              GuyThiebaut
                              wrote on last edited by
                              #19

                              In which case all you need to read this article[^]

                              “That which can be asserted without evidence, can be dismissed without evidence.”

                              ― Christopher Hitchens

                              1 Reply Last reply
                              0
                              • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                                ALTER DATABASE [your-database-name] SET RECOVERY SIMPLE;

                                Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                                A Offline
                                A Offline
                                Azam Niaz Ch
                                wrote on last edited by
                                #20

                                how can i check which one is my current recovery model?? i change it from DB options but on changing full to simple LOG backup is not possible... ** DB is showing its size 221GB including log instead of showing only MDF file size ? what should i do next ?

                                1 Reply Last reply
                                0
                                • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                                  ALTER DATABASE [your-database-name] SET RECOVERY SIMPLE;

                                  Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                                  A Offline
                                  A Offline
                                  Azam Niaz Ch
                                  wrote on last edited by
                                  #21

                                  how can i check the old recovery model? i try to change it from DB options but after changing to simple LOGS backup is not possible. DB is showing its size 221GB including LDF size.. Any suggestion to get out from this issue.

                                  1 Reply Last reply
                                  0
                                  • A Azam Niaz Ch

                                    No i am not using replication

                                    Richard DeemingR Offline
                                    Richard DeemingR Offline
                                    Richard Deeming
                                    wrote on last edited by
                                    #22

                                    Try running the following query:

                                    SELECT
                                    [name],
                                    recovery_model_desc,
                                    log_reuse_wait_desc
                                    FROM
                                    sys.databases
                                    WHERE
                                    [name] = 'YourDatabaseName'

                                    Compare the value returned to the list on TechNet: Factors That Can Delay Log Truncation[^]


                                    "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                                    "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

                                    A 1 Reply Last reply
                                    0
                                    • Richard DeemingR Richard Deeming

                                      Try running the following query:

                                      SELECT
                                      [name],
                                      recovery_model_desc,
                                      log_reuse_wait_desc
                                      FROM
                                      sys.databases
                                      WHERE
                                      [name] = 'YourDatabaseName'

                                      Compare the value returned to the list on TechNet: Factors That Can Delay Log Truncation[^]


                                      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                                      A Offline
                                      A Offline
                                      Azam Niaz Ch
                                      wrote on last edited by
                                      #23

                                      running this query, i come to know that log_reuse_wait_desc is REPLICATION. what should i do next ?

                                      Richard DeemingR 1 Reply Last reply
                                      0
                                      • A Azam Niaz Ch

                                        running this query, i come to know that log_reuse_wait_desc is REPLICATION. what should i do next ?

                                        Richard DeemingR Offline
                                        Richard DeemingR Offline
                                        Richard Deeming
                                        wrote on last edited by
                                        #24

                                        Is your database set up for replication? If so, the replication is broken and you'll need to fix it. If it's not set up for replication, then you'll need to remove the replication settings. Try sp_removedbreplication[^]:

                                        EXEC sp_removedbreplication 'YourDatabaseName'


                                        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                                        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

                                        A 1 Reply Last reply
                                        0
                                        • Richard DeemingR Richard Deeming

                                          Is your database set up for replication? If so, the replication is broken and you'll need to fix it. If it's not set up for replication, then you'll need to remove the replication settings. Try sp_removedbreplication[^]:

                                          EXEC sp_removedbreplication 'YourDatabaseName'


                                          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                                          A Offline
                                          A Offline
                                          Azam Niaz Ch
                                          wrote on last edited by
                                          #25

                                          Thank you so much its work for me. thank you so much for you cooperation.

                                          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