Unsolved
1 Rookie
•
1 Message
0
48
October 30th, 2025 19:13
problem with restoring database and configuring auto seeding in an availability group (SQL Server Always ON)
Hi. In my workplace, we have avamar server (software ver. 19.3) that is connected to data domain and we are currently facing a problem when restoring a database in an "Always On" AG. Although it removes the database from the AG, and restores it on the primary successfully, it fails when trying to configure automatic seeding in the secondary replica. The error in the secondary reads as follows:
2025-10-30 15:31:55 avsql Info <12978>: Forwarding [update_fc_status] request to: 10.60.25.248
2025-10-30 15:31:55 avsql Info <17424>: Removing databases from availability group 'AG-Ahmed' on secondary replica.
2025-10-30 15:31:55 avsql Error <40258>: sqlconnectimpl_smo::execute Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> System.Data.SqlClient.SqlException: Availability-group DDL operations are permitted only when you are using the master database.  Run the USE MASTER command, and retry your availability-group DDL command. 
   at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException) 
   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteWithResults(String sqlCommand, Boolean retry) 
   --- End of inner exception stack trace --- 
   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteWithResults(String sqlCommand, Boolean retry) 
   at SMOWrap.SMO_ExecuteWithResults(SMOWrap* , Char* sql_cmd, vector<std::basic_string<wchar_t\,std::char_traits<wchar_t>\,std::allocator<wchar_t> >\,std::allocator<std::basic_string<wchar_t\,std::char_traits<wchar_t>\,std::allocator<wchar_t> > > >* messages)
2025-10-30 15:31:55 avsql Error <17426>: Exception occurred while executing SQL command to remove the database 'listener10\AG-Ahmed/AdventureWorks2019-Ahmed' from the availability group 'AG-Ahmed'. on secondary replica
2025-10-30 15:31:55 avsql Info <17415>: Notifying the primary replica with 'IN_PROGRESS' status.
2025-10-30 15:31:55 avsql Info <12978>: Forwarding [update_fc_status] request to: 10.60.25.248
2025-10-30 15:31:55 avsql Info <17415>: Notifying the primary replica with 'FAILED' status.
2025-10-30 15:31:55 avsql Info <12978>: Forwarding [update_fc_status] request to: 10.60.25.248
Any help to get me out of this situation is appreciated.😊


