SQLServer 2016 linked server to iseries - catastrophic failure - linked-server

Environment:
Windows Server 2012 R2 Standard
SQL Server 2016 Developer and SQL SERVER 2008 R2 installed.
Linked Server to iseries DB2 (MSDASQL on 64bit ODBC connection) works fine on SQLServer 2008 R2.
Linked SERVER to same DB2 from SQL Server 2016 instance does not work though the Linked SERVER catalog lists out the tables on iseries.
On running a select query using openquery, query comes out with the following error:
The OLE DB provider "MSDASQL" for linked server "test" reported an error. The provider reported an unexpected catastrophic failure.
Msg 7330, Level 16, State 2, Line 5
Cannot fetch a row from OLE DB provider "MSDASQL" for linked server "test".
Query ouput tab shows all the column names in the table.
We have tried enabling Allow inprocess option on provider MSDASQL, dropping and recreating Linked Server etc.
Can any one help on this error please?

Related

System DSN ODBC connections working initially but failing after at least 4 hours

I am trying to migrate data from our Enterprise Data Warehouse to one of our own reporting databases via ODBC and Python scripts. The python scripts import pyodbc to handle the database connections and execute SQL queries. A system DSN is defined on our ETL server for each database involved in the process.
Enterprise Data Warehouse (Data Source)
ETL Server - Windows Server 2016 with SQL Server 2016 instance
Reporting database (Data Destination) - Windows Server 2016 with SQL Server 2019 instance
When the ETL server is freshly rebooted, all the scripts successfully execute and transfer data as expected. After a number of hours though one of the connections no longer works until a system reboot is performed. Rebooting the ETL server before every scheduled ETL job isn't ideal and I would like to have these connections persist without a reboot.
Here is the error
[Microsoft][ODBC Driver 17 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [53]. (53) (SQLDriverConnect); [08001] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0); [08001] [Microsoft][ODBC Driver 17 for SQL Server]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. (53)')
I tested each of the DSNs using ODBC Data Source Administrator (64-bit)
DSN for EDW connectivity test successful
DSN for ETL connectivity test successful
DSN for Reporting database connectivity test failed
Even when the scripts throw errors and the connectivity tests fail
I am still able to remotely connect to Reporting Database in SQL Server Management Studio and execute queries
The Reporting Database server also remains accessible via Windows Remote Desktop Connection so its not powered off or unavailable on the network.
Once the ETL server is rebooted, the DSN connection tests succeed and everything returns to normal for a few hours.
This problem also occurs with OLE DB connections defined in SSIS packages, which is why I'm trying python and ODBC for this project. Turns out I'm running into the exact same issue. The SSIS errors are also driven by the Connection Manager for the Reporting Database.
I have full administrative privileges on the ETL server as well as the Reporting Database but I am in an Enterprise environment and lack privileges to administrate networking.
Please let me know what other information would be helpful to diagnose and troubleshoot this problem.
Thanks in advance!

odbc_connect(): SQL error: [Sybase][ODBC Driver][SQL Anywhere]Database server not found, SQL state 08001

I am on windows 2012 server (PHP version 5.4.29, Apache server) and able to connect to Sybase DB which was running on windows 2008 server by using the below code. Both servers were connected via VPN
$odbc_conn = odbc_connect('Driver={SQL Anywhere 16};DataBase=DBNAME;Server=SERVERNAME;CommLinks=tcpip(Host=ipaddress);','username', 'password');
But the above code is not able to connect to Sybase DB which was running on windows 2012 server. As it is using the same SQL Anywhere version as on the Old windows 2008 server. The only change I did in my above code is the new server name and new IP like below. Remaining DB name and credentials are the same.
$odbc_conn = odbc_connect('Driver={SQL Anywhere 16};DataBase=DBNAME;Server=NEW_SERVERNAME;CommLinks=tcpip(Host=new_ipaddress);','username', 'password');
I am getting the below error.
Warning: odbc_connect(): SQL error: [Sybase][ODBC Driver][SQL Anywhere]Database server not found, SQL state 08001 in SQLConnect
Any help would be greatly appreciated.

connection string for classic asp application using odbc 11 for sql server

We have a classic asp application, we lost connection with the database. In application server we are able to connect to database only through odbc driver 11 for sql server. Have tried other native client drivers to establish connection which remained unsuccessful. The only supported driver is odbc 11 for sql server.
Have tried following connection strings -
ODBC Driver 11 for SQL Server:
{"Driver={ODBC Driver 11 for SQL Server }; Data Source =servername; Initial Catalog= dbname; Uid=username ; Pwd=password; "}
DSN:
{" DSN=dsnname;Uid=username ; Pwd=password; Database=dbname"}
Still unable to establish connection.
Can you please suggest the connection strings for odbc driver 11 for sql server?
The is an MS fix for these symtoms here https://blogs.msdn.microsoft.com/sqlreleaseservices/tls-1-2-support-for-sql-server-2008-2008-r2-2012-and-2014/
Issue described as below. The list of items fixed includes SQL Native client and ODBC client.
SQL Server Management Studio (SSMS), Report Server, and Report Manager don’t connect to the database engine after you apply the fix for SQL Server 2008, 2008 R2, 2012, or 2014. Report Server and Report Manager fail and return the following error message:
The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. (rsReportServerDatabaseUnavailable)
This issue occurs because SSMS, Report Manager, and Reporting Services Configuration Manager use ADO.NET, and ADO.NET support for TLS 1.2 is available only in the .NET Framework 4.6. For earlier versions of the .NET Framework, you have to apply a Windows update so that ADO.NET can support TLS 1.2 communications for the client. The Windows updates that enable TLS 1.2 support in earlier versions of .NET framework are listed in the table in the “How to know whether you need this update” section of KB3135244.
Found as to[ Google hit searching for https://www.google.co.uk/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=oledb+tls1.2 - there are many more interesting-looking hits in the top ten there that should get you going.
Please come back and self-answer if this solves your issue and there were any other peculiar or unexpected mods you had to make.

ASP.NET MSSQL fails to connect via web app, but succeeds in Server Explorer

Tech used:
Visual Studio 2015
ASP.NET 5 MVC 6 RC1
Identity via EF 7
I've successfully made a connection to a remote MSSQL server using the Server Explorer UI within VS2015. When I say "remote", I mean not on the same machine as my dev machine, but a machine that is local to the network.
Here is the connection string, which is the same in the Server Explorer (works) and the appsettings.json (doesn't work):
"Data Source=DBSERVER\INSTANCE1;Initial Catalog=MyDb;User ID=ASPNET-Db-User;Password=thepassword"
I'm using SQL Authentication in both cases.
When I copy the connection string from the server explorer and plug it into appsettings.json and try to connect to the db in order to create an Identity user account via the "register account" view, I get a connection error:
SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
It seems that, clearly, the SQL instance is reachable, but somehow ASP.NET isn't able to connect to it.
Any idea how I might trouble shoot this?
I tried the same code in MVC5 and everything works as expected. I believe this to be a MVC 6 error and have opened a bug report at
https://github.com/dotnet/corefx/issues/4586
After chatting with the folks building MVC 6, it turns out that the CoreCLR does not support named pipes. Using a fully qualified address and an explicit port sorts the problem.

I can't connect Netezza with microsoft ODBC (VS 2013)

I install netezza ODBC drivers and configure data sources(ODBC) in Adminitstrative tools by add user DSN as NZSQL.
Next I connect with Visual studio 2013 using DSN in Server Explorer, in Datasource I select Microsoft ODBC data source and data provider I select .Net framework data provider for ODBC. The connection test is successful and I copy connectionstring from connection string in server explorer and paste it in web.config:
<add name="cn" connectionString="Dsn=NZSQL;Driver={NetezzaSQL};uid=kbanke2e"/>
When I compile the error is:
Additional information: A network-related or instance-specific error
occurred while establishing a connection to SQL Server. The server was
not found or was not accessible. Verify that the instance name is
correct and that SQL Server is configured to allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a
connection to SQL Server
I successfully managed to create a Netezza datasource in VS2013 by specifying the full connection string manually:
Driver={NetezzaSQL};server=a.b.c.d;port=5480;database=SYSTEM;uid=myname;password=mypwd;
The only problem I had was due to VS looking for the 32-bit driver (nsqlodbc.dll) in C:\Windows\SysWOW64. Initially I only had the 64-bit driver installed.

Resources