To know the status:
SELECT (SELECT DB_NAME())AS DBName,database_id,mirroring_state_desc,
mirroring_role_desc,mirroring_partner_name,mirroring_partner_instance
FROM sys.database_mirroring
WHERE database_id=20
To break database Mirroring:
-------------Run it on Principal
ALTER DATABASE TestDBMirror SET PARTNER OFF
Now you can database mirroring is broken
To Presume database Mirroring:
Now we should re-establish mirroring between the servers for this database. First, add the partner server on the mirror server. The below SQL code will add the principal server on the mirror server.
--------------to presume we need to run it on mirror
ALTER DATABASE TestDBMirror SET PARTNER ='TCP://USER-PC.LOCAL:5022'
Now add the partner server on the principal. Run the below SQL code to add the mirror server to the principal server to resume mirroring.
----------second now it run on Principal
ALTER DATABASE TestDBMirror SET PARTNER ='TCP://USER-PC.LOCAL:5023'
Now we need to refresh it on GUI as see below
it will resume DATABASE MIRRORING
It’s great to come across a blog every once in a while that isn’t the same out of date rehashed material. Fantastic read.
ReplyDeleteData science Course Training in Chennai |Best Data Science Training Institute in Chennai
RPA Course Training in Chennai |Best RPA Training Institute in Chennai
AWS Course Training in Chennai |Best AWS Training Institute in Chennai
Appreciating the persistence you put into your blog and detailed information you provide.
ReplyDeleteCss training in chennai | Css course in chennai
blue prism training in chennai| Blue prism training course in chennai