Home > AlwaysOn 2012 > Configure Always On and Availability group Part 3

Configure Always On and Availability group Part 3

Add Secondary Replica

 

--- YOU MUST EXECUTE THE FOLLOWING SCRIPT IN SQLCMD MODE. :Connect SQL03\GOSGPRDSQL02 use [master] GO GRANT CONNECT ON ENDPOINT::[Mirroring_Endpoint] TO [DBPROX\administrator] GO :Connect SQL02\GOSGPRDSQL01 IF (SELECT state FROM sys.endpoints WHERE name = N'Mirroring_Endpoint') <> 0 BEGIN ALTER ENDPOINT [Mirroring_Endpoint] STATE = STARTED END GO use [master] GO GRANT CONNECT ON ENDPOINT::[Mirroring_Endpoint] TO [DBPROX\administrator] GO :Connect SQL02\GOSGPRDSQL01 IF EXISTS(SELECT * FROM sys.server_event_sessions WHERE name='AlwaysOn_health') BEGIN ALTER EVENT SESSION [AlwaysOn_health] ON SERVER WITH (STARTUP_STATE=ON); END IF NOT EXISTS(SELECT * FROM sys.dm_xe_sessions WHERE name='AlwaysOn_health') BEGIN ALTER EVENT SESSION [AlwaysOn_health] ON SERVER STATE=START; END GO :Connect SQL03\GOSGPRDSQL02 USE [master] GO ALTER AVAILABILITY GROUP [GLBAGSQL0203] ADD REPLICA ON N'SQL02\GOSGPRDSQL01' WITH (ENDPOINT_URL = N'TCP://SQL02.dbprox.local:5022', FAILOVER_MODE = MANUAL, AVAILABILITY_MODE = ASYNCHRONOUS_COMMIT, BACKUP_PRIORITY = 50, SECONDARY_ROLE(ALLOW_CONNECTIONS = NO)); GO :Connect SQL02\GOSGPRDSQL01 ALTER AVAILABILITY GROUP [GLBAGSQL0203] JOIN; GO

Categories: AlwaysOn 2012
  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: