SharePoint Troubleshooting: The operation cannot be performed on database WSS_UsageApplication

Issue

The operation cannot be performed on database "WSS_UsageApplication" because it is involved in a database mirroring session or an availability group. Some operations are not allowed on a database that is participating in a database mirroring session or in an availability group. ALTER DATABASE Statement failed.

Description

The issue occurs when we install the CU for SharePoint 2013 and runs the PSconfig.PSCONFIG failed with an error. When we check the Upgrade log we see the error ”The operation cannot be performed on database "WSS_UsageApplication" ".

Solution

We had the WSS_UsageApplication under high availability. Once we removed it from the high availability group and ran the PSconfig it worked successfully.

  1. Remove “WSS_UsageApplication” from the availability group before applying a CU and add it when the upgrade is completed (if necessary).
  2. Remove “WSS_UsageApplication” under high availability from the Primary node only.