Is it possible to connect to a database of another gateway and be able to query from that?

Hello everyone,

I have two gateways and one of them is connected to an SQL server database and my question is, is it possible to connect that database to the 2nd gateway? I do not have access to the SQL server itself so I cannot directly make a connection to the database from the 2nd gateway and the connection should be indirect. I want to be able to query for that database from the 2nd gateway.

Thank you!

You have to link the gateways (make an connection from each one). You also have to setup permissions for the new server to run sql commands on the other gateway,

https://docs.inductiveautomation.com/display/DOC81/Gateway+Network
https://inductiveuniversity.com/videos/remote-history-provider/8.1

1 Like

I actually tested and it worked! Thank you very much!!! However, this is not quite what I want.
Do you know if it is possible to have that database as a database on the 2nd gateway? Not as a remote tag history provider?
@jgooding
I have the database running on the 2nd gateway as a remote history provider, but the information that I am getting from the database is not similar to what I have on the 1st gateway. I do not see the schema that I had anymore. I want to be able to query for that database from the 2nd gateway.

1 Like

I too what that method of accessing remote database of gateway b through gateway network without configuring separately on gateway a

No, not possible. The best you can do is include a message handler on the gateway that actually has the database that will run named queries on behalf of other gateways, returning the results.

2 Likes

Hi Phil,

This seems to contradict the documentation for a remote tag provider's history access mode settings:

"This setting dictates how tag history is queried for remote tags. Normally requests are sent through the gateway network, but if access to the historian database is available, you can choose to query that directly."

This seems to suggest that if we configure a secondary gateway with an identical database connection, we should be able to use it to query data directly from that server.

I may be misunderstanding something but this is something I'm interested in doing myself.

Neither the original nor the most recent question were about remote tag providers. They were about directly querying a database connection (not tag history) in a remote gateway.

Remote tag provides can divert historian queries to a local database connection if that local connection contains the desired data, omitting the GAN round trip. Totally different thing.

Thanks for the clarification, you're right. I see the OP's original question was about making SQL queries directly, not about accessing data using remote tag providers.