Quantcast
Channel: SQL Service Broker forum
Viewing all 461 articles
Browse latest View live

An entity of type service cannot be owned by a role, a group, or by principals mapped to certificates or asymmetric keys.

$
0
0

I'm using SQL Server 2008 R2 and a WCF service in Visual Studio 2010. I am trying to set up a SQL Dependency to detect changes in the database, and I have set up a queue and service. I keep getting the above error when running the service, though. 

I already have the service set to AUTHORIZATION [dbo], and I have tried logging in as a regular user (I usually log in as dbo) but so far nothing has worked. 

I have looked around a lot and have not been able to find anything helpful. Any help would be much appreciated!


Replictaing data to multiple instance

$
0
0

Hi everyone,

I have two below questions regarding service broker, I would appreciate if someone help me on those.

1- Is it possible to replicate data from one sql instance to multiple(two- three) SQL instances using service broker? Or in Service broker there is only two instances involved?

2-Is there any performance(speed) consideration using service broker to replicate data ?

Thanks


A.G

The target service name could not be found. Server version compatibility problem?

$
0
0

Hi,

I have two remote SQL Servers. One initiator another one is target. 

Now I need to move target to new server and new database just with SAME database name.

I have recreated all SB objects on new target machine, but once I start conversation with new target I get:

The target service name could not be found.

If I alter Route back to old server all works fine again.

I am sure target names match on old and new targets, all config looks the same between servers. 

The only difference is between server - old target is SQL 2016 and new target is SQL 2017.

Could this cause this issue?

Any other ideas how to detect the problem if version compatibility should not cause the issue?

We user certificate authentication

Many thanks

Service Broker and Service Broker and is_trustworthy_on

$
0
0

I use the Service Broker to execute a stored procedure asynchronously simultaneously, using such a queue:

CREATE QUEUE MyQueue WITH STATUS=ON , RETENTION=Off , ACTIVATION (STATUS=ON, PROCEDURE_NAME=MyProcedure, MAX_QUEUE_READERS=3, EXECUTE AS Self);

When I insert a new item into the queue (using a Dialog/Conversation), the stored procedure is not initiated unless the database is_trustworthy_on definition is set to on (=1).

There are some risks in changing the is_trustworthy_on definition from its default value (Off=0) to On,
and I wonder if there is a way to avoid it.

Thanks in advance.


El castellano no es mi lengua materna. Discúlpenme por los errores gramaticales, y, si pueden, corríjanme en los comentarios, o por correo electrónico. ¡Muchas gracias! Blog: http://about.me/GeriReshef

SQL

$
0
0
My personnel computer is locked out after 2 minutes  The people say I must buy a card for 200 or more dollars. What can I do about this??

Service broker with multi-subnet

$
0
0

We have a sql server multi-subnet environment with Always On availability groups as our high availability solution. And we'd like to use Service Broker over it. Do you see any issues with this configuration and will this be a supported configuration? Or any advice on alternative options will be useful.


Service broker doing stuff when I don't want it to

$
0
0

Hello, 

I have recently implemented a Service Broker solution for asynchronous triggers. It seems to work well, but I have a question. 

We have "main" database and a "demo" database. The two databases are exactly the same in schema/object definitions, but the main database has "real" data and the demo database just has demonstration data for training and evaluation purposes.

Only the main database needs Service Broker. The functionality that we have implemented is not applicable to the demo, so Service Broker is disabled in the demo database. 

When one of the triggers is trigger in the demo database, I would have expected nothing to happen, since SB is disabled. However, rows are being added to the sys.conversation_endpoints and sys.transmission_queue tables. The "transmission_status" states that "The broker is disabled in the sender's database" -- that's expected because it's true. And the state is "CONVERSING" -- this makes me a little nervous as it seems like open conversations are building up. 

Should I be concerned about this? Should I empty out these tables so they don't build up? Should I try to explicitly end these conversations? And lastly, why is Service Broker still "doing stuff" while it is disabled?

Thanks for any help you can provide.

Single message stuck in transmission queue

$
0
0

I have single message that will not send in a transmission queue. All other messages of that type work fine. Only error I see is 

Connection attempt failed with error: '10060(A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)'.

But I am not sure that is related.


How should I encrypt/decrypt a TCP/IP data stream ?

$
0
0

I am working on a project which will provide a TCP/IP data stream which will be encrypted on arrival in SQL Server.

What would be a good way to decrypt the data stream in SQL Server ? I believe I could do it in C# or C++ with

ADO.net. The question is, is there a better way to do this in SQL Server ?

Randy


Randy Seedle

Is service broker a good option?

$
0
0

Hi,

I am developing a solution where an external app (.net based) at different client locations would upload CSV files in a queue and SQL server would then pick those files (from all different client) and then process them one by one.

I am new to Service Broker, and was wondering if its worth spending time looking into Service Broker to achieve the goal. 

My main question is, is it possible to queue files in the service broker? if not, can someone please suggest a better solution.

Thanks

FS

Service brocker master key error after db refresh

$
0
0

Error details

Please create a master key in the database or open the master key in the session before performing this operation.

The session keys for this conversation could not be created or accessed. The database master key is required for this operation. Error

$
0
0

Hi,

I'm getting the following error In sys.transmission_queue in the transmission_status column "The session keys for this conversation could not be created or accessed. The database master key"

I'm using only one Server to Send Messages but I thought you only need the master key if there are two or more Servers used in the Messaging?

Thanks in advance 


Trying to follow a SQL Service Broker Step By Step configuration, what am I missing?

$
0
0

I've never used SSB before and is looking to implement this due to an issue we recently had with long running queries executing from a trigger.

I'm following the guide below. Looks OK when I run each code and I'm kind of following what is happening.

https://sqlperformance.com/2014/03/sql-performance/configuring-service-broker

Anyway, I wanted to test an email notification. So on the [ProcessingQueueActivation] SPROC, I inserted the lines below (send mail part):

IF @message_type_name = N'AsyncRequest' BEGIN -- Handle complex long processing here -- For demonstration we'll pull the account number and send a reply back only DECLARE @AccountNumber INT = @message_body.value('(AsyncRequest/AccountNumber)[1]', 'INT');

-- ADDED PART START

EXEC msdb.dbo.sp_send_dbmail @profile_name = 'MYPRODILE', @recipients = 'myname@mycompany.org', @subject = 'BROKER TEST', @body = @AccountNumber; -- ADDED PART END -- Build reply message and send back DECLARE @reply_message_body XML = N' ' + CAST(@AccountNumber AS NVARCHAR(11)) + ' ';

I tested it and I got the email when I run the script below.

EXECUTE dbo.SendBrokerMessage
  @FromService = N'RequestService',
  @ToService   = N'ProcessingService',
  @Contract    = N'AsyncContract',
  @MessageType = N'AsyncRequest',
  @MessageBody = N'<AsyncRequest><AccountNumber>04</AccountNumber></AsyncRequest>';
 EXECUTE dbo.ProcessingQueueActivation;
 EXECUTE dbo.RequestQueueActivation;

However, when I turn on the AUTOMATE PROCESS (below), I don't get any email at all. I don't see any records on the [ProcessingQueue] and [RequestQueue] so I'm assuming it got processed.

-- Alter the processing queue to specify internal activation
ALTER QUEUE ProcessingQueue
    WITH ACTIVATION
    ( 
      STATUS = ON,
      PROCEDURE_NAME = dbo.ProcessingQueueActivation,
      MAX_QUEUE_READERS = 10,
      EXECUTE AS SELF
    );
GO
-- Alter the request queue to specify internal activation
ALTER QUEUE RequestQueue
    WITH ACTIVATION
    ( 
      STATUS = ON,
      PROCEDURE_NAME = dbo.RequestQueueActivation,
      MAX_QUEUE_READERS = 10,
      EXECUTE AS SELF
    );
GO

Any ideas?

TIA

Service Broker

$
0
0

I just migrated SQL Server 2008 R2 to SQL Server 2017 Standard edition to a different server. I migrated User databases only, not the system databases. Since the migration, I have been getting the following error:

"Service Broker needs to access the master key in the database 'dbname'. Error code:32. The master key has to exist and the service master key encryption is required."

Googling around, I found two potential solutions:

1. Turn the database property TRUSTWORTH ON
2. Create a new Master Key.

I do have the master key in the database. Following is the detail using the SQL script
SELECT * FROM master.sys.symmetric_keys

database: master
name: ##MS_ServiceMasterKey##
principal_id: 1
symmetric_key_id: 102
key_length: 256
key_algorithm: A3

database: dbname
name: ##MS_ServiceMasterKey##
principal_id: 1
symmetric_key_id: 101
key_length: 128
key_algorithm: D3

I do not want to turn on the TRUSTWORTHY as it might have security impact.
How do I resolve this issue? Should I create a new master key for each database affected by this issue? Will it break anything? To create a new master key, do I need the password for the old master key? If I create symmetric master key in database, will it synchronize with master key already in master database?

Or should I just overwrite the master database with the master database from old server?

I really hope someone will shed light on this and provide me the least disruptive solution.

Thank You.


Random mail lost with Database mail and non-Microsoft SMTP servers

$
0
0

The following facts was tested and reproduced on 3 completely different environments and with SQL 2005, 2008, 2008R2, 2012 and 2016.


  • When DB mail send email to Postfix(2.10.1 and 3.1.2) SMTP servers report several  errors  “lost connection after CONNECT” and a percentage of them will result in email lost.
  • When DB mail send email to a non-Microsoft email relay software(http://emailrelay.sourceforge.net/) installed on a Windows server will report events ID 1002 “winsock select error: 10053“.
  • A packet capture shows a specific behavior from DBmail that didn’t exist with other systems . DBmail initiate one or multiple  TCP connections depending of the number of mail to send then in a matter of micro or millisecond forsome of those TCP connections, it send a FIN/ACK  then a RST/ACK, which is interpreted as a lost connection from Postfix and the majority of SMTP daemons.  Those TCP connections  that didn’t have a FIN/ACK complete normally. 
  • When DBMail is talking to a Microsoft SMTP, it begins the same way including the FIN/ACK for some of the TCP connections but the SMTP conversation will continue under a different TCP source port and are followed by the sequence number. So Microsoft SMTP do not drop the whole SMTP connection when the initial TCP connection is dropped.
  • So for some SMTP conversation, the source port changes during the conversation usually just after the 220 Welcome message which cause a lost connection for the majority of the SMTP services.
  • SQL Database mail didn’t see any errors even when mails are lost.

I was always on the assumption that the SMTP protocol is a single TCP connection by design as described in RFC 821.

Right now the only work around we found was to configured DBmail to send emails to an IIS SMTP service which relay to our main Postfix server. We would like to get rid of the middle man if possible.

Can the EXE behind DBmail (Databasemail.exe) be replaced by something else more standard in term of SMTP conversation ?


Any help or suggestion are welcome?


SCCM service broker

$
0
0

Primary site server and the replica of the primary site server are connected via AlwaysON.

AlwaysOn works fine. Failover , Failback everything is fine.

Once after alwaysON is enabled, getting the bellow message in SQL error log.

Message
Service Broker login attempt failed with error: 'A previously existing connection with the same peer was detected during connection handshake. This connection lost the arbitration and it will be closed. All traffic will be redirected to the previously existing connection. This is an informational message only. No user action is required. State 80.'.  [CLIENT: 10.168.45.140]

Can anyone please let me know what this message means? as the SCCM team is not ready to move forward without resolving this error.

Many thanks for all your help in advance.

Performance Impact

$
0
0

Hi,

I'm would like to understand from all the folks using SQL Service Broker  if there is any sort of degraded performance on their server due to enabling of this internal message broker mechanism?

The server in production is already seeing performance issues, and we want to introduce a business use case to capture data change on certain tables asyncronously. 

However, an argument has come up that enabling SSSB and having SQL now perform additional mechanism of all that it goes into creation of queues, services and all other SQL broker objects, followed up by the execution may worsen the performance when pressure tested.

Would like to hear your experience if any.

Thankyou!

Service Broker- Similar to Trigger

$
0
0

Hi Guys,

We are new to service broker, we want to enable service broker on our server; we have lot of triggers in the SQL server which we want to get rid of  and go service broker route.

We have below table format

OrderID    OrderQty CreatedDate    OrderAmount  OrderTotalAmount      CreatedDateGMT           

1                  2          05-11-2012            4                   8                          GMTDate

Our trigger populates OrderTotalmount and GMT dates; now we want to achieve same using service broker; is it possible, if so can you provide sample or link etc.

Regards,

Navin


Navin.D http://dnavin.wordpress.com

SQL Service Not Found in Services

$
0
0
hello everyone, i want ask about service sql server (SSMS) in services windows. I already installed ssms 19 but always can't login. After that, i search in services.msc in windows and my ssms service is not found. Only SQL Server VSS Writer found in my services and no one others services about sql founded in my services. How can i add ssms service in my services.msc? Thank you 

Service broker manager has been started.

$
0
0

I inherited a SQL 2014 environment, and I see this in the log

Service broker manager has been started.”.

I also see broker enabled on tempdb and msdb. For security reasons, I would like to disable on both of these system databases.

How can I verify if there is any communication happening on these 2 databases, are there any system tables to query or where it get logged?

AFAIK these 2 dbs have service broker enabled in SQL , do you have experience if any issue in disabling?

Thank you,

Viewing all 461 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>