Linked Server from SQL 2008 to Connect to 2012 read only replica never works

I have two Production Database Servers
1. SQLServer2008 (2 Nodes Cluster)
2. SQLServer2012 with 2 read only replica (3 Nodes Cluster)
I would like to draw a line here, We have routing table and URL working perfectly fine. 
We have tested LINKED Server from 2012 Box to production Server by Specifying APPLICATIONINTENT = ReadOnly; it works perfectly fine, the routing is being used.
When we create linked server from SQL Server 2008 Box (Please note we have installed SQL Server 2012 Client tools on this box and Restarted the Servers) using the below script
USE [master]
EXEC master.dbo.sp_dropserver @server=N'AGL1', @droplogins='droplogins'
GO
EXEC master.dbo.sp_addlinkedserver @server = N'AGL1'
,@datasrc='AGL1'
,@provider='SQLNCLI11'
,@provstr='ApplicationIntent=ReadOnly;Database=AdventureWorks2012'
Linked Server is created, Now when I run the Query 
exec ('select @@servername') at AGL1
It always brings the Primary READ/WRITE node name only, after lots of research I found that, this linked Server is always using SQL Native Client 10.0 only, even after creating Linked Server using SNC 11, That is the reason it is not going to routing
table. Its always connecting to Primary node.
Below is the way I found it, on 2012 Production Server I executed below Query
SELECT session_id, protocol_type, driver_version = 
CASE SUBSTRING(CAST(protocol_version AS BINARY(4)), 1,1)
WHEN 0x70 THEN 'SQL Server 7.0'
WHEN 0x71 THEN 'SQL Server 2000'
WHEN 0x72 THEN 'SQL Server 2005'
WHEN 0x73 THEN 'SQL Server 2008'
ELSE 'SQL Server 2012' 
END,client_net_address ,client_tcp_port,local_tcp_port ,T.text
FROM sys.dm_exec_connections
CROSS APPLY sys.dm_exec_sql_text(most_recent_sql_handle) AS T
The help is taken from msdn (Link Provided below) for the above Query
https://msdn.microsoft.com/en-us/library/dd339982.aspx
and I found it always uses SQL Server 2008 SNC.
My Question is, is there a way to force SQL Server to use SQL Server Native Client 11.
Has anyone tried this setup?
Thank you in advance.

Unfortunately no, there is no other way of forcing it without restart. The SQL Server stack has no idea of the existing Native Client as it booted prior its installation. And you cannot force "DLL reload" without proper service restart. 
Ivan Donev MCT and MCSE Data Platform

Similar Messages

  • SCCM 2012 moving site Database server from SQL 2008 R2 cluster to 2012 cluster

    Hello,<o:p></o:p>
    Using the SCCM 2012 setup, I get
    the following errors and then it eventually fails……I’ve been uninstalled and
    installed SQL native client .....still unable to move SQL database,i get this error:<o:p></o:p>
    *** Failed to connect to the SQL Server, connection type: SMS ACCESS. Configuration Manager Setup 25/02/2015 21:01:03 8624 (0x21B0)
    INFO: SQL Connection failed. Connection: SMS ACCESS, Type: Secure Configuration Manager Setup 25/02/2015 21:01:03 8624 (0x21B0)
    *** [08001][-2146893019][Microsoft][SQL Server Native Client 11.0]SSL Provider: The certificate chain was issued by an authority that is not trusted. Configuration Manager Setup 25/02/2015 21:01:07 8624 (0x21B0)
    *** [08001][-2146893019][Microsoft][SQL Server Native Client 11.0]Client unable to establish connection Configuration Manager Setup 25/02/2015 21:01:07 8624 (0x21B0)
    I know that the problem is related to a certificat issue but i didn't arrived to resolve it.

    Have a look at this post (pay special attention to the comments):
    http://blogs.technet.com/b/configurationmgr/archive/2013/04/02/how-to-move-the-configmgr-2012-site-database-to-a-new-sql-server.aspx
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • Have trouble query after creating a linked server from SQL Server 2008 to EXCEL 2007

    I created a linked server from SQL Server 2008 Management Studio Express to an EXCEL 2007 workbook using:
    sp_addlinkedserver @server='LSERVER_EX0', @srvproduct='EXCELDATA', @provider='Microsoft.ACE.OLEDB.12.0', @datasrc='C:\Temp\abc.xlsx', @provstr='EXCEL 12.0'
    The linked server LSERVER_EX0 was created, but I cannot see any table(excel sheet), and when i ran the following to query tables,
    sp_tables_ex 'LSERVER_EX0'
    I got:Cannot obtain the schema rowset "DBSCHEMA_TABLES" for OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "LSERVER_EX0". The provider supports the interface, but returns a failure code when it is used.
    Any hint why?
    on another note, i was able to import the EXCEL sheets using the Import and Export Data wizard, but i cannot control the column data type and size in this way.

    Open management studio, goto "Server Objects"->"Linked Servers"->Providers, select the provider you use, right click it and in provider options, check "Allow inprocess".

  • How to create a Linked Server from SQL Server 2012 to Postgresql

    Hi, I am working on a third party application which is using Postgresql version 9 database and I am trying create a linked server in SQL Server 2012 using the below stored procedure.
    EXEC master.dbo.sp_addlinkedserver @server = N'LINKEDSERVERPOSTGRES', @srvproduct=N'PostgreSQL',
    @provider=N'MSDASQL', @provstr=N'Driver=PostgreSQL;uid=pguser;Server=pghost;database=pgdatabase;pwd=somepassword'
    Error: Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server.
    I have no clue if a jdbc provider exists in SQL Server to connect to Postgresql or what the right provider is? Could you please let me know if there's a workaround to achieve this.
    Thanks in advance............
    Ione

    See if this helps
    http://www.postgresonline.com/journal/archives/46-Setting-up-PostgreSQL-as-a-Linked-Server-in-Microsoft-SQL-Server-64-bit.html
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Trying to use Linked Servers in SQL 2005 to connect to RDB 7

    I'm looking for detailed info on how to set up a linked server in SQL 2005 to connect to my Oracle RDB 7 database (running on VMS). I'm able to connect via odbc using VS.Net and Sql Server 2005 Reporting Services. I'm not sure if I need to use the ODP.NET or not. I have created a generic linked server, but it requires me to use the OpenQuery function to access the data, which is not giving me the functionality I'm looking for.

    Hi doanpq,
    Please download and install OLE DB Provider for Visual FoxPro 9.0, which exposes OLE DB interfaces that you can use to access Visual FoxPro databases and tables from other programming languages and applications. Please see:
    http://www.microsoft.com/en-us/download/details.aspx?id=14839
    Then, please follow up the following article to create a linked server:
    Creating Linked Servers:
    http://technet.microsoft.com/en-us/library/ff772782(v=sql.105).aspx
    For more information, you can also take a look at the following article, especially Dave K's comment:
    http://blog.dbase.integralwebsolutions.co.za/2008/10/accessing-your-dbf-tables-via-linked.html
    Elvis Long
    TechNet Community Support

  • Cannot kill a session that is running a query on a linked server in SQL Server 2008 R2

    Hi,
    Cannot kill a session that is running a query on a linked server  in SQL Server 2008 R2.
    When I try to kill, it status shown as "KILLED/ROLLBACK"
    I have facing the issue from long back. I searched many and none of them worked for me
    Any help is greatly appreciated
    Thanks
    Jaison
    Carver

    I guess its stuck, can you see some blocking or any other process blocking the rollback.
    can you check rollback status using below command. Or you can use sp_who2 and check status column
    select percent_complete,estimated_completion_time from sys.dm_exec_requests
    where spid=xxx
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • Connecting Oracle 9i as a linked server of SQL Server 2000

    I have a problem inserting String values into Oracle 9i as a linked server or SQL Server 2000.
    When I run the following in SQL Analyzer:
    insert into ORACLEOLE..ADMIN.FM_SQL values('asdf','qwer');
    The result msg is:
    Server: Msg 7356, Level 16, State 1, Line 1
    OLE DB provider 'OraOLEDB.Oracle' supplied inconsistent metadata for a column. Metadata information was changed at execution time.
    OLE DB error trace [Non-interface error:  Column 'FM_ID' (compile-time ordinal 1) of object '"ADMIN"."FM_SQL"' was reported to have a DBTYPE of 129 at compile time and 130 at run time].
    Is this a problem that the Charaterset of Oracle 9i being 'ALU32UTF8' ?
    I have tried changing the field's type to varchar2, char, nvarchar2 and nchar...and they didn't work.
    However, when the field type is a number(10) and I insert to the table integer values, the sql works fine.
    so..any data mapping need to be done explicitly?
    Thanks in advance.

    Based on my reading of the ANSI SQL-92 standards, table names are supposed to be in upper case.
    "of course, any lower case letters appearing in a <regular identifier> will have been converted to the corresponding upper case letter before the <identifier> is stored in any table of the Information Schema"
    http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt
    Given that table names are supposed to be in upper case and they are in fact in upper case, why don't you just ask for them in upper case in the first place?

  • Linking Tables in SQL 2008

    I am running SQL server 2008 and want to link to a table in Access 2007. I have read many articles but most say to import from Access into SQL. Importing the table will not serve my needs as the data will not be dynamic. Is it possible to link to an Access
    table from SQL?
    Bruce

    You can create a linked server in SQL Server to connect to Access and query the table in Access
    http://msdn.microsoft.com/en-us/library/ff772782(v=sql.105).aspx
    YOu need to use the OLE DB provider for Jet inorder for Access.
    http://msdn.microsoft.com/en-us/library/ms175866(v=sql.105).aspx
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • How to create linked server in sql 2005 to access free table visual foxpro 9 step by step

    Hi All, I want to connect to dbf file visual foxpro by using linked server in sql 2005, but i can't do, i hope getting best anwser from every body in forum.
    Thanks all.

    Hi doanpq,
    Please download and install OLE DB Provider for Visual FoxPro 9.0, which exposes OLE DB interfaces that you can use to access Visual FoxPro databases and tables from other programming languages and applications. Please see:
    http://www.microsoft.com/en-us/download/details.aspx?id=14839
    Then, please follow up the following article to create a linked server:
    Creating Linked Servers:
    http://technet.microsoft.com/en-us/library/ff772782(v=sql.105).aspx
    For more information, you can also take a look at the following article, especially Dave K's comment:
    http://blog.dbase.integralwebsolutions.co.za/2008/10/accessing-your-dbf-tables-via-linked.html
    Elvis Long
    TechNet Community Support

  • Slow Speed While fetching data from SQL 2008 using DoQuery.

    Hello,
    I am working for an AddOn and tried to use DoQuery for fetching data from SQL 2008 in C#.
    There are around 148 records which full fill this query condition but it takes much time to fetch the data.
    I wanna know that is there any problem in this code by which my application is getting slower.
    I used break Points and checked it, I founds that while connecting to the server it is taking time.
    Code:
    // Get an initialized SBObob object
    oSBObob = (SAPbobsCOM.SBObob)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge);
    //// Get an initialized Recordset object
    oRecordset = (SAPbobsCOM.Recordset)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
    string sqlstring = "select DocEntry,ItemCode From OWOR  where OWOR.Status='R' and DocEntry not in ( Select distinct(BaseRef) from IGE1 where IGE1.BaseRef = OWOR.DocEntry)";
    oRecordset.DoQuery(sqlstring);
    var ProductList = new BindingList<KeyValuePair<string, string>>();
    ProductList.Add(new KeyValuePair<string, string>("", "---Please Select---"));
    while (!(oRecordset.EoF))
    ProductList.Add(new KeyValuePair<string, string>(oRecordset.Fields.Item(0).Value.ToString(), oRecordset.Fields.Item(0).Value.ToString() + " ( " + oRecordset.Fields.Item(1).Value.ToString() + " ) "));
    oRecordset.MoveNext();
    cmbProductionOrder.ValueMember = "Key";
    cmbProductionOrder.DisplayMember = "Value";
    Thanks and Regards,
    Ravi Sharma

    Hi Ravi,
    your code and query look correct. But can you ellaborate a little bit.
    It seems to be a DI API program ( no UI API ) ?
    When you say "I founds that while connecting to the server it is taking time." do you mean the recordset query or the DI API connection to SBO ? The later would be "normal" since the connection can take up to 30 seconds.
    To get data it is usually better to use direct SQL connections.
    regards,
    Maik

  • Oracle InstantClient with Linked Server in Sql Server 2005

    We are trying to connect ORACLE server from sql server 2005 using Linked Server Feature in SqlServer 2005
    Generally Oracle Client software is needed for this activity in the sql server machine.
    Can we use "Oracle InstantClient" instead of "Oracle Client Software" to connect ORACLE using Linked Servers ?
    Please give us your views, any existing reports similar to this activity
    Thanks & Regards,
    Palani

    Thanks for your reply
    I agree that Oracle Client software is used to connect oracle from SQL SERVER 2005.
    But my doubt is can we use Oracle InstantClient instead of Oracle Client software to connect oracle from SQL SERVER 2005
    with respect to Oracle Instant Client - I would like to know the development steps (Not the installation steps of Oracle Instant Client in windows machine) to connect ORACLE server.
    Thanks & Regards,
    Palani

  • Linked server from SQL2012 to SQL2000

    I need to set up a linked server to a SQL 2000 server from my new SQL 2012 server.  I see that the Native Client does not support access to SQL 2000.  What is a supported method/client I can use?

    Hello,
    Please see the workarounds in the following link:
    "It works through MSDASQL provider and an ODBC Data Source (datasource also configured with SQLNCLI10) :
    EXEC master.dbo.sp_addlinkedserver
    @server = N'TEST1' , @srvproduct = N'SQLSERVER' , @provider = N'SQLNCLI10' , @datasrc = N'MyServer\SQL2000';
    -- works only with distributed transactions even for SELECT
    EXEC master.dbo.sp_addlinkedserver
    @server = N'TEST2', @srvproduct=N'MSDASQL', @provider = N'MSDASQL', @datasrc=N'SQL2000DataSource', @location=N'System';
    -- works as it should be  "
    http://connect.microsoft.com/SQLServer/feedback/details/731869/using-sqlncli10-to-create-a-linked-server-to-sql-server-2000-causes-a-fault#details
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • How to create a linked server to SQL in Oracle?

    I am able to create a linked server to Oracle in SQL.. But I do not know the steps to create a linked server too SQL in Oracle.
    How to create a linked server to SQL in Oracle? After creating the linked server to SQL, I would like to create triggers in Oracle DB to insert records into SQL DB.

    There are 2 products in Oracle you can use to link to a MS SQl Server. The first one is for free and it is called Database Gateway for ODBC. With a suitable 3rd party ODBC driver you can connect to any foreign database. The second gateway is our commercial gateway and it is called Oracle Database Gateway for MS SQL Server. It is designed for MS SQl Server connections and more powerful then Dg4ODBC. It know how to map a lot of Oracle functions to SQL Server equivalents and you can also use it to directly call SQL Server procedures or functions. This dedicated SQL server gateway is also able to participate in distributed transactions.
    But again, this is a commercial gateway and you have to purchase a license for that second gateway, the Database Gateway for MS SQl Server.
    - Klaus

  • Adding a table to a linked server in SQL

    Hi
    I have a linked server in SQL server management studio.
    It has a list of oracle tables that can be reached through it. To add tables to the list do i need set up some permissions on the Oracle side?
    thanks a lot for any help

    To add to what Sunny posted. If the linked server uses a fixed user/password to connect to Oracle then in the Oracle database all you need do is get the required object privileges granted to the Oracle username being used in the linked server to Oracle. The grant can be direct to the username or to a role the username has been granted.
    If the MS SQL Server Linked Server to Oracle does not use a fixed user then the SQL Server usernames have to also exist in Oracle or have been mapped via the linked server definition to an Oracle username. Different SQL Server users can have different Oracle usernames associated to them via the linked server definition so you may need the Oracle grants issued to one or more Oracle usernames.
    Most linked servers use fixed users to connect to Oracle but you need to be aware this is not always true and when it is not true the list of tables shown under the linked server can vary based on the SQL Server user logged in.
    HTH -- Mark D Powell --

  • Syntax to query a MSSQL 2008R2 linked server from Oracle

    Hi,
        I would know if it's possible to query a MSSQL 2008R2 linked server from Oracle. Actually I can query local MSSQL databases from Oracle using dg4odbc without problem but how can I query the linked servers configured on the MSSQL side ?
    From MSSQL, I can query those linked servers using the [linked server name].[catalog].[owner].[table] syntax but using select * from [linked server name].[catalog].[owner].[table]@oracle_dblink_name syntax from the oracle side throw this error:
    ERROR at line 1:
    ORA-00933: SQL command not properly ended
    I tried some syntax variations, e.g. putting double quotes around the object name without luck. After some hours to find a solution I'm out of idea...
    So please if someone had a clue on this it would be very helpfull.
    Some info:
    Oracle 10g 10.2.0.5 Enterprise Edition x64
    Oracle Linux 5.9 Enterprise Edition x64
    MSSQL 2008R2 Enterprise x64
    Windows Server 2008R2 Enterprise x64
    Oracle 11gR2 Enterprise x64 for dg4odbc on MSSQL side
    SQL Server Natice Client 10.0 used as ODBC driver

    Hi kgronau,
                    Maybe I'm not clear in my explanations, sorry.
    I want, from Oracle, to query a MSSQL linked server.
    Basically I want to do that, if possible:
    Oracle --> MSSQL --> linked server --> MSSQL
        ^                                                         ^
        |                                                          |
        ---------------->------------------->--------------------
    and maybe have a clue about the syntax to be used.
    Knowing that querying the linked server directly form MSSQL is working and querying from Oracle to local MSSQL db is working too.
    Using the right syntax should lead me to succes, am I right ? Or maybe its something that cannot be done using oracle dblinks ?
    Thanks

Maybe you are looking for

  • How do I delete spinning wheel on top of program icon in menu bar at top of screen?

    I had LogMeIn installed on my iMac and it worked fine for a while.  Then the icon for the program in the menu bar at the top of the screen went gray.  When I hover the mouse over the icon a spinning pinwheel appears, so I can't click the icon to star

  • Error while installing Oracle 10g on CentOS 5.5

    Hello, I have been using the following url to install oracle 10g R2: http://onaxer.com/blog/blog/tag/oracle-10g-r2-installtion-on-centos-5-5rhel/ I have copied the oracle 10g R2 linux version from windows to linux using FTP. All the installer require

  • My picture in outgoing mails

    When I sent an e-mail there is a small picture in the mail which the receiver will see. How do I change this picture? At this point it is an illustration that I have chosen when I installed my new computer but I wish to change it to a picture of myse

  • Keyboard shortcuts lightroom5 pdf

    Where to find a PDF format for keyboard short-cuts lightroom5 ?

  • MP54G2 MiniPCI WiFi Car - WPA2 and Linux drivers or support?

    Hi All, I have a Rock Quddra T64 laptop with a MP54G2 module installed. I am looking for two thing from the MP54G2 WiFi module. 1) Support of WPA2 encryption. The standard driver for windows support WPA but even with the update from MS, they do not a