5

I have the linked server set up in SQL Server 2008. But I could not run any query against the linked server.

enter image description here

I tried to run this simple command but it's not working

SELECT * FROM MYSERVER..ALANH.TEMP_UPDATE1

This is the error I got when I run the above command.

Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "OraOLEDB.Oracle" for linked server "MYSERVER" 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 "OraOLEDB.Oracle" for linked server "MYSERVER". A four-part name was supplied, but the provider does not expose the necessary interfaces to use a catalog or schema.

Could anyone help me to connect to the OracleLinkedServer? Thanks very much.

1

6 Answers 6

10

you can be that way too:

**SELECT * FROM OPENQUERY(MYSERVER, 'SELECT * FROM ALANH.TEMP_UPDATE1')**
7

You can write the query like this:

select * FROM [MYSERVER]..[ALANH].[TEMP_UPDATE1]

Important: In this case, the fully qualified table name must be written in upper case.

1

You might try the fix from this article.

Also, this could be a problem with naming. From an MS KB article

If you receive these error messages, a table may be missing in the Oracle schema or you may not have permissions on that table. Verify that the schema name has been typed by using uppercase. The alphabetical case of the table and of the columns should be as specified in the Oracle system tables.

On the Oracle side, a table or a column that is created without double quotation marks is stored in uppercase. If the table or the column is enclosed in double quotation marks, the table or the column is stored as is.

0

First make sure the tnsping utility works from client server, then use the below string in linked server database source setup

host[:port]/service_name 

Check this link for more details :

http://www.oracledistilled.com/oracle-database/oracle-net/using-easy-connect-ezconnect-naming-method-to-connect-to-oracle-databases/

0

Try something like this:

SELECT * FROM ALL_TABLES@"SOME.SERVER.NAME";

In this case I'm selecting ALL_TABLES from a linked server called SOME.SERVER.NAME.

1
  • This is syntax from the Oracle side
    – Nick.Mc
    Feb 26, 2016 at 5:15
0

Richard's post above was critical.

I am using v12 ODP.NET odbc drivers and had to ensure that "Zero Level Only" was NOT checked and that the names supplied for table and schema were the correct case. All of the schemas and tables I access are uppercase only.

Use the query below to determine what the correct table name is, though you will have to supply the schema name in the correct case for the query to work. Try all uppercase, try all lowercase, try mixed case, or better yet get the actual name from the dba (I've heard that only table/schema names that are "" quoted will be allowed mixed case, otherwise in oracle it's all uppercase.)

sp_tables_ex @table_server=InsertLinkedServerHere, @table_schema=InsertSchemaNameHere

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.