bringing back a TDE database in AlwaysOn gives an error

167 Views Asked by At

We recently added a new disk to our SQL Server 2016 AlwaysOn environment, configuration is equal on both nodes. I wanted to move some databases to this new disk. (all databases have TDE enabled, AlwaysOn is working fine). This is what I did:

  1. removed database from AO group
  2. took database offline
  3. copied datafiles to new location, updated metadata
  4. bring database back online

So far so good. However, adding the database back to AlwaysOn, I get an error

secondary database is not joined

But automatic seeding is enabled (verified). Is automatic seeding not working with TDE?

Update: column [failure_state_desc] in dmv sys.dm_hadr_automatic_seeding shows "Seeding Check Message Timeout"

Update: see this error in errorlog "

The mirror database, "XXXX", has insufficient transaction log data to preserve the log backup chain of the principal database. This may happen if a log backup from the principal database has not been taken or has not been restored on the mirror database.

" but logbackups have been taken after bringing database back online

1

There are 1 best solutions below

0
On

Found the reason: After removing the database from AlwaysOn, the database got in restoring state on secondairy node. Direct seeding kicked in after adding the database to AlwaysOn on primary. However, the database was already on secondairy node on the old location, resulting the errors mentioned.

Solution: delete the database on secondairy nodes before bringing the database back to AlwaysOn