Heterogenous Replication Linked Server Error - replication

TITLE: Microsoft SQL Server Management Studio
The test connection to the linked server failed.
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
Server 'repl_distributor' is not configured for DATA ACCESS. (Microsoft SQL Server, Error: 7411)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.00.5500&EvtSrc=MSSQLServer&EvtID=7411&LinkId=20476
Facing this error while testing replication linked servers.
Tried following solutions also but they did not work.
1.exec sp_serveroption 'ORATEST', 'data access', 'true'
2.Properties set to these values (RPC:true , RPC Out:true)
So kindly let me know if there is any way to resolve this issue.

Related

How to use transaction in Linked server

I have a stored procedure which will do the DML operation from SQL query to Oracle DB and unable to use transaction in the Linked server and without the transaction, stored procedure is working as expected.
Server option to “Enable promotion of Distributed Transaction” has already been set to False.
DTC Configuration:
Providers: OraOLEDB.Oracle
Error message:
OLE DB provider "OraOLEDB.Oracle" for linked server "LinkedServer" returned message "Unable to enlist in the transaction.".
The operation could not be performed because OLE DB provider "OraOLEDB.Oracle" for linked server "LinkedServer" was unable to begin a distributed transaction.
All the properties/settings in Linked Server and DTC are followed but still getting the same error. Kindly help here.

SQL Server Agent Connection showing wrong Server

I have inherited another SQL database (Version 15.0.4083.2) and have noted some problems with the SQL Agent. Specifically the Agent is not logging any jobs (as I just discovered trying to check logs to debug an issue). I am seeing the following errors in the agent logs:
[298] SQLServer Error: 53, Named Pipes Provider: Could not open a connection to SQL Server [53]. [SQLSTATE 08001]
[165] ODBC Error: 0, Login timeout expired [SQLSTATE HYT00]
[298] SQLServer Error: 53, A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [SQLSTATE 08001]
[382] Logon to server 'NotMyClient' failed (ConnLogJobHistory)
(Server name substituted)
This is saying to me that the agent is trying to attach to an incorrect servername/instance. I have then checked the agent properties, i.e. right click on agent, and under Connection it also lists 'NotMyClient'
However when I click on View connection properties the correct IP and computer name.
I have looked at several options for correcting this, but the majoity of answers seem to basically consist of wiping the database, not an option in this case. Also seen a suggestion that the instance name is incorrect, but can see no way of changing the instance name on the server agent.
Any suggestions are greatly appreciated.

Access another SQL Server through stored procedure

I want to access another SQL Server to import and update data of that server's database through a stored procedure.
For that I created linked server using sp_addlinkedserver.
EXEC sp_addlinkedserver
#server = N'LINKEDSERVER'
,#srvproduct=N''
,#provider=N'SQLOLEDB'
,#datasrc=N'[DB-Instance.cuprxxxlj.ap-xxxxxxx-x.rds.amazonaws.com]';
Then try to access by SQL query
SELECT *
FROM [LINKEDSERVER].[DATABASE].[dbo].[TABLE]
And getting errors like
OLE DB provider "SQLNCLI11" for linked server "LINKEDSERVER" returned message "Login timeout expired".
OLE DB provider "SQLNCLI11" for linked server "LINKEDSERVER" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".
Msg 53, Level 16, State 1, Line 0
Named Pipes Provider: Could not open a connection to SQL Server [53].
I had created database instance on amazon server and another is also on the amazon server and both are publicly accessible but don't know why I'm getting Server is not found or not accessible. Am I missing any server site setting or something else?
Please guide me if I am going in wrong direction.
I found the answer. The problem was an instance, I had created "Amazon RDS for SQL Server" which is currently not supporting to "Linked servers".
So I create a new AWS EC2 instance for Windows Server 2012 R2 and then I create Linked servers in it and tried to assess remotely. Now its working fine as I wanted.
Here is detailed document to Running SQL Server Linked Servers on AWS
Thanks.
Maybe try changing the timeout settings?
sp_configure 'remote query timeout', 0
go
reconfigure with override
go
This article explains in detail how to link one AWS Sql Server to another (https://aws.amazon.com/blogs/apn/running-sql-server-linked-servers-on-aws/). I am not certain what is wrong in your case, but this has a lot of steps that I do not see in your description.
And the one thing that does jump out at me is that you haven't configured any login security/access control. So unless the target server is open to the world, I would guess that you have to add that as a minimum.

Creating a Link Server From SQL 2005 to Azure

I have a SQL Server 2005. I am trying to create a linked server to Azure SQL.
I set it up and tested the connection says it succeeded. However running any queries against it yields this
Enumerate columns failed for LinkedServer 'EBPCLOUD'. (Microsoft.SqlServer.Smo)
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
Cannot obtain the schema rowset "DBSCHEMA_COLUMNS" for OLE DB provider "SQL Server" for linked server "(null)". The provider supports the interface, but returns a failure code when it is used. (Microsoft SQL Server, Error: 7311)
The exact same queries work on a different box, albeit with a newer version of SQL Server.
SQL Server 2005 will not connect to Azure, 2008 R2 or higher required.

SQL Agent Job failing

I have a BizTalk Server that has been configured per the instructions for BizTalk disaster recovery using the BizTalk Log Shipping implementation.
On the backup SQL Server, call it SQL02, the "Get Backup History" job fails constantly with the following error:
Executed as user: DOMAIN\User. SQL
Server Network Interfaces: Error
getting enabled protocols list from
registry [xFFFFFFFF]. [SQLSTATE 42000]
(Error 65535) OLE DB provider
"SQLNCLI10" for linked server "SQL01"
returned message "Login timeout
expired". [SQLSTATE 01000] (Error
7412) OLE DB provider "SQLNCLI10" for
linked server "SQL01" returned message
"A network-related or
instance-specific error has occurred
while establishing a connection to SQL
Server. Server is not found or not
accessible. Check if instance name is
correct and if SQL Server is
configured to allow remote
connections. For more information see
SQL Server Books Online.". [SQLSTATE
01000] (Error 7412). The step failed.
This job executes a local stored procedure, which basically executes another stored procedure on a linked server, called SQL01.
When i execute this stored procedure in a query window on SQL02:
EXEC [SQL01].[BizTalkMgmtDb_Prod].[dbo].[sp_GetBackupHistory]
it executes without any errors.
When the SQL agent job attempts to execute the same query it fails with the error above.
Why can i execute the procedure manually and the sql agent job cannot?
I had this same problem and solved it by making sure the job runs against a database to which the job owner has access.
check the sql agent and sql instance users it should have the rights and the users should be common for every instance or must have all the required rights.
In query you connect through a user which has the rights but the sql agent user does not have it (as per my understanding).
check your sql server configuration manager for checking users for services of sql server.