Quick and easy Oracle question from a long-term DB2 guy

Dave Ford
Dave Ford used Ask the Experts™
on
Greetings, esteemed experts!

For decades, I've been a DB2 developer and DBA. I'm now being asked to write some queries for an existing Oracle database. Of course, I thought, "SQL is SQL. How hard can it be?"

But, unfortunately, I'm tripping up on (probably easy) problem. The SQL that I inherited from the previous developer includes access to "remote database" like this:

select <somestuff>
  from SomeSchema.SomeTable@adg

Open in new window


It looks simple enough, right?! But, when I run this query, it fails with a message that says "ORA-2019: connection description for remote database not found". I speculate that it has to do with the "@adg" at the end of the table-name, but I don't know what that refers to or how to point it correctly.

Does anybody have any suggestions?

Thanks in advance!
-- DaveSlash
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Distinguished Expert 2018
Commented:
You are correct.  the @adg is a remote table access by a database link.

Check the view DBA_DB_LINKS (or ALL_DB_LINKS).  Look at the HOST column for the link named adg.

The information fill provide the remote database alias used for the connection.  Then you can check the tnsnames.ora file on the database server to find out what remote server/database it is trying to access.

The error is typically because the tnsnames.ora entry isn't there or is incorrect.
Dave FordSoftware Developer / Database Administrator

Author

Commented:
Thanks, slightwv !

I checked the DB links in the logon schema and the table's schema (via Toad), and there are none ... which, I guess, explains why it couldn't find the one it was looking for. I removed the "@adg" part of the query, and it did come back with some data. So, I think that's all I really need.

Thanks, again!
DaveSlash
Most Valuable Expert 2012
Distinguished Expert 2018

Commented:
Be careful by removing the link.  It must have been there for a reason.

Without a database link in the query, you might not be using the table you are supposed to be using.
Dave FordSoftware Developer / Database Administrator

Author

Commented:
Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial