Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2002
    Location
    Bruges, Belgium
    Posts
    2

    Unanswered: TNS error after creating database link

    Hi,

    I have 2 databases and i would like to link them. I do this the following way: create database link test connect to USER2 identified by USER2 using 'DB2'.

    If i look in dba_objects i see that the link test.dis.be is created.

    But if i do select * from table2@test i get the error: ORA-12154: TNS:could not resolve service name. I get the same error if i do select * from table2@test.dis.be

    If i do connect user2/user2@db2 i get connected.

    Can anybody help me please?

  2. #2
    Join Date
    Mar 2002
    Location
    Ireland
    Posts
    181
    Can you tnsping db2 or db2.world?

  3. #3
    Join Date
    Aug 2002
    Location
    Bruges, Belgium
    Posts
    2
    Originally posted by Breen
    Can you tnsping db2 or db2.world?
    Yes, i can connect to.

    Thanx 4 ur reply

  4. #4
    Join Date
    Mar 2002
    Location
    Ireland
    Posts
    181
    create synonym table2 for user.table2@db2;

    Now see if you can select from the synonym.

    If not - could you print the relevant entry from your tnsnames.ora

    Breen.

  5. #5
    Join Date
    Oct 2002
    Posts
    1

    Re: TNS error after creating database link

    I think you're connecting to both databases from a client. You changed the tnsnames.ora correctly on the client so it can see both databases.

    You should add database db2 to the tnsnames.ora on the server too. This way, the first server (db1?) can see db2 also.

  6. #6
    Join Date
    Oct 2002
    Location
    greenwich.ct.us
    Posts
    279
    The tnsnames.ora alias must be configured on the machine that is acting as the client to db2. Try to tnsping db2 FROM the server where you create the database link.

    If all else fails, you can use the full tns syntax in your dblink statement:
    Code:
    CREATE DATABASE LINK db2 USING '(DESCRIPTION=....'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •