Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USE [MMProdat]
- GO
- /****** Object: StoredProcedure [dbo].[activateBroker] Script Date: 09/18/2014 19:41:41 ******/
- SET ANSI_NULLS ON
- GO
- SET QUOTED_IDENTIFIER ON
- GO
- ALTER PROCEDURE [dbo].[activateBroker]
- AS
- Set nocount on
- --Cambio owner DB
- EXEC MMProDat.dbo.sp_changedbowner @loginame = N'sa', @map = false
- EXEC HistoricalData.dbo.sp_changedbowner @loginame = N'sa', @map = false
- --Trusted DB
- ALTER DATABASE MMProdat SET trustworthy On
- ALTER DATABASE HistoricalData SET trustworthy On
- --Habilita Broker
- ALTER DATABASE MMProdat SET ENABLE_BROKER
- --Activa Colas
- --Send Queue State
- IF isNull((Select Convert(int,is_activation_enabled) + Convert(int,is_enqueue_enabled) + Convert(int,is_receive_enabled)
- From sys.service_queues WITH (nolock)
- Where name = 'SsbSendQueueState'),3) < 3
- Begin
- ALTER QUEUE SsbSendQueueState
- WITH STATUS=ON,
- ACTIVATION (
- STATUS = ON,
- PROCEDURE_NAME = SSBActivateSendHistoricalStates,
- MAX_QUEUE_READERS = 1,
- EXECUTE AS OWNER) ;
- End
- --Receive Queue State
- IF isNull((Select Convert(int,is_activation_enabled) + Convert(int,is_enqueue_enabled) + Convert(int,is_receive_enabled)
- From sys.service_queues WITH (nolock)
- Where name = 'SsbReceiveQueueState'),3) < 3
- Begin
- ALTER QUEUE SsbReceiveQueueState
- WITH STATUS=ON,
- ACTIVATION (
- STATUS = ON,
- PROCEDURE_NAME = SSBActivateReceiveHistoricalStates,
- MAX_QUEUE_READERS = 1,
- EXECUTE AS OWNER) ;
- End
- --Send Queue Interaction
- IF isNull((Select Convert(int,is_activation_enabled) + Convert(int,is_enqueue_enabled) + Convert(int,is_receive_enabled)
- From sys.service_queues WITH (nolock)
- Where name = 'SsbSendQueueInteraction'),3) < 3
- Begin
- ALTER QUEUE SsbSendQueueInteraction
- WITH STATUS=ON,
- ACTIVATION (
- STATUS = ON,
- PROCEDURE_NAME = SSBActivateSendHistoricalInteractions,
- MAX_QUEUE_READERS = 1,
- EXECUTE AS OWNER) ;
- End
- --Receive Queue Interaction
- IF isNull((Select Convert(int,is_activation_enabled) + Convert(int,is_enqueue_enabled) + Convert(int,is_receive_enabled)
- From sys.service_queues WITH (nolock)
- Where name = 'SsbReceiveQueueInteraction'),3) < 3
- Begin
- ALTER QUEUE SsbReceiveQueueInteraction
- WITH STATUS=ON,
- ACTIVATION (
- STATUS = ON,
- PROCEDURE_NAME = SSBActivateReceiveHistoricalInteractions,
- MAX_QUEUE_READERS = 1,
- EXECUTE AS OWNER) ;
- End
- --Receive Queue Dialer
- IF isNull((Select Convert(int,is_activation_enabled) + Convert(int,is_enqueue_enabled) + Convert(int,is_receive_enabled)
- From sys.service_queues WITH (nolock)
- Where name = 'SsbReceiveQueueDialer'),3) < 3
- Begin
- ALTER QUEUE SsbReceiveQueueDialer
- WITH STATUS=ON,
- ACTIVATION (
- STATUS = ON,
- PROCEDURE_NAME = SSBActivateReceiveHistoricalDialerInteractions,
- MAX_QUEUE_READERS = 1,
- EXECUTE AS OWNER) ;
- End
- --Receive Queue Supervisor
- IF isNull((Select Convert(int,is_activation_enabled) + Convert(int,is_enqueue_enabled) + Convert(int,is_receive_enabled)
- From sys.service_queues WITH (nolock)
- Where name = 'SsbReceiveQueueSupervisor'),3) < 3
- Begin
- ALTER QUEUE SsbReceiveQueueSupervisor
- WITH STATUS=ON,
- ACTIVATION (
- STATUS = ON,
- PROCEDURE_NAME = SSBActivateReceiveHistoricalSupervisorInteractions,
- MAX_QUEUE_READERS = 1,
- EXECUTE AS OWNER) ;
- End
- --Send Queue Dialer
- IF isNull((Select Convert(int,is_activation_enabled) + Convert(int,is_enqueue_enabled) + Convert(int,is_receive_enabled)
- From sys.service_queues WITH (nolock)
- Where name = 'SsbSendQueueDialer'),3) < 3
- Begin
- ALTER QUEUE SsbSendQueueDialer
- WITH STATUS=ON,
- ACTIVATION (
- STATUS = ON,
- PROCEDURE_NAME = SSBActivateSendHistoricalDialerInteractions,
- MAX_QUEUE_READERS = 1,
- EXECUTE AS OWNER) ;
- End
- --Send Queue Supervisor
- IF isNull((Select Convert(int,is_activation_enabled) + Convert(int,is_enqueue_enabled) + Convert(int,is_receive_enabled)
- From sys.service_queues WITH (nolock)
- Where name = 'SsbSendQueueSupervisor'),3) < 3
- Begin
- ALTER QUEUE SsbSendQueueSupervisor
- WITH STATUS=ON,
- ACTIVATION (
- STATUS = ON,
- PROCEDURE_NAME = SSBActivateSendHistoricalSupervisorInteractions,
- MAX_QUEUE_READERS = 1,
- EXECUTE AS OWNER) ;
- End
- Set nocount off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement