If you are replicating from #1 to #2 then there is no need to query both databases, the data you are trying to access will be in both so just query one of them.
If "NB: the 2 databases can contain different set of data for similar tables." is also true then you only need to query database #2 as all of the data from #1 will have been replicated to #2.
Alternatively, describe these "daily common tasks" you are trying to achieve and you might get better solutions.
However, there are three ways you can access remote databases in MSSQL - all of which are described here
Namely (all links are to Microsoft Docs)
] (From your description I think this is what you are after)
- Linked Servers
] (possibly in conjunction with OPENQUERY