Connect Oracle to SQL Server - sql-server

I am trying to connect Oracle 9i database using SQL Management studio 2008.
I tried this but it doesn't work
EXEC sp_addlinkedserver 'OracleLinkedServer','Oracle','OraOLEDB.Oracle','TestDB';
EXEC sp_addlinkedsrvlogin 'OracleLinkedServer','false','SA','TestUsername','TestPassword';
I am able to create the linked server and it test correctly,
But when I execute this statement:
SELECT sysdate FROM OracleLinkedServer...dual;
...it gives an error:
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "OraOLEDB.Oracle" for linked server "OracleLinkedServer" reported an error. Provider caused a server fault in an external process.
Msg 7311, Level 16, State 2, Line 1
Cannot obtain the schema rowset "DBSCHEMA_TABLES" for OLE DB provider "OraOLEDB.Oracle" for linked server "OracleLinkedServer". The provider supports the interface, but returns a failure code when it is used.

You should UNCHECKED the Allow inprocess in OraOLEDB.Oracle provider under the Linked Servers node.

Related

INSERT data From IBM i-series database table into SNOWFLAKE database table using Linked server connection

INSERT data From IBM i-series database (Created Linked server connection -SOFT) table into SNOWFLAKE database table (Created Linked server connection -SF_64)
Linked server connection(Created in One of the SQL server)
SOFT - linked server connection with IBM Iseries Database
SF_64 - linked server connection with IBM Iseries Database
INSERT INTO [SF_64].[PROD].[REPORTING].[DPMPPHY_SSIS_TESTING]
SELECT * FROM OPENQUERY(SOFT, 'SELECT * FROM ABC.DPMPPHY')
Getting below error wile executing above query in SQL server
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "MSDASQL" for linked server "SF_64" reported an error. The provider did not give any information about the error.
Msg 7312, Level 16, State 1, Line 1
Invalid use of schema or catalog for OLE DB provider "MSDASQL" for linked server "SF_64". A four-part name was supplied, but the provider does not expose the necessary interfaces to use a catalog or schema.
INSERT INTO OPENQUERY(SF_64,'SELECT * FROM REPORTING.DPMPPHY_SSIS_TESTING') SELECT *FROM OPENQUERY(SOFT,'SELECT * FROM ABC.DPMPPHY')

OPENROWSET From SQL to Oracle

i'm trying to connect from sql server to oracle server with OPENROWSET for fetch data.
this is my query:
SELECT a.*
FROM OPENROWSET(N'OraOLEDB.Oracle', N'Data Source=Myip:Port/dbname';'User Id=user';'Password=pass;',
'select * FROM view WHERE value = ''102030'' ') AS a;
sql return below error:
OLE DB provider "OraOLEDB.Oracle" for linked server "(null)" returned
message "ORA-12154: TNS:could not resolve the connect identifier
specified". Msg 7303, Level 16, State 1, Line 23 Cannot initialize the
data source object of OLE DB provider "OraOLEDB.Oracle" for linked
server "(null)".
how can i fix this ?
I used Linked Server for fetch data but oracle table not small and it takes a long time to execute.

Call Oracle function with ref cursor output in SQL Server linked server?

How do I need to call an Oracle function with ref cursor output in a SQL Server linked server?
I used this statement:
SELECT *
FROM OPENQUERY(oracle, 'select * from functionname(''N'',''2016-11-01'')')
but I get this error
OLE DB provider "OraOLEDB.Oracle" for linked server "oracle" returned message "ORA-00933: SQL command not properly ended".
Msg 7321, Level 16, State 2, Line 33
An error occurred while preparing the query "select * from functionname('N','2016-11-01')" for execution against OLE DB provider "OraOLEDB.Oracle" for linked server "oracle".
Any help?
Maybe this will help?
Calling an Oracle function from SQL Server Linked Server
EXECUTE (Query, Parameters) AT LinkedServerName

Error when executing SQL scripts with SQL Server authentication

I have some issue when executing scripts in SQL.
SELECT *
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 8.0;Database=D:\Application\myExcel.xls;',
'SELECT * FROM [Sheet1$]')
When I login to SQL Server with Windows authentication, the script above runs successfully.
But when I login to SQL Server with SQL Server authentication (not sa account), the script throw this error:
Msg 7399, Level 16, State 1, Line 8
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 8
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
Could anyone please tell me why and how to fix it?
I'm using SQL Server 2012 (x64), Windows Server 2012 R2.
Thank you very much.

Error while calling stored procedure on linked server

I had configured a linked server to enable the SQL Server Database Engine to execute commands against OLE DB data sources outside of the instance of SQL server by executing sp_addlinkedserver procedure. After doing that I was trying to execute a procedure on a linked server using the following statement
EXEC [LinkedServer].[DatabaseName].[DatabaseOwner].[StoredProcedure] param1, param2
When I tried to execute the statement mentioned above it threw me the following error
OLE DB provider "SQLNCLI10" for linked server "server name" returned message "Unable to complete login process due to delay in opening server connection".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "SQLNCLI10" for linked server "server name".
I tried the following
Check if a linked server has remote access enabled
Increase remote query timeout
Check firewall to see if port was enabled.
What am I missing here? I appreciate your help.

Resources