You can backup the transaction log from either of the replicas. Doing the transaction log backup on either the primary replica or the secondary replica will mark both replicas' transaction logs as reusable (provided no other stoppers are in place like active transactions, etc.).
To do a test, in a non-production environment, setup an availability group just as you have it in your production system (asynchronous commit to the secondary replica).
In my test environment I have a test database, TestBackupDatabase
, and I bloated it with logged transactions through a dummy table:
use TestBackupDatabase;
go
create table dbo.TestTable
(
id int identity(1, 1) not null,
some_int int not null
default 1
);
go
insert into dbo.TestTable
default values;
go 1000
Now when I do a transaction log backup on my primary, using DBCC SQLPERF(LOGSPACE)
I see on both transaction logs (primary and secondary) that space used has dropped due to log truncation. Bloating the transaction log back up with the same test on the primary:
insert into dbo.TestTable
default values;
go 1000
I now do a transaction log backup on the secondary async replica. Running DBCC SQLPERF(LOGSPACE)
again on each replica I see the same behavior: transaction log reuse.
BOL Reference: Active Secondaries: Backup on Secondary Replicas (AlwaysOn Availability Groups)