--- title: "Remove Database Mirroring (SQL Server) | Microsoft Docs" ms.custom: "" ms.date: "05/17/2016" ms.prod: sql ms.prod_service: high-availability ms.reviewer: "" ms.technology: high-availability ms.topic: conceptual helpviewer_keywords: - "database mirroring [SQL Server], removing" - "removing database mirroring [SQL Server]" ms.assetid: bbc4d7f7-3bc7-40d6-a822-af195fe7f8c0 author: MikeRayMSFT ms.author: mikeray --- # Remove Database Mirroring (SQL Server) [!INCLUDE[appliesto-ss-xxxx-xxxx-xxx-md](../../includes/appliesto-ss-xxxx-xxxx-xxx-md.md)] This topic describes how to remove database mirroring from a database in [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)] by using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] or [!INCLUDE[tsql](../../includes/tsql-md.md)]. At any time, the database owner can manually stop a database mirroring session by removing mirroring from the database. **In This Topic** - **Before you begin:** [Security](#Security) - **To remove database mirroring, using:** [SQL Server Management Studio](#SSMSProcedure) [Transact-SQL](#TsqlProcedure) - **Follow Up:** [After Removing Database Mirroring](#FollowUp) - [Related Tasks](#RelatedTasks) ## Before You Begin ### Security #### Permissions Requires ALTER permission on the database. ## Using SQL Server Management Studio #### To remove database mirroring 1. During a database mirroring session, connect to the principal server instance, in Object Explorer, click the server name to expand the server tree. 2. Expand **Databases**, and select the database. 3. Right-click the database, select **Tasks**, and then click **Mirror**. This opens the **Mirroring** page of the **Database Properties** dialog box. 4. In the **Select a Page** pane, click **Mirroring**. 5. To remove mirroring, click **Remove Mirroring**. A prompt asks for confirmation. If you click **Yes**, the session is stopped and mirroring is removed from the database. ## Using Transact-SQL To remove database mirroring, use the **Database Properties**. use the **Mirroring** page of the **Database Properties** dialog box. #### To remove database mirroring 1. Connect to the [!INCLUDE[ssDE](../../includes/ssde-md.md)] of either mirroring partner. 2. From the Standard bar, click **New Query**. 3. Issue the following [!INCLUDE[tsql](../../includes/tsql-md.md)] statement: ``` ALTER DATABASE database_name SET PARTNER OFF ``` where *database_name* is the mirrored database whose session you want to remove. The following example removes database mirroring from the [!INCLUDE[ssSampleDBobject](../../includes/sssampledbobject-md.md)] sample database. ``` ALTER DATABASE AdventureWorks2012 SET PARTNER OFF; ``` ## Follow Up: Removing Database Mirroring > [!NOTE] > For information about the impact of removing mirroring, see [Removing Database Mirroring (SQL Server)](../../database-engine/database-mirroring/removing-database-mirroring-sql-server.md). - **If you intend to restart mirroring on the database** Any log backups taken on the principal database after mirroring was removed must all be applied to the mirror database before you can restart mirroring. - **If you do not intend to restart mirroring** Optionally, you can recover the former mirror database. On the server instance that was the mirror server, you can use the following [!INCLUDE[tsql](../../includes/tsql-md.md)] statement: ``` RESTORE DATABASE database_name WITH RECOVERY; ``` > [!IMPORTANT] > If you recover this database, two divergent databases with the same name are online. Therefore, you need to ensure that clients can access only one of them-typically the most recent principal database. ## Related Tasks - [Pause or Resume a Database Mirroring Session (SQL Server)](../../database-engine/database-mirroring/pause-or-resume-a-database-mirroring-session-sql-server.md) - [Remove the Witness from a Database Mirroring Session (SQL Server)](../../database-engine/database-mirroring/remove-the-witness-from-a-database-mirroring-session-sql-server.md) - [Establish a Database Mirroring Session Using Windows Authentication (SQL Server Management Studio)](../../database-engine/database-mirroring/establish-database-mirroring-session-windows-authentication.md) - [Establish a Database Mirroring Session Using Windows Authentication (Transact-SQL)](../../database-engine/database-mirroring/database-mirroring-establish-session-windows-authentication.md) - [Example: Setting Up Database Mirroring Using Certificates (Transact-SQL)](../../database-engine/database-mirroring/example-setting-up-database-mirroring-using-certificates-transact-sql.md) ## See Also [Database Mirroring (SQL Server)](../../database-engine/database-mirroring/database-mirroring-sql-server.md) [Setting Up Database Mirroring (SQL Server)](../../database-engine/database-mirroring/setting-up-database-mirroring-sql-server.md) [Always On Availability Groups (SQL Server)](../../database-engine/availability-groups/windows/always-on-availability-groups-sql-server.md)