none
Database cannot be deleted RRS feed

  • Question

  • Database 'X' cannot be deleted because it is used as a sync metadata database which still contains sync groups and/or sync agents. (Code: 16606) Database 'X' cannot be deleted because it is used as a sync metadata database which still contains sync groups and/or sync agents. (Code: 16606)

    The "Sync Agent" says "Loading..."

     


    Wednesday, August 1, 2018 5:54 PM

Answers

  • The best course of action is to leverage Azure Support to identify any service issues, as well as get you 'unstuck' so that you can move forward. If you do not have an Azure Support plan, if you send your Azure Subscription GUID to AzCommunity@microsoft.com (while also referencing this forum thread), we can have a one-time incident ticket enabled for you, so that this issue can be addressed. 

    If you have additional questions, please update this forum thread. Regards, ~Mike

    Monday, August 20, 2018 5:16 PM
    Moderator

All replies

  • So you have sync running against that database. Remove that first. Then you can remove the database. Here's a blog post on cleaning up sync.
    Wednesday, August 1, 2018 6:49 PM
  • Welcome to Azure forums!

    There is probably an on-premises computer where you installed SQL Data Sync Agent to sync an on-premises with that SQL Azure database, under the c:\program files (x86)\Microsoft SQL Azure Data Sync directory of that computer you should find an utility named deprovisionUtil.exe. If you run it with the switch /F it will remove the DSS schema and all its objects.

    After that you may be able to delete the database.

    Hope this helps.



    Regards,

    Alberto Morillo
    SQLCoffee.com

    Wednesday, August 1, 2018 6:57 PM
  • Hi SenseiJoe,

    Additional information with regard to cleaning up sync job configuration and metadata.  

    How to remove SQL Azure Data Sync objects manually

    Regards,

    Mike

    Note: If you have found an answer to your specific issue, please mark this as Answered so as to assist others looking for the same solution. Thank you! 

    Thursday, August 2, 2018 5:05 PM
    Moderator
  • Can't remove the database, that's the issue.
    There is no Sync Group and the "Sync Agent" says "Loading..."

    Joe

    Friday, August 3, 2018 1:06 PM
  • Deprovisioning failed. Error:
    Microsoft.Synchronization.Data.DbNotProvisionedException:

    The current operation could not be completed because the database is not provisioned for sync or you not have permissions to the sync configuration tables.

       at Microsoft.Synchronization.Data.SqlServer.SqlManagementUtils.VerifyProvisionSupported(SqlConnection connection, SqlTransaction trans, String objectPrefix, String objectSchema, Boolean throwWhenNotProvisioned)
       at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeDeprovisioning.DeprovisionStore()
       at Microsoft.SqlAzureDataSync.DeprovisioningUtility.DeprovisioningUtilProgram.Main(String[] args)

    Friday, August 3, 2018 1:11 PM
  • So for no go,  I went to the link you sent, ran both scripts that were listed there.

    Still get:
    Database 'MVRS' cannot be deleted because it is used as a sync metadata database which still contains sync groups and/or sync agents. (Code: 16606) Database 'MVRS' cannot be deleted because it is used as a sync metadata database which still contains sync groups and/or sync agents. (Code: 16606)

    Friday, August 3, 2018 1:22 PM
  • More Info...

    My guess is that it's looking for the Sync Agent name and can't find it anywhere, so it keeps looking.

    There is no local database to sync to, the Sync Service running on the local machine has been turned off. 

    If I turn on the Sync Service there are no registered databases.

    If I try to submit the agent key, the "Test Connection" succeeds but when I click OK the data sync program tells me to enter a valid agent key to proceed.

    Friday, August 3, 2018 3:38 PM
  • None of the scripts work.
    Sunday, August 5, 2018 1:45 AM
  • Hi,

    Look like you have the same issue.

    Avis de non-responsabilité:
    Mon opinion ne peut pas coïncider avec la position officielle de Microsoft.

    Bien cordialement, Andrei ...

    MCP

    Sunday, August 5, 2018 3:14 AM
  • The best course of action is to leverage Azure Support to identify any service issues, as well as get you 'unstuck' so that you can move forward. If you do not have an Azure Support plan, if you send your Azure Subscription GUID to AzCommunity@microsoft.com (while also referencing this forum thread), we can have a one-time incident ticket enabled for you, so that this issue can be addressed. 

    If you have additional questions, please update this forum thread. Regards, ~Mike

    Monday, August 20, 2018 5:16 PM
    Moderator
  • Can you make sure that there are no Sync Groups in place? These need to be deleted first before you can delete all the artifacts that make up the sync.

    Monday, October 21, 2019 4:33 PM
    Moderator