tier application via dacpac fails after database restore
I have a server running Windows Server 2016 and Sql Server 2016 with 3 databases in that sql instance. All 3 databases have only ever been updated via DACPAC application (calling sqlpackage from a custom powershell script, executed using TFS Release Management). The release deployment updates all databases with the same DACPAC, which is a build artifact attached to the release. The databases are all registered as data-tier applications using the RegisterDataTierApplication parameter with sqlpackage.
Yesterday someone had the DBA take a backup and restore one of the 3 databases on that server. Ever since, we have been unable to update the database via DACPAC because it is complaining that the Dacinstance already exists. What is interesting is that the drift report is now also failing with an odd message.
Here's the error from the drift report:
[error]*** Databases registered as a DAC database must be hosted by an instance of SQL 2005 SP4, SQL 2008 SP2, SQL 2008 R2, SQL 2012, SQL 2014 or Microsoft Azure SQL Database. Unable to proceed with DAC operations on the target instance because it does not support DACs. Specify another instance, or upgrade to a version that supports DACs.
Here's the error message from application of the DACPAC:
[error]*** Could not deploy package. Unable to register data-tier application: DacInstance 'MYDATABASENAME' already exists in the database. DacInstance 'MYDATABASENAME' already exists in the database.
We have already tried to re-apply the version of the DACPAC that the now restored database is running on with the same error. We also attempted with the database in 2014 compatibility mode with the same result.
So my question is, how do you update a registered data-tier application after that database has been restored from backup?
Just to clarify, the backup was taken via SSMS of this database and restored with overwrite over top of the existing database. No name changes or server changes. Further, the other two databases on the same server are having no issues with application of the same DACPAC - only the one that has been restored from backup. We use the same exact powershell script (invoking sqlpackage) with the same parameters every time we deploy the DACPAC. These databases have only ever been updated in this fashion.
I hesitate to un-register and try to re-register the db as a data-tier application due to the odd error message from the drift report about compatibility. Does anyone know what would cause that?
What are the appropriate steps to get out of this situation where the restored database is now unable to accept current or updated versions of the DACPAC?
链接地址: http://www.djcxy.com/p/62334.html