Database Administration (MOSC)

MOSC Banner

Trouble with public database links

edited Jan 4, 2017 2:10AM in Database Administration (MOSC) 6 commentsAnswered ✓

Hi all,

on our test database we have 2 public database links which uses different connectors in tnsnames.ora but reference the same database:

tnsnames.ora looks like:

TEST.DB.QS2=

  (DESCRIPTION=

    (ADDRESS=

      (PROTOCOL=TCP)

      (HOST=testhost)

      (PORT=1521)

    )

    (CONNECT_DATA=

      (SERVER=dedicated)

      (SERVICE_NAME=DBTEST2)

    )

  )

TEST.DB.PROD2=

  (DESCRIPTION=

    (ADDRESS=

      (PROTOCOL=TCP)

      (HOST=testhost)

      (PORT=1521)

    )

    (CONNECT_DATA=

      (SERVER=dedicated)

      (SERVICE_NAME=DBTEST2)

    )

  )

database links look like:

CREATE PUBLIC DATABASE LINK ORA_PRD2

CONNECT TO USERB

IDENTIFIED BY <PWD>

USING 'TEST.DB.PROD2';

CREATE PUBLIC DATABASE LINK ORA_QS2

CONNECT TO USERB

IDENTIFIED BY <PWD>

USING 'TEST.DB.QS2';

Now there is a weird phenomenon. When I use the first database link (ORA_PRD2) within a package I get a compilation error like:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center