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
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,811 questions
{count} votes

3 answers

Sort by: Most helpful
  1. m 4,271 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,301 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,271 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