Space is not reducing after running log shrinking job

Muhammad Faisal Sharif 41 Reputation points
2020-11-04T04:23:00.46+00:00

Scenario:

There is SQL FCI Instance that is configure with SQL Always-On AOG which host replicas. The log shrink job executes successfully but space is not reduced instead when we run log shrink job after suspend replica seeding then it works.

Is it default behavior or do I need to change some parameters?

Any suggestion will be appreciated.

SQL Server | Other
{count} votes

3 answers

Sort by: Most helpful
  1. m 4,276 Reputation points
    2020-11-04T05:31:46.943+00:00

    Hi anonymous user,

    Is it default behavior or do I need to change some parameters?

    You need to firstly backup the log and then run DBCC SHRINKFILE, steps as next:
    1.backup file

    BACKUP LOG DatabaseName TO DISK=’ ’
    

    2.DBCC SHRINKFILE:

    DBCC SHRINKFILE (DatabaseName_Log, EMPTYFILE)
    

    Quote from this doc.:
    ...
    The shrink operation can't reduce the file size any further if there's insufficient free space available.

    Typically it's the log file that appears not to shrink. This non-shrinking is usually the result of a log file that hasn't been truncated. To truncate the log, you can set the database recovery model to SIMPLE, or back up the log and then run the DBCC SHRINKFILE operation again.
    ...

    More information: shrinking-sql-log-files-in-an-availability-group-cluster-or-database-mirror

    BR,
    Mia


    If the answer is helpful, please click "Accept Answer" and upvote it.


  2. tibor_karaszi@hotmail.com 4,316 Reputation points
    2020-11-04T10:02:31.663+00:00

    There are several aspects regarding shrinking the transaction log. I've written about it here: https://karaszi.com/large-transaction-log-file


  3. m 4,276 Reputation points
    2020-11-05T01:29:03.44+00:00

    Hi anonymous user,

    Is the issue solved?

    BR,
    Mia


    If the answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.