Reply
Highlighted
Regular Visitor
Posts: 17
Registered: ‎07-25-2016
Accepted Solution

Unable to connect using Oracle database and ODBC

Hi team,

 

i have access to an oracle database but for some reason I cannot access the database and keep getting error message stating "Oralce: ORA-12541: TNS: No Listener". I have tried the following as stated other knowledge base

 

1. Update the tnsname file

2. Update the host information in listener and tnsname

3. uninstall and reinstall the oracle instant client

4. updated the environment variables

 

Having said the above, I went to verify if my connection from the ODBC driver works fine and I'm able to connect successfully but cannot connect via Data > New Query >  Database > Oracle Database and the same applies for ODBC.

 

Please advise....A!


Accepted Solutions
Regular Visitor
Posts: 17
Registered: ‎07-25-2016

Re: Unable to connect using Oracle database and ODBC

@Lydia Apologies for getting back so late but I found a solution for this to work.

 

New Query > connect to DB > Oracle Database > in the servername the syntax to use is "hostname:[port number] /SID" which I was using only as host ID. After this update, it all worked fine.

 

Thanks again for the help.

 

Kind regards,

Anand

View solution in original post


All Replies
Moderator
Posts: 2,215
Registered: ‎03-10-2016

Re: Unable to connect using Oracle database and ODBC

[ Edited ]

Hi @ranand1482,

Do you use Power BI Desktop to connect to remote Oracle database? If that is the case, there are some proposals for you  troubleshooting this issue.

1. Make sure you have installed the latest version of Oracle client following the instructions in this article. Ensure that your Oracle client, Oracle Server and Power BI  Desktop have the same bitness(32bit or 64bit).

2. Make sure the Host IP you update in listener.ora is correct, you can use ipconfig command to verify the Host IP.

3. Restart LISTENER with the following commands.

    lsnrctl  stop

    lsnrctl  start

4. Use TNSPING to test the connectivity from Desktop to Oracle server.

5. When connecting to Oracle from Power BI desktop, enter the connection details in TNSnames.ora file, then check if it is successful. Alternatively, you can connect to the Oracle Database via EZConnect connection string. For more details, please review this similar blog.


Thanks,
Lydia Zhang

Regular Visitor
Posts: 17
Registered: ‎07-25-2016

Re: Unable to connect using Oracle database and ODBC

[ Edited ]

Hi Lydia,

 

I have tried the following and still have the same issue

 

1. manually updated the listener.ora file with the host information (available used based on cmd > hostname)

2. deleted and re-configured listener.ora using the net assistant part of Oracle home

3. I've both Power BI for desktop and the Oracle server running 64-bit

4. tried to run the commands lsnrctl > start or services but i get message as mentioned below

   TNS-12560: TNS: protocol adapter error
   TNS-00530: Protocol adapter error

 

Not sure what am I doing incorrect here. Please advice.

 

Kind regards,

Anand

 

Moderator
Posts: 2,215
Registered: ‎03-10-2016

Re: Unable to connect using Oracle database and ODBC


4. tried to run the commands lsnrctl > start or services but i get message as mentioned below

   TNS-12560: TNS: protocol adapter error
   TNS-00530: Protocol adapter error

 

 

 Hi @ranand1482,


About the above error message, I would recommend you post it in Oracle forum to get dedicated support.

Thanks,
Lydia Zhang


 

Regular Visitor
Posts: 17
Registered: ‎07-25-2016

Re: Unable to connect using Oracle database and ODBC

@Lydia Apologies for getting back so late but I found a solution for this to work.

 

New Query > connect to DB > Oracle Database > in the servername the syntax to use is "hostname:[port number] /SID" which I was using only as host ID. After this update, it all worked fine.

 

Thanks again for the help.

 

Kind regards,

Anand

Visitor
Posts: 1
Registered: ‎02-19-2017

Re: Unable to connect using Oracle database and ODBC

I was having the same issue and could not work out what was wrong...this change allowed me to connect fine;

 

hostname:[port number] /SID

 

THANK YOU!!

New Member
Posts: 1
Registered: Friday

Re: Unable to connect using Oracle database and ODBC

Thank you very much. This worked for me as well. One update I would make is that for me "hostname:[port number] /SID" didn't work, but "hostname:[port number] /[SERVICE_NAME]" is what worked. I had tried pulling the SID from the listener.ora on the server but still couldn't get connected. When I used the "[SERVICE_NAME]" it connected right away. Thanks again!