SQL SERVER - Automatic Seeding of Availability Database SQLAGDB' in Availability Group AG' Failed With A Transient Error
SQL SERVER - Automatic Seeding of Availability Database SQLAGDB' in Availability Group AG' Failed With A Transient Error
Group �AG� Failed With a Transient Error. The Operation Will be Retried
June 29, 2019
Pinal Dave
SQL
No Comments
Earlier I have written few blogs about automatic seeding feature. In this blog we
would learn how to fix error: Automatic seeding of availability database �SQLAGDB�
in availability group �AG� failed with a transient error.
Solarwinds
In both scenarios, the database was started to restore, and it failed in the middle
due to which it was in �Restoring� state. But in my client�s situation, the
database was not getting listed in the databases folder in SSMS.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
CREATE DATABASE [SQLAuthority]
ON PRIMARY
(NAME = 'SQLAuthority', FILENAME = 'C:\Temp\SQLAuthority.mdf')
LOG ON
(NAME = 'SQLAuthority_log', FILENAME = 'C:\Temp\SQLAuthority_log.ldf')
GO
ALTER DATABASE SQLAuthority ADD FILE
(NAME = 'SQLAuthority_D1', FILENAME = 'C:\Temp\D1.ndf')
GO
ALTER DATABASE SQLAuthority ADD LOG FILE
(NAME = 'SQLAuthority_L1', FILENAME = 'C:\Temp\L1.ndf'),
(NAME = 'SQLAuthority_L1', FILENAME = 'C:\Temp\L2.ndf')
GO
BACKUP DATABASE SQLAuthority TO DISK = 'SQLAuthority.bak'
This would create a database with two physical transaction log files with a same
logical name. Once done, use Automatic Seeding and add a database to the
availability group. It is not going to fail from the UI. Here is what you would
see.
If you investigate and look at ERRORLOG file on secondary, here are the failure
SQL SERVER � FIX: Msg 4353 � Conflicting File Relocations Have Been Specified for
File. Only a Single WITH MOVE Clause Should be Specified for Any Logical File Name
I looked at the database and there were no duplicate logical names! I asked about
this history of the database and if there was any file added and later removed and
the answer was �Yes�.
WORKAROUND/SOLUTION
I tried a lot of things, removing files completely, breaking AG, removing the
database from AG. But none worked. I was not able to add the database to AG.
Finally, I used the workaround given in my blog to rename the logical file to some
new name.
1
2
3
4
USE [SQLAuthority]
GO
ALTER DATABASE [SQLAuthority] MODIFY FILE (NAME=N'SQLAuthority_L1',
NEWNAME=N'SQLAuthority_L2')
GO
Once the command was executed, I was able to add the database to AG via automatic
seeding. Hopefully, Microsoft would see this blog and fix duplicate logical file
name issue. Until then you can use a workaround.