Oracle Connector on Polybase

tobz 161 Reputation points
2022-08-25T15:35:27.173+00:00

Hi everyone,

I currently have Polybase (SQL Server 2019 RTM) that connects to Oracle database. This was working well untill the Oracle database was upgraded to 13c and I started getting this error:

TNS: Listner could not resolve SERVICE_NAME given in the connect descriptor.

Please I need someone help me confirm if Polybase works with Oracle 13c.

Thanks

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,977 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,652 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Alberto Morillo 34,051 Reputation points MVP
    2022-08-25T17:01:27.977+00:00

    Are you able to connect to the Oracle server by creating an ODBC DSN using Control Panel on the SQL 2019 instance? If you are not able to connect using ODBC then troubleshoot that first.

    Based on the error the listener on the Oracle server is OK, but you can verify that by using tnsping.

    Another troubleshooting step is to check the listener status on the Oracle server and make sure on the list of services listed, the service name is listed as OK.

    By the way. 13c does not exist as Oracle versions. Valid versions of Oracle are 12c, 18c, 19c and 21c.

    One last thing you can try that should work, is to change the SERVICE_NAME=TEST by SID=TEST. On the Oracle server you can get the SID.

    0 comments No comments

  2. Seeya Xi-MSFT 16,471 Reputation points
    2022-08-26T03:06:17.527+00:00

    Hi @tobz ,

    Welcome to Microsoft Q&A!

    By the way. 13c does not exist as Oracle versions. Valid versions of Oracle are 12c, 18c, 19c and 21c.

    So I deduce that you are 12c. If I misunderstood you, please feel free to let me know.

    Please I need someone help me confirm if Polybase works with Oracle 13c.

    Assuming your Oracle is 12c, that's no problem.

    TNS: Listner could not resolve SERVICE_NAME given in the connect descriptor.

    Take a look at this article, which covers as many reasons as possible for this error. The author divides them into four options ABCD.
    Hope this would give you some help.
    Finally, i put this related article here: https://www.sqlshack.com/enhanced-polybase-sql-2019-external-tables-for-oracle-db/

    Best regards,
    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  3. Robishaw, Eric 0 Reputation points
    2024-04-08T22:51:22.22+00:00

    If you get the Listner could not resolve SERVICE_NAME given in the connect descriptor error, you need to provide the service name in the connection options, but not as "service_name" like you would expect.. rather:
    CONNECTION_OPTIONS ='servicename=the-service-name'
    **
    Then...
    When creating the "External Table" be sure to provide the 3 part FQN in the LOCATION:**
    LOCATION='database.schema.table',

    **USUALLY the "database" and "service name" will be the same

    So typically:
    create/alter Data Source My-Data-Source**
    CONNECTION_OPTIONS ='servicename=abc'

    CREATE EXTERNAL TABLE MY_NEW_TABLE(

    [BATCH_ID] FLOAT(53) NOT NULL,
    ANOTHER_FIELD varchar(200))

    WITH (

    LOCATION='abc.some-schema.some-table', --CASE Sensitive!

    DATA_SOURCE=My-Data-Source)

    ALSO note:
    Most Oracle connections are case sensitive

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.