- C:\Program Files (x86)\Common Files\System\Ole DB>regsvr32 msdaora.dll
- EXEC sp_addlinkedserver 'CFS', 'Oracle', 'MSDAORA', 'oracle10g'
- EXEC sp_addlinkedsrvlogin 'CFS', 'FALSE',NULL, 'scott', 'tiger'
- SELECT * FROM CFS..SCOTT.SOME_VIEW
- Msg 7308, Level 16, State 1, Line 1
- OLE DB provider 'MSDAORA' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode.
I switched to Oracle OLEDB Provider and it worked without issues:
- USE [master]
- GO
- EXEC master.dbo.sp_MSset_oledb_prop N'OraOLEDB.Oracle', N'AllowInProcess', 1
- GO
- EXEC master.dbo.sp_MSset_oledb_prop N'OraOLEDB.Oracle', N'DynamicParameters', 1
- GO
- EXEC master.dbo.sp_addlinkedserver @server = N'CFS', @srvproduct=N'Oracle', @provider=N'OraOLEDB.Oracle', @datasrc=N'CFS'
- EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'CFS',@useself=N'False',@locallogin=NULL,@rmtuser=N'scott',@rmtpassword='tiger'
The only drawback with using the Oracle provider is that for any errors, we have to go to Oracle to get a support.
2 comments:
Thanks for posting this. Since moving to 64-bit SQL Server 2008 on Win2008r2, I've had nothing but problems setting up a stable linked Oracle server. Your post provided an option that I hadn't tried & while I did not have success with it, I did appreciate the time that you put in to write it up. Here's the error that I'm receiving with the linked server config that you summed up:
Cannot create an instance of OLE DB provider "OraOLEDB.Oracle" for linked server "XXXXXX". (Microsoft SQL Server, Error: 7302)
I know it is an old site.
When running the script after installing the ORAOLEDB.ORACLE provider, the servers will not show up.
My ODBC has the same issue, the list of servers don't drop down. However, when I put the server name in ODBC, it reports connection successful.
In my Windows 7 (32 bit) the server names list out.
Is there a port or application to add in the firewall to allow sp_helpserver to show available servers?
Regards
Post a Comment