Agent Jobs

Automatically Failover All Database Mirrors With A Single Job (08 of 10)

JOB:  DATABASE MIRRORS – FAILOVER ALL MIRRORED DATABASES

Automatically Failover All Database Mirrors With A Single Job_08

STEP 8:  SET HIGH PERFORMANCE

Step logic:

 

use master;
set nocount on

declare
	@set_full_safety_off_on_mirror_databases	varchar(max) = ''
select
	@set_full_safety_off_on_mirror_databases	= @set_full_safety_off_on_mirror_databases 	+ 
	'alter database [' + cast(DB_NAME(database_id) as varchar(255)) + '] set safety off;'		+ char(10)
from
	sys.database_mirroring
where
	mirroring_guid is not null
	and mirroring_role_desc = 'PRINCIPAL'

exec (@set_full_safety_off_on_mirror_databases)
Advertisements

1 reply »

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