Removing database mirroring

When you try to recover and open mirrored database using dbcc dbrecover([DBNAME])

You would get below error

{

Msg 7930, Level 20, State 1, Line 1

Mirroring must be removed from the database for this DBCC command.

}

When you try to recover and open the database using “restore database [DBNAME] with recovery”

{

Msg 3104, Level 16, State 1, Line 1

RESTORE cannot operate on database dbname because it is configured for database mirroring. Use ALTER DATABASE to remove mirroring if you intend to restore the database.

Msg 3013, Level 16, State 1, Line 1

RESTORE DATABASE is terminating abnormally.

}

When you try to drop the database

Msg 3743, Level 16, State 1, Line 1

The database ‘dbname’ is enabled for database mirroring. Database mirroring must be removed before you drop the database.

Resolution

1 . ALTER DATABASE [databasename] SET partner OFF

Note: Above command will remove the mirroring .

2. restore database [databasename] with recovery

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s