Shrink Log in Synchronized DB's

  • Hi,

    I have two server A & B and I have always on high availability turned on SQL14.

    I need to shrink the log on server A and it's fine if it also needs to shrink B.

    My problem is that when I run my shrink command I get:

    "cannot be shrunk until all secondaries have moved past the point where the log was added.."

    I think I need to drop the High availability on the servers and then run this:

    USE iTest2_Claims;

    GO

    ALTER DATABASE iTest2_Claims

    SET RECOVERY SIMPLE;

    GO

    DBCC SHRINKFILE (iTest2_Claims_Log, 10);

    GO

    ALTER DATABASE iTest2_Claims

    SET RECOVERY FULL;

    GO

    If the only way to shrink my log file is to drop high availibity how do I do that in script? and how risky is it that the high availaibity will not re-connect?

  • take a log backup of primary db before going for shrinking.

  • First, why do you need to shrink the log at all?

    Second, no you absolutely do not have to change recovery model and you shouldn't. If you've got HA set up then I assume recovery is important in the case of a disaster. In that case, breaking the recovery chain and ensuring that you cannot restore to a point in time is probably not a good idea.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply