Cannot drop the database because it is being used for replication


You may need to uninstall a replication that you previously installed and drop the database.

You may receive an error if you want to delete the database after removing the related publication and subscription.

In such a case, run the following script and try to delete the database again.

If this method doesn’t work, create another database with the same name on another instance. Take the backup of this empty database, and restore it to the database that you cannot delete with Overwrite(WITH REPLACE) option. After the restore process is finished, try deleting again.

Author: dbtut

We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.

Leave a Reply

Your email address will not be published. Required fields are marked *