Wednesday, March 21, 2012

Migrate LogShipping Monitor

Hi,
I have a server SRV03 monitoring the logshipping between SRV01(Primary) and
SRV02(Secondary), a need to move this
role (monitoring server) to other server (SRV04).
Is there a way to migrate monitoring server without need to reconstruct the
logshipping's tasks one by one?
Fábio Jr
Analista de Redes, MCSE
BrasilTry the below steps to change the Monitor Server
1. Script the "Log Shipping Alert - Backup" and "Log Shipping Alert -
Restore" jobs from the current monitor server
2. Run the following query on current monitor server and save the output -
select maintenance_plan_id from msdb.dbo.log_shipping_primaries
select secondary_plan_id from msdb.dbo.log_shipping_secondaries
3. Execute the scripts created in Step 1 on the new monitor server
4. Execute the following stored proc on the new monitor server -
sp_add_log_shipping_primary
@.primary_server_name = '<primary server name>' ,
@.primary_database_name = '<primary database name>'
,@.maintenance_plan_id = '<maintenance Plan ID from first select command
in Step 2>'
,@.backup_threshold = <backup threshold - should be at least 3 times the
freq of
backup job the value is in minutes>
,@.threshold_alert = '14420'
,@.threshold_alert_enabled = 1
,@.planned_outage_start_time = 0
,@.planned_outage_end_time = 0
,@.planned_outage_weekday_mask = 0
5. Execute the following select statement to get the Primary_ID -
select primary_id from msdb.dbo.log_shipping_primaries where
primary_server_name = '<primary server name>' and primary_database_name =
'<primary database name>'
6. Execute the following stored procedure on the new monitor server -
sp_add_log_shipping_secondary @.primary_id = <primary id retrieved in Step 5>
, @.secondary_server_name = '<Secondary Server name>'
, @.secondary_database_name = '<secondary database name>'
, @.secondary_plan_id = '<Comes from second select statement in Step 2>'
, @.copy_enabled = 1
, @.load_enabled = 1
, @.out_of_sync_threshold = <out-of-sync threshold should be at least 3
times
the freq of copy/restore jobs the value is in minutes>
, @.threshold_alert = '14421'
, @.threshold_alert_enabled = 1
, @.planned_outage_start_time = 0
, @.planned_outage_end_time = 0
, @.planned_outage_weekday_mask = 0
7. Execute the following statement on the Primary and secondary servers to
get the current monitor login information. Verify that the customer has 1
for logon type before proceeding with step 8. If they do not have this
field set to 1, tell them
that for the time being we will change the authentication mode to NT and
then we can change this later on once the monitor is completely migrated -
select * from msdb.dbo.log_shipping_monitor
go
8. Execute the following command on both Primary and all secondary servers
to change the monitor information -
delete from msdb.dbo.log_shipping_monitor
go
sp_define_log_shipping_monitor '<New monitor server name>', 1, NULL, 1
go
9. This should complete the migration. Test that the monitor server icon
appears under Management tree (Enterprise Manager). When you click this Log
Shipping Monitor, there should be the new pair that you just added. Once
the jobs are working successfully the last copied/loaded file field will be
updated to
reflect the changes.
Hope this helps
Vishal Gandhi
"Fbio Jr" wrote:

> Hi,
> I have a server SRV03 monitoring the logshipping between SRV01(Primary)
and
> SRV02(Secondary), a need to move this
> role (monitoring server) to other server (SRV04).
> Is there a way to migrate monitoring server without need to reconstruct
the
> logshipping's tasks one by one?
> --
> Fbio Jr
> Analista de Redes, MCSE
> Brasil|||Thanks Vishal,
I will try to use this procedure in my test environment and then I will
return the result.
Fábio Jr
Analista de Redes, MCSE
Brasil
"Vishal Gandhi" wrote:

> Try the below steps to change the Monitor Server
> 1. Script the "Log Shipping Alert - Backup" and "Log Shipping Alert -
> Restore" jobs from the current monitor server
> 2. Run the following query on current monitor server and save the output -
> select maintenance_plan_id from msdb.dbo.log_shipping_primaries
> select secondary_plan_id from msdb.dbo.log_shipping_secondaries
> 3. Execute the scripts created in Step 1 on the new monitor server
> 4. Execute the following stored proc on the new monitor server -
> sp_add_log_shipping_primary
> @.primary_server_name = '<primary server name>' ,
> @.primary_database_name = '<primary database name>'
> ,@.maintenance_plan_id = '<maintenance Plan ID from first select comman
d
> in Step 2>'
> ,@.backup_threshold = <backup threshold - should be at least 3 times th
e
> freq of
> backup job the value is in minutes>
> ,@.threshold_alert = '14420'
> ,@.threshold_alert_enabled = 1
> ,@.planned_outage_start_time = 0
> ,@.planned_outage_end_time = 0
> ,@.planned_outage_weekday_mask = 0
> 5. Execute the following select statement to get the Primary_ID -
> select primary_id from msdb.dbo.log_shipping_primaries where
> primary_server_name = '<primary server name>' and primary_database_name =
> '<primary database name>'
> 6. Execute the following stored procedure on the new monitor server -
> sp_add_log_shipping_secondary @.primary_id = <primary id retrieved in Step
5>
> , @.secondary_server_name = '<Secondary Server name>'
> , @.secondary_database_name = '<secondary database name>'
> , @.secondary_plan_id = '<Comes from second select statement in Step 2>
'
> , @.copy_enabled = 1
> , @.load_enabled = 1
> , @.out_of_sync_threshold = <out-of-sync threshold should be at least 3
> times
> the freq of copy/restore jobs the value is in minutes>
> , @.threshold_alert = '14421'
> , @.threshold_alert_enabled = 1
> , @.planned_outage_start_time = 0
> , @.planned_outage_end_time = 0
> , @.planned_outage_weekday_mask = 0
> 7. Execute the following statement on the Primary and secondary servers to
> get the current monitor login information. Verify that the customer has 1
> for logon type before proceeding with step 8. If they do not have this
> field set to 1, tell them
> that for the time being we will change the authentication mode to NT and
> then we can change this later on once the monitor is completely migrated -
> select * from msdb.dbo.log_shipping_monitor
> go
> 8. Execute the following command on both Primary and all secondary servers
> to change the monitor information -
> delete from msdb.dbo.log_shipping_monitor
> go
> sp_define_log_shipping_monitor '<New monitor server name>', 1, NULL, 1
> go
> 9. This should complete the migration. Test that the monitor server icon
> appears under Management tree (Enterprise Manager). When you click this Lo
g
> Shipping Monitor, there should be the new pair that you just added. Once
> the jobs are working successfully the last copied/loaded file field will b
e
> updated to
> reflect the changes.
>
> Hope this helps
> Vishal Gandhi
> "Fábio Jr" wrote:
>
> and
> the
>sql

No comments:

Post a Comment