sql broker route tcp test to same server - sql-server

For testing purposes, I placed two databases on the same server, I want to send queued messages between databases via TCP (not GUID.) Would I still need an endpoint since its all on 1 server? Also do I use tcp://127.0.0.1:PORT or tcp://IP:port?
Lastly is the ReceivingService in the route the service on the target database or the service on the initiating database? Thanks in advance!
CREATE ROUTE Route_to_Target_Database_On_Same_Server
WITH
BROKER_INSTANCE = '111F27B6-1211-10E1-1711-B1D19113121111',
SERVICE_NAME = 'ReceivingService',
ADDRESS = 'TCP://127.0.0.1:2044'
CREATE ENDPOINT BrokerEndpoint
STATE = STARTED
AS TCP ( LISTENER_PORT = 2044 )
FOR SERVICE_BROKER (
ENCRYPTION = DISABLED);

I figured it out. Both work. Just have to becarefull of firewalls/closed ports and permissions are correct on both machines. No need for endpoints if on same server, but if its remote then endpoints are a must (with correct user permissions on both)

Related

Problem connecting with Listener server in High Availability

Recently I set up AG and server X is Primary and Server Y is secondary and Z is listener server. Ag is running fine. If I do RDP to Primary Server I can connect to Listener but Can't connect through Secondary server and from my local SSMS,I can't connect to listener at all.
We have Azure environment and I set up load balancer, Front end ip and health probe.
I checked all configurations are correct or not. There are no firewall issues.
compared with other listeners also.
can someone please help me, what I am missing..
I found the Solution.DNS was not able to communicate with Listener server.So need to run this powershell script and It worked.I am attaching link for reference.
$ClusterNetworkName = "<MyClusterNetworkName>" # the cluster network name (Use Get-ClusterNetwork on Windows Server 2012 of higher to find the name)
$IPResourceName = "<IPResourceName>" # the IP Address resource name
$ListenerILBIP = "<n.n.n.n>" # the IP Address of the Internal Load Balancer (ILB). This is the static IP address for the load balancer you configured in the Azure portal.
[int]$ListenerProbePort = <nnnnn>
Import-Module FailoverClusters
Get-ClusterResource $IPResourceName | Set-ClusterParameter -Multiple #{"Address"="$ListenerILBIP";"ProbePort"=$ListenerProbePort;"SubnetMask"="255.255.255.255";"Network"="$ClusterNetworkName";"EnableDhcp"=0}
enter link description here

SymmetricDS: sync client nodes to each other

I have symmetricDS configured so that there is one master node in the cloud, and then two "store" (client) nodes in remote locations.
If I insert data in the cloud, it is syncd to both clients. If I insert data in a client, it is syncd to the cloud.
However, data added on client1 never makes it to client2 and data added on client2 never makes it to client1...
Any ideas on this?
Thanks
Yes you would want a second set of triggers (maybe prefix each with the name cloud_*) that has an additional flag turned on sym_trigger.sync_on_incoming_batch=1. This will cause changes coming in as part of replication from client 1..n to be captured and resent to all other clients.
This can be more efficient that a client to client group link solution because usually the clients do not all have access over a network to sync to each other. So the change would sync to the cloud and then be redistributed to the other clients.

SQL Server Event Notifications & Service Broker - minimum req'd for multiple servers?

I'm trying to figure out the easiest way to send SQL Server Event Notifications to a separate server using service broker. I've built an endpoint on each server, a queue on each server, working on Dialogs and Contracts and activation... but do I need any of that?
CREATE EVENT NOTIFICATION says it can send the notification XML to a "target service" - so could I just create a contract on the "sending" server that points to a queue on a "receiving server", and use activation there?
Or do I need to have it send to a local queue and then forward on to the receiving server's queue? Thanks!
You can target the remote service, but you have to have the ROUTEs defined for bidirectional communication so that you get the Acknowledgement message back. I once had a script for creating a centralized processing server for all Event Notifications, and the other servers targeted it's service. If I can find it I'll post it on my blog and update this with a link.

Weblogic set JDBC Shared

I'm using Weblogic and I set a JDBC driver to allow a service to get a connection to the db. This DB is also reachable by other clients for other purposes.What I want to do now, it's to make the JDBC connections "SHARED" with the other clients that connect to the database.
I read that the follow syntax let me achieve this:
jdbc:oracle:thin:<USER>/#(PROTOCOL = TCP)(HOST = <HOST>)(PORT = <PORT>)))(CONNECT_DATA = (SID = <SID>) (SERVER = SHARED)))
and would let me have the JDBC connections shared with the others regular connections.
Is it true ?
Where to set such parameters in weblogic ?
I'm currently using the JDBC driver ( SERVICES->JDBC->DATA SOURCES-> connection pool (tab) ) configured in the following manner:
URL:
jdbc:bea:oracle://[dbIP]:1521
Driver Class Name:
weblogic.jdbc.oracle.OracleDriver
Properties:
user=ETL
portNumber=1521
SID=LIVDEV1
serverName=[dbIP]
Thanks
The URL of Oracle should be jdbc:oracle:thin:#[host][:port]:SID.
No need to set these parameters in properties again, but you need to set the user
And for password, WebLogic already provides a standalone field for it. It will be encrypted by WebLogic.
You can reference http://download.oracle.com/docs/cd/E13222_01/wls/docs81/jdbc/programming.html#1053561

Service Broker, endpoint - do i really need a certificate to send message between two servers?

Do I really need to create a certificate to send a queued message between sql servers?
Can I use dbo authentication for the endpoint on both servers?
create endpoint target
state = started
as TCP
(
LISTENER_PORT = 4022
)
FOR SERVICE_BROKER (AUTHENTICATION = CERTIFICATE ????, ENCRYPTION = ENABLED);
IF I have to use a certificate, can I use a User database certificate instead of one on master? How would I go about doing this?
I am not concerned with security at the moment. Both servers are on a closed lan, with no internet access.
Sorry.I do not have profiler. I am using sql express 2005.
CREATE ROUTE RoutetoTarget
WITH
BROKER_INSTANCE = 'xxxxxx-xxx-xx-x-x-x-x',
SERVICE_NAME = 'LOCALReceivingService',
<---that works only in instances on same server. However once I add the target server IP with port number (the endpoint I created on target server) messages get sent into the void. They never make it to the other server.
ADDRESS = 'TCP://targetipadress:PORT'
I figured it out. You need to at least have AUTHORIZATION DBO for both local and remote service, make sure all encryption in endpoint, and sent message is off/disabled, and lastly, DO NOT have a master key. Many online sites say Broker will not work without an encrypted master key, but doesn't seem to be true in this case.
You are not required to use a certificate:
CREATE ENDPOINT ssb_target
STATE = STARTED
AS TCP
(
LISTENER_PORT = 4022
)
FOR SERVICE_BROKER
(
AUTHENTICATION = WINDOWS,
ENCRYPTION = DISABLED
)
GO
More info: link

Resources